azure_mgmt_cosmosdb 0.23.1 → 0.24.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (218) 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 +1 -1
  4. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb +1 -1
  5. data/lib/2019-12-12/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb +1 -1
  6. data/lib/2020-03-01/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb +1 -1
  7. data/lib/2020-03-01/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb +0 -1
  8. data/lib/2020-04-01/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb +1 -1
  9. data/lib/2020-06-01-preview/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb +1 -1
  10. data/lib/2020-09-01/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb +1 -1
  11. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb.rb +228 -0
  12. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/cassandra_resources.rb +2348 -0
  13. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/collection.rb +389 -0
  14. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/collection_partition.rb +279 -0
  15. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/collection_partition_region.rb +161 -0
  16. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/collection_region.rb +161 -0
  17. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/cosmos_dbmanagement_client.rb +211 -0
  18. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/database.rb +377 -0
  19. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/database_account_region.rb +153 -0
  20. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/database_accounts.rb +2281 -0
  21. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/gremlin_resources.rb +2335 -0
  22. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/api_properties.rb +48 -0
  23. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/armproxy_resource.rb +73 -0
  24. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/armresource_properties.rb +102 -0
  25. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/auto_upgrade_policy_resource.rb +48 -0
  26. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/autoscale_settings.rb +48 -0
  27. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/autoscale_settings_resource.rb +73 -0
  28. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/azure_entity_resource.rb +77 -0
  29. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/backup_policy.rb +47 -0
  30. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/backup_policy_type.rb +16 -0
  31. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/capability.rb +48 -0
  32. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_create_update_parameters.rb +112 -0
  33. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_options.rb +53 -0
  34. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_properties_resource.rb +85 -0
  35. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_results.rb +110 -0
  36. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_list_result.rb +58 -0
  37. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_resource.rb +46 -0
  38. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_partition_key.rb +46 -0
  39. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_schema.rb +95 -0
  40. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_table_create_update_parameters.rb +112 -0
  41. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_options.rb +53 -0
  42. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_properties_resource.rb +119 -0
  43. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_results.rb +110 -0
  44. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_table_list_result.rb +58 -0
  45. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/cassandra_table_resource.rb +80 -0
  46. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/cluster_key.rb +58 -0
  47. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/column.rb +57 -0
  48. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/composite_path.rb +60 -0
  49. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/composite_path_sort_order.rb +16 -0
  50. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/conflict_resolution_mode.rb +16 -0
  51. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/conflict_resolution_policy.rb +73 -0
  52. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/connector_offer.rb +15 -0
  53. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/consistency_policy.rb +86 -0
  54. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/container_partition_key.rb +99 -0
  55. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/continuous_mode_backup_policy.rb +50 -0
  56. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/cors_policy.rb +99 -0
  57. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/create_update_options.rb +61 -0
  58. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/data_type.rb +20 -0
  59. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/database_account_connection_string.rb +59 -0
  60. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/database_account_create_update_parameters.rb +424 -0
  61. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/database_account_get_results.rb +537 -0
  62. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/database_account_kind.rb +17 -0
  63. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/database_account_list_connection_strings_result.rb +57 -0
  64. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/database_account_list_keys_result.rb +77 -0
  65. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/database_account_list_read_only_keys_result.rb +59 -0
  66. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/database_account_offer_type.rb +15 -0
  67. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/database_account_regenerate_key_parameters.rb +47 -0
  68. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/database_account_update_parameters.rb +375 -0
  69. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/database_accounts_list_result.rb +58 -0
  70. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/default_consistency_level.rb +19 -0
  71. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/error_response.rb +57 -0
  72. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/error_response_updated_format.rb +47 -0
  73. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/excluded_path.rb +48 -0
  74. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/extended_resource_properties.rb +74 -0
  75. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/failover_policies.rb +55 -0
  76. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/failover_policy.rb +79 -0
  77. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_database_create_update_parameters.rb +112 -0
  78. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_options.rb +53 -0
  79. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_properties_resource.rb +85 -0
  80. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_results.rb +110 -0
  81. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_database_list_result.rb +58 -0
  82. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_database_resource.rb +46 -0
  83. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_graph_create_update_parameters.rb +112 -0
  84. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_options.rb +53 -0
  85. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_properties_resource.rb +150 -0
  86. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_results.rb +110 -0
  87. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_graph_list_result.rb +58 -0
  88. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/gremlin_graph_resource.rb +111 -0
  89. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/included_path.rb +67 -0
  90. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/index_kind.rb +17 -0
  91. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/indexes.rb +73 -0
  92. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/indexing_mode.rb +17 -0
  93. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/indexing_policy.rb +147 -0
  94. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/ip_address_or_range.rb +51 -0
  95. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/key_kind.rb +18 -0
  96. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/location.rb +114 -0
  97. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/managed_service_identity.rb +102 -0
  98. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/managed_service_identity_user_assigned_identities_value.rb +61 -0
  99. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/metric.rb +120 -0
  100. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/metric_availability.rb +60 -0
  101. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/metric_definition.rb +109 -0
  102. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/metric_definitions_list_result.rb +57 -0
  103. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/metric_list_result.rb +56 -0
  104. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/metric_name.rb +59 -0
  105. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/metric_value.rb +107 -0
  106. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_create_update_parameters.rb +112 -0
  107. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_options.rb +53 -0
  108. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_properties_resource.rb +136 -0
  109. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_results.rb +110 -0
  110. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_list_result.rb +58 -0
  111. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_resource.rb +97 -0
  112. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_create_update_parameters.rb +112 -0
  113. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_options.rb +53 -0
  114. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_properties_resource.rb +85 -0
  115. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_results.rb +110 -0
  116. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_list_result.rb +58 -0
  117. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_resource.rb +46 -0
  118. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_index.rb +60 -0
  119. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_index_keys.rb +55 -0
  120. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/mongo_index_options.rb +57 -0
  121. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/network_acl_bypass.rb +16 -0
  122. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/notebook_workspace.rb +87 -0
  123. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/notebook_workspace_connection_info_result.rb +60 -0
  124. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/notebook_workspace_create_update_parameters.rb +62 -0
  125. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/notebook_workspace_list_result.rb +56 -0
  126. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/operation.rb +58 -0
  127. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/operation_display.rb +80 -0
  128. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/operation_list_result.rb +101 -0
  129. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/options_resource.rb +60 -0
  130. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/partition_kind.rb +17 -0
  131. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/partition_metric.rb +124 -0
  132. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/partition_metric_list_result.rb +57 -0
  133. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/partition_usage.rb +105 -0
  134. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/partition_usages_result.rb +57 -0
  135. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/percentile_metric.rb +120 -0
  136. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/percentile_metric_list_result.rb +57 -0
  137. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/percentile_metric_value.rb +173 -0
  138. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/periodic_mode_backup_policy.rb +63 -0
  139. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/periodic_mode_properties.rb +65 -0
  140. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/primary_aggregation_type.rb +20 -0
  141. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/private_endpoint_connection.rb +110 -0
  142. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/private_endpoint_connection_list_result.rb +56 -0
  143. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/private_endpoint_property.rb +46 -0
  144. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/private_link_resource.rb +115 -0
  145. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/private_link_resource_list_result.rb +55 -0
  146. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/private_link_service_connection_state_property.rb +71 -0
  147. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/proxy_resource.rb +65 -0
  148. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/public_network_access.rb +16 -0
  149. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/region_for_online_offline.rb +47 -0
  150. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/resource.rb +86 -0
  151. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/resource_identity_type.rb +18 -0
  152. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/server_version.rb +17 -0
  153. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/spatial_spec.rb +67 -0
  154. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/spatial_type.rb +18 -0
  155. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_container_create_update_parameters.rb +111 -0
  156. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_options.rb +53 -0
  157. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_container_get_properties_resource.rb +161 -0
  158. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_container_get_results.rb +110 -0
  159. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_container_list_result.rb +58 -0
  160. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_container_resource.rb +122 -0
  161. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_database_create_update_parameters.rb +112 -0
  162. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_options.rb +53 -0
  163. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_database_get_properties_resource.rb +109 -0
  164. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_database_get_results.rb +110 -0
  165. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_database_list_result.rb +58 -0
  166. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_database_resource.rb +46 -0
  167. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_create_update_parameters.rb +112 -0
  168. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_properties_resource.rb +96 -0
  169. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_results.rb +98 -0
  170. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_list_result.rb +58 -0
  171. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_resource.rb +57 -0
  172. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_trigger_create_update_parameters.rb +111 -0
  173. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_properties_resource.rb +121 -0
  174. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_results.rb +98 -0
  175. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_trigger_list_result.rb +58 -0
  176. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_trigger_resource.rb +82 -0
  177. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_create_update_parameters.rb +113 -0
  178. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_properties_resource.rb +97 -0
  179. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_results.rb +98 -0
  180. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_list_result.rb +58 -0
  181. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_resource.rb +57 -0
  182. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/table_create_update_parameters.rb +111 -0
  183. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/table_get_properties_options.rb +53 -0
  184. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/table_get_properties_resource.rb +85 -0
  185. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/table_get_results.rb +110 -0
  186. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/table_list_result.rb +57 -0
  187. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/table_resource.rb +46 -0
  188. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/throughput_policy_resource.rb +59 -0
  189. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_properties_resource.rb +124 -0
  190. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_results.rb +98 -0
  191. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/throughput_settings_resource.rb +86 -0
  192. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/throughput_settings_update_parameters.rb +99 -0
  193. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/tracked_resource.rb +95 -0
  194. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/trigger_operation.rb +19 -0
  195. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/trigger_type.rb +16 -0
  196. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/unique_key.rb +56 -0
  197. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/unique_key_policy.rb +58 -0
  198. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/unit_type.rb +21 -0
  199. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/usage.rb +97 -0
  200. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/usages_result.rb +57 -0
  201. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/models/virtual_network_rule.rb +59 -0
  202. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/module_definition.rb +9 -0
  203. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/mongo_dbresources.rb +2354 -0
  204. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/notebook_workspaces.rb +905 -0
  205. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/operations.rb +220 -0
  206. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/partition_key_range_id.rb +161 -0
  207. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/partition_key_range_id_region.rb +168 -0
  208. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/percentile.rb +146 -0
  209. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/percentile_source_target.rb +163 -0
  210. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/percentile_target.rb +153 -0
  211. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/private_endpoint_connections.rb +560 -0
  212. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/private_link_resources.rb +245 -0
  213. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/sql_resources.rb +4065 -0
  214. data/lib/2021-01-15/generated/azure_mgmt_cosmosdb/table_resources.rb +1150 -0
  215. data/lib/azure_mgmt_cosmosdb.rb +1 -0
  216. data/lib/profiles/latest/modules/cosmosdb_profile_module.rb +497 -489
  217. data/lib/version.rb +1 -1
  218. metadata +206 -2
