azure_mgmt_cosmosdb 0.18.0 → 0.19.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (286) hide show
  1. checksums.yaml +5 -5
  2. data/LICENSE.txt +20 -20
  3. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb.rb +0 -0
  4. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/collection.rb +0 -0
  5. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/collection_partition.rb +0 -0
  6. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/collection_partition_region.rb +0 -0
  7. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/collection_region.rb +0 -0
  8. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/cosmos_db.rb +1 -1
  9. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/database.rb +0 -0
  10. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_account_region.rb +0 -0
  11. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/database_accounts.rb +0 -0
  12. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/capability.rb +0 -0
  13. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace.rb +0 -0
  14. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_create_update_parameters.rb +0 -0
  15. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_list_result.rb +0 -0
  16. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_resource.rb +0 -0
  17. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/cassandra_partition_key.rb +0 -0
  18. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/cassandra_schema.rb +0 -0
  19. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/cassandra_table.rb +0 -0
  20. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/cassandra_table_create_update_parameters.rb +0 -0
  21. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/cassandra_table_list_result.rb +0 -0
  22. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/cassandra_table_resource.rb +0 -0
  23. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/cluster_key.rb +0 -0
  24. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/column.rb +0 -0
  25. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/conflict_resolution_mode.rb +0 -0
  26. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/conflict_resolution_policy.rb +0 -0
  27. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/connector_offer.rb +0 -0
  28. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/consistency_policy.rb +0 -0
  29. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/container_partition_key.rb +0 -0
  30. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/data_type.rb +0 -0
  31. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/database_account.rb +0 -0
  32. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/database_account_connection_string.rb +0 -0
  33. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/database_account_create_update_parameters.rb +0 -0
  34. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/database_account_kind.rb +0 -0
  35. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/database_account_list_connection_strings_result.rb +0 -0
  36. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/database_account_list_keys_result.rb +0 -0
  37. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/database_account_list_read_only_keys_result.rb +0 -0
  38. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/database_account_offer_type.rb +0 -0
  39. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/database_account_patch_parameters.rb +0 -0
  40. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/database_account_regenerate_key_parameters.rb +0 -0
  41. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/database_accounts_list_result.rb +0 -0
  42. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/default_consistency_level.rb +0 -0
  43. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/error_response.rb +0 -0
  44. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/excluded_path.rb +0 -0
  45. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/extended_resource_properties.rb +0 -0
  46. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/failover_policies.rb +0 -0
  47. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/failover_policy.rb +0 -0
  48. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/gremlin_database.rb +0 -0
  49. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/gremlin_database_create_update_parameters.rb +0 -0
  50. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/gremlin_database_list_result.rb +0 -0
  51. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/gremlin_database_resource.rb +0 -0
  52. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/gremlin_graph.rb +0 -0
  53. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/gremlin_graph_create_update_parameters.rb +0 -0
  54. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/gremlin_graph_list_result.rb +0 -0
  55. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/gremlin_graph_resource.rb +0 -0
  56. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/included_path.rb +0 -0
  57. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/index_kind.rb +0 -0
  58. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/indexes.rb +0 -0
  59. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/indexing_mode.rb +0 -0
  60. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/indexing_policy.rb +0 -0
  61. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/key_kind.rb +0 -0
  62. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/location.rb +0 -0
  63. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/metric.rb +0 -0
  64. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/metric_availability.rb +0 -0
  65. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/metric_definition.rb +0 -0
  66. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/metric_definitions_list_result.rb +0 -0
  67. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/metric_list_result.rb +0 -0
  68. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/metric_name.rb +0 -0
  69. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/metric_value.rb +0 -0
  70. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection.rb +0 -0
  71. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_create_update_parameters.rb +0 -0
  72. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_list_result.rb +0 -0
  73. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_resource.rb +0 -0
  74. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase.rb +0 -0
  75. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_create_update_parameters.rb +0 -0
  76. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_list_result.rb +0 -0
  77. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_resource.rb +0 -0
  78. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_index.rb +0 -0
  79. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_index_keys.rb +0 -0
  80. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/mongo_index_options.rb +0 -0
  81. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/operation.rb +0 -0
  82. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/operation_display.rb +0 -0
  83. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/operation_list_result.rb +0 -0
  84. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/partition_kind.rb +0 -0
  85. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/partition_metric.rb +0 -0
  86. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/partition_metric_list_result.rb +0 -0
  87. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/partition_usage.rb +0 -0
  88. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/partition_usages_result.rb +0 -0
  89. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/percentile_metric.rb +0 -0
  90. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/percentile_metric_list_result.rb +0 -0
  91. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/percentile_metric_value.rb +0 -0
  92. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/primary_aggregation_type.rb +0 -0
  93. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/region_for_online_offline.rb +0 -0
  94. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/resource.rb +0 -0
  95. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/sql_container.rb +0 -0
  96. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/sql_container_create_update_parameters.rb +0 -0
  97. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/sql_container_list_result.rb +0 -0
  98. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/sql_container_resource.rb +0 -0
  99. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/sql_database.rb +0 -0
  100. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/sql_database_create_update_parameters.rb +0 -0
  101. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/sql_database_list_result.rb +0 -0
  102. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/sql_database_resource.rb +0 -0
  103. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/table.rb +0 -0
  104. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/table_create_update_parameters.rb +0 -0
  105. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/table_list_result.rb +0 -0
  106. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/table_resource.rb +0 -0
  107. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/throughput.rb +0 -0
  108. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/throughput_resource.rb +0 -0
  109. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/throughput_update_parameters.rb +0 -0
  110. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/unique_key.rb +0 -0
  111. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/unique_key_policy.rb +0 -0
  112. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/unit_type.rb +0 -0
  113. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/usage.rb +0 -0
  114. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/usages_result.rb +0 -0
  115. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/models/virtual_network_rule.rb +0 -0
  116. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/module_definition.rb +0 -0
  117. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/operations.rb +0 -0
  118. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/partition_key_range_id.rb +0 -0
  119. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/partition_key_range_id_region.rb +0 -0
  120. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/percentile.rb +0 -0
  121. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/percentile_source_target.rb +0 -0
  122. data/lib/2015-04-08/generated/azure_mgmt_cosmosdb/percentile_target.rb +0 -0
  123. data/lib/2019-08-01-preview/generated/azure_mgmt_cosmosdb.rb +41 -0
  124. data/lib/2019-08-01-preview/generated/azure_mgmt_cosmosdb/cosmos_db.rb +142 -0
  125. data/lib/2019-08-01-preview/generated/azure_mgmt_cosmosdb/models/armproxy_resource.rb +73 -0
  126. data/lib/2019-08-01-preview/generated/azure_mgmt_cosmosdb/models/azure_entity_resource.rb +75 -0
  127. data/lib/2019-08-01-preview/generated/azure_mgmt_cosmosdb/models/error_response.rb +57 -0
  128. data/lib/2019-08-01-preview/generated/azure_mgmt_cosmosdb/models/private_endpoint_connection.rb +88 -0
  129. data/lib/2019-08-01-preview/generated/azure_mgmt_cosmosdb/models/private_endpoint_connection_list_result.rb +56 -0
  130. data/lib/2019-08-01-preview/generated/azure_mgmt_cosmosdb/models/private_endpoint_property.rb +46 -0
  131. data/lib/2019-08-01-preview/generated/azure_mgmt_cosmosdb/models/private_link_resource.rb +95 -0
  132. data/lib/2019-08-01-preview/generated/azure_mgmt_cosmosdb/models/private_link_resource_list_result.rb +55 -0
  133. data/lib/2019-08-01-preview/generated/azure_mgmt_cosmosdb/models/private_link_service_connection_state_property.rb +71 -0
  134. data/lib/2019-08-01-preview/generated/azure_mgmt_cosmosdb/models/proxy_resource.rb +63 -0
  135. data/lib/2019-08-01-preview/generated/azure_mgmt_cosmosdb/models/resource.rb +83 -0
  136. data/lib/2019-08-01-preview/generated/azure_mgmt_cosmosdb/models/tracked_resource.rb +92 -0
  137. data/lib/2019-08-01-preview/generated/azure_mgmt_cosmosdb/module_definition.rb +9 -0
  138. data/lib/2019-08-01-preview/generated/azure_mgmt_cosmosdb/private_endpoint_connections.rb +560 -0
  139. data/lib/2019-08-01-preview/generated/azure_mgmt_cosmosdb/private_link_resources.rb +235 -0
  140. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb.rb +164 -0
  141. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/cassandra_resources.rb +1628 -0
  142. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/collection.rb +374 -0
  143. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/collection_partition.rb +269 -0
  144. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/collection_partition_region.rb +156 -0
  145. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/collection_region.rb +156 -0
  146. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/cosmos_db.rb +200 -0
  147. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/database.rb +362 -0
  148. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/database_account_region.rb +148 -0
  149. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/database_accounts.rb +2184 -0
  150. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/gremlin_resources.rb +1623 -0
  151. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/armproxy_resource.rb +73 -0
  152. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/armresource_properties.rb +102 -0
  153. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/capability.rb +48 -0
  154. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_create_update_parameters.rb +120 -0
  155. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_get_results.rb +135 -0
  156. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_list_result.rb +58 -0
  157. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/cassandra_keyspace_resource.rb +46 -0
  158. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/cassandra_partition_key.rb +46 -0
  159. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/cassandra_schema.rb +95 -0
  160. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_create_update_parameters.rb +120 -0
  161. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_get_results.rb +158 -0
  162. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_list_result.rb +58 -0
  163. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/cassandra_table_resource.rb +69 -0
  164. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/cluster_key.rb +58 -0
  165. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/column.rb +57 -0
  166. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/conflict_resolution_mode.rb +16 -0
  167. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/conflict_resolution_policy.rb +73 -0
  168. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/connector_offer.rb +15 -0
  169. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/consistency_policy.rb +86 -0
  170. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/container_partition_key.rb +85 -0
  171. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/data_type.rb +20 -0
  172. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/database_account_connection_string.rb +59 -0
  173. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/database_account_create_update_parameters.rb +279 -0
  174. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/database_account_get_results.rb +371 -0
  175. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/database_account_kind.rb +17 -0
  176. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/database_account_list_connection_strings_result.rb +57 -0
  177. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/database_account_list_keys_result.rb +77 -0
  178. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/database_account_list_read_only_keys_result.rb +59 -0
  179. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/database_account_offer_type.rb +15 -0
  180. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/database_account_regenerate_key_parameters.rb +47 -0
  181. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/database_account_update_parameters.rb +230 -0
  182. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/database_accounts_list_result.rb +58 -0
  183. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/default_consistency_level.rb +19 -0
  184. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/error_response.rb +57 -0
  185. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/excluded_path.rb +48 -0
  186. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/extended_resource_properties.rb +74 -0
  187. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/failover_policies.rb +55 -0
  188. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/failover_policy.rb +79 -0
  189. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_create_update_parameters.rb +120 -0
  190. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_get_results.rb +135 -0
  191. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_list_result.rb +58 -0
  192. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/gremlin_database_resource.rb +46 -0
  193. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_create_update_parameters.rb +120 -0
  194. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_get_results.rb +200 -0
  195. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_list_result.rb +58 -0
  196. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/gremlin_graph_resource.rb +111 -0
  197. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/included_path.rb +67 -0
  198. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/index_kind.rb +17 -0
  199. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/indexes.rb +73 -0
  200. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/indexing_mode.rb +17 -0
  201. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/indexing_policy.rb +99 -0
  202. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/key_kind.rb +18 -0
  203. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/location.rb +114 -0
  204. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/metric.rb +120 -0
  205. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/metric_availability.rb +60 -0
  206. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/metric_definition.rb +109 -0
  207. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/metric_definitions_list_result.rb +57 -0
  208. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/metric_list_result.rb +56 -0
  209. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/metric_name.rb +59 -0
  210. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/metric_value.rb +107 -0
  211. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_create_update_parameters.rb +120 -0
  212. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_get_results.rb +175 -0
  213. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_list_result.rb +58 -0
  214. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/mongo_dbcollection_resource.rb +86 -0
  215. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_create_update_parameters.rb +120 -0
  216. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_get_results.rb +135 -0
  217. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_list_result.rb +58 -0
  218. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/mongo_dbdatabase_resource.rb +46 -0
  219. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/mongo_index.rb +60 -0
  220. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/mongo_index_keys.rb +55 -0
  221. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/mongo_index_options.rb +57 -0
  222. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/operation.rb +58 -0
  223. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/operation_display.rb +80 -0
  224. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/operation_list_result.rb +101 -0
  225. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/partition_kind.rb +16 -0
  226. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/partition_metric.rb +124 -0
  227. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/partition_metric_list_result.rb +57 -0
  228. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/partition_usage.rb +105 -0
  229. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/partition_usages_result.rb +57 -0
  230. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/percentile_metric.rb +120 -0
  231. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/percentile_metric_list_result.rb +57 -0
  232. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/percentile_metric_value.rb +173 -0
  233. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/primary_aggregation_type.rb +20 -0
  234. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/region_for_online_offline.rb +47 -0
  235. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/sql_container_create_update_parameters.rb +119 -0
  236. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/sql_container_get_results.rb +200 -0
  237. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/sql_container_list_result.rb +58 -0
  238. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/sql_container_resource.rb +111 -0
  239. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/sql_database_create_update_parameters.rb +120 -0
  240. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/sql_database_get_results.rb +159 -0
  241. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/sql_database_list_result.rb +58 -0
  242. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/sql_database_resource.rb +46 -0
  243. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_create_update_parameters.rb +120 -0
  244. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_get_results.rb +146 -0
  245. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_list_result.rb +58 -0
  246. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/sql_stored_procedure_resource.rb +57 -0
  247. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_create_update_parameters.rb +119 -0
  248. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_get_results.rb +171 -0
  249. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_list_result.rb +58 -0
  250. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/sql_trigger_resource.rb +82 -0
  251. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_create_update_parameters.rb +121 -0
  252. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_get_results.rb +146 -0
  253. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_list_result.rb +58 -0
  254. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/sql_user_defined_function_resource.rb +57 -0
  255. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/table_create_update_parameters.rb +119 -0
  256. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/table_get_results.rb +135 -0
  257. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/table_list_result.rb +57 -0
  258. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/table_resource.rb +46 -0
  259. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_get_results.rb +121 -0
  260. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_resource.rb +70 -0
  261. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/throughput_settings_update_parameters.rb +99 -0
  262. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/trigger_operation.rb +19 -0
  263. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/trigger_type.rb +16 -0
  264. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/unique_key.rb +56 -0
  265. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/unique_key_policy.rb +58 -0
  266. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/unit_type.rb +21 -0
  267. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/usage.rb +97 -0
  268. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/usages_result.rb +57 -0
  269. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/models/virtual_network_rule.rb +59 -0
  270. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/module_definition.rb +9 -0
  271. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/mongo_dbresources.rb +1634 -0
  272. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/operations.rb +219 -0
  273. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/partition_key_range_id.rb +156 -0
  274. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/partition_key_range_id_region.rb +163 -0
  275. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/percentile.rb +141 -0
  276. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/percentile_source_target.rb +158 -0
  277. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/percentile_target.rb +148 -0
  278. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/sql_resources.rb +3289 -0
  279. data/lib/2019-08-01/generated/azure_mgmt_cosmosdb/table_resources.rb +804 -0
  280. data/lib/azure_mgmt_cosmosdb.rb +8 -6
  281. data/lib/module_definition.rb +7 -7
  282. data/lib/profiles/latest/cosmosdb_latest_profile_client.rb +40 -40
  283. data/lib/profiles/latest/cosmosdb_module_definition.rb +8 -8
  284. data/lib/profiles/latest/modules/cosmosdb_profile_module.rb +571 -501
  285. data/lib/version.rb +1 -1
  286. metadata +160 -3
