azure_mgmt_cosmosdb 0.22.0 → 0.23.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (459) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/cosmos_db.rb +1 -1
  3. data/lib/2019-08-01-preview/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb +3 -10
  4. data/lib/2019-08-01-preview/generated/azure_mgmt_cosmosdb/models/azure_entity_resource.rb +3 -1
  5. data/lib/2019-08-01-preview/generated/azure_mgmt_cosmosdb/models/private_endpoint_connection.rb +22 -0
  6. data/lib/2019-08-01-preview/generated/azure_mgmt_cosmosdb/models/private_link_resource.rb +20 -0
  7. data/lib/2019-08-01-preview/generated/azure_mgmt_cosmosdb/models/proxy_resource.rb +4 -2
  8. data/lib/2019-08-01-preview/generated/azure_mgmt_cosmosdb/models/resource.rb +8 -5
  9. data/lib/2019-08-01-preview/generated/azure_mgmt_cosmosdb/models/tracked_resource.rb +4 -1
  10. data/lib/2019-08-01-preview/generated/azure_mgmt_cosmosdb/private_link_resources.rb +16 -6
  11. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb +1 -1
  12. data/lib/2019-12-12/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb +1 -1
  13. data/lib/2019-12-12/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb +0 -2
  14. data/lib/2020-03-01/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb +1 -1
  15. data/lib/2020-03-01/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb +1 -2
  16. data/lib/2020-04-01/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb +1 -1
  17. data/lib/2020-04-01/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb +0 -2
  18. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb.rb +267 -0
  19. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/cassandra_resources.rb +1700 -0
  20. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/collection.rb +389 -0
  21. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/collection_partition.rb +279 -0
  22. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/collection_partition_region.rb +161 -0
  23. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/collection_region.rb +161 -0
  24. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb +231 -0
  25. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/database.rb +377 -0
  26. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/database_account_region.rb +153 -0
  27. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/database_accounts.rb +2281 -0
  28. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/gremlin_resources.rb +1695 -0
  29. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/api_properties.rb +48 -0
  30. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/api_type.rb +20 -0
  31. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/armproxy_resource.rb +73 -0
  32. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/armresource_properties.rb +114 -0
  33. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/auto_upgrade_policy_resource.rb +48 -0
  34. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/autoscale_settings.rb +48 -0
  35. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/autoscale_settings_resource.rb +73 -0
  36. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/azure_entity_resource.rb +77 -0
  37. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/backup_policy.rb +47 -0
  38. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/backup_storage_redundancy.rb +17 -0
  39. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/capability.rb +48 -0
  40. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_create_update_parameters.rb +121 -0
  41. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_options.rb +53 -0
  42. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_resource.rb +85 -0
  43. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_results.rb +119 -0
  44. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_list_result.rb +58 -0
  45. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_resource.rb +46 -0
  46. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/cassandra_partition_key.rb +46 -0
  47. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/cassandra_schema.rb +95 -0
  48. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/cassandra_table_create_update_parameters.rb +121 -0
  49. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_options.rb +53 -0
  50. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_resource.rb +119 -0
  51. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_results.rb +119 -0
  52. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/cassandra_table_list_result.rb +58 -0
  53. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/cassandra_table_resource.rb +80 -0
  54. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/cluster_key.rb +58 -0
  55. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/column.rb +57 -0
  56. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/composite_path.rb +60 -0
  57. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/composite_path_sort_order.rb +16 -0
  58. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/conflict_resolution_mode.rb +16 -0
  59. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/conflict_resolution_policy.rb +73 -0
  60. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/connector_offer.rb +15 -0
  61. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/consistency_policy.rb +86 -0
  62. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/container_partition_key.rb +85 -0
  63. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/continuous_mode_backup_policy.rb +50 -0
  64. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/cors_policy.rb +99 -0
  65. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/create_mode.rb +16 -0
  66. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/create_update_options.rb +61 -0
  67. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/created_by_type.rb +18 -0
  68. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/data_type.rb +20 -0
  69. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/database_account_connection_string.rb +59 -0
  70. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/database_account_create_update_parameters.rb +125 -0
  71. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/database_account_create_update_properties.rb +324 -0
  72. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/database_account_get_results.rb +552 -0
  73. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/database_account_kind.rb +17 -0
  74. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/database_account_list_connection_strings_result.rb +57 -0
  75. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/database_account_list_keys_result.rb +77 -0
  76. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/database_account_list_read_only_keys_result.rb +59 -0
  77. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/database_account_offer_type.rb +15 -0
  78. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/database_account_regenerate_key_parameters.rb +47 -0
  79. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/database_account_update_parameters.rb +341 -0
  80. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/database_accounts_list_result.rb +58 -0
  81. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/database_restore_resource.rb +66 -0
  82. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/default_consistency_level.rb +19 -0
  83. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/default_error_response.rb +47 -0
  84. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/default_request_database_account_create_update_properties.rb +255 -0
  85. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/error_response.rb +57 -0
  86. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/excluded_path.rb +48 -0
  87. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/extended_resource_properties.rb +74 -0
  88. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/failover_policies.rb +55 -0
  89. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/failover_policy.rb +79 -0
  90. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/gremlin_database_create_update_parameters.rb +121 -0
  91. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_options.rb +53 -0
  92. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_resource.rb +85 -0
  93. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_results.rb +119 -0
  94. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/gremlin_database_list_result.rb +58 -0
  95. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/gremlin_database_resource.rb +46 -0
  96. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/gremlin_graph_create_update_parameters.rb +121 -0
  97. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_options.rb +53 -0
  98. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_resource.rb +150 -0
  99. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_results.rb +119 -0
  100. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/gremlin_graph_list_result.rb +58 -0
  101. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/gremlin_graph_resource.rb +111 -0
  102. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/included_path.rb +67 -0
  103. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/index_kind.rb +17 -0
  104. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/indexes.rb +73 -0
  105. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/indexing_mode.rb +17 -0
  106. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/indexing_policy.rb +147 -0
  107. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/ip_address_or_range.rb +51 -0
  108. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/key_kind.rb +18 -0
  109. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/location.rb +114 -0
  110. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/managed_service_identity.rb +102 -0
  111. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/managed_service_identity_user_assigned_identities_value.rb +61 -0
  112. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/metric.rb +120 -0
  113. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/metric_availability.rb +60 -0
  114. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/metric_definition.rb +109 -0
  115. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/metric_definitions_list_result.rb +57 -0
  116. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/metric_list_result.rb +56 -0
  117. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/metric_name.rb +59 -0
  118. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/metric_value.rb +107 -0
  119. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_create_update_parameters.rb +121 -0
  120. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_options.rb +53 -0
  121. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_resource.rb +136 -0
  122. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_results.rb +119 -0
  123. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_list_result.rb +58 -0
  124. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_resource.rb +97 -0
  125. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_create_update_parameters.rb +121 -0
  126. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_options.rb +53 -0
  127. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_resource.rb +85 -0
  128. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_results.rb +119 -0
  129. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_list_result.rb +58 -0
  130. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_resource.rb +46 -0
  131. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/mongo_index.rb +60 -0
  132. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/mongo_index_keys.rb +55 -0
  133. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/mongo_index_options.rb +57 -0
  134. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/notebook_workspace.rb +87 -0
  135. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/notebook_workspace_connection_info_result.rb +60 -0
  136. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/notebook_workspace_create_update_parameters.rb +62 -0
  137. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/notebook_workspace_list_result.rb +56 -0
  138. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/operation.rb +58 -0
  139. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/operation_display.rb +80 -0
  140. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/operation_list_result.rb +101 -0
  141. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/operation_type.rb +18 -0
  142. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/options_resource.rb +60 -0
  143. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/partition_kind.rb +16 -0
  144. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/partition_metric.rb +124 -0
  145. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/partition_metric_list_result.rb +57 -0
  146. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/partition_usage.rb +105 -0
  147. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/partition_usages_result.rb +57 -0
  148. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/percentile_metric.rb +120 -0
  149. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/percentile_metric_list_result.rb +57 -0
  150. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/percentile_metric_value.rb +173 -0
  151. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/periodic_mode_backup_policy.rb +63 -0
  152. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/periodic_mode_properties.rb +77 -0
  153. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/permission.rb +73 -0
  154. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/primary_aggregation_type.rb +20 -0
  155. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/private_endpoint_connection.rb +88 -0
  156. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/private_endpoint_property.rb +46 -0
  157. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/private_link_service_connection_state_property.rb +60 -0
  158. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/proxy_resource.rb +65 -0
  159. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/public_network_access.rb +16 -0
  160. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/region_for_online_offline.rb +47 -0
  161. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/resource.rb +86 -0
  162. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/resource_identity_type.rb +18 -0
  163. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/restorable_database_account_get_result.rb +166 -0
  164. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/restorable_database_accounts_list_result.rb +58 -0
  165. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/restorable_location_resource.rb +85 -0
  166. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/restorable_mongodb_collection_get_result.rb +107 -0
  167. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/restorable_mongodb_collection_properties_resource.rb +99 -0
  168. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/restorable_mongodb_collections_list_result.rb +58 -0
  169. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/restorable_mongodb_database_get_result.rb +107 -0
  170. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/restorable_mongodb_database_properties_resource.rb +99 -0
  171. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/restorable_mongodb_databases_list_result.rb +58 -0
  172. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/restorable_mongodb_resources_list_result.rb +58 -0
  173. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/restorable_sql_container_get_result.rb +107 -0
  174. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/restorable_sql_container_properties_resource.rb +110 -0
  175. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/restorable_sql_container_properties_resource_container.rb +164 -0
  176. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/restorable_sql_containers_list_result.rb +58 -0
  177. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/restorable_sql_database_get_result.rb +107 -0
  178. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/restorable_sql_database_properties_resource.rb +110 -0
  179. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/restorable_sql_database_properties_resource_database.rb +125 -0
  180. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/restorable_sql_databases_list_result.rb +58 -0
  181. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/restorable_sql_resources_list_result.rb +57 -0
  182. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/restore_mode.rb +15 -0
  183. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/restore_parameters.rb +93 -0
  184. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/restore_reqeust_database_account_create_update_properties.rb +268 -0
  185. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/role_definition_type.rb +16 -0
  186. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/server_version.rb +16 -0
  187. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/spatial_spec.rb +67 -0
  188. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/spatial_type.rb +18 -0
  189. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_container_create_update_parameters.rb +120 -0
  190. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_options.rb +53 -0
  191. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_resource.rb +150 -0
  192. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_container_get_results.rb +119 -0
  193. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_container_list_result.rb +58 -0
  194. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_container_resource.rb +111 -0
  195. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_database_create_update_parameters.rb +121 -0
  196. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_options.rb +53 -0
  197. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_resource.rb +109 -0
  198. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_database_get_results.rb +119 -0
  199. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_database_list_result.rb +58 -0
  200. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_database_resource.rb +46 -0
  201. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_role_assignment_create_update_parameters.rb +73 -0
  202. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_role_assignment_get_results.rb +100 -0
  203. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_role_assignment_list_result.rb +57 -0
  204. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_role_definition_create_update_parameters.rb +107 -0
  205. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_role_definition_get_results.rb +134 -0
  206. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_role_definition_list_result.rb +57 -0
  207. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_create_update_parameters.rb +121 -0
  208. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_properties_resource.rb +96 -0
  209. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_results.rb +107 -0
  210. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_list_result.rb +58 -0
  211. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_resource.rb +57 -0
  212. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_trigger_create_update_parameters.rb +120 -0
  213. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_properties_resource.rb +121 -0
  214. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_results.rb +107 -0
  215. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_trigger_list_result.rb +58 -0
  216. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_trigger_resource.rb +82 -0
  217. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_create_update_parameters.rb +122 -0
  218. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_properties_resource.rb +97 -0
  219. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_results.rb +107 -0
  220. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_list_result.rb +58 -0
  221. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_resource.rb +57 -0
  222. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/system_data.rb +106 -0
  223. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/table_create_update_parameters.rb +120 -0
  224. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/table_get_properties_options.rb +53 -0
  225. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/table_get_properties_resource.rb +85 -0
  226. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/table_get_results.rb +119 -0
  227. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/table_list_result.rb +57 -0
  228. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/table_resource.rb +46 -0
  229. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/throughput_policy_resource.rb +59 -0
  230. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_properties_resource.rb +124 -0
  231. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_results.rb +107 -0
  232. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/throughput_settings_resource.rb +86 -0
  233. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/throughput_settings_update_parameters.rb +108 -0
  234. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/tracked_resource.rb +95 -0
  235. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/trigger_operation.rb +19 -0
  236. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/trigger_type.rb +16 -0
  237. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/unique_key.rb +56 -0
  238. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/unique_key_policy.rb +58 -0
  239. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/unit_type.rb +21 -0
  240. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/usage.rb +97 -0
  241. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/usages_result.rb +57 -0
  242. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/models/virtual_network_rule.rb +59 -0
  243. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/module_definition.rb +9 -0
  244. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/mongo_dbresources.rb +1706 -0
  245. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb +905 -0
  246. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/operations.rb +220 -0
  247. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/partition_key_range_id.rb +161 -0
  248. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/partition_key_range_id_region.rb +168 -0
  249. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/percentile.rb +146 -0
  250. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/percentile_source_target.rb +163 -0
  251. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/percentile_target.rb +153 -0
  252. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/restorable_database_accounts.rb +319 -0
  253. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/restorable_mongodb_collections.rb +136 -0
  254. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/restorable_mongodb_databases.rb +130 -0
  255. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/restorable_mongodb_resources.rb +142 -0
  256. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/restorable_sql_containers.rb +136 -0
  257. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/restorable_sql_databases.rb +130 -0
  258. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/restorable_sql_resources.rb +142 -0
  259. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/sql_resources.rb +4503 -0
  260. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/table_resources.rb +840 -0
  261. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb.rb +219 -0
  262. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb +2348 -0
  263. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/collection.rb +389 -0
  264. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/collection_partition.rb +279 -0
  265. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/collection_partition_region.rb +161 -0
  266. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/collection_region.rb +161 -0
  267. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb +203 -0
  268. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/database.rb +377 -0
  269. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/database_account_region.rb +153 -0
  270. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/database_accounts.rb +2281 -0
  271. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/gremlin_resources.rb +2335 -0
  272. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/api_properties.rb +48 -0
  273. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/armproxy_resource.rb +73 -0
  274. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/armresource_properties.rb +102 -0
  275. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/auto_upgrade_policy_resource.rb +48 -0
  276. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/autoscale_settings.rb +48 -0
  277. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/autoscale_settings_resource.rb +73 -0
  278. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/azure_entity_resource.rb +77 -0
  279. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/backup_policy.rb +47 -0
  280. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/backup_policy_type.rb +16 -0
  281. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/capability.rb +48 -0
  282. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_create_update_parameters.rb +112 -0
  283. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_options.rb +53 -0
  284. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_resource.rb +85 -0
  285. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_results.rb +110 -0
  286. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_list_result.rb +58 -0
  287. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_resource.rb +46 -0
  288. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/cassandra_partition_key.rb +46 -0
  289. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/cassandra_schema.rb +95 -0
  290. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_create_update_parameters.rb +112 -0
  291. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_options.rb +53 -0
  292. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_resource.rb +119 -0
  293. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_results.rb +110 -0
  294. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_list_result.rb +58 -0
  295. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_resource.rb +80 -0
  296. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/cluster_key.rb +58 -0
  297. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/column.rb +57 -0
  298. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/composite_path.rb +60 -0
  299. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/composite_path_sort_order.rb +16 -0
  300. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/conflict_resolution_mode.rb +16 -0
  301. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/conflict_resolution_policy.rb +73 -0
  302. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/connector_offer.rb +15 -0
  303. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/consistency_policy.rb +86 -0
  304. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/container_partition_key.rb +85 -0
  305. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/continuous_mode_backup_policy.rb +50 -0
  306. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/cors_policy.rb +99 -0
  307. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/create_update_options.rb +61 -0
  308. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/data_type.rb +20 -0
  309. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/database_account_connection_string.rb +59 -0
  310. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/database_account_create_update_parameters.rb +378 -0
  311. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/database_account_get_results.rb +491 -0
  312. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/database_account_kind.rb +17 -0
  313. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/database_account_list_connection_strings_result.rb +57 -0
  314. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/database_account_list_keys_result.rb +77 -0
  315. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/database_account_list_read_only_keys_result.rb +59 -0
  316. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/database_account_offer_type.rb +15 -0
  317. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/database_account_regenerate_key_parameters.rb +47 -0
  318. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/database_account_update_parameters.rb +329 -0
  319. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/database_accounts_list_result.rb +58 -0
  320. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/default_consistency_level.rb +19 -0
  321. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/error_response.rb +57 -0
  322. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/error_response_updated_format.rb +47 -0
  323. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/excluded_path.rb +48 -0
  324. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/extended_resource_properties.rb +74 -0
  325. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/failover_policies.rb +55 -0
  326. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/failover_policy.rb +79 -0
  327. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_create_update_parameters.rb +112 -0
  328. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_options.rb +53 -0
  329. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_resource.rb +85 -0
  330. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_results.rb +110 -0
  331. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_list_result.rb +58 -0
  332. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_resource.rb +46 -0
  333. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_create_update_parameters.rb +112 -0
  334. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_options.rb +53 -0
  335. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_resource.rb +150 -0
  336. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_results.rb +110 -0
  337. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_list_result.rb +58 -0
  338. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_resource.rb +111 -0
  339. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/included_path.rb +67 -0
  340. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/index_kind.rb +17 -0
  341. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/indexes.rb +73 -0
  342. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/indexing_mode.rb +17 -0
  343. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/indexing_policy.rb +147 -0
  344. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/ip_address_or_range.rb +51 -0
  345. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/key_kind.rb +18 -0
  346. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/location.rb +114 -0
  347. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/metric.rb +120 -0
  348. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/metric_availability.rb +60 -0
  349. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/metric_definition.rb +109 -0
  350. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/metric_definitions_list_result.rb +57 -0
  351. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/metric_list_result.rb +56 -0
  352. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/metric_name.rb +59 -0
  353. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/metric_value.rb +107 -0
  354. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_create_update_parameters.rb +112 -0
  355. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_options.rb +53 -0
  356. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_resource.rb +136 -0
  357. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_results.rb +110 -0
  358. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_list_result.rb +58 -0
  359. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_resource.rb +97 -0
  360. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_create_update_parameters.rb +112 -0
  361. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_options.rb +53 -0
  362. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_resource.rb +85 -0
  363. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_results.rb +110 -0
  364. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_list_result.rb +58 -0
  365. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_resource.rb +46 -0
  366. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/mongo_index.rb +60 -0
  367. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/mongo_index_keys.rb +55 -0
  368. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/mongo_index_options.rb +57 -0
  369. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace.rb +87 -0
  370. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_connection_info_result.rb +60 -0
  371. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_create_update_parameters.rb +62 -0
  372. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/notebook_workspace_list_result.rb +56 -0
  373. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/operation.rb +58 -0
  374. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/operation_display.rb +80 -0
  375. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/operation_list_result.rb +101 -0
  376. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/options_resource.rb +60 -0
  377. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/partition_kind.rb +16 -0
  378. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/partition_metric.rb +124 -0
  379. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/partition_metric_list_result.rb +57 -0
  380. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/partition_usage.rb +105 -0
  381. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/partition_usages_result.rb +57 -0
  382. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/percentile_metric.rb +120 -0
  383. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/percentile_metric_list_result.rb +57 -0
  384. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/percentile_metric_value.rb +173 -0
  385. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/periodic_mode_backup_policy.rb +63 -0
  386. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/periodic_mode_properties.rb +65 -0
  387. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/primary_aggregation_type.rb +20 -0
  388. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/private_endpoint_connection.rb +88 -0
  389. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/private_endpoint_property.rb +46 -0
  390. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/private_link_service_connection_state_property.rb +60 -0
  391. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/proxy_resource.rb +65 -0
  392. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/public_network_access.rb +16 -0
  393. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/region_for_online_offline.rb +47 -0
  394. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/resource.rb +86 -0
  395. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/server_version.rb +16 -0
  396. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/spatial_spec.rb +67 -0
  397. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/spatial_type.rb +18 -0
  398. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/sql_container_create_update_parameters.rb +111 -0
  399. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_options.rb +53 -0
  400. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_resource.rb +161 -0
  401. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_results.rb +110 -0
  402. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/sql_container_list_result.rb +58 -0
  403. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/sql_container_resource.rb +122 -0
  404. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/sql_database_create_update_parameters.rb +112 -0
  405. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_options.rb +53 -0
  406. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_resource.rb +109 -0
  407. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_results.rb +110 -0
  408. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/sql_database_list_result.rb +58 -0
  409. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/sql_database_resource.rb +46 -0
  410. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_create_update_parameters.rb +112 -0
  411. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_properties_resource.rb +96 -0
  412. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_results.rb +98 -0
  413. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_list_result.rb +58 -0
  414. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_resource.rb +57 -0
  415. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_create_update_parameters.rb +111 -0
  416. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_properties_resource.rb +121 -0
  417. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_results.rb +98 -0
  418. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_list_result.rb +58 -0
  419. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_resource.rb +82 -0
  420. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_create_update_parameters.rb +113 -0
  421. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_properties_resource.rb +97 -0
  422. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_results.rb +98 -0
  423. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_list_result.rb +58 -0
  424. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_resource.rb +57 -0
  425. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/table_create_update_parameters.rb +111 -0
  426. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/table_get_properties_options.rb +53 -0
  427. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/table_get_properties_resource.rb +85 -0
  428. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/table_get_results.rb +110 -0
  429. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/table_list_result.rb +57 -0
  430. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/table_resource.rb +46 -0
  431. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/throughput_policy_resource.rb +59 -0
  432. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_properties_resource.rb +124 -0
  433. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_results.rb +98 -0
  434. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_resource.rb +86 -0
  435. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_update_parameters.rb +99 -0
  436. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/tracked_resource.rb +95 -0
  437. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/trigger_operation.rb +19 -0
  438. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/trigger_type.rb +16 -0
  439. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/unique_key.rb +56 -0
  440. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/unique_key_policy.rb +58 -0
  441. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/unit_type.rb +21 -0
  442. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/usage.rb +97 -0
  443. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/usages_result.rb +57 -0
  444. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/models/virtual_network_rule.rb +59 -0
  445. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/module_definition.rb +9 -0
  446. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/mongo_dbresources.rb +2354 -0
  447. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb +905 -0
  448. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/operations.rb +220 -0
  449. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/partition_key_range_id.rb +161 -0
  450. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/partition_key_range_id_region.rb +168 -0
  451. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/percentile.rb +146 -0
  452. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/percentile_source_target.rb +163 -0
  453. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/percentile_target.rb +153 -0
  454. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/sql_resources.rb +4065 -0
  455. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/table_resources.rb +1150 -0
  456. data/lib/azure_mgmt_cosmosdb.rb +5 -3
  457. data/lib/profiles/latest/modules/cosmosdb_profile_module.rb +479 -357
  458. data/lib/version.rb +1 -1
  459. metadata +441 -3