@@ -0,0 +1,1150 @@
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::V2021_01_15
7
+ #
8
+ # Azure Cosmos DB Database Service Resource Provider REST API
9
+ #
10
+ class TableResources
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the TableResources 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
+ # Lists the Tables under 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 [TableListResult] operation results.
34
+ #
35
+ def list_tables(resource_group_name, account_name, custom_headers:nil)
36
+ response = list_tables_async(resource_group_name, account_name, custom_headers:custom_headers).value!
37
+ response.body unless response.nil?
38
+ end
39
+
40
+ #
41
+ # Lists the Tables under 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 list_tables_with_http_info(resource_group_name, account_name, custom_headers:nil)
52
+ list_tables_async(resource_group_name, account_name, custom_headers:custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # Lists the Tables under 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 list_tables_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}/tables'
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::V2021_01_15::Models::TableListResult.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
+ # Gets the Tables under an existing Azure Cosmos DB database account with the
131
+ # provided name.
132
+ #
133
+ # @param resource_group_name [String] The name of the resource group. The name
134
+ # is case insensitive.
135
+ # @param account_name [String] Cosmos DB database account name.
136
+ # @param table_name [String] Cosmos DB table name.
137
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
138
+ # will be added to the HTTP request.
139
+ #
140
+ # @return [TableGetResults] operation results.
141
+ #
142
+ def get_table(resource_group_name, account_name, table_name, custom_headers:nil)
143
+ response = get_table_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value!
144
+ response.body unless response.nil?
145
+ end
146
+
147
+ #
148
+ # Gets the Tables under an existing Azure Cosmos DB database account with the
149
+ # provided name.
150
+ #
151
+ # @param resource_group_name [String] The name of the resource group. The name
152
+ # is case insensitive.
153
+ # @param account_name [String] Cosmos DB database account name.
154
+ # @param table_name [String] Cosmos DB table name.
155
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
156
+ # will be added to the HTTP request.
157
+ #
158
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
159
+ #
160
+ def get_table_with_http_info(resource_group_name, account_name, table_name, custom_headers:nil)
161
+ get_table_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value!
162
+ end
163
+
164
+ #
165
+ # Gets the Tables under an existing Azure Cosmos DB database account with the
166
+ # provided name.
167
+ #
168
+ # @param resource_group_name [String] The name of the resource group. The name
169
+ # is case insensitive.
170
+ # @param account_name [String] Cosmos DB database account name.
171
+ # @param table_name [String] Cosmos DB table name.
172
+ # @param [Hash{String => String}] A hash of custom headers that will be added
173
+ # to the HTTP request.
174
+ #
175
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
176
+ #
177
+ def get_table_async(resource_group_name, account_name, table_name, custom_headers:nil)
178
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
179
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
180
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
181
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
182
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
183
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
184
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
185
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
186
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
187
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
188
+ fail ArgumentError, 'table_name is nil' if table_name.nil?
189
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
190
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
191
+
192
+
193
+ request_headers = {}
194
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
195
+
196
+ # Set Headers
197
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
198
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
199
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}'
200
+
201
+ request_url = @base_url || @client.base_url
202
+
203
+ options = {
204
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
205
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'tableName' => table_name},
206
+ query_params: {'api-version' => @client.api_version},
207
+ headers: request_headers.merge(custom_headers || {}),
208
+ base_url: request_url
209
+ }
210
+ promise = @client.make_request_async(:get, path_template, options)
211
+
212
+ promise = promise.then do |result|
213
+ http_response = result.response
214
+ status_code = http_response.status
215
+ response_content = http_response.body
216
+ unless status_code == 200
217
+ error_model = JSON.load(response_content)
218
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
219
+ end
220
+
221
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
222
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
223
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
224
+ # Deserialize Response
225
+ if status_code == 200
226
+ begin
227
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
228
+ result_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::TableGetResults.mapper()
229
+ result.body = @client.deserialize(result_mapper, parsed_response)
230
+ rescue Exception => e
231
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
232
+ end
233
+ end
234
+
235
+ result
236
+ end
237
+
238
+ promise.execute
239
+ end
240
+
241
+ #
242
+ # Create or update an Azure Cosmos DB Table
243
+ #
244
+ # @param resource_group_name [String] The name of the resource group. The name
245
+ # is case insensitive.
246
+ # @param account_name [String] Cosmos DB database account name.
247
+ # @param table_name [String] Cosmos DB table name.
248
+ # @param create_update_table_parameters [TableCreateUpdateParameters] The
249
+ # parameters to provide for the current Table.
250
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
251
+ # will be added to the HTTP request.
252
+ #
253
+ # @return [TableGetResults] operation results.
254
+ #
255
+ def create_update_table(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:nil)
256
+ response = create_update_table_async(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:custom_headers).value!
257
+ response.body unless response.nil?
258
+ end
259
+
260
+ #
261
+ # @param resource_group_name [String] The name of the resource group. The name
262
+ # is case insensitive.
263
+ # @param account_name [String] Cosmos DB database account name.
264
+ # @param table_name [String] Cosmos DB table name.
265
+ # @param create_update_table_parameters [TableCreateUpdateParameters] The
266
+ # parameters to provide for the current Table.
267
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
268
+ # will be added to the HTTP request.
269
+ #
270
+ # @return [Concurrent::Promise] promise which provides async access to http
271
+ # response.
272
+ #
273
+ def create_update_table_async(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:nil)
274
+ # Send request
275
+ promise = begin_create_update_table_async(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:custom_headers)
276
+
277
+ promise = promise.then do |response|
278
+ # Defining deserialization method.
279
+ deserialize_method = lambda do |parsed_response|
280
+ result_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::TableGetResults.mapper()
281
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
282
+ end
283
+
284
+ # Waiting for response.
285
+ @client.get_long_running_operation_result(response, deserialize_method)
286
+ end
287
+
288
+ promise
289
+ end
290
+
291
+ #
292
+ # Deletes an existing Azure Cosmos DB Table.
293
+ #
294
+ # @param resource_group_name [String] The name of the resource group. The name
295
+ # is case insensitive.
296
+ # @param account_name [String] Cosmos DB database account name.
297
+ # @param table_name [String] Cosmos DB table name.
298
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
299
+ # will be added to the HTTP request.
300
+ #
301
+ def delete_table(resource_group_name, account_name, table_name, custom_headers:nil)
302
+ response = delete_table_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value!
303
+ nil
304
+ end
305
+
306
+ #
307
+ # @param resource_group_name [String] The name of the resource group. The name
308
+ # is case insensitive.
309
+ # @param account_name [String] Cosmos DB database account name.
310
+ # @param table_name [String] Cosmos DB table name.
311
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
312
+ # will be added to the HTTP request.
313
+ #
314
+ # @return [Concurrent::Promise] promise which provides async access to http
315
+ # response.
316
+ #
317
+ def delete_table_async(resource_group_name, account_name, table_name, custom_headers:nil)
318
+ # Send request
319
+ promise = begin_delete_table_async(resource_group_name, account_name, table_name, custom_headers:custom_headers)
320
+
321
+ promise = promise.then do |response|
322
+ # Defining deserialization method.
323
+ deserialize_method = lambda do |parsed_response|
324
+ end
325
+
326
+ # Waiting for response.
327
+ @client.get_long_running_operation_result(response, deserialize_method)
328
+ end
329
+
330
+ promise
331
+ end
332
+
333
+ #
334
+ # Gets the RUs per second of the Table under an existing Azure Cosmos DB
335
+ # database account with the provided name.
336
+ #
337
+ # @param resource_group_name [String] The name of the resource group. The name
338
+ # is case insensitive.
339
+ # @param account_name [String] Cosmos DB database account name.
340
+ # @param table_name [String] Cosmos DB table name.
341
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
342
+ # will be added to the HTTP request.
343
+ #
344
+ # @return [ThroughputSettingsGetResults] operation results.
345
+ #
346
+ def get_table_throughput(resource_group_name, account_name, table_name, custom_headers:nil)
347
+ response = get_table_throughput_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value!
348
+ response.body unless response.nil?
349
+ end
350
+
351
+ #
352
+ # Gets the RUs per second of the Table under an existing Azure Cosmos DB
353
+ # database account with the provided name.
354
+ #
355
+ # @param resource_group_name [String] The name of the resource group. The name
356
+ # is case insensitive.
357
+ # @param account_name [String] Cosmos DB database account name.
358
+ # @param table_name [String] Cosmos DB table name.
359
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
360
+ # will be added to the HTTP request.
361
+ #
362
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
363
+ #
364
+ def get_table_throughput_with_http_info(resource_group_name, account_name, table_name, custom_headers:nil)
365
+ get_table_throughput_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value!
366
+ end
367
+
368
+ #
369
+ # Gets the RUs per second of the Table under an existing Azure Cosmos DB
370
+ # database account with the provided name.
371
+ #
372
+ # @param resource_group_name [String] The name of the resource group. The name
373
+ # is case insensitive.
374
+ # @param account_name [String] Cosmos DB database account name.
375
+ # @param table_name [String] Cosmos DB table name.
376
+ # @param [Hash{String => String}] A hash of custom headers that will be added
377
+ # to the HTTP request.
378
+ #
379
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
380
+ #
381
+ def get_table_throughput_async(resource_group_name, account_name, table_name, custom_headers:nil)
382
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
383
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
384
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
385
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
386
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
387
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
388
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
389
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
390
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
391
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
392
+ fail ArgumentError, 'table_name is nil' if table_name.nil?
393
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
394
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
395
+
396
+
397
+ request_headers = {}
398
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
399
+
400
+ # Set Headers
401
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
402
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
403
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default'
404
+
405
+ request_url = @base_url || @client.base_url
406
+
407
+ options = {
408
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
409
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'tableName' => table_name},
410
+ query_params: {'api-version' => @client.api_version},
411
+ headers: request_headers.merge(custom_headers || {}),
412
+ base_url: request_url
413
+ }
414
+ promise = @client.make_request_async(:get, path_template, options)
415
+
416
+ promise = promise.then do |result|
417
+ http_response = result.response
418
+ status_code = http_response.status
419
+ response_content = http_response.body
420
+ unless status_code == 200
421
+ error_model = JSON.load(response_content)
422
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
423
+ end
424
+
425
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
426
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
427
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
428
+ # Deserialize Response
429
+ if status_code == 200
430
+ begin
431
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
432
+ result_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::ThroughputSettingsGetResults.mapper()
433
+ result.body = @client.deserialize(result_mapper, parsed_response)
434
+ rescue Exception => e
435
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
436
+ end
437
+ end
438
+
439
+ result
440
+ end
441
+
442
+ promise.execute
443
+ end
444
+
445
+ #
446
+ # Update RUs per second of an Azure Cosmos DB Table
447
+ #
448
+ # @param resource_group_name [String] The name of the resource group. The name
449
+ # is case insensitive.
450
+ # @param account_name [String] Cosmos DB database account name.
451
+ # @param table_name [String] Cosmos DB table name.
452
+ # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The
453
+ # parameters to provide for the RUs per second of the current Table.
454
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
455
+ # will be added to the HTTP request.
456
+ #
457
+ # @return [ThroughputSettingsGetResults] operation results.
458
+ #
459
+ def update_table_throughput(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:nil)
460
+ response = update_table_throughput_async(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value!
461
+ response.body unless response.nil?
462
+ end
463
+
464
+ #
465
+ # @param resource_group_name [String] The name of the resource group. The name
466
+ # is case insensitive.
467
+ # @param account_name [String] Cosmos DB database account name.
468
+ # @param table_name [String] Cosmos DB table name.
469
+ # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The
470
+ # parameters to provide for the RUs per second of the current Table.
471
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
472
+ # will be added to the HTTP request.
473
+ #
474
+ # @return [Concurrent::Promise] promise which provides async access to http
475
+ # response.
476
+ #
477
+ def update_table_throughput_async(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:nil)
478
+ # Send request
479
+ promise = begin_update_table_throughput_async(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:custom_headers)
480
+
481
+ promise = promise.then do |response|
482
+ # Defining deserialization method.
483
+ deserialize_method = lambda do |parsed_response|
484
+ result_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::ThroughputSettingsGetResults.mapper()
485
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
486
+ end
487
+
488
+ # Waiting for response.
489
+ @client.get_long_running_operation_result(response, deserialize_method)
490
+ end
491
+
492
+ promise
493
+ end
494
+
495
+ #
496
+ # Migrate an Azure Cosmos DB Table from manual throughput to autoscale
497
+ #
498
+ # @param resource_group_name [String] The name of the resource group. The name
499
+ # is case insensitive.
500
+ # @param account_name [String] Cosmos DB database account name.
501
+ # @param table_name [String] Cosmos DB table name.
502
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
503
+ # will be added to the HTTP request.
504
+ #
505
+ # @return [ThroughputSettingsGetResults] operation results.
506
+ #
507
+ def migrate_table_to_autoscale(resource_group_name, account_name, table_name, custom_headers:nil)
508
+ response = migrate_table_to_autoscale_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value!
509
+ response.body unless response.nil?
510
+ end
511
+
512
+ #
513
+ # @param resource_group_name [String] The name of the resource group. The name
514
+ # is case insensitive.
515
+ # @param account_name [String] Cosmos DB database account name.
516
+ # @param table_name [String] Cosmos DB table name.
517
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
518
+ # will be added to the HTTP request.
519
+ #
520
+ # @return [Concurrent::Promise] promise which provides async access to http
521
+ # response.
522
+ #
523
+ def migrate_table_to_autoscale_async(resource_group_name, account_name, table_name, custom_headers:nil)
524
+ # Send request
525
+ promise = begin_migrate_table_to_autoscale_async(resource_group_name, account_name, table_name, custom_headers:custom_headers)
526
+
527
+ promise = promise.then do |response|
528
+ # Defining deserialization method.
529
+ deserialize_method = lambda do |parsed_response|
530
+ result_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::ThroughputSettingsGetResults.mapper()
531
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
532
+ end
533
+
534
+ # Waiting for response.
535
+ @client.get_long_running_operation_result(response, deserialize_method)
536
+ end
537
+
538
+ promise
539
+ end
540
+
541
+ #
542
+ # Migrate an Azure Cosmos DB Table from autoscale to manual throughput
543
+ #
544
+ # @param resource_group_name [String] The name of the resource group. The name
545
+ # is case insensitive.
546
+ # @param account_name [String] Cosmos DB database account name.
547
+ # @param table_name [String] Cosmos DB table name.
548
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
549
+ # will be added to the HTTP request.
550
+ #
551
+ # @return [ThroughputSettingsGetResults] operation results.
552
+ #
553
+ def migrate_table_to_manual_throughput(resource_group_name, account_name, table_name, custom_headers:nil)
554
+ response = migrate_table_to_manual_throughput_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value!
555
+ response.body unless response.nil?
556
+ end
557
+
558
+ #
559
+ # @param resource_group_name [String] The name of the resource group. The name
560
+ # is case insensitive.
561
+ # @param account_name [String] Cosmos DB database account name.
562
+ # @param table_name [String] Cosmos DB table name.
563
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
564
+ # will be added to the HTTP request.
565
+ #
566
+ # @return [Concurrent::Promise] promise which provides async access to http
567
+ # response.
568
+ #
569
+ def migrate_table_to_manual_throughput_async(resource_group_name, account_name, table_name, custom_headers:nil)
570
+ # Send request
571
+ promise = begin_migrate_table_to_manual_throughput_async(resource_group_name, account_name, table_name, custom_headers:custom_headers)
572
+
573
+ promise = promise.then do |response|
574
+ # Defining deserialization method.
575
+ deserialize_method = lambda do |parsed_response|
576
+ result_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::ThroughputSettingsGetResults.mapper()
577
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
578
+ end
579
+
580
+ # Waiting for response.
581
+ @client.get_long_running_operation_result(response, deserialize_method)
582
+ end
583
+
584
+ promise
585
+ end
586
+
587
+ #
588
+ # Create or update an Azure Cosmos DB Table
589
+ #
590
+ # @param resource_group_name [String] The name of the resource group. The name
591
+ # is case insensitive.
592
+ # @param account_name [String] Cosmos DB database account name.
593
+ # @param table_name [String] Cosmos DB table name.
594
+ # @param create_update_table_parameters [TableCreateUpdateParameters] The
595
+ # parameters to provide for the current Table.
596
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
597
+ # will be added to the HTTP request.
598
+ #
599
+ # @return [TableGetResults] operation results.
600
+ #
601
+ def begin_create_update_table(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:nil)
602
+ response = begin_create_update_table_async(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:custom_headers).value!
603
+ response.body unless response.nil?
604
+ end
605
+
606
+ #
607
+ # Create or update an Azure Cosmos DB Table
608
+ #
609
+ # @param resource_group_name [String] The name of the resource group. The name
610
+ # is case insensitive.
611
+ # @param account_name [String] Cosmos DB database account name.
612
+ # @param table_name [String] Cosmos DB table name.
613
+ # @param create_update_table_parameters [TableCreateUpdateParameters] The
614
+ # parameters to provide for the current Table.
615
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
616
+ # will be added to the HTTP request.
617
+ #
618
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
619
+ #
620
+ def begin_create_update_table_with_http_info(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:nil)
621
+ begin_create_update_table_async(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:custom_headers).value!
622
+ end
623
+
624
+ #
625
+ # Create or update an Azure Cosmos DB Table
626
+ #
627
+ # @param resource_group_name [String] The name of the resource group. The name
628
+ # is case insensitive.
629
+ # @param account_name [String] Cosmos DB database account name.
630
+ # @param table_name [String] Cosmos DB table name.
631
+ # @param create_update_table_parameters [TableCreateUpdateParameters] The
632
+ # parameters to provide for the current Table.
633
+ # @param [Hash{String => String}] A hash of custom headers that will be added
634
+ # to the HTTP request.
635
+ #
636
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
637
+ #
638
+ def begin_create_update_table_async(resource_group_name, account_name, table_name, create_update_table_parameters, custom_headers:nil)
639
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
640
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
641
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
642
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
643
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
644
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
645
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
646
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
647
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
648
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
649
+ fail ArgumentError, 'table_name is nil' if table_name.nil?
650
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
651
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
652
+ fail ArgumentError, 'create_update_table_parameters is nil' if create_update_table_parameters.nil?
653
+
654
+
655
+ request_headers = {}
656
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
657
+
658
+ # Set Headers
659
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
660
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
661
+
662
+ # Serialize Request
663
+ request_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::TableCreateUpdateParameters.mapper()
664
+ request_content = @client.serialize(request_mapper, create_update_table_parameters)
665
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
666
+
667
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}'
668
+
669
+ request_url = @base_url || @client.base_url
670
+
671
+ options = {
672
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
673
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'tableName' => table_name},
674
+ query_params: {'api-version' => @client.api_version},
675
+ body: request_content,
676
+ headers: request_headers.merge(custom_headers || {}),
677
+ base_url: request_url
678
+ }
679
+ promise = @client.make_request_async(:put, path_template, options)
680
+
681
+ promise = promise.then do |result|
682
+ http_response = result.response
683
+ status_code = http_response.status
684
+ response_content = http_response.body
685
+ unless status_code == 202 || status_code == 200
686
+ error_model = JSON.load(response_content)
687
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
688
+ end
689
+
690
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
691
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
692
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
693
+ # Deserialize Response
694
+ if status_code == 200
695
+ begin
696
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
697
+ result_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::TableGetResults.mapper()
698
+ result.body = @client.deserialize(result_mapper, parsed_response)
699
+ rescue Exception => e
700
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
701
+ end
702
+ end
703
+
704
+ result
705
+ end
706
+
707
+ promise.execute
708
+ end
709
+
710
+ #
711
+ # Deletes an existing Azure Cosmos DB Table.
712
+ #
713
+ # @param resource_group_name [String] The name of the resource group. The name
714
+ # is case insensitive.
715
+ # @param account_name [String] Cosmos DB database account name.
716
+ # @param table_name [String] Cosmos DB table name.
717
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
718
+ # will be added to the HTTP request.
719
+ #
720
+ #
721
+ def begin_delete_table(resource_group_name, account_name, table_name, custom_headers:nil)
722
+ response = begin_delete_table_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value!
723
+ nil
724
+ end
725
+
726
+ #
727
+ # Deletes an existing Azure Cosmos DB Table.
728
+ #
729
+ # @param resource_group_name [String] The name of the resource group. The name
730
+ # is case insensitive.
731
+ # @param account_name [String] Cosmos DB database account name.
732
+ # @param table_name [String] Cosmos DB table name.
733
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
734
+ # will be added to the HTTP request.
735
+ #
736
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
737
+ #
738
+ def begin_delete_table_with_http_info(resource_group_name, account_name, table_name, custom_headers:nil)
739
+ begin_delete_table_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value!
740
+ end
741
+
742
+ #
743
+ # Deletes an existing Azure Cosmos DB Table.
744
+ #
745
+ # @param resource_group_name [String] The name of the resource group. The name
746
+ # is case insensitive.
747
+ # @param account_name [String] Cosmos DB database account name.
748
+ # @param table_name [String] Cosmos DB table name.
749
+ # @param [Hash{String => String}] A hash of custom headers that will be added
750
+ # to the HTTP request.
751
+ #
752
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
753
+ #
754
+ def begin_delete_table_async(resource_group_name, account_name, table_name, custom_headers:nil)
755
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
756
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
757
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
758
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
759
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
760
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
761
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
762
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
763
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
764
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
765
+ fail ArgumentError, 'table_name is nil' if table_name.nil?
766
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
767
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
768
+
769
+
770
+ request_headers = {}
771
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
772
+
773
+ # Set Headers
774
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
775
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
776
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}'
777
+
778
+ request_url = @base_url || @client.base_url
779
+
780
+ options = {
781
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
782
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'tableName' => table_name},
783
+ query_params: {'api-version' => @client.api_version},
784
+ headers: request_headers.merge(custom_headers || {}),
785
+ base_url: request_url
786
+ }
787
+ promise = @client.make_request_async(:delete, path_template, options)
788
+
789
+ promise = promise.then do |result|
790
+ http_response = result.response
791
+ status_code = http_response.status
792
+ response_content = http_response.body
793
+ unless status_code == 202 || status_code == 204
794
+ error_model = JSON.load(response_content)
795
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
796
+ end
797
+
798
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
799
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
800
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
801
+
802
+ result
803
+ end
804
+
805
+ promise.execute
806
+ end
807
+
808
+ #
809
+ # Update RUs per second of an Azure Cosmos DB Table
810
+ #
811
+ # @param resource_group_name [String] The name of the resource group. The name
812
+ # is case insensitive.
813
+ # @param account_name [String] Cosmos DB database account name.
814
+ # @param table_name [String] Cosmos DB table name.
815
+ # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The
816
+ # parameters to provide for the RUs per second of the current Table.
817
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
818
+ # will be added to the HTTP request.
819
+ #
820
+ # @return [ThroughputSettingsGetResults] operation results.
821
+ #
822
+ def begin_update_table_throughput(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:nil)
823
+ response = begin_update_table_throughput_async(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value!
824
+ response.body unless response.nil?
825
+ end
826
+
827
+ #
828
+ # Update RUs per second of an Azure Cosmos DB Table
829
+ #
830
+ # @param resource_group_name [String] The name of the resource group. The name
831
+ # is case insensitive.
832
+ # @param account_name [String] Cosmos DB database account name.
833
+ # @param table_name [String] Cosmos DB table name.
834
+ # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The
835
+ # parameters to provide for the RUs per second of the current Table.
836
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
837
+ # will be added to the HTTP request.
838
+ #
839
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
840
+ #
841
+ def begin_update_table_throughput_with_http_info(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:nil)
842
+ begin_update_table_throughput_async(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:custom_headers).value!
843
+ end
844
+
845
+ #
846
+ # Update RUs per second of an Azure Cosmos DB Table
847
+ #
848
+ # @param resource_group_name [String] The name of the resource group. The name
849
+ # is case insensitive.
850
+ # @param account_name [String] Cosmos DB database account name.
851
+ # @param table_name [String] Cosmos DB table name.
852
+ # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The
853
+ # parameters to provide for the RUs per second of the current Table.
854
+ # @param [Hash{String => String}] A hash of custom headers that will be added
855
+ # to the HTTP request.
856
+ #
857
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
858
+ #
859
+ def begin_update_table_throughput_async(resource_group_name, account_name, table_name, update_throughput_parameters, custom_headers:nil)
860
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
861
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
862
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
863
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
864
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
865
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
866
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
867
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
868
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
869
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
870
+ fail ArgumentError, 'table_name is nil' if table_name.nil?
871
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
872
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
873
+ fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil?
874
+
875
+
876
+ request_headers = {}
877
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
878
+
879
+ # Set Headers
880
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
881
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
882
+
883
+ # Serialize Request
884
+ request_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::ThroughputSettingsUpdateParameters.mapper()
885
+ request_content = @client.serialize(request_mapper, update_throughput_parameters)
886
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
887
+
888
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default'
889
+
890
+ request_url = @base_url || @client.base_url
891
+
892
+ options = {
893
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
894
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'tableName' => table_name},
895
+ query_params: {'api-version' => @client.api_version},
896
+ body: request_content,
897
+ headers: request_headers.merge(custom_headers || {}),
898
+ base_url: request_url
899
+ }
900
+ promise = @client.make_request_async(:put, path_template, options)
901
+
902
+ promise = promise.then do |result|
903
+ http_response = result.response
904
+ status_code = http_response.status
905
+ response_content = http_response.body
906
+ unless status_code == 202 || status_code == 200
907
+ error_model = JSON.load(response_content)
908
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
909
+ end
910
+
911
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
912
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
913
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
914
+ # Deserialize Response
915
+ if status_code == 200
916
+ begin
917
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
918
+ result_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::ThroughputSettingsGetResults.mapper()
919
+ result.body = @client.deserialize(result_mapper, parsed_response)
920
+ rescue Exception => e
921
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
922
+ end
923
+ end
924
+
925
+ result
926
+ end
927
+
928
+ promise.execute
929
+ end
930
+
931
+ #
932
+ # Migrate an Azure Cosmos DB Table from manual throughput to autoscale
933
+ #
934
+ # @param resource_group_name [String] The name of the resource group. The name
935
+ # is case insensitive.
936
+ # @param account_name [String] Cosmos DB database account name.
937
+ # @param table_name [String] Cosmos DB table name.
938
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
939
+ # will be added to the HTTP request.
940
+ #
941
+ # @return [ThroughputSettingsGetResults] operation results.
942
+ #
943
+ def begin_migrate_table_to_autoscale(resource_group_name, account_name, table_name, custom_headers:nil)
944
+ response = begin_migrate_table_to_autoscale_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value!
945
+ response.body unless response.nil?
946
+ end
947
+
948
+ #
949
+ # Migrate an Azure Cosmos DB Table from manual throughput to autoscale
950
+ #
951
+ # @param resource_group_name [String] The name of the resource group. The name
952
+ # is case insensitive.
953
+ # @param account_name [String] Cosmos DB database account name.
954
+ # @param table_name [String] Cosmos DB table name.
955
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
956
+ # will be added to the HTTP request.
957
+ #
958
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
959
+ #
960
+ def begin_migrate_table_to_autoscale_with_http_info(resource_group_name, account_name, table_name, custom_headers:nil)
961
+ begin_migrate_table_to_autoscale_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value!
962
+ end
963
+
964
+ #
965
+ # Migrate an Azure Cosmos DB Table from manual throughput to autoscale
966
+ #
967
+ # @param resource_group_name [String] The name of the resource group. The name
968
+ # is case insensitive.
969
+ # @param account_name [String] Cosmos DB database account name.
970
+ # @param table_name [String] Cosmos DB table name.
971
+ # @param [Hash{String => String}] A hash of custom headers that will be added
972
+ # to the HTTP request.
973
+ #
974
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
975
+ #
976
+ def begin_migrate_table_to_autoscale_async(resource_group_name, account_name, table_name, custom_headers:nil)
977
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
978
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
979
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
980
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
981
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
982
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
983
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
984
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
985
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
986
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
987
+ fail ArgumentError, 'table_name is nil' if table_name.nil?
988
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
989
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
990
+
991
+
992
+ request_headers = {}
993
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
994
+
995
+ # Set Headers
996
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
997
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
998
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale'
999
+
1000
+ request_url = @base_url || @client.base_url
1001
+
1002
+ options = {
1003
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1004
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'tableName' => table_name},
1005
+ query_params: {'api-version' => @client.api_version},
1006
+ headers: request_headers.merge(custom_headers || {}),
1007
+ base_url: request_url
1008
+ }
1009
+ promise = @client.make_request_async(:post, path_template, options)
1010
+
1011
+ promise = promise.then do |result|
1012
+ http_response = result.response
1013
+ status_code = http_response.status
1014
+ response_content = http_response.body
1015
+ unless status_code == 202 || status_code == 200
1016
+ error_model = JSON.load(response_content)
1017
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1018
+ end
1019
+
1020
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1021
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1022
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1023
+ # Deserialize Response
1024
+ if status_code == 200
1025
+ begin
1026
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1027
+ result_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::ThroughputSettingsGetResults.mapper()
1028
+ result.body = @client.deserialize(result_mapper, parsed_response)
1029
+ rescue Exception => e
1030
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1031
+ end
1032
+ end
1033
+
1034
+ result
1035
+ end
1036
+
1037
+ promise.execute
1038
+ end
1039
+
1040
+ #
1041
+ # Migrate an Azure Cosmos DB Table from autoscale to manual throughput
1042
+ #
1043
+ # @param resource_group_name [String] The name of the resource group. The name
1044
+ # is case insensitive.
1045
+ # @param account_name [String] Cosmos DB database account name.
1046
+ # @param table_name [String] Cosmos DB table name.
1047
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1048
+ # will be added to the HTTP request.
1049
+ #
1050
+ # @return [ThroughputSettingsGetResults] operation results.
1051
+ #
1052
+ def begin_migrate_table_to_manual_throughput(resource_group_name, account_name, table_name, custom_headers:nil)
1053
+ response = begin_migrate_table_to_manual_throughput_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value!
1054
+ response.body unless response.nil?
1055
+ end
1056
+
1057
+ #
1058
+ # Migrate an Azure Cosmos DB Table from autoscale to manual throughput
1059
+ #
1060
+ # @param resource_group_name [String] The name of the resource group. The name
1061
+ # is case insensitive.
1062
+ # @param account_name [String] Cosmos DB database account name.
1063
+ # @param table_name [String] Cosmos DB table name.
1064
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1065
+ # will be added to the HTTP request.
1066
+ #
1067
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1068
+ #
1069
+ def begin_migrate_table_to_manual_throughput_with_http_info(resource_group_name, account_name, table_name, custom_headers:nil)
1070
+ begin_migrate_table_to_manual_throughput_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value!
1071
+ end
1072
+
1073
+ #
1074
+ # Migrate an Azure Cosmos DB Table from autoscale to manual throughput
1075
+ #
1076
+ # @param resource_group_name [String] The name of the resource group. The name
1077
+ # is case insensitive.
1078
+ # @param account_name [String] Cosmos DB database account name.
1079
+ # @param table_name [String] Cosmos DB table name.
1080
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1081
+ # to the HTTP request.
1082
+ #
1083
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1084
+ #
1085
+ def begin_migrate_table_to_manual_throughput_async(resource_group_name, account_name, table_name, custom_headers:nil)
1086
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1087
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
1088
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1089
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1090
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1091
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1092
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1093
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
1094
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1095
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
1096
+ fail ArgumentError, 'table_name is nil' if table_name.nil?
1097
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1098
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
1099
+
1100
+
1101
+ request_headers = {}
1102
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1103
+
1104
+ # Set Headers
1105
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1106
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1107
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput'
1108
+
1109
+ request_url = @base_url || @client.base_url
1110
+
1111
+ options = {
1112
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1113
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'tableName' => table_name},
1114
+ query_params: {'api-version' => @client.api_version},
1115
+ headers: request_headers.merge(custom_headers || {}),
1116
+ base_url: request_url
1117
+ }
1118
+ promise = @client.make_request_async(:post, path_template, options)
1119
+
1120
+ promise = promise.then do |result|
1121
+ http_response = result.response
1122
+ status_code = http_response.status
1123
+ response_content = http_response.body
1124
+ unless status_code == 202 || status_code == 200
1125
+ error_model = JSON.load(response_content)
1126
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1127
+ end
1128
+
1129
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1130
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1131
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1132
+ # Deserialize Response
1133
+ if status_code == 200
1134
+ begin
1135
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1136
+ result_mapper = Azure::Cosmosdb::Mgmt::V2021_01_15::Models::ThroughputSettingsGetResults.mapper()
1137
+ result.body = @client.deserialize(result_mapper, parsed_response)
1138
+ rescue Exception => e
1139
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1140
+ end
1141
+ end
1142
+
1143
+ result
1144
+ end
1145
+
1146
+ promise.execute
1147
+ end
1148
+
1149
+ end
1150
+ end