@@ -0,0 +1,1623 @@
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::V2019_08_01
7
+ #
8
+ # Azure Cosmos DB Database Service Resource Provider REST API
9
+ #
10
+ class GremlinResources
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the GremlinResources class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [CosmosDB] reference to the CosmosDB
22
+ attr_reader :client
23
+
24
+ #
25
+ # Lists the Gremlin databases under an existing Azure Cosmos DB database
26
+ # account.
27
+ #
28
+ # @param resource_group_name [String] Name of an Azure resource group.
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 [GremlinDatabaseListResult] operation results.
34
+ #
35
+ def list_gremlin_databases(resource_group_name, account_name, custom_headers:nil)
36
+ response = list_gremlin_databases_async(resource_group_name, account_name, custom_headers:custom_headers).value!
37
+ response.body unless response.nil?
38
+ end
39
+
40
+ #
41
+ # Lists the Gremlin databases under an existing Azure Cosmos DB database
42
+ # account.
43
+ #
44
+ # @param resource_group_name [String] Name of an Azure resource group.
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_gremlin_databases_with_http_info(resource_group_name, account_name, custom_headers:nil)
52
+ list_gremlin_databases_async(resource_group_name, account_name, custom_headers:custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # Lists the Gremlin databases under an existing Azure Cosmos DB database
57
+ # account.
58
+ #
59
+ # @param resource_group_name [String] Name of an Azure resource group.
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_gremlin_databases_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, 'resource_group_name is nil' if resource_group_name.nil?
69
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
70
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
71
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
72
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
73
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
74
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
75
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
76
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
77
+
78
+
79
+ request_headers = {}
80
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
81
+
82
+ # Set Headers
83
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
84
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
85
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases'
86
+
87
+ request_url = @base_url || @client.base_url
88
+
89
+ options = {
90
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
91
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
92
+ query_params: {'api-version' => @client.api_version},
93
+ headers: request_headers.merge(custom_headers || {}),
94
+ base_url: request_url
95
+ }
96
+ promise = @client.make_request_async(:get, path_template, options)
97
+
98
+ promise = promise.then do |result|
99
+ http_response = result.response
100
+ status_code = http_response.status
101
+ response_content = http_response.body
102
+ unless status_code == 200
103
+ error_model = JSON.load(response_content)
104
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
105
+ end
106
+
107
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
108
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
109
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
110
+ # Deserialize Response
111
+ if status_code == 200
112
+ begin
113
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
114
+ result_mapper = Azure::Cosmosdb::Mgmt::V2019_08_01::Models::GremlinDatabaseListResult.mapper()
115
+ result.body = @client.deserialize(result_mapper, parsed_response)
116
+ rescue Exception => e
117
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
118
+ end
119
+ end
120
+
121
+ result
122
+ end
123
+
124
+ promise.execute
125
+ end
126
+
127
+ #
128
+ # Gets the Gremlin databases under an existing Azure Cosmos DB database account
129
+ # with the provided name.
130
+ #
131
+ # @param resource_group_name [String] Name of an Azure resource group.
132
+ # @param account_name [String] Cosmos DB database account name.
133
+ # @param database_name [String] Cosmos DB database name.
134
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
135
+ # will be added to the HTTP request.
136
+ #
137
+ # @return [GremlinDatabaseGetResults] operation results.
138
+ #
139
+ def get_gremlin_database(resource_group_name, account_name, database_name, custom_headers:nil)
140
+ response = get_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value!
141
+ response.body unless response.nil?
142
+ end
143
+
144
+ #
145
+ # Gets the Gremlin databases under an existing Azure Cosmos DB database account
146
+ # with the provided name.
147
+ #
148
+ # @param resource_group_name [String] Name of an Azure resource group.
149
+ # @param account_name [String] Cosmos DB database account name.
150
+ # @param database_name [String] Cosmos DB database name.
151
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
152
+ # will be added to the HTTP request.
153
+ #
154
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
155
+ #
156
+ def get_gremlin_database_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil)
157
+ get_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value!
158
+ end
159
+
160
+ #
161
+ # Gets the Gremlin databases under an existing Azure Cosmos DB database account
162
+ # with the provided name.
163
+ #
164
+ # @param resource_group_name [String] Name of an Azure resource group.
165
+ # @param account_name [String] Cosmos DB database account name.
166
+ # @param database_name [String] Cosmos DB database name.
167
+ # @param [Hash{String => String}] A hash of custom headers that will be added
168
+ # to the HTTP request.
169
+ #
170
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
171
+ #
172
+ def get_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:nil)
173
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
174
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
175
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
176
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
177
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
178
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
179
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
180
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
181
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
182
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
183
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
184
+
185
+
186
+ request_headers = {}
187
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
188
+
189
+ # Set Headers
190
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
191
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
192
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}'
193
+
194
+ request_url = @base_url || @client.base_url
195
+
196
+ options = {
197
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
198
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name},
199
+ query_params: {'api-version' => @client.api_version},
200
+ headers: request_headers.merge(custom_headers || {}),
201
+ base_url: request_url
202
+ }
203
+ promise = @client.make_request_async(:get, path_template, options)
204
+
205
+ promise = promise.then do |result|
206
+ http_response = result.response
207
+ status_code = http_response.status
208
+ response_content = http_response.body
209
+ unless status_code == 200
210
+ error_model = JSON.load(response_content)
211
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
212
+ end
213
+
214
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
215
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
216
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
217
+ # Deserialize Response
218
+ if status_code == 200
219
+ begin
220
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
221
+ result_mapper = Azure::Cosmosdb::Mgmt::V2019_08_01::Models::GremlinDatabaseGetResults.mapper()
222
+ result.body = @client.deserialize(result_mapper, parsed_response)
223
+ rescue Exception => e
224
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
225
+ end
226
+ end
227
+
228
+ result
229
+ end
230
+
231
+ promise.execute
232
+ end
233
+
234
+ #
235
+ # Create or update an Azure Cosmos DB Gremlin database
236
+ #
237
+ # @param resource_group_name [String] Name of an Azure resource group.
238
+ # @param account_name [String] Cosmos DB database account name.
239
+ # @param database_name [String] Cosmos DB database name.
240
+ # @param create_update_gremlin_database_parameters
241
+ # [GremlinDatabaseCreateUpdateParameters] The parameters to provide for the
242
+ # current Gremlin database.
243
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
244
+ # will be added to the HTTP request.
245
+ #
246
+ # @return [GremlinDatabaseGetResults] operation results.
247
+ #
248
+ def create_update_gremlin_database(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:nil)
249
+ response = create_update_gremlin_database_async(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:custom_headers).value!
250
+ response.body unless response.nil?
251
+ end
252
+
253
+ #
254
+ # @param resource_group_name [String] Name of an Azure resource group.
255
+ # @param account_name [String] Cosmos DB database account name.
256
+ # @param database_name [String] Cosmos DB database name.
257
+ # @param create_update_gremlin_database_parameters
258
+ # [GremlinDatabaseCreateUpdateParameters] The parameters to provide for the
259
+ # current Gremlin database.
260
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
261
+ # will be added to the HTTP request.
262
+ #
263
+ # @return [Concurrent::Promise] promise which provides async access to http
264
+ # response.
265
+ #
266
+ def create_update_gremlin_database_async(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:nil)
267
+ # Send request
268
+ promise = begin_create_update_gremlin_database_async(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:custom_headers)
269
+
270
+ promise = promise.then do |response|
271
+ # Defining deserialization method.
272
+ deserialize_method = lambda do |parsed_response|
273
+ result_mapper = Azure::Cosmosdb::Mgmt::V2019_08_01::Models::GremlinDatabaseGetResults.mapper()
274
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
275
+ end
276
+
277
+ # Waiting for response.
278
+ @client.get_long_running_operation_result(response, deserialize_method)
279
+ end
280
+
281
+ promise
282
+ end
283
+
284
+ #
285
+ # Deletes an existing Azure Cosmos DB Gremlin database.
286
+ #
287
+ # @param resource_group_name [String] Name of an Azure resource group.
288
+ # @param account_name [String] Cosmos DB database account name.
289
+ # @param database_name [String] Cosmos DB database name.
290
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
291
+ # will be added to the HTTP request.
292
+ #
293
+ def delete_gremlin_database(resource_group_name, account_name, database_name, custom_headers:nil)
294
+ response = delete_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value!
295
+ nil
296
+ end
297
+
298
+ #
299
+ # @param resource_group_name [String] Name of an Azure resource group.
300
+ # @param account_name [String] Cosmos DB database account name.
301
+ # @param database_name [String] Cosmos DB database name.
302
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
303
+ # will be added to the HTTP request.
304
+ #
305
+ # @return [Concurrent::Promise] promise which provides async access to http
306
+ # response.
307
+ #
308
+ def delete_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:nil)
309
+ # Send request
310
+ promise = begin_delete_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers)
311
+
312
+ promise = promise.then do |response|
313
+ # Defining deserialization method.
314
+ deserialize_method = lambda do |parsed_response|
315
+ end
316
+
317
+ # Waiting for response.
318
+ @client.get_long_running_operation_result(response, deserialize_method)
319
+ end
320
+
321
+ promise
322
+ end
323
+
324
+ #
325
+ # Gets the RUs per second of the Gremlin database under an existing Azure
326
+ # Cosmos DB database account with the provided name.
327
+ #
328
+ # @param resource_group_name [String] Name of an Azure resource group.
329
+ # @param account_name [String] Cosmos DB database account name.
330
+ # @param database_name [String] Cosmos DB database name.
331
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
332
+ # will be added to the HTTP request.
333
+ #
334
+ # @return [ThroughputSettingsGetResults] operation results.
335
+ #
336
+ def get_gremlin_database_throughput(resource_group_name, account_name, database_name, custom_headers:nil)
337
+ response = get_gremlin_database_throughput_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value!
338
+ response.body unless response.nil?
339
+ end
340
+
341
+ #
342
+ # Gets the RUs per second of the Gremlin database under an existing Azure
343
+ # Cosmos DB database account with the provided name.
344
+ #
345
+ # @param resource_group_name [String] Name of an Azure resource group.
346
+ # @param account_name [String] Cosmos DB database account name.
347
+ # @param database_name [String] Cosmos DB database name.
348
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
349
+ # will be added to the HTTP request.
350
+ #
351
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
352
+ #
353
+ def get_gremlin_database_throughput_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil)
354
+ get_gremlin_database_throughput_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value!
355
+ end
356
+
357
+ #
358
+ # Gets the RUs per second of the Gremlin database under an existing Azure
359
+ # Cosmos DB database account with the provided name.
360
+ #
361
+ # @param resource_group_name [String] Name of an Azure resource group.
362
+ # @param account_name [String] Cosmos DB database account name.
363
+ # @param database_name [String] Cosmos DB database name.
364
+ # @param [Hash{String => String}] A hash of custom headers that will be added
365
+ # to the HTTP request.
366
+ #
367
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
368
+ #
369
+ def get_gremlin_database_throughput_async(resource_group_name, account_name, database_name, custom_headers:nil)
370
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
371
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
372
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
373
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
374
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
375
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
376
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
377
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
378
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
379
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
380
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
381
+
382
+
383
+ request_headers = {}
384
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
385
+
386
+ # Set Headers
387
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
388
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
389
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default'
390
+
391
+ request_url = @base_url || @client.base_url
392
+
393
+ options = {
394
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
395
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name},
396
+ query_params: {'api-version' => @client.api_version},
397
+ headers: request_headers.merge(custom_headers || {}),
398
+ base_url: request_url
399
+ }
400
+ promise = @client.make_request_async(:get, path_template, options)
401
+
402
+ promise = promise.then do |result|
403
+ http_response = result.response
404
+ status_code = http_response.status
405
+ response_content = http_response.body
406
+ unless status_code == 200
407
+ error_model = JSON.load(response_content)
408
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
409
+ end
410
+
411
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
412
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
413
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
414
+ # Deserialize Response
415
+ if status_code == 200
416
+ begin
417
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
418
+ result_mapper = Azure::Cosmosdb::Mgmt::V2019_08_01::Models::ThroughputSettingsGetResults.mapper()
419
+ result.body = @client.deserialize(result_mapper, parsed_response)
420
+ rescue Exception => e
421
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
422
+ end
423
+ end
424
+
425
+ result
426
+ end
427
+
428
+ promise.execute
429
+ end
430
+
431
+ #
432
+ # Update RUs per second of an Azure Cosmos DB Gremlin database
433
+ #
434
+ # @param resource_group_name [String] Name of an Azure resource group.
435
+ # @param account_name [String] Cosmos DB database account name.
436
+ # @param database_name [String] Cosmos DB database name.
437
+ # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The
438
+ # RUs per second of the parameters to provide for the current Gremlin database.
439
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
440
+ # will be added to the HTTP request.
441
+ #
442
+ # @return [ThroughputSettingsGetResults] operation results.
443
+ #
444
+ def update_gremlin_database_throughput(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil)
445
+ response = update_gremlin_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value!
446
+ response.body unless response.nil?
447
+ end
448
+
449
+ #
450
+ # @param resource_group_name [String] Name of an Azure resource group.
451
+ # @param account_name [String] Cosmos DB database account name.
452
+ # @param database_name [String] Cosmos DB database name.
453
+ # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The
454
+ # RUs per second of the parameters to provide for the current Gremlin database.
455
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
456
+ # will be added to the HTTP request.
457
+ #
458
+ # @return [Concurrent::Promise] promise which provides async access to http
459
+ # response.
460
+ #
461
+ def update_gremlin_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil)
462
+ # Send request
463
+ promise = begin_update_gremlin_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers)
464
+
465
+ promise = promise.then do |response|
466
+ # Defining deserialization method.
467
+ deserialize_method = lambda do |parsed_response|
468
+ result_mapper = Azure::Cosmosdb::Mgmt::V2019_08_01::Models::ThroughputSettingsGetResults.mapper()
469
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
470
+ end
471
+
472
+ # Waiting for response.
473
+ @client.get_long_running_operation_result(response, deserialize_method)
474
+ end
475
+
476
+ promise
477
+ end
478
+
479
+ #
480
+ # Lists the Gremlin graph under an existing Azure Cosmos DB database account.
481
+ #
482
+ # @param resource_group_name [String] Name of an Azure resource group.
483
+ # @param account_name [String] Cosmos DB database account name.
484
+ # @param database_name [String] Cosmos DB database name.
485
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
486
+ # will be added to the HTTP request.
487
+ #
488
+ # @return [GremlinGraphListResult] operation results.
489
+ #
490
+ def list_gremlin_graphs(resource_group_name, account_name, database_name, custom_headers:nil)
491
+ response = list_gremlin_graphs_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value!
492
+ response.body unless response.nil?
493
+ end
494
+
495
+ #
496
+ # Lists the Gremlin graph under an existing Azure Cosmos DB database account.
497
+ #
498
+ # @param resource_group_name [String] Name of an Azure resource group.
499
+ # @param account_name [String] Cosmos DB database account name.
500
+ # @param database_name [String] Cosmos DB database name.
501
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
502
+ # will be added to the HTTP request.
503
+ #
504
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
505
+ #
506
+ def list_gremlin_graphs_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil)
507
+ list_gremlin_graphs_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value!
508
+ end
509
+
510
+ #
511
+ # Lists the Gremlin graph under an existing Azure Cosmos DB database account.
512
+ #
513
+ # @param resource_group_name [String] Name of an Azure resource group.
514
+ # @param account_name [String] Cosmos DB database account name.
515
+ # @param database_name [String] Cosmos DB database name.
516
+ # @param [Hash{String => String}] A hash of custom headers that will be added
517
+ # to the HTTP request.
518
+ #
519
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
520
+ #
521
+ def list_gremlin_graphs_async(resource_group_name, account_name, database_name, custom_headers:nil)
522
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
523
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
524
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
525
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
526
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
527
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
528
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
529
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
530
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
531
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
532
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
533
+
534
+
535
+ request_headers = {}
536
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
537
+
538
+ # Set Headers
539
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
540
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
541
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs'
542
+
543
+ request_url = @base_url || @client.base_url
544
+
545
+ options = {
546
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
547
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name},
548
+ query_params: {'api-version' => @client.api_version},
549
+ headers: request_headers.merge(custom_headers || {}),
550
+ base_url: request_url
551
+ }
552
+ promise = @client.make_request_async(:get, path_template, options)
553
+
554
+ promise = promise.then do |result|
555
+ http_response = result.response
556
+ status_code = http_response.status
557
+ response_content = http_response.body
558
+ unless status_code == 200
559
+ error_model = JSON.load(response_content)
560
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
561
+ end
562
+
563
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
564
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
565
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
566
+ # Deserialize Response
567
+ if status_code == 200
568
+ begin
569
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
570
+ result_mapper = Azure::Cosmosdb::Mgmt::V2019_08_01::Models::GremlinGraphListResult.mapper()
571
+ result.body = @client.deserialize(result_mapper, parsed_response)
572
+ rescue Exception => e
573
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
574
+ end
575
+ end
576
+
577
+ result
578
+ end
579
+
580
+ promise.execute
581
+ end
582
+
583
+ #
584
+ # Gets the Gremlin graph under an existing Azure Cosmos DB database account.
585
+ #
586
+ # @param resource_group_name [String] Name of an Azure resource group.
587
+ # @param account_name [String] Cosmos DB database account name.
588
+ # @param database_name [String] Cosmos DB database name.
589
+ # @param graph_name [String] Cosmos DB graph name.
590
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
591
+ # will be added to the HTTP request.
592
+ #
593
+ # @return [GremlinGraphGetResults] operation results.
594
+ #
595
+ def get_gremlin_graph(resource_group_name, account_name, database_name, graph_name, custom_headers:nil)
596
+ response = get_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value!
597
+ response.body unless response.nil?
598
+ end
599
+
600
+ #
601
+ # Gets the Gremlin graph under an existing Azure Cosmos DB database account.
602
+ #
603
+ # @param resource_group_name [String] Name of an Azure resource group.
604
+ # @param account_name [String] Cosmos DB database account name.
605
+ # @param database_name [String] Cosmos DB database name.
606
+ # @param graph_name [String] Cosmos DB graph name.
607
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
608
+ # will be added to the HTTP request.
609
+ #
610
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
611
+ #
612
+ def get_gremlin_graph_with_http_info(resource_group_name, account_name, database_name, graph_name, custom_headers:nil)
613
+ get_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value!
614
+ end
615
+
616
+ #
617
+ # Gets the Gremlin graph under an existing Azure Cosmos DB database account.
618
+ #
619
+ # @param resource_group_name [String] Name of an Azure resource group.
620
+ # @param account_name [String] Cosmos DB database account name.
621
+ # @param database_name [String] Cosmos DB database name.
622
+ # @param graph_name [String] Cosmos DB graph name.
623
+ # @param [Hash{String => String}] A hash of custom headers that will be added
624
+ # to the HTTP request.
625
+ #
626
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
627
+ #
628
+ def get_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:nil)
629
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
630
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
631
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
632
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
633
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
634
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
635
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
636
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
637
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
638
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
639
+ fail ArgumentError, 'graph_name is nil' if graph_name.nil?
640
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
641
+
642
+
643
+ request_headers = {}
644
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
645
+
646
+ # Set Headers
647
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
648
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
649
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}'
650
+
651
+ request_url = @base_url || @client.base_url
652
+
653
+ options = {
654
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
655
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'graphName' => graph_name},
656
+ query_params: {'api-version' => @client.api_version},
657
+ headers: request_headers.merge(custom_headers || {}),
658
+ base_url: request_url
659
+ }
660
+ promise = @client.make_request_async(:get, path_template, options)
661
+
662
+ promise = promise.then do |result|
663
+ http_response = result.response
664
+ status_code = http_response.status
665
+ response_content = http_response.body
666
+ unless status_code == 200
667
+ error_model = JSON.load(response_content)
668
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
669
+ end
670
+
671
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
672
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
673
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
674
+ # Deserialize Response
675
+ if status_code == 200
676
+ begin
677
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
678
+ result_mapper = Azure::Cosmosdb::Mgmt::V2019_08_01::Models::GremlinGraphGetResults.mapper()
679
+ result.body = @client.deserialize(result_mapper, parsed_response)
680
+ rescue Exception => e
681
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
682
+ end
683
+ end
684
+
685
+ result
686
+ end
687
+
688
+ promise.execute
689
+ end
690
+
691
+ #
692
+ # Create or update an Azure Cosmos DB Gremlin graph
693
+ #
694
+ # @param resource_group_name [String] Name of an Azure resource group.
695
+ # @param account_name [String] Cosmos DB database account name.
696
+ # @param database_name [String] Cosmos DB database name.
697
+ # @param graph_name [String] Cosmos DB graph name.
698
+ # @param create_update_gremlin_graph_parameters
699
+ # [GremlinGraphCreateUpdateParameters] The parameters to provide for the
700
+ # current Gremlin graph.
701
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
702
+ # will be added to the HTTP request.
703
+ #
704
+ # @return [GremlinGraphGetResults] operation results.
705
+ #
706
+ def create_update_gremlin_graph(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:nil)
707
+ response = create_update_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:custom_headers).value!
708
+ response.body unless response.nil?
709
+ end
710
+
711
+ #
712
+ # @param resource_group_name [String] Name of an Azure resource group.
713
+ # @param account_name [String] Cosmos DB database account name.
714
+ # @param database_name [String] Cosmos DB database name.
715
+ # @param graph_name [String] Cosmos DB graph name.
716
+ # @param create_update_gremlin_graph_parameters
717
+ # [GremlinGraphCreateUpdateParameters] The parameters to provide for the
718
+ # current Gremlin graph.
719
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
720
+ # will be added to the HTTP request.
721
+ #
722
+ # @return [Concurrent::Promise] promise which provides async access to http
723
+ # response.
724
+ #
725
+ def create_update_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:nil)
726
+ # Send request
727
+ promise = begin_create_update_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:custom_headers)
728
+
729
+ promise = promise.then do |response|
730
+ # Defining deserialization method.
731
+ deserialize_method = lambda do |parsed_response|
732
+ result_mapper = Azure::Cosmosdb::Mgmt::V2019_08_01::Models::GremlinGraphGetResults.mapper()
733
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
734
+ end
735
+
736
+ # Waiting for response.
737
+ @client.get_long_running_operation_result(response, deserialize_method)
738
+ end
739
+
740
+ promise
741
+ end
742
+
743
+ #
744
+ # Deletes an existing Azure Cosmos DB Gremlin graph.
745
+ #
746
+ # @param resource_group_name [String] Name of an Azure resource group.
747
+ # @param account_name [String] Cosmos DB database account name.
748
+ # @param database_name [String] Cosmos DB database name.
749
+ # @param graph_name [String] Cosmos DB graph name.
750
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
751
+ # will be added to the HTTP request.
752
+ #
753
+ def delete_gremlin_graph(resource_group_name, account_name, database_name, graph_name, custom_headers:nil)
754
+ response = delete_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value!
755
+ nil
756
+ end
757
+
758
+ #
759
+ # @param resource_group_name [String] Name of an Azure resource group.
760
+ # @param account_name [String] Cosmos DB database account name.
761
+ # @param database_name [String] Cosmos DB database name.
762
+ # @param graph_name [String] Cosmos DB graph name.
763
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
764
+ # will be added to the HTTP request.
765
+ #
766
+ # @return [Concurrent::Promise] promise which provides async access to http
767
+ # response.
768
+ #
769
+ def delete_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:nil)
770
+ # Send request
771
+ promise = begin_delete_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers)
772
+
773
+ promise = promise.then do |response|
774
+ # Defining deserialization method.
775
+ deserialize_method = lambda do |parsed_response|
776
+ end
777
+
778
+ # Waiting for response.
779
+ @client.get_long_running_operation_result(response, deserialize_method)
780
+ end
781
+
782
+ promise
783
+ end
784
+
785
+ #
786
+ # Gets the Gremlin graph throughput under an existing Azure Cosmos DB database
787
+ # account with the provided name.
788
+ #
789
+ # @param resource_group_name [String] Name of an Azure resource group.
790
+ # @param account_name [String] Cosmos DB database account name.
791
+ # @param database_name [String] Cosmos DB database name.
792
+ # @param graph_name [String] Cosmos DB graph name.
793
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
794
+ # will be added to the HTTP request.
795
+ #
796
+ # @return [ThroughputSettingsGetResults] operation results.
797
+ #
798
+ def get_gremlin_graph_throughput(resource_group_name, account_name, database_name, graph_name, custom_headers:nil)
799
+ response = get_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value!
800
+ response.body unless response.nil?
801
+ end
802
+
803
+ #
804
+ # Gets the Gremlin graph throughput under an existing Azure Cosmos DB database
805
+ # account with the provided name.
806
+ #
807
+ # @param resource_group_name [String] Name of an Azure resource group.
808
+ # @param account_name [String] Cosmos DB database account name.
809
+ # @param database_name [String] Cosmos DB database name.
810
+ # @param graph_name [String] Cosmos DB graph name.
811
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
812
+ # will be added to the HTTP request.
813
+ #
814
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
815
+ #
816
+ def get_gremlin_graph_throughput_with_http_info(resource_group_name, account_name, database_name, graph_name, custom_headers:nil)
817
+ get_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value!
818
+ end
819
+
820
+ #
821
+ # Gets the Gremlin graph throughput under an existing Azure Cosmos DB database
822
+ # account with the provided name.
823
+ #
824
+ # @param resource_group_name [String] Name of an Azure resource group.
825
+ # @param account_name [String] Cosmos DB database account name.
826
+ # @param database_name [String] Cosmos DB database name.
827
+ # @param graph_name [String] Cosmos DB graph name.
828
+ # @param [Hash{String => String}] A hash of custom headers that will be added
829
+ # to the HTTP request.
830
+ #
831
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
832
+ #
833
+ def get_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, custom_headers:nil)
834
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
835
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
836
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
837
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
838
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
839
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
840
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
841
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
842
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
843
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
844
+ fail ArgumentError, 'graph_name is nil' if graph_name.nil?
845
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
846
+
847
+
848
+ request_headers = {}
849
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
850
+
851
+ # Set Headers
852
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
853
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
854
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default'
855
+
856
+ request_url = @base_url || @client.base_url
857
+
858
+ options = {
859
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
860
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'graphName' => graph_name},
861
+ query_params: {'api-version' => @client.api_version},
862
+ headers: request_headers.merge(custom_headers || {}),
863
+ base_url: request_url
864
+ }
865
+ promise = @client.make_request_async(:get, path_template, options)
866
+
867
+ promise = promise.then do |result|
868
+ http_response = result.response
869
+ status_code = http_response.status
870
+ response_content = http_response.body
871
+ unless status_code == 200
872
+ error_model = JSON.load(response_content)
873
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
874
+ end
875
+
876
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
877
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
878
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
879
+ # Deserialize Response
880
+ if status_code == 200
881
+ begin
882
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
883
+ result_mapper = Azure::Cosmosdb::Mgmt::V2019_08_01::Models::ThroughputSettingsGetResults.mapper()
884
+ result.body = @client.deserialize(result_mapper, parsed_response)
885
+ rescue Exception => e
886
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
887
+ end
888
+ end
889
+
890
+ result
891
+ end
892
+
893
+ promise.execute
894
+ end
895
+
896
+ #
897
+ # Update RUs per second of an Azure Cosmos DB Gremlin graph
898
+ #
899
+ # @param resource_group_name [String] Name of an Azure resource group.
900
+ # @param account_name [String] Cosmos DB database account name.
901
+ # @param database_name [String] Cosmos DB database name.
902
+ # @param graph_name [String] Cosmos DB graph name.
903
+ # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The
904
+ # RUs per second of the parameters to provide for the current Gremlin graph.
905
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
906
+ # will be added to the HTTP request.
907
+ #
908
+ # @return [ThroughputSettingsGetResults] operation results.
909
+ #
910
+ def update_gremlin_graph_throughput(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:nil)
911
+ response = update_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:custom_headers).value!
912
+ response.body unless response.nil?
913
+ end
914
+
915
+ #
916
+ # @param resource_group_name [String] Name of an Azure resource group.
917
+ # @param account_name [String] Cosmos DB database account name.
918
+ # @param database_name [String] Cosmos DB database name.
919
+ # @param graph_name [String] Cosmos DB graph name.
920
+ # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The
921
+ # RUs per second of the parameters to provide for the current Gremlin graph.
922
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
923
+ # will be added to the HTTP request.
924
+ #
925
+ # @return [Concurrent::Promise] promise which provides async access to http
926
+ # response.
927
+ #
928
+ def update_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:nil)
929
+ # Send request
930
+ promise = begin_update_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:custom_headers)
931
+
932
+ promise = promise.then do |response|
933
+ # Defining deserialization method.
934
+ deserialize_method = lambda do |parsed_response|
935
+ result_mapper = Azure::Cosmosdb::Mgmt::V2019_08_01::Models::ThroughputSettingsGetResults.mapper()
936
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
937
+ end
938
+
939
+ # Waiting for response.
940
+ @client.get_long_running_operation_result(response, deserialize_method)
941
+ end
942
+
943
+ promise
944
+ end
945
+
946
+ #
947
+ # Create or update an Azure Cosmos DB Gremlin database
948
+ #
949
+ # @param resource_group_name [String] Name of an Azure resource group.
950
+ # @param account_name [String] Cosmos DB database account name.
951
+ # @param database_name [String] Cosmos DB database name.
952
+ # @param create_update_gremlin_database_parameters
953
+ # [GremlinDatabaseCreateUpdateParameters] The parameters to provide for the
954
+ # current Gremlin database.
955
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
956
+ # will be added to the HTTP request.
957
+ #
958
+ # @return [GremlinDatabaseGetResults] operation results.
959
+ #
960
+ def begin_create_update_gremlin_database(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:nil)
961
+ response = begin_create_update_gremlin_database_async(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:custom_headers).value!
962
+ response.body unless response.nil?
963
+ end
964
+
965
+ #
966
+ # Create or update an Azure Cosmos DB Gremlin database
967
+ #
968
+ # @param resource_group_name [String] Name of an Azure resource group.
969
+ # @param account_name [String] Cosmos DB database account name.
970
+ # @param database_name [String] Cosmos DB database name.
971
+ # @param create_update_gremlin_database_parameters
972
+ # [GremlinDatabaseCreateUpdateParameters] The parameters to provide for the
973
+ # current Gremlin database.
974
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
975
+ # will be added to the HTTP request.
976
+ #
977
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
978
+ #
979
+ def begin_create_update_gremlin_database_with_http_info(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:nil)
980
+ begin_create_update_gremlin_database_async(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:custom_headers).value!
981
+ end
982
+
983
+ #
984
+ # Create or update an Azure Cosmos DB Gremlin database
985
+ #
986
+ # @param resource_group_name [String] Name of an Azure resource group.
987
+ # @param account_name [String] Cosmos DB database account name.
988
+ # @param database_name [String] Cosmos DB database name.
989
+ # @param create_update_gremlin_database_parameters
990
+ # [GremlinDatabaseCreateUpdateParameters] The parameters to provide for the
991
+ # current Gremlin database.
992
+ # @param [Hash{String => String}] A hash of custom headers that will be added
993
+ # to the HTTP request.
994
+ #
995
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
996
+ #
997
+ def begin_create_update_gremlin_database_async(resource_group_name, account_name, database_name, create_update_gremlin_database_parameters, custom_headers:nil)
998
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
999
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1000
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1001
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1002
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1003
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1004
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
1005
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1006
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
1007
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
1008
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1009
+ fail ArgumentError, 'create_update_gremlin_database_parameters is nil' if create_update_gremlin_database_parameters.nil?
1010
+
1011
+
1012
+ request_headers = {}
1013
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1014
+
1015
+ # Set Headers
1016
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1017
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1018
+
1019
+ # Serialize Request
1020
+ request_mapper = Azure::Cosmosdb::Mgmt::V2019_08_01::Models::GremlinDatabaseCreateUpdateParameters.mapper()
1021
+ request_content = @client.serialize(request_mapper, create_update_gremlin_database_parameters)
1022
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1023
+
1024
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}'
1025
+
1026
+ request_url = @base_url || @client.base_url
1027
+
1028
+ options = {
1029
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1030
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name},
1031
+ query_params: {'api-version' => @client.api_version},
1032
+ body: request_content,
1033
+ headers: request_headers.merge(custom_headers || {}),
1034
+ base_url: request_url
1035
+ }
1036
+ promise = @client.make_request_async(:put, path_template, options)
1037
+
1038
+ promise = promise.then do |result|
1039
+ http_response = result.response
1040
+ status_code = http_response.status
1041
+ response_content = http_response.body
1042
+ unless status_code == 202 || status_code == 200
1043
+ error_model = JSON.load(response_content)
1044
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1045
+ end
1046
+
1047
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1048
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1049
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1050
+ # Deserialize Response
1051
+ if status_code == 200
1052
+ begin
1053
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1054
+ result_mapper = Azure::Cosmosdb::Mgmt::V2019_08_01::Models::GremlinDatabaseGetResults.mapper()
1055
+ result.body = @client.deserialize(result_mapper, parsed_response)
1056
+ rescue Exception => e
1057
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1058
+ end
1059
+ end
1060
+
1061
+ result
1062
+ end
1063
+
1064
+ promise.execute
1065
+ end
1066
+
1067
+ #
1068
+ # Deletes an existing Azure Cosmos DB Gremlin database.
1069
+ #
1070
+ # @param resource_group_name [String] Name of an Azure resource group.
1071
+ # @param account_name [String] Cosmos DB database account name.
1072
+ # @param database_name [String] Cosmos DB database name.
1073
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1074
+ # will be added to the HTTP request.
1075
+ #
1076
+ #
1077
+ def begin_delete_gremlin_database(resource_group_name, account_name, database_name, custom_headers:nil)
1078
+ response = begin_delete_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value!
1079
+ nil
1080
+ end
1081
+
1082
+ #
1083
+ # Deletes an existing Azure Cosmos DB Gremlin database.
1084
+ #
1085
+ # @param resource_group_name [String] Name of an Azure resource group.
1086
+ # @param account_name [String] Cosmos DB database account name.
1087
+ # @param database_name [String] Cosmos DB database name.
1088
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1089
+ # will be added to the HTTP request.
1090
+ #
1091
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1092
+ #
1093
+ def begin_delete_gremlin_database_with_http_info(resource_group_name, account_name, database_name, custom_headers:nil)
1094
+ begin_delete_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:custom_headers).value!
1095
+ end
1096
+
1097
+ #
1098
+ # Deletes an existing Azure Cosmos DB Gremlin database.
1099
+ #
1100
+ # @param resource_group_name [String] Name of an Azure resource group.
1101
+ # @param account_name [String] Cosmos DB database account name.
1102
+ # @param database_name [String] Cosmos DB database name.
1103
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1104
+ # to the HTTP request.
1105
+ #
1106
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1107
+ #
1108
+ def begin_delete_gremlin_database_async(resource_group_name, account_name, database_name, custom_headers:nil)
1109
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1110
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1111
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1112
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1113
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1114
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1115
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
1116
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1117
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
1118
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
1119
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1120
+
1121
+
1122
+ request_headers = {}
1123
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1124
+
1125
+ # Set Headers
1126
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1127
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1128
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}'
1129
+
1130
+ request_url = @base_url || @client.base_url
1131
+
1132
+ options = {
1133
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1134
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name},
1135
+ query_params: {'api-version' => @client.api_version},
1136
+ headers: request_headers.merge(custom_headers || {}),
1137
+ base_url: request_url
1138
+ }
1139
+ promise = @client.make_request_async(:delete, path_template, options)
1140
+
1141
+ promise = promise.then do |result|
1142
+ http_response = result.response
1143
+ status_code = http_response.status
1144
+ response_content = http_response.body
1145
+ unless status_code == 202 || status_code == 204
1146
+ error_model = JSON.load(response_content)
1147
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1148
+ end
1149
+
1150
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1151
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1152
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1153
+
1154
+ result
1155
+ end
1156
+
1157
+ promise.execute
1158
+ end
1159
+
1160
+ #
1161
+ # Update RUs per second of an Azure Cosmos DB Gremlin database
1162
+ #
1163
+ # @param resource_group_name [String] Name of an Azure resource group.
1164
+ # @param account_name [String] Cosmos DB database account name.
1165
+ # @param database_name [String] Cosmos DB database name.
1166
+ # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The
1167
+ # RUs per second of the parameters to provide for the current Gremlin database.
1168
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1169
+ # will be added to the HTTP request.
1170
+ #
1171
+ # @return [ThroughputSettingsGetResults] operation results.
1172
+ #
1173
+ def begin_update_gremlin_database_throughput(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil)
1174
+ response = begin_update_gremlin_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value!
1175
+ response.body unless response.nil?
1176
+ end
1177
+
1178
+ #
1179
+ # Update RUs per second of an Azure Cosmos DB Gremlin database
1180
+ #
1181
+ # @param resource_group_name [String] Name of an Azure resource group.
1182
+ # @param account_name [String] Cosmos DB database account name.
1183
+ # @param database_name [String] Cosmos DB database name.
1184
+ # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The
1185
+ # RUs per second of the parameters to provide for the current Gremlin database.
1186
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1187
+ # will be added to the HTTP request.
1188
+ #
1189
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1190
+ #
1191
+ def begin_update_gremlin_database_throughput_with_http_info(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil)
1192
+ begin_update_gremlin_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:custom_headers).value!
1193
+ end
1194
+
1195
+ #
1196
+ # Update RUs per second of an Azure Cosmos DB Gremlin database
1197
+ #
1198
+ # @param resource_group_name [String] Name of an Azure resource group.
1199
+ # @param account_name [String] Cosmos DB database account name.
1200
+ # @param database_name [String] Cosmos DB database name.
1201
+ # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The
1202
+ # RUs per second of the parameters to provide for the current Gremlin database.
1203
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1204
+ # to the HTTP request.
1205
+ #
1206
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1207
+ #
1208
+ def begin_update_gremlin_database_throughput_async(resource_group_name, account_name, database_name, update_throughput_parameters, custom_headers:nil)
1209
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1210
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1211
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1212
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1213
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1214
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1215
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
1216
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1217
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
1218
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
1219
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1220
+ fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil?
1221
+
1222
+
1223
+ request_headers = {}
1224
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1225
+
1226
+ # Set Headers
1227
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1228
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1229
+
1230
+ # Serialize Request
1231
+ request_mapper = Azure::Cosmosdb::Mgmt::V2019_08_01::Models::ThroughputSettingsUpdateParameters.mapper()
1232
+ request_content = @client.serialize(request_mapper, update_throughput_parameters)
1233
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1234
+
1235
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default'
1236
+
1237
+ request_url = @base_url || @client.base_url
1238
+
1239
+ options = {
1240
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1241
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name},
1242
+ query_params: {'api-version' => @client.api_version},
1243
+ body: request_content,
1244
+ headers: request_headers.merge(custom_headers || {}),
1245
+ base_url: request_url
1246
+ }
1247
+ promise = @client.make_request_async(:put, path_template, options)
1248
+
1249
+ promise = promise.then do |result|
1250
+ http_response = result.response
1251
+ status_code = http_response.status
1252
+ response_content = http_response.body
1253
+ unless status_code == 202 || status_code == 200
1254
+ error_model = JSON.load(response_content)
1255
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1256
+ end
1257
+
1258
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1259
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1260
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1261
+ # Deserialize Response
1262
+ if status_code == 200
1263
+ begin
1264
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1265
+ result_mapper = Azure::Cosmosdb::Mgmt::V2019_08_01::Models::ThroughputSettingsGetResults.mapper()
1266
+ result.body = @client.deserialize(result_mapper, parsed_response)
1267
+ rescue Exception => e
1268
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1269
+ end
1270
+ end
1271
+
1272
+ result
1273
+ end
1274
+
1275
+ promise.execute
1276
+ end
1277
+
1278
+ #
1279
+ # Create or update an Azure Cosmos DB Gremlin graph
1280
+ #
1281
+ # @param resource_group_name [String] Name of an Azure resource group.
1282
+ # @param account_name [String] Cosmos DB database account name.
1283
+ # @param database_name [String] Cosmos DB database name.
1284
+ # @param graph_name [String] Cosmos DB graph name.
1285
+ # @param create_update_gremlin_graph_parameters
1286
+ # [GremlinGraphCreateUpdateParameters] The parameters to provide for the
1287
+ # current Gremlin graph.
1288
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1289
+ # will be added to the HTTP request.
1290
+ #
1291
+ # @return [GremlinGraphGetResults] operation results.
1292
+ #
1293
+ def begin_create_update_gremlin_graph(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:nil)
1294
+ response = begin_create_update_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:custom_headers).value!
1295
+ response.body unless response.nil?
1296
+ end
1297
+
1298
+ #
1299
+ # Create or update an Azure Cosmos DB Gremlin graph
1300
+ #
1301
+ # @param resource_group_name [String] Name of an Azure resource group.
1302
+ # @param account_name [String] Cosmos DB database account name.
1303
+ # @param database_name [String] Cosmos DB database name.
1304
+ # @param graph_name [String] Cosmos DB graph name.
1305
+ # @param create_update_gremlin_graph_parameters
1306
+ # [GremlinGraphCreateUpdateParameters] The parameters to provide for the
1307
+ # current Gremlin graph.
1308
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1309
+ # will be added to the HTTP request.
1310
+ #
1311
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1312
+ #
1313
+ def begin_create_update_gremlin_graph_with_http_info(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:nil)
1314
+ begin_create_update_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:custom_headers).value!
1315
+ end
1316
+
1317
+ #
1318
+ # Create or update an Azure Cosmos DB Gremlin graph
1319
+ #
1320
+ # @param resource_group_name [String] Name of an Azure resource group.
1321
+ # @param account_name [String] Cosmos DB database account name.
1322
+ # @param database_name [String] Cosmos DB database name.
1323
+ # @param graph_name [String] Cosmos DB graph name.
1324
+ # @param create_update_gremlin_graph_parameters
1325
+ # [GremlinGraphCreateUpdateParameters] The parameters to provide for the
1326
+ # current Gremlin graph.
1327
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1328
+ # to the HTTP request.
1329
+ #
1330
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1331
+ #
1332
+ def begin_create_update_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, create_update_gremlin_graph_parameters, custom_headers:nil)
1333
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1334
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1335
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1336
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1337
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1338
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1339
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
1340
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1341
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
1342
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
1343
+ fail ArgumentError, 'graph_name is nil' if graph_name.nil?
1344
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1345
+ fail ArgumentError, 'create_update_gremlin_graph_parameters is nil' if create_update_gremlin_graph_parameters.nil?
1346
+
1347
+
1348
+ request_headers = {}
1349
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1350
+
1351
+ # Set Headers
1352
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1353
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1354
+
1355
+ # Serialize Request
1356
+ request_mapper = Azure::Cosmosdb::Mgmt::V2019_08_01::Models::GremlinGraphCreateUpdateParameters.mapper()
1357
+ request_content = @client.serialize(request_mapper, create_update_gremlin_graph_parameters)
1358
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1359
+
1360
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}'
1361
+
1362
+ request_url = @base_url || @client.base_url
1363
+
1364
+ options = {
1365
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1366
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'graphName' => graph_name},
1367
+ query_params: {'api-version' => @client.api_version},
1368
+ body: request_content,
1369
+ headers: request_headers.merge(custom_headers || {}),
1370
+ base_url: request_url
1371
+ }
1372
+ promise = @client.make_request_async(:put, path_template, options)
1373
+
1374
+ promise = promise.then do |result|
1375
+ http_response = result.response
1376
+ status_code = http_response.status
1377
+ response_content = http_response.body
1378
+ unless status_code == 202 || status_code == 200
1379
+ error_model = JSON.load(response_content)
1380
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1381
+ end
1382
+
1383
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1384
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1385
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1386
+ # Deserialize Response
1387
+ if status_code == 200
1388
+ begin
1389
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1390
+ result_mapper = Azure::Cosmosdb::Mgmt::V2019_08_01::Models::GremlinGraphGetResults.mapper()
1391
+ result.body = @client.deserialize(result_mapper, parsed_response)
1392
+ rescue Exception => e
1393
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1394
+ end
1395
+ end
1396
+
1397
+ result
1398
+ end
1399
+
1400
+ promise.execute
1401
+ end
1402
+
1403
+ #
1404
+ # Deletes an existing Azure Cosmos DB Gremlin graph.
1405
+ #
1406
+ # @param resource_group_name [String] Name of an Azure resource group.
1407
+ # @param account_name [String] Cosmos DB database account name.
1408
+ # @param database_name [String] Cosmos DB database name.
1409
+ # @param graph_name [String] Cosmos DB graph name.
1410
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1411
+ # will be added to the HTTP request.
1412
+ #
1413
+ #
1414
+ def begin_delete_gremlin_graph(resource_group_name, account_name, database_name, graph_name, custom_headers:nil)
1415
+ response = begin_delete_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value!
1416
+ nil
1417
+ end
1418
+
1419
+ #
1420
+ # Deletes an existing Azure Cosmos DB Gremlin graph.
1421
+ #
1422
+ # @param resource_group_name [String] Name of an Azure resource group.
1423
+ # @param account_name [String] Cosmos DB database account name.
1424
+ # @param database_name [String] Cosmos DB database name.
1425
+ # @param graph_name [String] Cosmos DB graph name.
1426
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1427
+ # will be added to the HTTP request.
1428
+ #
1429
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1430
+ #
1431
+ def begin_delete_gremlin_graph_with_http_info(resource_group_name, account_name, database_name, graph_name, custom_headers:nil)
1432
+ begin_delete_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:custom_headers).value!
1433
+ end
1434
+
1435
+ #
1436
+ # Deletes an existing Azure Cosmos DB Gremlin graph.
1437
+ #
1438
+ # @param resource_group_name [String] Name of an Azure resource group.
1439
+ # @param account_name [String] Cosmos DB database account name.
1440
+ # @param database_name [String] Cosmos DB database name.
1441
+ # @param graph_name [String] Cosmos DB graph name.
1442
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1443
+ # to the HTTP request.
1444
+ #
1445
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1446
+ #
1447
+ def begin_delete_gremlin_graph_async(resource_group_name, account_name, database_name, graph_name, custom_headers:nil)
1448
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1449
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1450
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1451
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1452
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1453
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1454
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
1455
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1456
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
1457
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
1458
+ fail ArgumentError, 'graph_name is nil' if graph_name.nil?
1459
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1460
+
1461
+
1462
+ request_headers = {}
1463
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1464
+
1465
+ # Set Headers
1466
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1467
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1468
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}'
1469
+
1470
+ request_url = @base_url || @client.base_url
1471
+
1472
+ options = {
1473
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1474
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'graphName' => graph_name},
1475
+ query_params: {'api-version' => @client.api_version},
1476
+ headers: request_headers.merge(custom_headers || {}),
1477
+ base_url: request_url
1478
+ }
1479
+ promise = @client.make_request_async(:delete, path_template, options)
1480
+
1481
+ promise = promise.then do |result|
1482
+ http_response = result.response
1483
+ status_code = http_response.status
1484
+ response_content = http_response.body
1485
+ unless status_code == 202 || status_code == 204
1486
+ error_model = JSON.load(response_content)
1487
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1488
+ end
1489
+
1490
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1491
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1492
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1493
+
1494
+ result
1495
+ end
1496
+
1497
+ promise.execute
1498
+ end
1499
+
1500
+ #
1501
+ # Update RUs per second of an Azure Cosmos DB Gremlin graph
1502
+ #
1503
+ # @param resource_group_name [String] Name of an Azure resource group.
1504
+ # @param account_name [String] Cosmos DB database account name.
1505
+ # @param database_name [String] Cosmos DB database name.
1506
+ # @param graph_name [String] Cosmos DB graph name.
1507
+ # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The
1508
+ # RUs per second of the parameters to provide for the current Gremlin graph.
1509
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1510
+ # will be added to the HTTP request.
1511
+ #
1512
+ # @return [ThroughputSettingsGetResults] operation results.
1513
+ #
1514
+ def begin_update_gremlin_graph_throughput(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:nil)
1515
+ response = begin_update_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:custom_headers).value!
1516
+ response.body unless response.nil?
1517
+ end
1518
+
1519
+ #
1520
+ # Update RUs per second of an Azure Cosmos DB Gremlin graph
1521
+ #
1522
+ # @param resource_group_name [String] Name of an Azure resource group.
1523
+ # @param account_name [String] Cosmos DB database account name.
1524
+ # @param database_name [String] Cosmos DB database name.
1525
+ # @param graph_name [String] Cosmos DB graph name.
1526
+ # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The
1527
+ # RUs per second of the parameters to provide for the current Gremlin graph.
1528
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1529
+ # will be added to the HTTP request.
1530
+ #
1531
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1532
+ #
1533
+ def begin_update_gremlin_graph_throughput_with_http_info(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:nil)
1534
+ begin_update_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:custom_headers).value!
1535
+ end
1536
+
1537
+ #
1538
+ # Update RUs per second of an Azure Cosmos DB Gremlin graph
1539
+ #
1540
+ # @param resource_group_name [String] Name of an Azure resource group.
1541
+ # @param account_name [String] Cosmos DB database account name.
1542
+ # @param database_name [String] Cosmos DB database name.
1543
+ # @param graph_name [String] Cosmos DB graph name.
1544
+ # @param update_throughput_parameters [ThroughputSettingsUpdateParameters] The
1545
+ # RUs per second of the parameters to provide for the current Gremlin graph.
1546
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1547
+ # to the HTTP request.
1548
+ #
1549
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1550
+ #
1551
+ def begin_update_gremlin_graph_throughput_async(resource_group_name, account_name, database_name, graph_name, update_throughput_parameters, custom_headers:nil)
1552
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1553
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1554
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1555
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1556
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1557
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1558
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '50'" if !account_name.nil? && account_name.length > 50
1559
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1560
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'Pattern': '^[a-z0-9]+(-[a-z0-9]+)*'" if !account_name.nil? && account_name.match(Regexp.new('^^[a-z0-9]+(-[a-z0-9]+)*$')).nil?
1561
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
1562
+ fail ArgumentError, 'graph_name is nil' if graph_name.nil?
1563
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1564
+ fail ArgumentError, 'update_throughput_parameters is nil' if update_throughput_parameters.nil?
1565
+
1566
+
1567
+ request_headers = {}
1568
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1569
+
1570
+ # Set Headers
1571
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1572
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1573
+
1574
+ # Serialize Request
1575
+ request_mapper = Azure::Cosmosdb::Mgmt::V2019_08_01::Models::ThroughputSettingsUpdateParameters.mapper()
1576
+ request_content = @client.serialize(request_mapper, update_throughput_parameters)
1577
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1578
+
1579
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default'
1580
+
1581
+ request_url = @base_url || @client.base_url
1582
+
1583
+ options = {
1584
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1585
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'databaseName' => database_name,'graphName' => graph_name},
1586
+ query_params: {'api-version' => @client.api_version},
1587
+ body: request_content,
1588
+ headers: request_headers.merge(custom_headers || {}),
1589
+ base_url: request_url
1590
+ }
1591
+ promise = @client.make_request_async(:put, path_template, options)
1592
+
1593
+ promise = promise.then do |result|
1594
+ http_response = result.response
1595
+ status_code = http_response.status
1596
+ response_content = http_response.body
1597
+ unless status_code == 202 || status_code == 200
1598
+ error_model = JSON.load(response_content)
1599
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1600
+ end
1601
+
1602
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1603
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1604
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1605
+ # Deserialize Response
1606
+ if status_code == 200
1607
+ begin
1608
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1609
+ result_mapper = Azure::Cosmosdb::Mgmt::V2019_08_01::Models::ThroughputSettingsGetResults.mapper()
1610
+ result.body = @client.deserialize(result_mapper, parsed_response)
1611
+ rescue Exception => e
1612
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1613
+ end
1614
+ end
1615
+
1616
+ result
1617
+ end
1618
+
1619
+ promise.execute
1620
+ end
1621
+
1622
+ end
1623
+ end