@@ -0,0 +1,2281 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::Cosmosdb::Mgmt::V2020_06_01_preview
7
+ #
8
+ # DatabaseAccounts
9
+ #
10
+ class DatabaseAccounts
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the DatabaseAccounts class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [CosmosDBManagementClient] reference to the CosmosDBManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Retrieves the properties of an existing Azure Cosmos DB database account.
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group. The name
28
+ # is case insensitive.
29
+ # @param account_name [String] Cosmos DB database account name.
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [DatabaseAccountGetResults] operation results.
34
+ #
35
+ def get(resource_group_name, account_name, custom_headers:nil)
36
+ response = get_async(resource_group_name, account_name, custom_headers:custom_headers).value!
37
+ response.body unless response.nil?
38
+ end
39
+
40
+ #
41
+ # Retrieves the properties of an existing Azure Cosmos DB database account.
42
+ #
43
+ # @param resource_group_name [String] The name of the resource group. The name
44
+ # is case insensitive.
45
+ # @param account_name [String] Cosmos DB database account name.
46
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
47
+ # will be added to the HTTP request.
48
+ #
49
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
50
+ #
51
+ def get_with_http_info(resource_group_name, account_name, custom_headers:nil)
52
+ get_async(resource_group_name, account_name, custom_headers:custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # Retrieves the properties of an existing Azure Cosmos DB database account.
57
+ #
58
+ # @param resource_group_name [String] The name of the resource group. The name
59
+ # is case insensitive.
60
+ # @param account_name [String] Cosmos DB database account name.
61
+ # @param [Hash{String => String}] A hash of custom headers that will be added
62
+ # to the HTTP request.
63
+ #
64
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
65
+ #
66
+ def get_async(resource_group_name, account_name, custom_headers:nil)
67
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
68
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
69
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
70
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
71
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
72
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
73
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
74
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
75
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
76
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
77
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
78
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
79
+
80
+
81
+ request_headers = {}
82
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
83
+
84
+ # Set Headers
85
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
86
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
87
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}'
88
+
89
+ request_url = @base_url || @client.base_url
90
+
91
+ options = {
92
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
93
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
94
+ query_params: {'api-version' => @client.api_version},
95
+ headers: request_headers.merge(custom_headers || {}),
96
+ base_url: request_url
97
+ }
98
+ promise = @client.make_request_async(:get, path_template, options)
99
+
100
+ promise = promise.then do |result|
101
+ http_response = result.response
102
+ status_code = http_response.status
103
+ response_content = http_response.body
104
+ unless status_code == 200
105
+ error_model = JSON.load(response_content)
106
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
107
+ end
108
+
109
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
110
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
111
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
112
+ # Deserialize Response
113
+ if status_code == 200
114
+ begin
115
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
116
+ result_mapper = Azure::Cosmosdb::Mgmt::V2020_06_01_preview::Models::DatabaseAccountGetResults.mapper()
117
+ result.body = @client.deserialize(result_mapper, parsed_response)
118
+ rescue Exception => e
119
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
120
+ end
121
+ end
122
+
123
+ result
124
+ end
125
+
126
+ promise.execute
127
+ end
128
+
129
+ #
130
+ # Updates the properties of an existing Azure Cosmos DB database account.
131
+ #
132
+ # @param resource_group_name [String] The name of the resource group. The name
133
+ # is case insensitive.
134
+ # @param account_name [String] Cosmos DB database account name.
135
+ # @param update_parameters [DatabaseAccountUpdateParameters] The parameters to
136
+ # provide for the current database account.
137
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
138
+ # will be added to the HTTP request.
139
+ #
140
+ # @return [DatabaseAccountGetResults] operation results.
141
+ #
142
+ def update(resource_group_name, account_name, update_parameters, custom_headers:nil)
143
+ response = update_async(resource_group_name, account_name, update_parameters, custom_headers:custom_headers).value!
144
+ response.body unless response.nil?
145
+ end
146
+
147
+ #
148
+ # @param resource_group_name [String] The name of the resource group. The name
149
+ # is case insensitive.
150
+ # @param account_name [String] Cosmos DB database account name.
151
+ # @param update_parameters [DatabaseAccountUpdateParameters] The parameters to
152
+ # provide for the current database account.
153
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
154
+ # will be added to the HTTP request.
155
+ #
156
+ # @return [Concurrent::Promise] promise which provides async access to http
157
+ # response.
158
+ #
159
+ def update_async(resource_group_name, account_name, update_parameters, custom_headers:nil)
160
+ # Send request
161
+ promise = begin_update_async(resource_group_name, account_name, update_parameters, custom_headers:custom_headers)
162
+
163
+ promise = promise.then do |response|
164
+ # Defining deserialization method.
165
+ deserialize_method = lambda do |parsed_response|
166
+ result_mapper = Azure::Cosmosdb::Mgmt::V2020_06_01_preview::Models::DatabaseAccountGetResults.mapper()
167
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
168
+ end
169
+
170
+ # Waiting for response.
171
+ @client.get_long_running_operation_result(response, deserialize_method)
172
+ end
173
+
174
+ promise
175
+ end
176
+
177
+ #
178
+ # Creates or updates an Azure Cosmos DB database account. The "Update" method
179
+ # is preferred when performing updates on an account.
180
+ #
181
+ # @param resource_group_name [String] The name of the resource group. The name
182
+ # is case insensitive.
183
+ # @param account_name [String] Cosmos DB database account name.
184
+ # @param create_update_parameters [DatabaseAccountCreateUpdateParameters] The
185
+ # parameters to provide for the current database account.
186
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
187
+ # will be added to the HTTP request.
188
+ #
189
+ # @return [DatabaseAccountGetResults] operation results.
190
+ #
191
+ def create_or_update(resource_group_name, account_name, create_update_parameters, custom_headers:nil)
192
+ response = create_or_update_async(resource_group_name, account_name, create_update_parameters, custom_headers:custom_headers).value!
193
+ response.body unless response.nil?
194
+ end
195
+
196
+ #
197
+ # @param resource_group_name [String] The name of the resource group. The name
198
+ # is case insensitive.
199
+ # @param account_name [String] Cosmos DB database account name.
200
+ # @param create_update_parameters [DatabaseAccountCreateUpdateParameters] The
201
+ # parameters to provide for the current database account.
202
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
203
+ # will be added to the HTTP request.
204
+ #
205
+ # @return [Concurrent::Promise] promise which provides async access to http
206
+ # response.
207
+ #
208
+ def create_or_update_async(resource_group_name, account_name, create_update_parameters, custom_headers:nil)
209
+ # Send request
210
+ promise = begin_create_or_update_async(resource_group_name, account_name, create_update_parameters, custom_headers:custom_headers)
211
+
212
+ promise = promise.then do |response|
213
+ # Defining deserialization method.
214
+ deserialize_method = lambda do |parsed_response|
215
+ result_mapper = Azure::Cosmosdb::Mgmt::V2020_06_01_preview::Models::DatabaseAccountGetResults.mapper()
216
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
217
+ end
218
+
219
+ # Waiting for response.
220
+ @client.get_long_running_operation_result(response, deserialize_method)
221
+ end
222
+
223
+ promise
224
+ end
225
+
226
+ #
227
+ # Deletes an existing Azure Cosmos DB database account.
228
+ #
229
+ # @param resource_group_name [String] The name of the resource group. The name
230
+ # is case insensitive.
231
+ # @param account_name [String] Cosmos DB database account name.
232
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
233
+ # will be added to the HTTP request.
234
+ #
235
+ def delete(resource_group_name, account_name, custom_headers:nil)
236
+ response = delete_async(resource_group_name, account_name, custom_headers:custom_headers).value!
237
+ nil
238
+ end
239
+
240
+ #
241
+ # @param resource_group_name [String] The name of the resource group. The name
242
+ # is case insensitive.
243
+ # @param account_name [String] Cosmos DB database account name.
244
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
245
+ # will be added to the HTTP request.
246
+ #
247
+ # @return [Concurrent::Promise] promise which provides async access to http
248
+ # response.
249
+ #
250
+ def delete_async(resource_group_name, account_name, custom_headers:nil)
251
+ # Send request
252
+ promise = begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers)
253
+
254
+ promise = promise.then do |response|
255
+ # Defining deserialization method.
256
+ deserialize_method = lambda do |parsed_response|
257
+ end
258
+
259
+ # Waiting for response.
260
+ @client.get_long_running_operation_result(response, deserialize_method)
261
+ end
262
+
263
+ promise
264
+ end
265
+
266
+ #
267
+ # Changes the failover priority for the Azure Cosmos DB database account. A
268
+ # failover priority of 0 indicates a write region. The maximum value for a
269
+ # failover priority = (total number of regions - 1). Failover priority values
270
+ # must be unique for each of the regions in which the database account exists.
271
+ #
272
+ # @param resource_group_name [String] The name of the resource group. The name
273
+ # is case insensitive.
274
+ # @param account_name [String] Cosmos DB database account name.
275
+ # @param failover_parameters [FailoverPolicies] The new failover policies for
276
+ # the database account.
277
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
278
+ # will be added to the HTTP request.
279
+ #
280
+ def failover_priority_change(resource_group_name, account_name, failover_parameters, custom_headers:nil)
281
+ response = failover_priority_change_async(resource_group_name, account_name, failover_parameters, custom_headers:custom_headers).value!
282
+ nil
283
+ end
284
+
285
+ #
286
+ # @param resource_group_name [String] The name of the resource group. The name
287
+ # is case insensitive.
288
+ # @param account_name [String] Cosmos DB database account name.
289
+ # @param failover_parameters [FailoverPolicies] The new failover policies for
290
+ # the database account.
291
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
292
+ # will be added to the HTTP request.
293
+ #
294
+ # @return [Concurrent::Promise] promise which provides async access to http
295
+ # response.
296
+ #
297
+ def failover_priority_change_async(resource_group_name, account_name, failover_parameters, custom_headers:nil)
298
+ # Send request
299
+ promise = begin_failover_priority_change_async(resource_group_name, account_name, failover_parameters, custom_headers:custom_headers)
300
+
301
+ promise = promise.then do |response|
302
+ # Defining deserialization method.
303
+ deserialize_method = lambda do |parsed_response|
304
+ end
305
+
306
+ # Waiting for response.
307
+ @client.get_long_running_operation_result(response, deserialize_method)
308
+ end
309
+
310
+ promise
311
+ end
312
+
313
+ #
314
+ # Lists all the Azure Cosmos DB database accounts available under the
315
+ # subscription.
316
+ #
317
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
318
+ # will be added to the HTTP request.
319
+ #
320
+ # @return [DatabaseAccountsListResult] operation results.
321
+ #
322
+ def list(custom_headers:nil)
323
+ response = list_async(custom_headers:custom_headers).value!
324
+ response.body unless response.nil?
325
+ end
326
+
327
+ #
328
+ # Lists all the Azure Cosmos DB database accounts available under the
329
+ # subscription.
330
+ #
331
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
332
+ # will be added to the HTTP request.
333
+ #
334
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
335
+ #
336
+ def list_with_http_info(custom_headers:nil)
337
+ list_async(custom_headers:custom_headers).value!
338
+ end
339
+
340
+ #
341
+ # Lists all the Azure Cosmos DB database accounts available under the
342
+ # subscription.
343
+ #
344
+ # @param [Hash{String => String}] A hash of custom headers that will be added
345
+ # to the HTTP request.
346
+ #
347
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
348
+ #
349
+ def list_async(custom_headers:nil)
350
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
351
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
352
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
353
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
354
+
355
+
356
+ request_headers = {}
357
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
358
+
359
+ # Set Headers
360
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
361
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
362
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/databaseAccounts'
363
+
364
+ request_url = @base_url || @client.base_url
365
+
366
+ options = {
367
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
368
+ path_params: {'subscriptionId' => @client.subscription_id},
369
+ query_params: {'api-version' => @client.api_version},
370
+ headers: request_headers.merge(custom_headers || {}),
371
+ base_url: request_url
372
+ }
373
+ promise = @client.make_request_async(:get, path_template, options)
374
+
375
+ promise = promise.then do |result|
376
+ http_response = result.response
377
+ status_code = http_response.status
378
+ response_content = http_response.body
379
+ unless status_code == 200
380
+ error_model = JSON.load(response_content)
381
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
382
+ end
383
+
384
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
385
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
386
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
387
+ # Deserialize Response
388
+ if status_code == 200
389
+ begin
390
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
391
+ result_mapper = Azure::Cosmosdb::Mgmt::V2020_06_01_preview::Models::DatabaseAccountsListResult.mapper()
392
+ result.body = @client.deserialize(result_mapper, parsed_response)
393
+ rescue Exception => e
394
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
395
+ end
396
+ end
397
+
398
+ result
399
+ end
400
+
401
+ promise.execute
402
+ end
403
+
404
+ #
405
+ # Lists all the Azure Cosmos DB database accounts available under the given
406
+ # resource group.
407
+ #
408
+ # @param resource_group_name [String] The name of the resource group. The name
409
+ # is case insensitive.
410
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
411
+ # will be added to the HTTP request.
412
+ #
413
+ # @return [DatabaseAccountsListResult] operation results.
414
+ #
415
+ def list_by_resource_group(resource_group_name, custom_headers:nil)
416
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
417
+ response.body unless response.nil?
418
+ end
419
+
420
+ #
421
+ # Lists all the Azure Cosmos DB database accounts available under the given
422
+ # resource group.
423
+ #
424
+ # @param resource_group_name [String] The name of the resource group. The name
425
+ # is case insensitive.
426
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
427
+ # will be added to the HTTP request.
428
+ #
429
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
430
+ #
431
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
432
+ list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
433
+ end
434
+
435
+ #
436
+ # Lists all the Azure Cosmos DB database accounts available under the given
437
+ # resource group.
438
+ #
439
+ # @param resource_group_name [String] The name of the resource group. The name
440
+ # is case insensitive.
441
+ # @param [Hash{String => String}] A hash of custom headers that will be added
442
+ # to the HTTP request.
443
+ #
444
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
445
+ #
446
+ def list_by_resource_group_async(resource_group_name, custom_headers:nil)
447
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
448
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
449
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
450
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
451
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
452
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
453
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
454
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
455
+
456
+
457
+ request_headers = {}
458
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
459
+
460
+ # Set Headers
461
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
462
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
463
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts'
464
+
465
+ request_url = @base_url || @client.base_url
466
+
467
+ options = {
468
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
469
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
470
+ query_params: {'api-version' => @client.api_version},
471
+ headers: request_headers.merge(custom_headers || {}),
472
+ base_url: request_url
473
+ }
474
+ promise = @client.make_request_async(:get, path_template, options)
475
+
476
+ promise = promise.then do |result|
477
+ http_response = result.response
478
+ status_code = http_response.status
479
+ response_content = http_response.body
480
+ unless status_code == 200
481
+ error_model = JSON.load(response_content)
482
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
483
+ end
484
+
485
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
486
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
487
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
488
+ # Deserialize Response
489
+ if status_code == 200
490
+ begin
491
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
492
+ result_mapper = Azure::Cosmosdb::Mgmt::V2020_06_01_preview::Models::DatabaseAccountsListResult.mapper()
493
+ result.body = @client.deserialize(result_mapper, parsed_response)
494
+ rescue Exception => e
495
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
496
+ end
497
+ end
498
+
499
+ result
500
+ end
501
+
502
+ promise.execute
503
+ end
504
+
505
+ #
506
+ # Lists the access keys for the specified Azure Cosmos DB database account.
507
+ #
508
+ # @param resource_group_name [String] The name of the resource group. The name
509
+ # is case insensitive.
510
+ # @param account_name [String] Cosmos DB database account name.
511
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
512
+ # will be added to the HTTP request.
513
+ #
514
+ # @return [DatabaseAccountListKeysResult] operation results.
515
+ #
516
+ def list_keys(resource_group_name, account_name, custom_headers:nil)
517
+ response = list_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value!
518
+ response.body unless response.nil?
519
+ end
520
+
521
+ #
522
+ # Lists the access keys for the specified Azure Cosmos DB database account.
523
+ #
524
+ # @param resource_group_name [String] The name of the resource group. The name
525
+ # is case insensitive.
526
+ # @param account_name [String] Cosmos DB database account name.
527
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
528
+ # will be added to the HTTP request.
529
+ #
530
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
531
+ #
532
+ def list_keys_with_http_info(resource_group_name, account_name, custom_headers:nil)
533
+ list_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value!
534
+ end
535
+
536
+ #
537
+ # Lists the access keys for the specified Azure Cosmos DB database account.
538
+ #
539
+ # @param resource_group_name [String] The name of the resource group. The name
540
+ # is case insensitive.
541
+ # @param account_name [String] Cosmos DB database account name.
542
+ # @param [Hash{String => String}] A hash of custom headers that will be added
543
+ # to the HTTP request.
544
+ #
545
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
546
+ #
547
+ def list_keys_async(resource_group_name, account_name, custom_headers:nil)
548
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
549
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
550
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
551
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
552
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
553
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
554
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
555
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
556
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
557
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
558
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
559
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
560
+
561
+
562
+ request_headers = {}
563
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
564
+
565
+ # Set Headers
566
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
567
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
568
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listKeys'
569
+
570
+ request_url = @base_url || @client.base_url
571
+
572
+ options = {
573
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
574
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
575
+ query_params: {'api-version' => @client.api_version},
576
+ headers: request_headers.merge(custom_headers || {}),
577
+ base_url: request_url
578
+ }
579
+ promise = @client.make_request_async(:post, path_template, options)
580
+
581
+ promise = promise.then do |result|
582
+ http_response = result.response
583
+ status_code = http_response.status
584
+ response_content = http_response.body
585
+ unless status_code == 200
586
+ error_model = JSON.load(response_content)
587
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
588
+ end
589
+
590
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
591
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
592
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
593
+ # Deserialize Response
594
+ if status_code == 200
595
+ begin
596
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
597
+ result_mapper = Azure::Cosmosdb::Mgmt::V2020_06_01_preview::Models::DatabaseAccountListKeysResult.mapper()
598
+ result.body = @client.deserialize(result_mapper, parsed_response)
599
+ rescue Exception => e
600
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
601
+ end
602
+ end
603
+
604
+ result
605
+ end
606
+
607
+ promise.execute
608
+ end
609
+
610
+ #
611
+ # Lists the connection strings for the specified Azure Cosmos DB database
612
+ # account.
613
+ #
614
+ # @param resource_group_name [String] The name of the resource group. The name
615
+ # is case insensitive.
616
+ # @param account_name [String] Cosmos DB database account name.
617
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
618
+ # will be added to the HTTP request.
619
+ #
620
+ # @return [DatabaseAccountListConnectionStringsResult] operation results.
621
+ #
622
+ def list_connection_strings(resource_group_name, account_name, custom_headers:nil)
623
+ response = list_connection_strings_async(resource_group_name, account_name, custom_headers:custom_headers).value!
624
+ response.body unless response.nil?
625
+ end
626
+
627
+ #
628
+ # Lists the connection strings for the specified Azure Cosmos DB database
629
+ # account.
630
+ #
631
+ # @param resource_group_name [String] The name of the resource group. The name
632
+ # is case insensitive.
633
+ # @param account_name [String] Cosmos DB database account name.
634
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
635
+ # will be added to the HTTP request.
636
+ #
637
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
638
+ #
639
+ def list_connection_strings_with_http_info(resource_group_name, account_name, custom_headers:nil)
640
+ list_connection_strings_async(resource_group_name, account_name, custom_headers:custom_headers).value!
641
+ end
642
+
643
+ #
644
+ # Lists the connection strings for the specified Azure Cosmos DB database
645
+ # account.
646
+ #
647
+ # @param resource_group_name [String] The name of the resource group. The name
648
+ # is case insensitive.
649
+ # @param account_name [String] Cosmos DB database account name.
650
+ # @param [Hash{String => String}] A hash of custom headers that will be added
651
+ # to the HTTP request.
652
+ #
653
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
654
+ #
655
+ def list_connection_strings_async(resource_group_name, account_name, custom_headers:nil)
656
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
657
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
658
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
659
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
660
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
661
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
662
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
663
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
664
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
665
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
666
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
667
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
668
+
669
+
670
+ request_headers = {}
671
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
672
+
673
+ # Set Headers
674
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
675
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
676
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listConnectionStrings'
677
+
678
+ request_url = @base_url || @client.base_url
679
+
680
+ options = {
681
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
682
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
683
+ query_params: {'api-version' => @client.api_version},
684
+ headers: request_headers.merge(custom_headers || {}),
685
+ base_url: request_url
686
+ }
687
+ promise = @client.make_request_async(:post, path_template, options)
688
+
689
+ promise = promise.then do |result|
690
+ http_response = result.response
691
+ status_code = http_response.status
692
+ response_content = http_response.body
693
+ unless status_code == 200
694
+ error_model = JSON.load(response_content)
695
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
696
+ end
697
+
698
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
699
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
700
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
701
+ # Deserialize Response
702
+ if status_code == 200
703
+ begin
704
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
705
+ result_mapper = Azure::Cosmosdb::Mgmt::V2020_06_01_preview::Models::DatabaseAccountListConnectionStringsResult.mapper()
706
+ result.body = @client.deserialize(result_mapper, parsed_response)
707
+ rescue Exception => e
708
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
709
+ end
710
+ end
711
+
712
+ result
713
+ end
714
+
715
+ promise.execute
716
+ end
717
+
718
+ #
719
+ # Offline the specified region for the specified Azure Cosmos DB database
720
+ # account.
721
+ #
722
+ # @param resource_group_name [String] The name of the resource group. The name
723
+ # is case insensitive.
724
+ # @param account_name [String] Cosmos DB database account name.
725
+ # @param region_parameter_for_offline [RegionForOnlineOffline] Cosmos DB region
726
+ # to offline for the database account.
727
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
728
+ # will be added to the HTTP request.
729
+ #
730
+ def offline_region(resource_group_name, account_name, region_parameter_for_offline, custom_headers:nil)
731
+ response = offline_region_async(resource_group_name, account_name, region_parameter_for_offline, custom_headers:custom_headers).value!
732
+ nil
733
+ end
734
+
735
+ #
736
+ # @param resource_group_name [String] The name of the resource group. The name
737
+ # is case insensitive.
738
+ # @param account_name [String] Cosmos DB database account name.
739
+ # @param region_parameter_for_offline [RegionForOnlineOffline] Cosmos DB region
740
+ # to offline for the database account.
741
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
742
+ # will be added to the HTTP request.
743
+ #
744
+ # @return [Concurrent::Promise] promise which provides async access to http
745
+ # response.
746
+ #
747
+ def offline_region_async(resource_group_name, account_name, region_parameter_for_offline, custom_headers:nil)
748
+ # Send request
749
+ promise = begin_offline_region_async(resource_group_name, account_name, region_parameter_for_offline, custom_headers:custom_headers)
750
+
751
+ promise = promise.then do |response|
752
+ # Defining deserialization method.
753
+ deserialize_method = lambda do |parsed_response|
754
+ end
755
+
756
+ # Waiting for response.
757
+ @client.get_long_running_operation_result(response, deserialize_method)
758
+ end
759
+
760
+ promise
761
+ end
762
+
763
+ #
764
+ # Online the specified region for the specified Azure Cosmos DB database
765
+ # account.
766
+ #
767
+ # @param resource_group_name [String] The name of the resource group. The name
768
+ # is case insensitive.
769
+ # @param account_name [String] Cosmos DB database account name.
770
+ # @param region_parameter_for_online [RegionForOnlineOffline] Cosmos DB region
771
+ # to online for the database account.
772
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
773
+ # will be added to the HTTP request.
774
+ #
775
+ def online_region(resource_group_name, account_name, region_parameter_for_online, custom_headers:nil)
776
+ response = online_region_async(resource_group_name, account_name, region_parameter_for_online, custom_headers:custom_headers).value!
777
+ nil
778
+ end
779
+
780
+ #
781
+ # @param resource_group_name [String] The name of the resource group. The name
782
+ # is case insensitive.
783
+ # @param account_name [String] Cosmos DB database account name.
784
+ # @param region_parameter_for_online [RegionForOnlineOffline] Cosmos DB region
785
+ # to online for the database account.
786
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
787
+ # will be added to the HTTP request.
788
+ #
789
+ # @return [Concurrent::Promise] promise which provides async access to http
790
+ # response.
791
+ #
792
+ def online_region_async(resource_group_name, account_name, region_parameter_for_online, custom_headers:nil)
793
+ # Send request
794
+ promise = begin_online_region_async(resource_group_name, account_name, region_parameter_for_online, custom_headers:custom_headers)
795
+
796
+ promise = promise.then do |response|
797
+ # Defining deserialization method.
798
+ deserialize_method = lambda do |parsed_response|
799
+ end
800
+
801
+ # Waiting for response.
802
+ @client.get_long_running_operation_result(response, deserialize_method)
803
+ end
804
+
805
+ promise
806
+ end
807
+
808
+ #
809
+ # Lists the read-only access keys for the specified Azure Cosmos DB database
810
+ # account.
811
+ #
812
+ # @param resource_group_name [String] The name of the resource group. The name
813
+ # is case insensitive.
814
+ # @param account_name [String] Cosmos DB database account name.
815
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
816
+ # will be added to the HTTP request.
817
+ #
818
+ # @return [DatabaseAccountListReadOnlyKeysResult] operation results.
819
+ #
820
+ def get_read_only_keys(resource_group_name, account_name, custom_headers:nil)
821
+ response = get_read_only_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value!
822
+ response.body unless response.nil?
823
+ end
824
+
825
+ #
826
+ # Lists the read-only access keys for the specified Azure Cosmos DB database
827
+ # account.
828
+ #
829
+ # @param resource_group_name [String] The name of the resource group. The name
830
+ # is case insensitive.
831
+ # @param account_name [String] Cosmos DB database account name.
832
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
833
+ # will be added to the HTTP request.
834
+ #
835
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
836
+ #
837
+ def get_read_only_keys_with_http_info(resource_group_name, account_name, custom_headers:nil)
838
+ get_read_only_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value!
839
+ end
840
+
841
+ #
842
+ # Lists the read-only access keys for the specified Azure Cosmos DB database
843
+ # account.
844
+ #
845
+ # @param resource_group_name [String] The name of the resource group. The name
846
+ # is case insensitive.
847
+ # @param account_name [String] Cosmos DB database account name.
848
+ # @param [Hash{String => String}] A hash of custom headers that will be added
849
+ # to the HTTP request.
850
+ #
851
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
852
+ #
853
+ def get_read_only_keys_async(resource_group_name, account_name, custom_headers:nil)
854
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
855
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
856
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
857
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
858
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
859
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
860
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
861
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
862
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
863
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
864
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
865
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
866
+
867
+
868
+ request_headers = {}
869
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
870
+
871
+ # Set Headers
872
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
873
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
874
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys'
875
+
876
+ request_url = @base_url || @client.base_url
877
+
878
+ options = {
879
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
880
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
881
+ query_params: {'api-version' => @client.api_version},
882
+ headers: request_headers.merge(custom_headers || {}),
883
+ base_url: request_url
884
+ }
885
+ promise = @client.make_request_async(:get, path_template, options)
886
+
887
+ promise = promise.then do |result|
888
+ http_response = result.response
889
+ status_code = http_response.status
890
+ response_content = http_response.body
891
+ unless status_code == 200
892
+ error_model = JSON.load(response_content)
893
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
894
+ end
895
+
896
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
897
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
898
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
899
+ # Deserialize Response
900
+ if status_code == 200
901
+ begin
902
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
903
+ result_mapper = Azure::Cosmosdb::Mgmt::V2020_06_01_preview::Models::DatabaseAccountListReadOnlyKeysResult.mapper()
904
+ result.body = @client.deserialize(result_mapper, parsed_response)
905
+ rescue Exception => e
906
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
907
+ end
908
+ end
909
+
910
+ result
911
+ end
912
+
913
+ promise.execute
914
+ end
915
+
916
+ #
917
+ # Lists the read-only access keys for the specified Azure Cosmos DB database
918
+ # account.
919
+ #
920
+ # @param resource_group_name [String] The name of the resource group. The name
921
+ # is case insensitive.
922
+ # @param account_name [String] Cosmos DB database account name.
923
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
924
+ # will be added to the HTTP request.
925
+ #
926
+ # @return [DatabaseAccountListReadOnlyKeysResult] operation results.
927
+ #
928
+ def list_read_only_keys(resource_group_name, account_name, custom_headers:nil)
929
+ response = list_read_only_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value!
930
+ response.body unless response.nil?
931
+ end
932
+
933
+ #
934
+ # Lists the read-only access keys for the specified Azure Cosmos DB database
935
+ # account.
936
+ #
937
+ # @param resource_group_name [String] The name of the resource group. The name
938
+ # is case insensitive.
939
+ # @param account_name [String] Cosmos DB database account name.
940
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
941
+ # will be added to the HTTP request.
942
+ #
943
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
944
+ #
945
+ def list_read_only_keys_with_http_info(resource_group_name, account_name, custom_headers:nil)
946
+ list_read_only_keys_async(resource_group_name, account_name, custom_headers:custom_headers).value!
947
+ end
948
+
949
+ #
950
+ # Lists the read-only access keys for the specified Azure Cosmos DB database
951
+ # account.
952
+ #
953
+ # @param resource_group_name [String] The name of the resource group. The name
954
+ # is case insensitive.
955
+ # @param account_name [String] Cosmos DB database account name.
956
+ # @param [Hash{String => String}] A hash of custom headers that will be added
957
+ # to the HTTP request.
958
+ #
959
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
960
+ #
961
+ def list_read_only_keys_async(resource_group_name, account_name, custom_headers:nil)
962
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
963
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
964
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
965
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
966
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
967
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
968
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
969
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
970
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
971
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
972
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
973
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
974
+
975
+
976
+ request_headers = {}
977
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
978
+
979
+ # Set Headers
980
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
981
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
982
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys'
983
+
984
+ request_url = @base_url || @client.base_url
985
+
986
+ options = {
987
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
988
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
989
+ query_params: {'api-version' => @client.api_version},
990
+ headers: request_headers.merge(custom_headers || {}),
991
+ base_url: request_url
992
+ }
993
+ promise = @client.make_request_async(:post, path_template, options)
994
+
995
+ promise = promise.then do |result|
996
+ http_response = result.response
997
+ status_code = http_response.status
998
+ response_content = http_response.body
999
+ unless status_code == 200
1000
+ error_model = JSON.load(response_content)
1001
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1002
+ end
1003
+
1004
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1005
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1006
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1007
+ # Deserialize Response
1008
+ if status_code == 200
1009
+ begin
1010
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1011
+ result_mapper = Azure::Cosmosdb::Mgmt::V2020_06_01_preview::Models::DatabaseAccountListReadOnlyKeysResult.mapper()
1012
+ result.body = @client.deserialize(result_mapper, parsed_response)
1013
+ rescue Exception => e
1014
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1015
+ end
1016
+ end
1017
+
1018
+ result
1019
+ end
1020
+
1021
+ promise.execute
1022
+ end
1023
+
1024
+ #
1025
+ # Regenerates an access key for the specified Azure Cosmos DB database account.
1026
+ #
1027
+ # @param resource_group_name [String] The name of the resource group. The name
1028
+ # is case insensitive.
1029
+ # @param account_name [String] Cosmos DB database account name.
1030
+ # @param key_to_regenerate [DatabaseAccountRegenerateKeyParameters] The name of
1031
+ # the key to regenerate.
1032
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1033
+ # will be added to the HTTP request.
1034
+ #
1035
+ def regenerate_key(resource_group_name, account_name, key_to_regenerate, custom_headers:nil)
1036
+ response = regenerate_key_async(resource_group_name, account_name, key_to_regenerate, custom_headers:custom_headers).value!
1037
+ nil
1038
+ end
1039
+
1040
+ #
1041
+ # @param resource_group_name [String] The name of the resource group. The name
1042
+ # is case insensitive.
1043
+ # @param account_name [String] Cosmos DB database account name.
1044
+ # @param key_to_regenerate [DatabaseAccountRegenerateKeyParameters] The name of
1045
+ # the key to regenerate.
1046
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1047
+ # will be added to the HTTP request.
1048
+ #
1049
+ # @return [Concurrent::Promise] promise which provides async access to http
1050
+ # response.
1051
+ #
1052
+ def regenerate_key_async(resource_group_name, account_name, key_to_regenerate, custom_headers:nil)
1053
+ # Send request
1054
+ promise = begin_regenerate_key_async(resource_group_name, account_name, key_to_regenerate, custom_headers:custom_headers)
1055
+
1056
+ promise = promise.then do |response|
1057
+ # Defining deserialization method.
1058
+ deserialize_method = lambda do |parsed_response|
1059
+ end
1060
+
1061
+ # Waiting for response.
1062
+ @client.get_long_running_operation_result(response, deserialize_method)
1063
+ end
1064
+
1065
+ promise
1066
+ end
1067
+
1068
+ #
1069
+ # Checks that the Azure Cosmos DB account name already exists. A valid account
1070
+ # name may contain only lowercase letters, numbers, and the '-' character, and
1071
+ # must be between 3 and 50 characters.
1072
+ #
1073
+ # @param account_name [String] Cosmos DB database account name.
1074
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1075
+ # will be added to the HTTP request.
1076
+ #
1077
+ # @return [Boolean] operation results.
1078
+ #
1079
+ def check_name_exists(account_name, custom_headers:nil)
1080
+ response = check_name_exists_async(account_name, custom_headers:custom_headers).value!
1081
+ response.body unless response.nil?
1082
+ end
1083
+
1084
+ #
1085
+ # Checks that the Azure Cosmos DB account name already exists. A valid account
1086
+ # name may contain only lowercase letters, numbers, and the '-' character, and
1087
+ # must be between 3 and 50 characters.
1088
+ #
1089
+ # @param account_name [String] Cosmos DB database account name.
1090
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1091
+ # will be added to the HTTP request.
1092
+ #
1093
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1094
+ #
1095
+ def check_name_exists_with_http_info(account_name, custom_headers:nil)
1096
+ check_name_exists_async(account_name, custom_headers:custom_headers).value!
1097
+ end
1098
+
1099
+ #
1100
+ # Checks that the Azure Cosmos DB account name already exists. A valid account
1101
+ # name may contain only lowercase letters, numbers, and the '-' character, and
1102
+ # must be between 3 and 50 characters.
1103
+ #
1104
+ # @param account_name [String] Cosmos DB database account name.
1105
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1106
+ # to the HTTP request.
1107
+ #
1108
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1109
+ #
1110
+ def check_name_exists_async(account_name, custom_headers:nil)
1111
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1112
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
1113
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1114
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
1115
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1116
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
1117
+
1118
+
1119
+ request_headers = {}
1120
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1121
+
1122
+ # Set Headers
1123
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1124
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1125
+ path_template = 'providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}'
1126
+
1127
+ request_url = @base_url || @client.base_url
1128
+
1129
+ options = {
1130
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1131
+ path_params: {'accountName' => account_name},
1132
+ query_params: {'api-version' => @client.api_version},
1133
+ headers: request_headers.merge(custom_headers || {}),
1134
+ base_url: request_url
1135
+ }
1136
+ promise = @client.make_request_async(:head, path_template, options)
1137
+
1138
+ promise = promise.then do |result|
1139
+ http_response = result.response
1140
+ status_code = http_response.status
1141
+ response_content = http_response.body
1142
+ unless status_code == 200 || status_code == 404
1143
+ error_model = JSON.load(response_content)
1144
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1145
+ end
1146
+
1147
+ result.body = (status_code == 200)
1148
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1149
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1150
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1151
+
1152
+ result
1153
+ end
1154
+
1155
+ promise.execute
1156
+ end
1157
+
1158
+ #
1159
+ # Retrieves the metrics determined by the given filter for the given database
1160
+ # account.
1161
+ #
1162
+ # @param resource_group_name [String] The name of the resource group. The name
1163
+ # is case insensitive.
1164
+ # @param account_name [String] Cosmos DB database account name.
1165
+ # @param filter [String] An OData filter expression that describes a subset of
1166
+ # metrics to return. The parameters that can be filtered are name.value (name
1167
+ # of the metric, can have an or of multiple names), startTime, endTime, and
1168
+ # timeGrain. The supported operator is eq.
1169
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1170
+ # will be added to the HTTP request.
1171
+ #
1172
+ # @return [MetricListResult] operation results.
1173
+ #
1174
+ def list_metrics(resource_group_name, account_name, filter, custom_headers:nil)
1175
+ response = list_metrics_async(resource_group_name, account_name, filter, custom_headers:custom_headers).value!
1176
+ response.body unless response.nil?
1177
+ end
1178
+
1179
+ #
1180
+ # Retrieves the metrics determined by the given filter for the given database
1181
+ # account.
1182
+ #
1183
+ # @param resource_group_name [String] The name of the resource group. The name
1184
+ # is case insensitive.
1185
+ # @param account_name [String] Cosmos DB database account name.
1186
+ # @param filter [String] An OData filter expression that describes a subset of
1187
+ # metrics to return. The parameters that can be filtered are name.value (name
1188
+ # of the metric, can have an or of multiple names), startTime, endTime, and
1189
+ # timeGrain. The supported operator is eq.
1190
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1191
+ # will be added to the HTTP request.
1192
+ #
1193
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1194
+ #
1195
+ def list_metrics_with_http_info(resource_group_name, account_name, filter, custom_headers:nil)
1196
+ list_metrics_async(resource_group_name, account_name, filter, custom_headers:custom_headers).value!
1197
+ end
1198
+
1199
+ #
1200
+ # Retrieves the metrics determined by the given filter for the given database
1201
+ # account.
1202
+ #
1203
+ # @param resource_group_name [String] The name of the resource group. The name
1204
+ # is case insensitive.
1205
+ # @param account_name [String] Cosmos DB database account name.
1206
+ # @param filter [String] An OData filter expression that describes a subset of
1207
+ # metrics to return. The parameters that can be filtered are name.value (name
1208
+ # of the metric, can have an or of multiple names), startTime, endTime, and
1209
+ # timeGrain. The supported operator is eq.
1210
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1211
+ # to the HTTP request.
1212
+ #
1213
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1214
+ #
1215
+ def list_metrics_async(resource_group_name, account_name, filter, custom_headers:nil)
1216
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1217
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
1218
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1219
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1220
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1221
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1222
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1223
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
1224
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1225
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
1226
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1227
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
1228
+ fail ArgumentError, 'filter is nil' if filter.nil?
1229
+
1230
+
1231
+ request_headers = {}
1232
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1233
+
1234
+ # Set Headers
1235
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1236
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1237
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metrics'
1238
+
1239
+ request_url = @base_url || @client.base_url
1240
+
1241
+ options = {
1242
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1243
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
1244
+ query_params: {'api-version' => @client.api_version,'$filter' => filter},
1245
+ headers: request_headers.merge(custom_headers || {}),
1246
+ base_url: request_url
1247
+ }
1248
+ promise = @client.make_request_async(:get, path_template, options)
1249
+
1250
+ promise = promise.then do |result|
1251
+ http_response = result.response
1252
+ status_code = http_response.status
1253
+ response_content = http_response.body
1254
+ unless status_code == 200
1255
+ error_model = JSON.load(response_content)
1256
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1257
+ end
1258
+
1259
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1260
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1261
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1262
+ # Deserialize Response
1263
+ if status_code == 200
1264
+ begin
1265
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1266
+ result_mapper = Azure::Cosmosdb::Mgmt::V2020_06_01_preview::Models::MetricListResult.mapper()
1267
+ result.body = @client.deserialize(result_mapper, parsed_response)
1268
+ rescue Exception => e
1269
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1270
+ end
1271
+ end
1272
+
1273
+ result
1274
+ end
1275
+
1276
+ promise.execute
1277
+ end
1278
+
1279
+ #
1280
+ # Retrieves the usages (most recent data) for the given database account.
1281
+ #
1282
+ # @param resource_group_name [String] The name of the resource group. The name
1283
+ # is case insensitive.
1284
+ # @param account_name [String] Cosmos DB database account name.
1285
+ # @param filter [String] An OData filter expression that describes a subset of
1286
+ # usages to return. The supported parameter is name.value (name of the metric,
1287
+ # can have an or of multiple names).
1288
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1289
+ # will be added to the HTTP request.
1290
+ #
1291
+ # @return [UsagesResult] operation results.
1292
+ #
1293
+ def list_usages(resource_group_name, account_name, filter:nil, custom_headers:nil)
1294
+ response = list_usages_async(resource_group_name, account_name, filter:filter, custom_headers:custom_headers).value!
1295
+ response.body unless response.nil?
1296
+ end
1297
+
1298
+ #
1299
+ # Retrieves the usages (most recent data) for the given database account.
1300
+ #
1301
+ # @param resource_group_name [String] The name of the resource group. The name
1302
+ # is case insensitive.
1303
+ # @param account_name [String] Cosmos DB database account name.
1304
+ # @param filter [String] An OData filter expression that describes a subset of
1305
+ # usages to return. The supported parameter is name.value (name of the metric,
1306
+ # can have an or of multiple names).
1307
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1308
+ # will be added to the HTTP request.
1309
+ #
1310
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1311
+ #
1312
+ def list_usages_with_http_info(resource_group_name, account_name, filter:nil, custom_headers:nil)
1313
+ list_usages_async(resource_group_name, account_name, filter:filter, custom_headers:custom_headers).value!
1314
+ end
1315
+
1316
+ #
1317
+ # Retrieves the usages (most recent data) for the given database account.
1318
+ #
1319
+ # @param resource_group_name [String] The name of the resource group. The name
1320
+ # is case insensitive.
1321
+ # @param account_name [String] Cosmos DB database account name.
1322
+ # @param filter [String] An OData filter expression that describes a subset of
1323
+ # usages to return. The supported parameter is name.value (name of the metric,
1324
+ # can have an or of multiple names).
1325
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1326
+ # to the HTTP request.
1327
+ #
1328
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1329
+ #
1330
+ def list_usages_async(resource_group_name, account_name, filter:nil, custom_headers:nil)
1331
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1332
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
1333
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1334
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1335
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1336
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1337
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1338
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
1339
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1340
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
1341
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1342
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
1343
+
1344
+
1345
+ request_headers = {}
1346
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1347
+
1348
+ # Set Headers
1349
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1350
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1351
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/usages'
1352
+
1353
+ request_url = @base_url || @client.base_url
1354
+
1355
+ options = {
1356
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1357
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
1358
+ query_params: {'api-version' => @client.api_version,'$filter' => filter},
1359
+ headers: request_headers.merge(custom_headers || {}),
1360
+ base_url: request_url
1361
+ }
1362
+ promise = @client.make_request_async(:get, path_template, options)
1363
+
1364
+ promise = promise.then do |result|
1365
+ http_response = result.response
1366
+ status_code = http_response.status
1367
+ response_content = http_response.body
1368
+ unless status_code == 200
1369
+ error_model = JSON.load(response_content)
1370
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1371
+ end
1372
+
1373
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1374
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1375
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1376
+ # Deserialize Response
1377
+ if status_code == 200
1378
+ begin
1379
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1380
+ result_mapper = Azure::Cosmosdb::Mgmt::V2020_06_01_preview::Models::UsagesResult.mapper()
1381
+ result.body = @client.deserialize(result_mapper, parsed_response)
1382
+ rescue Exception => e
1383
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1384
+ end
1385
+ end
1386
+
1387
+ result
1388
+ end
1389
+
1390
+ promise.execute
1391
+ end
1392
+
1393
+ #
1394
+ # Retrieves metric definitions for the given database account.
1395
+ #
1396
+ # @param resource_group_name [String] The name of the resource group. The name
1397
+ # is case insensitive.
1398
+ # @param account_name [String] Cosmos DB database account name.
1399
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1400
+ # will be added to the HTTP request.
1401
+ #
1402
+ # @return [MetricDefinitionsListResult] operation results.
1403
+ #
1404
+ def list_metric_definitions(resource_group_name, account_name, custom_headers:nil)
1405
+ response = list_metric_definitions_async(resource_group_name, account_name, custom_headers:custom_headers).value!
1406
+ response.body unless response.nil?
1407
+ end
1408
+
1409
+ #
1410
+ # Retrieves metric definitions for the given database account.
1411
+ #
1412
+ # @param resource_group_name [String] The name of the resource group. The name
1413
+ # is case insensitive.
1414
+ # @param account_name [String] Cosmos DB database account name.
1415
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1416
+ # will be added to the HTTP request.
1417
+ #
1418
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1419
+ #
1420
+ def list_metric_definitions_with_http_info(resource_group_name, account_name, custom_headers:nil)
1421
+ list_metric_definitions_async(resource_group_name, account_name, custom_headers:custom_headers).value!
1422
+ end
1423
+
1424
+ #
1425
+ # Retrieves metric definitions for the given database account.
1426
+ #
1427
+ # @param resource_group_name [String] The name of the resource group. The name
1428
+ # is case insensitive.
1429
+ # @param account_name [String] Cosmos DB database account name.
1430
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1431
+ # to the HTTP request.
1432
+ #
1433
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1434
+ #
1435
+ def list_metric_definitions_async(resource_group_name, account_name, custom_headers:nil)
1436
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1437
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
1438
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1439
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1440
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1441
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1442
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1443
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
1444
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1445
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
1446
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1447
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
1448
+
1449
+
1450
+ request_headers = {}
1451
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1452
+
1453
+ # Set Headers
1454
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1455
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1456
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metricDefinitions'
1457
+
1458
+ request_url = @base_url || @client.base_url
1459
+
1460
+ options = {
1461
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1462
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
1463
+ query_params: {'api-version' => @client.api_version},
1464
+ headers: request_headers.merge(custom_headers || {}),
1465
+ base_url: request_url
1466
+ }
1467
+ promise = @client.make_request_async(:get, path_template, options)
1468
+
1469
+ promise = promise.then do |result|
1470
+ http_response = result.response
1471
+ status_code = http_response.status
1472
+ response_content = http_response.body
1473
+ unless status_code == 200
1474
+ error_model = JSON.load(response_content)
1475
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1476
+ end
1477
+
1478
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1479
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1480
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1481
+ # Deserialize Response
1482
+ if status_code == 200
1483
+ begin
1484
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1485
+ result_mapper = Azure::Cosmosdb::Mgmt::V2020_06_01_preview::Models::MetricDefinitionsListResult.mapper()
1486
+ result.body = @client.deserialize(result_mapper, parsed_response)
1487
+ rescue Exception => e
1488
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1489
+ end
1490
+ end
1491
+
1492
+ result
1493
+ end
1494
+
1495
+ promise.execute
1496
+ end
1497
+
1498
+ #
1499
+ # Updates the properties of an existing Azure Cosmos DB database account.
1500
+ #
1501
+ # @param resource_group_name [String] The name of the resource group. The name
1502
+ # is case insensitive.
1503
+ # @param account_name [String] Cosmos DB database account name.
1504
+ # @param update_parameters [DatabaseAccountUpdateParameters] The parameters to
1505
+ # provide for the current database account.
1506
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1507
+ # will be added to the HTTP request.
1508
+ #
1509
+ # @return [DatabaseAccountGetResults] operation results.
1510
+ #
1511
+ def begin_update(resource_group_name, account_name, update_parameters, custom_headers:nil)
1512
+ response = begin_update_async(resource_group_name, account_name, update_parameters, custom_headers:custom_headers).value!
1513
+ response.body unless response.nil?
1514
+ end
1515
+
1516
+ #
1517
+ # Updates the properties of an existing Azure Cosmos DB database account.
1518
+ #
1519
+ # @param resource_group_name [String] The name of the resource group. The name
1520
+ # is case insensitive.
1521
+ # @param account_name [String] Cosmos DB database account name.
1522
+ # @param update_parameters [DatabaseAccountUpdateParameters] The parameters to
1523
+ # provide for the current database account.
1524
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1525
+ # will be added to the HTTP request.
1526
+ #
1527
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1528
+ #
1529
+ def begin_update_with_http_info(resource_group_name, account_name, update_parameters, custom_headers:nil)
1530
+ begin_update_async(resource_group_name, account_name, update_parameters, custom_headers:custom_headers).value!
1531
+ end
1532
+
1533
+ #
1534
+ # Updates the properties of an existing Azure Cosmos DB database account.
1535
+ #
1536
+ # @param resource_group_name [String] The name of the resource group. The name
1537
+ # is case insensitive.
1538
+ # @param account_name [String] Cosmos DB database account name.
1539
+ # @param update_parameters [DatabaseAccountUpdateParameters] The parameters to
1540
+ # provide for the current database account.
1541
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1542
+ # to the HTTP request.
1543
+ #
1544
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1545
+ #
1546
+ def begin_update_async(resource_group_name, account_name, update_parameters, custom_headers:nil)
1547
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1548
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
1549
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1550
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1551
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1552
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1553
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1554
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
1555
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1556
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
1557
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1558
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
1559
+ fail ArgumentError, 'update_parameters is nil' if update_parameters.nil?
1560
+
1561
+
1562
+ request_headers = {}
1563
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1564
+
1565
+ # Set Headers
1566
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1567
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1568
+
1569
+ # Serialize Request
1570
+ request_mapper = Azure::Cosmosdb::Mgmt::V2020_06_01_preview::Models::DatabaseAccountUpdateParameters.mapper()
1571
+ request_content = @client.serialize(request_mapper, update_parameters)
1572
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1573
+
1574
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}'
1575
+
1576
+ request_url = @base_url || @client.base_url
1577
+
1578
+ options = {
1579
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1580
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
1581
+ query_params: {'api-version' => @client.api_version},
1582
+ body: request_content,
1583
+ headers: request_headers.merge(custom_headers || {}),
1584
+ base_url: request_url
1585
+ }
1586
+ promise = @client.make_request_async(:patch, path_template, options)
1587
+
1588
+ promise = promise.then do |result|
1589
+ http_response = result.response
1590
+ status_code = http_response.status
1591
+ response_content = http_response.body
1592
+ unless status_code == 200
1593
+ error_model = JSON.load(response_content)
1594
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1595
+ end
1596
+
1597
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1598
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1599
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1600
+ # Deserialize Response
1601
+ if status_code == 200
1602
+ begin
1603
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1604
+ result_mapper = Azure::Cosmosdb::Mgmt::V2020_06_01_preview::Models::DatabaseAccountGetResults.mapper()
1605
+ result.body = @client.deserialize(result_mapper, parsed_response)
1606
+ rescue Exception => e
1607
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1608
+ end
1609
+ end
1610
+
1611
+ result
1612
+ end
1613
+
1614
+ promise.execute
1615
+ end
1616
+
1617
+ #
1618
+ # Creates or updates an Azure Cosmos DB database account. The "Update" method
1619
+ # is preferred when performing updates on an account.
1620
+ #
1621
+ # @param resource_group_name [String] The name of the resource group. The name
1622
+ # is case insensitive.
1623
+ # @param account_name [String] Cosmos DB database account name.
1624
+ # @param create_update_parameters [DatabaseAccountCreateUpdateParameters] The
1625
+ # parameters to provide for the current database account.
1626
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1627
+ # will be added to the HTTP request.
1628
+ #
1629
+ # @return [DatabaseAccountGetResults] operation results.
1630
+ #
1631
+ def begin_create_or_update(resource_group_name, account_name, create_update_parameters, custom_headers:nil)
1632
+ response = begin_create_or_update_async(resource_group_name, account_name, create_update_parameters, custom_headers:custom_headers).value!
1633
+ response.body unless response.nil?
1634
+ end
1635
+
1636
+ #
1637
+ # Creates or updates an Azure Cosmos DB database account. The "Update" method
1638
+ # is preferred when performing updates on an account.
1639
+ #
1640
+ # @param resource_group_name [String] The name of the resource group. The name
1641
+ # is case insensitive.
1642
+ # @param account_name [String] Cosmos DB database account name.
1643
+ # @param create_update_parameters [DatabaseAccountCreateUpdateParameters] The
1644
+ # parameters to provide for the current database account.
1645
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1646
+ # will be added to the HTTP request.
1647
+ #
1648
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1649
+ #
1650
+ def begin_create_or_update_with_http_info(resource_group_name, account_name, create_update_parameters, custom_headers:nil)
1651
+ begin_create_or_update_async(resource_group_name, account_name, create_update_parameters, custom_headers:custom_headers).value!
1652
+ end
1653
+
1654
+ #
1655
+ # Creates or updates an Azure Cosmos DB database account. The "Update" method
1656
+ # is preferred when performing updates on an account.
1657
+ #
1658
+ # @param resource_group_name [String] The name of the resource group. The name
1659
+ # is case insensitive.
1660
+ # @param account_name [String] Cosmos DB database account name.
1661
+ # @param create_update_parameters [DatabaseAccountCreateUpdateParameters] The
1662
+ # parameters to provide for the current database account.
1663
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1664
+ # to the HTTP request.
1665
+ #
1666
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1667
+ #
1668
+ def begin_create_or_update_async(resource_group_name, account_name, create_update_parameters, custom_headers:nil)
1669
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1670
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
1671
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1672
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1673
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1674
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1675
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1676
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
1677
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1678
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
1679
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1680
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
1681
+ fail ArgumentError, 'create_update_parameters is nil' if create_update_parameters.nil?
1682
+
1683
+
1684
+ request_headers = {}
1685
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1686
+
1687
+ # Set Headers
1688
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1689
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1690
+
1691
+ # Serialize Request
1692
+ request_mapper = Azure::Cosmosdb::Mgmt::V2020_06_01_preview::Models::DatabaseAccountCreateUpdateParameters.mapper()
1693
+ request_content = @client.serialize(request_mapper, create_update_parameters)
1694
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1695
+
1696
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}'
1697
+
1698
+ request_url = @base_url || @client.base_url
1699
+
1700
+ options = {
1701
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1702
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
1703
+ query_params: {'api-version' => @client.api_version},
1704
+ body: request_content,
1705
+ headers: request_headers.merge(custom_headers || {}),
1706
+ base_url: request_url
1707
+ }
1708
+ promise = @client.make_request_async(:put, path_template, options)
1709
+
1710
+ promise = promise.then do |result|
1711
+ http_response = result.response
1712
+ status_code = http_response.status
1713
+ response_content = http_response.body
1714
+ unless status_code == 200
1715
+ error_model = JSON.load(response_content)
1716
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1717
+ end
1718
+
1719
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1720
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1721
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1722
+ # Deserialize Response
1723
+ if status_code == 200
1724
+ begin
1725
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1726
+ result_mapper = Azure::Cosmosdb::Mgmt::V2020_06_01_preview::Models::DatabaseAccountGetResults.mapper()
1727
+ result.body = @client.deserialize(result_mapper, parsed_response)
1728
+ rescue Exception => e
1729
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1730
+ end
1731
+ end
1732
+
1733
+ result
1734
+ end
1735
+
1736
+ promise.execute
1737
+ end
1738
+
1739
+ #
1740
+ # Deletes an existing Azure Cosmos DB database account.
1741
+ #
1742
+ # @param resource_group_name [String] The name of the resource group. The name
1743
+ # is case insensitive.
1744
+ # @param account_name [String] Cosmos DB database account name.
1745
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1746
+ # will be added to the HTTP request.
1747
+ #
1748
+ #
1749
+ def begin_delete(resource_group_name, account_name, custom_headers:nil)
1750
+ response = begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers).value!
1751
+ nil
1752
+ end
1753
+
1754
+ #
1755
+ # Deletes an existing Azure Cosmos DB database account.
1756
+ #
1757
+ # @param resource_group_name [String] The name of the resource group. The name
1758
+ # is case insensitive.
1759
+ # @param account_name [String] Cosmos DB database account name.
1760
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1761
+ # will be added to the HTTP request.
1762
+ #
1763
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1764
+ #
1765
+ def begin_delete_with_http_info(resource_group_name, account_name, custom_headers:nil)
1766
+ begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers).value!
1767
+ end
1768
+
1769
+ #
1770
+ # Deletes an existing Azure Cosmos DB database account.
1771
+ #
1772
+ # @param resource_group_name [String] The name of the resource group. The name
1773
+ # is case insensitive.
1774
+ # @param account_name [String] Cosmos DB database account name.
1775
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1776
+ # to the HTTP request.
1777
+ #
1778
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1779
+ #
1780
+ def begin_delete_async(resource_group_name, account_name, custom_headers:nil)
1781
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1782
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
1783
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1784
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1785
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1786
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1787
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1788
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
1789
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1790
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
1791
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1792
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
1793
+
1794
+
1795
+ request_headers = {}
1796
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1797
+
1798
+ # Set Headers
1799
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1800
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1801
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}'
1802
+
1803
+ request_url = @base_url || @client.base_url
1804
+
1805
+ options = {
1806
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1807
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
1808
+ query_params: {'api-version' => @client.api_version},
1809
+ headers: request_headers.merge(custom_headers || {}),
1810
+ base_url: request_url
1811
+ }
1812
+ promise = @client.make_request_async(:delete, path_template, options)
1813
+
1814
+ promise = promise.then do |result|
1815
+ http_response = result.response
1816
+ status_code = http_response.status
1817
+ response_content = http_response.body
1818
+ unless status_code == 202 || status_code == 204
1819
+ error_model = JSON.load(response_content)
1820
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1821
+ end
1822
+
1823
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1824
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1825
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1826
+
1827
+ result
1828
+ end
1829
+
1830
+ promise.execute
1831
+ end
1832
+
1833
+ #
1834
+ # Changes the failover priority for the Azure Cosmos DB database account. A
1835
+ # failover priority of 0 indicates a write region. The maximum value for a
1836
+ # failover priority = (total number of regions - 1). Failover priority values
1837
+ # must be unique for each of the regions in which the database account exists.
1838
+ #
1839
+ # @param resource_group_name [String] The name of the resource group. The name
1840
+ # is case insensitive.
1841
+ # @param account_name [String] Cosmos DB database account name.
1842
+ # @param failover_parameters [FailoverPolicies] The new failover policies for
1843
+ # the database account.
1844
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1845
+ # will be added to the HTTP request.
1846
+ #
1847
+ #
1848
+ def begin_failover_priority_change(resource_group_name, account_name, failover_parameters, custom_headers:nil)
1849
+ response = begin_failover_priority_change_async(resource_group_name, account_name, failover_parameters, custom_headers:custom_headers).value!
1850
+ nil
1851
+ end
1852
+
1853
+ #
1854
+ # Changes the failover priority for the Azure Cosmos DB database account. A
1855
+ # failover priority of 0 indicates a write region. The maximum value for a
1856
+ # failover priority = (total number of regions - 1). Failover priority values
1857
+ # must be unique for each of the regions in which the database account exists.
1858
+ #
1859
+ # @param resource_group_name [String] The name of the resource group. The name
1860
+ # is case insensitive.
1861
+ # @param account_name [String] Cosmos DB database account name.
1862
+ # @param failover_parameters [FailoverPolicies] The new failover policies for
1863
+ # the database account.
1864
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1865
+ # will be added to the HTTP request.
1866
+ #
1867
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1868
+ #
1869
+ def begin_failover_priority_change_with_http_info(resource_group_name, account_name, failover_parameters, custom_headers:nil)
1870
+ begin_failover_priority_change_async(resource_group_name, account_name, failover_parameters, custom_headers:custom_headers).value!
1871
+ end
1872
+
1873
+ #
1874
+ # Changes the failover priority for the Azure Cosmos DB database account. A
1875
+ # failover priority of 0 indicates a write region. The maximum value for a
1876
+ # failover priority = (total number of regions - 1). Failover priority values
1877
+ # must be unique for each of the regions in which the database account exists.
1878
+ #
1879
+ # @param resource_group_name [String] The name of the resource group. The name
1880
+ # is case insensitive.
1881
+ # @param account_name [String] Cosmos DB database account name.
1882
+ # @param failover_parameters [FailoverPolicies] The new failover policies for
1883
+ # the database account.
1884
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1885
+ # to the HTTP request.
1886
+ #
1887
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1888
+ #
1889
+ def begin_failover_priority_change_async(resource_group_name, account_name, failover_parameters, custom_headers:nil)
1890
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1891
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
1892
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1893
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1894
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1895
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1896
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1897
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
1898
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1899
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
1900
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1901
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
1902
+ fail ArgumentError, 'failover_parameters is nil' if failover_parameters.nil?
1903
+
1904
+
1905
+ request_headers = {}
1906
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1907
+
1908
+ # Set Headers
1909
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1910
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1911
+
1912
+ # Serialize Request
1913
+ request_mapper = Azure::Cosmosdb::Mgmt::V2020_06_01_preview::Models::FailoverPolicies.mapper()
1914
+ request_content = @client.serialize(request_mapper, failover_parameters)
1915
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1916
+
1917
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange'
1918
+
1919
+ request_url = @base_url || @client.base_url
1920
+
1921
+ options = {
1922
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1923
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
1924
+ query_params: {'api-version' => @client.api_version},
1925
+ body: request_content,
1926
+ headers: request_headers.merge(custom_headers || {}),
1927
+ base_url: request_url
1928
+ }
1929
+ promise = @client.make_request_async(:post, path_template, options)
1930
+
1931
+ promise = promise.then do |result|
1932
+ http_response = result.response
1933
+ status_code = http_response.status
1934
+ response_content = http_response.body
1935
+ unless status_code == 202 || status_code == 204
1936
+ error_model = JSON.load(response_content)
1937
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1938
+ end
1939
+
1940
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1941
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1942
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1943
+
1944
+ result
1945
+ end
1946
+
1947
+ promise.execute
1948
+ end
1949
+
1950
+ #
1951
+ # Offline the specified region for the specified Azure Cosmos DB database
1952
+ # account.
1953
+ #
1954
+ # @param resource_group_name [String] The name of the resource group. The name
1955
+ # is case insensitive.
1956
+ # @param account_name [String] Cosmos DB database account name.
1957
+ # @param region_parameter_for_offline [RegionForOnlineOffline] Cosmos DB region
1958
+ # to offline for the database account.
1959
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1960
+ # will be added to the HTTP request.
1961
+ #
1962
+ #
1963
+ def begin_offline_region(resource_group_name, account_name, region_parameter_for_offline, custom_headers:nil)
1964
+ response = begin_offline_region_async(resource_group_name, account_name, region_parameter_for_offline, custom_headers:custom_headers).value!
1965
+ nil
1966
+ end
1967
+
1968
+ #
1969
+ # Offline the specified region for the specified Azure Cosmos DB database
1970
+ # account.
1971
+ #
1972
+ # @param resource_group_name [String] The name of the resource group. The name
1973
+ # is case insensitive.
1974
+ # @param account_name [String] Cosmos DB database account name.
1975
+ # @param region_parameter_for_offline [RegionForOnlineOffline] Cosmos DB region
1976
+ # to offline for the database account.
1977
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1978
+ # will be added to the HTTP request.
1979
+ #
1980
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1981
+ #
1982
+ def begin_offline_region_with_http_info(resource_group_name, account_name, region_parameter_for_offline, custom_headers:nil)
1983
+ begin_offline_region_async(resource_group_name, account_name, region_parameter_for_offline, custom_headers:custom_headers).value!
1984
+ end
1985
+
1986
+ #
1987
+ # Offline the specified region for the specified Azure Cosmos DB database
1988
+ # account.
1989
+ #
1990
+ # @param resource_group_name [String] The name of the resource group. The name
1991
+ # is case insensitive.
1992
+ # @param account_name [String] Cosmos DB database account name.
1993
+ # @param region_parameter_for_offline [RegionForOnlineOffline] Cosmos DB region
1994
+ # to offline for the database account.
1995
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1996
+ # to the HTTP request.
1997
+ #
1998
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1999
+ #
2000
+ def begin_offline_region_async(resource_group_name, account_name, region_parameter_for_offline, custom_headers:nil)
2001
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2002
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
2003
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2004
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
2005
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
2006
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
2007
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
2008
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
2009
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
2010
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
2011
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2012
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
2013
+ fail ArgumentError, 'region_parameter_for_offline is nil' if region_parameter_for_offline.nil?
2014
+
2015
+
2016
+ request_headers = {}
2017
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2018
+
2019
+ # Set Headers
2020
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2021
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2022
+
2023
+ # Serialize Request
2024
+ request_mapper = Azure::Cosmosdb::Mgmt::V2020_06_01_preview::Models::RegionForOnlineOffline.mapper()
2025
+ request_content = @client.serialize(request_mapper, region_parameter_for_offline)
2026
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2027
+
2028
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion'
2029
+
2030
+ request_url = @base_url || @client.base_url
2031
+
2032
+ options = {
2033
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2034
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
2035
+ query_params: {'api-version' => @client.api_version},
2036
+ body: request_content,
2037
+ headers: request_headers.merge(custom_headers || {}),
2038
+ base_url: request_url
2039
+ }
2040
+ promise = @client.make_request_async(:post, path_template, options)
2041
+
2042
+ promise = promise.then do |result|
2043
+ http_response = result.response
2044
+ status_code = http_response.status
2045
+ response_content = http_response.body
2046
+ unless status_code == 200 || status_code == 202
2047
+ error_model = JSON.load(response_content)
2048
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2049
+ end
2050
+
2051
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2052
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2053
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2054
+
2055
+ result
2056
+ end
2057
+
2058
+ promise.execute
2059
+ end
2060
+
2061
+ #
2062
+ # Online the specified region for the specified Azure Cosmos DB database
2063
+ # account.
2064
+ #
2065
+ # @param resource_group_name [String] The name of the resource group. The name
2066
+ # is case insensitive.
2067
+ # @param account_name [String] Cosmos DB database account name.
2068
+ # @param region_parameter_for_online [RegionForOnlineOffline] Cosmos DB region
2069
+ # to online for the database account.
2070
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2071
+ # will be added to the HTTP request.
2072
+ #
2073
+ #
2074
+ def begin_online_region(resource_group_name, account_name, region_parameter_for_online, custom_headers:nil)
2075
+ response = begin_online_region_async(resource_group_name, account_name, region_parameter_for_online, custom_headers:custom_headers).value!
2076
+ nil
2077
+ end
2078
+
2079
+ #
2080
+ # Online the specified region for the specified Azure Cosmos DB database
2081
+ # account.
2082
+ #
2083
+ # @param resource_group_name [String] The name of the resource group. The name
2084
+ # is case insensitive.
2085
+ # @param account_name [String] Cosmos DB database account name.
2086
+ # @param region_parameter_for_online [RegionForOnlineOffline] Cosmos DB region
2087
+ # to online for the database account.
2088
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2089
+ # will be added to the HTTP request.
2090
+ #
2091
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2092
+ #
2093
+ def begin_online_region_with_http_info(resource_group_name, account_name, region_parameter_for_online, custom_headers:nil)
2094
+ begin_online_region_async(resource_group_name, account_name, region_parameter_for_online, custom_headers:custom_headers).value!
2095
+ end
2096
+
2097
+ #
2098
+ # Online the specified region for the specified Azure Cosmos DB database
2099
+ # account.
2100
+ #
2101
+ # @param resource_group_name [String] The name of the resource group. The name
2102
+ # is case insensitive.
2103
+ # @param account_name [String] Cosmos DB database account name.
2104
+ # @param region_parameter_for_online [RegionForOnlineOffline] Cosmos DB region
2105
+ # to online for the database account.
2106
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2107
+ # to the HTTP request.
2108
+ #
2109
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2110
+ #
2111
+ def begin_online_region_async(resource_group_name, account_name, region_parameter_for_online, custom_headers:nil)
2112
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2113
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
2114
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2115
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
2116
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
2117
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
2118
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
2119
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
2120
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
2121
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
2122
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2123
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
2124
+ fail ArgumentError, 'region_parameter_for_online is nil' if region_parameter_for_online.nil?
2125
+
2126
+
2127
+ request_headers = {}
2128
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2129
+
2130
+ # Set Headers
2131
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2132
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2133
+
2134
+ # Serialize Request
2135
+ request_mapper = Azure::Cosmosdb::Mgmt::V2020_06_01_preview::Models::RegionForOnlineOffline.mapper()
2136
+ request_content = @client.serialize(request_mapper, region_parameter_for_online)
2137
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2138
+
2139
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion'
2140
+
2141
+ request_url = @base_url || @client.base_url
2142
+
2143
+ options = {
2144
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2145
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
2146
+ query_params: {'api-version' => @client.api_version},
2147
+ body: request_content,
2148
+ headers: request_headers.merge(custom_headers || {}),
2149
+ base_url: request_url
2150
+ }
2151
+ promise = @client.make_request_async(:post, path_template, options)
2152
+
2153
+ promise = promise.then do |result|
2154
+ http_response = result.response
2155
+ status_code = http_response.status
2156
+ response_content = http_response.body
2157
+ unless status_code == 200 || status_code == 202
2158
+ error_model = JSON.load(response_content)
2159
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2160
+ end
2161
+
2162
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2163
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2164
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2165
+
2166
+ result
2167
+ end
2168
+
2169
+ promise.execute
2170
+ end
2171
+
2172
+ #
2173
+ # Regenerates an access key for the specified Azure Cosmos DB database account.
2174
+ #
2175
+ # @param resource_group_name [String] The name of the resource group. The name
2176
+ # is case insensitive.
2177
+ # @param account_name [String] Cosmos DB database account name.
2178
+ # @param key_to_regenerate [DatabaseAccountRegenerateKeyParameters] The name of
2179
+ # the key to regenerate.
2180
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2181
+ # will be added to the HTTP request.
2182
+ #
2183
+ #
2184
+ def begin_regenerate_key(resource_group_name, account_name, key_to_regenerate, custom_headers:nil)
2185
+ response = begin_regenerate_key_async(resource_group_name, account_name, key_to_regenerate, custom_headers:custom_headers).value!
2186
+ nil
2187
+ end
2188
+
2189
+ #
2190
+ # Regenerates an access key for the specified Azure Cosmos DB database account.
2191
+ #
2192
+ # @param resource_group_name [String] The name of the resource group. The name
2193
+ # is case insensitive.
2194
+ # @param account_name [String] Cosmos DB database account name.
2195
+ # @param key_to_regenerate [DatabaseAccountRegenerateKeyParameters] The name of
2196
+ # the key to regenerate.
2197
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2198
+ # will be added to the HTTP request.
2199
+ #
2200
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2201
+ #
2202
+ def begin_regenerate_key_with_http_info(resource_group_name, account_name, key_to_regenerate, custom_headers:nil)
2203
+ begin_regenerate_key_async(resource_group_name, account_name, key_to_regenerate, custom_headers:custom_headers).value!
2204
+ end
2205
+
2206
+ #
2207
+ # Regenerates an access key for the specified Azure Cosmos DB database account.
2208
+ #
2209
+ # @param resource_group_name [String] The name of the resource group. The name
2210
+ # is case insensitive.
2211
+ # @param account_name [String] Cosmos DB database account name.
2212
+ # @param key_to_regenerate [DatabaseAccountRegenerateKeyParameters] The name of
2213
+ # the key to regenerate.
2214
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2215
+ # to the HTTP request.
2216
+ #
2217
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2218
+ #
2219
+ def begin_regenerate_key_async(resource_group_name, account_name, key_to_regenerate, custom_headers:nil)
2220
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2221
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
2222
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2223
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
2224
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
2225
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
2226
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
2227
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
2228
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
2229
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
2230
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2231
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
2232
+ fail ArgumentError, 'key_to_regenerate is nil' if key_to_regenerate.nil?
2233
+
2234
+
2235
+ request_headers = {}
2236
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2237
+
2238
+ # Set Headers
2239
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2240
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2241
+
2242
+ # Serialize Request
2243
+ request_mapper = Azure::Cosmosdb::Mgmt::V2020_06_01_preview::Models::DatabaseAccountRegenerateKeyParameters.mapper()
2244
+ request_content = @client.serialize(request_mapper, key_to_regenerate)
2245
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2246
+
2247
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey'
2248
+
2249
+ request_url = @base_url || @client.base_url
2250
+
2251
+ options = {
2252
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2253
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
2254
+ query_params: {'api-version' => @client.api_version},
2255
+ body: request_content,
2256
+ headers: request_headers.merge(custom_headers || {}),
2257
+ base_url: request_url
2258
+ }
2259
+ promise = @client.make_request_async(:post, path_template, options)
2260
+
2261
+ promise = promise.then do |result|
2262
+ http_response = result.response
2263
+ status_code = http_response.status
2264
+ response_content = http_response.body
2265
+ unless status_code == 200 || status_code == 202
2266
+ error_model = JSON.load(response_content)
2267
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2268
+ end
2269
+
2270
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2271
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
2272
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
2273
+
2274
+ result
2275
+ end
2276
+
2277
+ promise.execute
2278
+ end
2279
+
2280
+ end
2281
+ end