azure_mgmt_sql 0.15.2 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2014-04-01/generated/azure_mgmt_sql.rb +77 -63
  3. data/lib/2014-04-01/generated/azure_mgmt_sql/backup_long_term_retention_policies.rb +118 -16
  4. data/lib/2014-04-01/generated/azure_mgmt_sql/backup_long_term_retention_vaults.rb +114 -16
  5. data/lib/2014-04-01/generated/azure_mgmt_sql/capabilities.rb +6 -5
  6. data/lib/2014-04-01/generated/azure_mgmt_sql/data_masking_policies.rb +12 -12
  7. data/lib/2014-04-01/generated/azure_mgmt_sql/data_masking_rules.rb +12 -12
  8. data/lib/2014-04-01/generated/azure_mgmt_sql/database_advisors.rb +18 -17
  9. data/lib/2014-04-01/generated/azure_mgmt_sql/database_connection_policies.rb +12 -12
  10. data/lib/2014-04-01/generated/azure_mgmt_sql/database_table_auditing_policies.rb +18 -17
  11. data/lib/2014-04-01/generated/azure_mgmt_sql/database_threat_detection_policies.rb +12 -12
  12. data/lib/2014-04-01/generated/azure_mgmt_sql/database_usages.rb +6 -5
  13. data/lib/2014-04-01/generated/azure_mgmt_sql/databases.rb +649 -643
  14. data/lib/2014-04-01/generated/azure_mgmt_sql/disaster_recovery_configurations.rb +830 -0
  15. data/lib/2014-04-01/generated/azure_mgmt_sql/elastic_pool_activities.rb +6 -5
  16. data/lib/2014-04-01/generated/azure_mgmt_sql/elastic_pool_database_activities.rb +6 -5
  17. data/lib/2014-04-01/generated/azure_mgmt_sql/elastic_pools.rb +216 -213
  18. data/lib/2014-04-01/generated/azure_mgmt_sql/extensions.rb +130 -0
  19. data/lib/2014-04-01/generated/azure_mgmt_sql/firewall_rules.rb +24 -22
  20. data/lib/2014-04-01/generated/azure_mgmt_sql/geo_backup_policies.rb +18 -17
  21. data/lib/2014-04-01/generated/azure_mgmt_sql/models/backup_long_term_retention_policy_list_result.rb +56 -0
  22. data/lib/2014-04-01/generated/azure_mgmt_sql/models/backup_long_term_retention_vault_list_result.rb +56 -0
  23. data/lib/2014-04-01/generated/azure_mgmt_sql/models/database.rb +43 -10
  24. data/lib/2014-04-01/generated/azure_mgmt_sql/models/database_edition.rb +1 -0
  25. data/lib/2014-04-01/generated/azure_mgmt_sql/models/database_update.rb +43 -10
  26. data/lib/2014-04-01/generated/azure_mgmt_sql/models/disaster_recovery_configuration.rb +164 -0
  27. data/lib/2014-04-01/generated/azure_mgmt_sql/models/disaster_recovery_configuration_auto_failover.rb +16 -0
  28. data/lib/2014-04-01/generated/azure_mgmt_sql/models/disaster_recovery_configuration_failover_policy.rb +16 -0
  29. data/lib/2014-04-01/generated/azure_mgmt_sql/models/disaster_recovery_configuration_list_result.rb +57 -0
  30. data/lib/2014-04-01/generated/azure_mgmt_sql/models/disaster_recovery_configuration_role.rb +17 -0
  31. data/lib/2014-04-01/generated/azure_mgmt_sql/models/disaster_recovery_configuration_status.rb +18 -0
  32. data/lib/2014-04-01/generated/azure_mgmt_sql/models/edition_capability.rb +13 -0
  33. data/lib/2014-04-01/generated/azure_mgmt_sql/models/elastic_pool.rb +13 -0
  34. data/lib/2014-04-01/generated/azure_mgmt_sql/models/elastic_pool_edition_capability.rb +13 -0
  35. data/lib/2014-04-01/generated/azure_mgmt_sql/models/elastic_pool_update.rb +13 -0
  36. data/lib/2014-04-01/generated/azure_mgmt_sql/models/extension_list_result.rb +54 -0
  37. data/lib/2014-04-01/generated/azure_mgmt_sql/models/import_request.rb +12 -4
  38. data/lib/2014-04-01/generated/azure_mgmt_sql/models/query_text.rb +72 -0
  39. data/lib/2014-04-01/generated/azure_mgmt_sql/models/query_text_list_result.rb +55 -0
  40. data/lib/2014-04-01/generated/azure_mgmt_sql/models/service_objective_name.rb +52 -2
  41. data/lib/2014-04-01/generated/azure_mgmt_sql/models/slo_usage_metric.rb +10 -3
  42. data/lib/2014-04-01/generated/azure_mgmt_sql/operations.rb +6 -5
  43. data/lib/2014-04-01/generated/azure_mgmt_sql/queries.rb +6 -5
  44. data/lib/2014-04-01/generated/azure_mgmt_sql/query_statistics.rb +6 -5
  45. data/lib/2014-04-01/generated/azure_mgmt_sql/query_texts.rb +134 -0
  46. data/lib/2014-04-01/generated/azure_mgmt_sql/recommended_elastic_pools.rb +18 -15
  47. data/lib/2014-04-01/generated/azure_mgmt_sql/recoverable_databases.rb +12 -10
  48. data/lib/2014-04-01/generated/azure_mgmt_sql/replication_links.rb +38 -33
  49. data/lib/2014-04-01/generated/azure_mgmt_sql/restorable_dropped_databases.rb +12 -10
  50. data/lib/2014-04-01/generated/azure_mgmt_sql/restore_points.rb +6 -5
  51. data/lib/2014-04-01/generated/azure_mgmt_sql/server_azure_adadministrators.rb +32 -30
  52. data/lib/2014-04-01/generated/azure_mgmt_sql/server_communication_links.rb +28 -26
  53. data/lib/2014-04-01/generated/azure_mgmt_sql/server_connection_policies.rb +12 -12
  54. data/lib/2014-04-01/generated/azure_mgmt_sql/server_table_auditing_policies.rb +18 -17
  55. data/lib/2014-04-01/generated/azure_mgmt_sql/server_usages.rb +6 -5
  56. data/lib/2014-04-01/generated/azure_mgmt_sql/servers.rb +134 -133
  57. data/lib/2014-04-01/generated/azure_mgmt_sql/service_objectives.rb +12 -10
  58. data/lib/2014-04-01/generated/azure_mgmt_sql/service_tier_advisors.rb +12 -10
  59. data/lib/2014-04-01/generated/azure_mgmt_sql/sql_management_client.rb +32 -17
  60. data/lib/2014-04-01/generated/azure_mgmt_sql/transparent_data_encryption_activities.rb +6 -5
  61. data/lib/2014-04-01/generated/azure_mgmt_sql/transparent_data_encryption_configurations.rb +6 -5
  62. data/lib/2014-04-01/generated/azure_mgmt_sql/transparent_data_encryptions.rb +12 -12
  63. data/lib/2015-05-01-preview/generated/azure_mgmt_sql.rb +22 -19
  64. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/database_advisors.rb +18 -17
  65. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/database_blob_auditing_policies.rb +12 -12
  66. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/database_recommended_actions.rb +18 -17
  67. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/encryption_protectors.rb +31 -29
  68. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/failover_groups.rb +71 -67
  69. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/subscription_usage.rb +110 -0
  70. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/models/subscription_usage_list_result.rb +100 -0
  71. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/operations.rb +15 -13
  72. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/server_advisors.rb +18 -17
  73. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/server_keys.rb +41 -38
  74. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/servers.rb +66 -62
  75. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/sql_management_client.rb +8 -1
  76. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/subscription_usages.rb +324 -0
  77. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_agents.rb +62 -56
  78. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb +118 -107
  79. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_members.rb +76 -71
  80. data/lib/2015-05-01-preview/generated/azure_mgmt_sql/virtual_network_rules.rb +41 -38
  81. data/lib/2017-03-01-preview/generated/azure_mgmt_sql.rb +30 -1
  82. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/database_operations.rb +21 -18
  83. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/database_restore_points.rb +527 -0
  84. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/databases.rb +1599 -0
  85. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/arm_sku.rb +92 -0
  86. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/automatic_tuning_option_mode_actual.rb +16 -0
  87. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/automatic_tuning_option_mode_desired.rb +17 -0
  88. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/automatic_tuning_server_mode.rb +17 -0
  89. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/automatic_tuning_server_options.rb +90 -0
  90. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/automatic_tuning_server_reason.rb +17 -0
  91. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/catalog_collation_type.rb +16 -0
  92. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/create_database_restore_point_definition.rb +47 -0
  93. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/create_mode.rb +23 -0
  94. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/database.rb +393 -0
  95. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/database_list_result.rb +100 -0
  96. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/database_restore_point.rb +124 -0
  97. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/database_restore_point_list_result.rb +100 -0
  98. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/database_update.rb +348 -0
  99. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/import_export_database_definition.rb +145 -0
  100. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/import_export_operation_result.rb +170 -0
  101. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/resource_move_definition.rb +46 -0
  102. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/restore_point_type.rb +16 -0
  103. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/sample_name.rb +17 -0
  104. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/server_automatic_tuning.rb +110 -0
  105. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/server_dns_alias.rb +74 -0
  106. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/server_dns_alias_acquisition.rb +47 -0
  107. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/server_dns_alias_list_result.rb +100 -0
  108. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/status.rb +32 -0
  109. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/models/tracked_resource.rb +92 -0
  110. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/server_automatic_tuning_operations.rb +238 -0
  111. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/server_dns_aliases.rb +805 -0
  112. data/lib/2017-03-01-preview/generated/azure_mgmt_sql/sql_management_client.rb +21 -1
  113. data/lib/profiles/latest/modules/sql_profile_module.rb +912 -749
  114. data/lib/profiles/latest/sql_latest_profile_client.rb +28 -9
  115. data/lib/profiles/latest/sql_module_definition.rb +0 -1
  116. data/lib/version.rb +1 -1
  117. metadata +49 -3
@@ -38,8 +38,8 @@ module Azure::SQL::Mgmt::V2015_05_01_preview
38
38
  #
39
39
  # @return [VirtualNetworkRule] operation results.
40
40
  #
41
- def get(resource_group_name, server_name, virtual_network_rule_name, custom_headers = nil)
42
- response = get_async(resource_group_name, server_name, virtual_network_rule_name, custom_headers).value!
41
+ def get(resource_group_name, server_name, virtual_network_rule_name, custom_headers:nil)
42
+ response = get_async(resource_group_name, server_name, virtual_network_rule_name, custom_headers:custom_headers).value!
43
43
  response.body unless response.nil?
44
44
  end
45
45
 
@@ -57,8 +57,8 @@ module Azure::SQL::Mgmt::V2015_05_01_preview
57
57
  #
58
58
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
59
59
  #
60
- def get_with_http_info(resource_group_name, server_name, virtual_network_rule_name, custom_headers = nil)
61
- get_async(resource_group_name, server_name, virtual_network_rule_name, custom_headers).value!
60
+ def get_with_http_info(resource_group_name, server_name, virtual_network_rule_name, custom_headers:nil)
61
+ get_async(resource_group_name, server_name, virtual_network_rule_name, custom_headers:custom_headers).value!
62
62
  end
63
63
 
64
64
  #
@@ -75,7 +75,7 @@ module Azure::SQL::Mgmt::V2015_05_01_preview
75
75
  #
76
76
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
77
77
  #
78
- def get_async(resource_group_name, server_name, virtual_network_rule_name, custom_headers = nil)
78
+ def get_async(resource_group_name, server_name, virtual_network_rule_name, custom_headers:nil)
79
79
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
80
80
  fail ArgumentError, 'server_name is nil' if server_name.nil?
81
81
  fail ArgumentError, 'virtual_network_rule_name is nil' if virtual_network_rule_name.nil?
@@ -84,6 +84,7 @@ module Azure::SQL::Mgmt::V2015_05_01_preview
84
84
 
85
85
 
86
86
  request_headers = {}
87
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
87
88
 
88
89
  # Set Headers
89
90
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -144,8 +145,8 @@ module Azure::SQL::Mgmt::V2015_05_01_preview
144
145
  #
145
146
  # @return [VirtualNetworkRule] operation results.
146
147
  #
147
- def create_or_update(resource_group_name, server_name, virtual_network_rule_name, parameters, custom_headers = nil)
148
- response = create_or_update_async(resource_group_name, server_name, virtual_network_rule_name, parameters, custom_headers).value!
148
+ def create_or_update(resource_group_name, server_name, virtual_network_rule_name, parameters, custom_headers:nil)
149
+ response = create_or_update_async(resource_group_name, server_name, virtual_network_rule_name, parameters, custom_headers:custom_headers).value!
149
150
  response.body unless response.nil?
150
151
  end
151
152
 
@@ -164,9 +165,9 @@ module Azure::SQL::Mgmt::V2015_05_01_preview
164
165
  # @return [Concurrent::Promise] promise which provides async access to http
165
166
  # response.
166
167
  #
167
- def create_or_update_async(resource_group_name, server_name, virtual_network_rule_name, parameters, custom_headers = nil)
168
+ def create_or_update_async(resource_group_name, server_name, virtual_network_rule_name, parameters, custom_headers:nil)
168
169
  # Send request
169
- promise = begin_create_or_update_async(resource_group_name, server_name, virtual_network_rule_name, parameters, custom_headers)
170
+ promise = begin_create_or_update_async(resource_group_name, server_name, virtual_network_rule_name, parameters, custom_headers:custom_headers)
170
171
 
171
172
  promise = promise.then do |response|
172
173
  # Defining deserialization method.
@@ -194,8 +195,8 @@ module Azure::SQL::Mgmt::V2015_05_01_preview
194
195
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
195
196
  # will be added to the HTTP request.
196
197
  #
197
- def delete(resource_group_name, server_name, virtual_network_rule_name, custom_headers = nil)
198
- response = delete_async(resource_group_name, server_name, virtual_network_rule_name, custom_headers).value!
198
+ def delete(resource_group_name, server_name, virtual_network_rule_name, custom_headers:nil)
199
+ response = delete_async(resource_group_name, server_name, virtual_network_rule_name, custom_headers:custom_headers).value!
199
200
  nil
200
201
  end
201
202
 
@@ -212,9 +213,9 @@ module Azure::SQL::Mgmt::V2015_05_01_preview
212
213
  # @return [Concurrent::Promise] promise which provides async access to http
213
214
  # response.
214
215
  #
215
- def delete_async(resource_group_name, server_name, virtual_network_rule_name, custom_headers = nil)
216
+ def delete_async(resource_group_name, server_name, virtual_network_rule_name, custom_headers:nil)
216
217
  # Send request
217
- promise = begin_delete_async(resource_group_name, server_name, virtual_network_rule_name, custom_headers)
218
+ promise = begin_delete_async(resource_group_name, server_name, virtual_network_rule_name, custom_headers:custom_headers)
218
219
 
219
220
  promise = promise.then do |response|
220
221
  # Defining deserialization method.
@@ -240,8 +241,8 @@ module Azure::SQL::Mgmt::V2015_05_01_preview
240
241
  #
241
242
  # @return [Array<VirtualNetworkRule>] operation results.
242
243
  #
243
- def list_by_server(resource_group_name, server_name, custom_headers = nil)
244
- first_page = list_by_server_as_lazy(resource_group_name, server_name, custom_headers)
244
+ def list_by_server(resource_group_name, server_name, custom_headers:nil)
245
+ first_page = list_by_server_as_lazy(resource_group_name, server_name, custom_headers:custom_headers)
245
246
  first_page.get_all_items
246
247
  end
247
248
 
@@ -257,8 +258,8 @@ module Azure::SQL::Mgmt::V2015_05_01_preview
257
258
  #
258
259
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
259
260
  #
260
- def list_by_server_with_http_info(resource_group_name, server_name, custom_headers = nil)
261
- list_by_server_async(resource_group_name, server_name, custom_headers).value!
261
+ def list_by_server_with_http_info(resource_group_name, server_name, custom_headers:nil)
262
+ list_by_server_async(resource_group_name, server_name, custom_headers:custom_headers).value!
262
263
  end
263
264
 
264
265
  #
@@ -273,7 +274,7 @@ module Azure::SQL::Mgmt::V2015_05_01_preview
273
274
  #
274
275
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
275
276
  #
276
- def list_by_server_async(resource_group_name, server_name, custom_headers = nil)
277
+ def list_by_server_async(resource_group_name, server_name, custom_headers:nil)
277
278
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
278
279
  fail ArgumentError, 'server_name is nil' if server_name.nil?
279
280
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
@@ -281,6 +282,7 @@ module Azure::SQL::Mgmt::V2015_05_01_preview
281
282
 
282
283
 
283
284
  request_headers = {}
285
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
284
286
 
285
287
  # Set Headers
286
288
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -341,8 +343,8 @@ module Azure::SQL::Mgmt::V2015_05_01_preview
341
343
  #
342
344
  # @return [VirtualNetworkRule] operation results.
343
345
  #
344
- def begin_create_or_update(resource_group_name, server_name, virtual_network_rule_name, parameters, custom_headers = nil)
345
- response = begin_create_or_update_async(resource_group_name, server_name, virtual_network_rule_name, parameters, custom_headers).value!
346
+ def begin_create_or_update(resource_group_name, server_name, virtual_network_rule_name, parameters, custom_headers:nil)
347
+ response = begin_create_or_update_async(resource_group_name, server_name, virtual_network_rule_name, parameters, custom_headers:custom_headers).value!
346
348
  response.body unless response.nil?
347
349
  end
348
350
 
@@ -362,8 +364,8 @@ module Azure::SQL::Mgmt::V2015_05_01_preview
362
364
  #
363
365
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
364
366
  #
365
- def begin_create_or_update_with_http_info(resource_group_name, server_name, virtual_network_rule_name, parameters, custom_headers = nil)
366
- begin_create_or_update_async(resource_group_name, server_name, virtual_network_rule_name, parameters, custom_headers).value!
367
+ def begin_create_or_update_with_http_info(resource_group_name, server_name, virtual_network_rule_name, parameters, custom_headers:nil)
368
+ begin_create_or_update_async(resource_group_name, server_name, virtual_network_rule_name, parameters, custom_headers:custom_headers).value!
367
369
  end
368
370
 
369
371
  #
@@ -382,7 +384,7 @@ module Azure::SQL::Mgmt::V2015_05_01_preview
382
384
  #
383
385
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
384
386
  #
385
- def begin_create_or_update_async(resource_group_name, server_name, virtual_network_rule_name, parameters, custom_headers = nil)
387
+ def begin_create_or_update_async(resource_group_name, server_name, virtual_network_rule_name, parameters, custom_headers:nil)
386
388
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
387
389
  fail ArgumentError, 'server_name is nil' if server_name.nil?
388
390
  fail ArgumentError, 'virtual_network_rule_name is nil' if virtual_network_rule_name.nil?
@@ -392,13 +394,12 @@ module Azure::SQL::Mgmt::V2015_05_01_preview
392
394
 
393
395
 
394
396
  request_headers = {}
397
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
395
398
 
396
399
  # Set Headers
397
400
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
398
401
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
399
402
 
400
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
401
-
402
403
  # Serialize Request
403
404
  request_mapper = Azure::SQL::Mgmt::V2015_05_01_preview::Models::VirtualNetworkRule.mapper()
404
405
  request_content = @client.serialize(request_mapper, parameters)
@@ -468,8 +469,8 @@ module Azure::SQL::Mgmt::V2015_05_01_preview
468
469
  # will be added to the HTTP request.
469
470
  #
470
471
  #
471
- def begin_delete(resource_group_name, server_name, virtual_network_rule_name, custom_headers = nil)
472
- response = begin_delete_async(resource_group_name, server_name, virtual_network_rule_name, custom_headers).value!
472
+ def begin_delete(resource_group_name, server_name, virtual_network_rule_name, custom_headers:nil)
473
+ response = begin_delete_async(resource_group_name, server_name, virtual_network_rule_name, custom_headers:custom_headers).value!
473
474
  nil
474
475
  end
475
476
 
@@ -487,8 +488,8 @@ module Azure::SQL::Mgmt::V2015_05_01_preview
487
488
  #
488
489
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
489
490
  #
490
- def begin_delete_with_http_info(resource_group_name, server_name, virtual_network_rule_name, custom_headers = nil)
491
- begin_delete_async(resource_group_name, server_name, virtual_network_rule_name, custom_headers).value!
491
+ def begin_delete_with_http_info(resource_group_name, server_name, virtual_network_rule_name, custom_headers:nil)
492
+ begin_delete_async(resource_group_name, server_name, virtual_network_rule_name, custom_headers:custom_headers).value!
492
493
  end
493
494
 
494
495
  #
@@ -505,7 +506,7 @@ module Azure::SQL::Mgmt::V2015_05_01_preview
505
506
  #
506
507
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
507
508
  #
508
- def begin_delete_async(resource_group_name, server_name, virtual_network_rule_name, custom_headers = nil)
509
+ def begin_delete_async(resource_group_name, server_name, virtual_network_rule_name, custom_headers:nil)
509
510
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
510
511
  fail ArgumentError, 'server_name is nil' if server_name.nil?
511
512
  fail ArgumentError, 'virtual_network_rule_name is nil' if virtual_network_rule_name.nil?
@@ -514,6 +515,7 @@ module Azure::SQL::Mgmt::V2015_05_01_preview
514
515
 
515
516
 
516
517
  request_headers = {}
518
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
517
519
 
518
520
  # Set Headers
519
521
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -558,8 +560,8 @@ module Azure::SQL::Mgmt::V2015_05_01_preview
558
560
  #
559
561
  # @return [VirtualNetworkRuleListResult] operation results.
560
562
  #
561
- def list_by_server_next(next_page_link, custom_headers = nil)
562
- response = list_by_server_next_async(next_page_link, custom_headers).value!
563
+ def list_by_server_next(next_page_link, custom_headers:nil)
564
+ response = list_by_server_next_async(next_page_link, custom_headers:custom_headers).value!
563
565
  response.body unless response.nil?
564
566
  end
565
567
 
@@ -573,8 +575,8 @@ module Azure::SQL::Mgmt::V2015_05_01_preview
573
575
  #
574
576
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
575
577
  #
576
- def list_by_server_next_with_http_info(next_page_link, custom_headers = nil)
577
- list_by_server_next_async(next_page_link, custom_headers).value!
578
+ def list_by_server_next_with_http_info(next_page_link, custom_headers:nil)
579
+ list_by_server_next_async(next_page_link, custom_headers:custom_headers).value!
578
580
  end
579
581
 
580
582
  #
@@ -587,11 +589,12 @@ module Azure::SQL::Mgmt::V2015_05_01_preview
587
589
  #
588
590
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
589
591
  #
590
- def list_by_server_next_async(next_page_link, custom_headers = nil)
592
+ def list_by_server_next_async(next_page_link, custom_headers:nil)
591
593
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
592
594
 
593
595
 
594
596
  request_headers = {}
597
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
595
598
 
596
599
  # Set Headers
597
600
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -648,12 +651,12 @@ module Azure::SQL::Mgmt::V2015_05_01_preview
648
651
  # @return [VirtualNetworkRuleListResult] which provide lazy access to pages of
649
652
  # the response.
650
653
  #
651
- def list_by_server_as_lazy(resource_group_name, server_name, custom_headers = nil)
652
- response = list_by_server_async(resource_group_name, server_name, custom_headers).value!
654
+ def list_by_server_as_lazy(resource_group_name, server_name, custom_headers:nil)
655
+ response = list_by_server_async(resource_group_name, server_name, custom_headers:custom_headers).value!
653
656
  unless response.nil?
654
657
  page = response.body
655
658
  page.next_method = Proc.new do |next_page_link|
656
- list_by_server_next_async(next_page_link, custom_headers)
659
+ list_by_server_next_async(next_page_link, custom_headers:custom_headers)
657
660
  end
658
661
  page
659
662
  end
@@ -21,13 +21,42 @@ require 'ms_rest_azure'
21
21
 
22
22
  module Azure::SQL::Mgmt::V2017_03_01_preview
23
23
  autoload :DatabaseOperations, '2017-03-01-preview/generated/azure_mgmt_sql/database_operations.rb'
24
+ autoload :Databases, '2017-03-01-preview/generated/azure_mgmt_sql/databases.rb'
25
+ autoload :DatabaseRestorePoints, '2017-03-01-preview/generated/azure_mgmt_sql/database_restore_points.rb'
26
+ autoload :ServerAutomaticTuningOperations, '2017-03-01-preview/generated/azure_mgmt_sql/server_automatic_tuning_operations.rb'
27
+ autoload :ServerDnsAliases, '2017-03-01-preview/generated/azure_mgmt_sql/server_dns_aliases.rb'
24
28
  autoload :SqlManagementClient, '2017-03-01-preview/generated/azure_mgmt_sql/sql_management_client.rb'
25
29
 
26
30
  module Models
27
- autoload :Resource, '2017-03-01-preview/generated/azure_mgmt_sql/models/resource.rb'
31
+ autoload :DatabaseUpdate, '2017-03-01-preview/generated/azure_mgmt_sql/models/database_update.rb'
32
+ autoload :AutomaticTuningServerOptions, '2017-03-01-preview/generated/azure_mgmt_sql/models/automatic_tuning_server_options.rb'
28
33
  autoload :DatabaseOperationListResult, '2017-03-01-preview/generated/azure_mgmt_sql/models/database_operation_list_result.rb'
34
+ autoload :CreateDatabaseRestorePointDefinition, '2017-03-01-preview/generated/azure_mgmt_sql/models/create_database_restore_point_definition.rb'
35
+ autoload :DatabaseRestorePointListResult, '2017-03-01-preview/generated/azure_mgmt_sql/models/database_restore_point_list_result.rb'
36
+ autoload :ArmSku, '2017-03-01-preview/generated/azure_mgmt_sql/models/arm_sku.rb'
37
+ autoload :ImportExportDatabaseDefinition, '2017-03-01-preview/generated/azure_mgmt_sql/models/import_export_database_definition.rb'
38
+ autoload :DatabaseListResult, '2017-03-01-preview/generated/azure_mgmt_sql/models/database_list_result.rb'
39
+ autoload :ServerDnsAliasListResult, '2017-03-01-preview/generated/azure_mgmt_sql/models/server_dns_alias_list_result.rb'
40
+ autoload :ResourceMoveDefinition, '2017-03-01-preview/generated/azure_mgmt_sql/models/resource_move_definition.rb'
41
+ autoload :Resource, '2017-03-01-preview/generated/azure_mgmt_sql/models/resource.rb'
42
+ autoload :ServerDnsAliasAcquisition, '2017-03-01-preview/generated/azure_mgmt_sql/models/server_dns_alias_acquisition.rb'
29
43
  autoload :ProxyResource, '2017-03-01-preview/generated/azure_mgmt_sql/models/proxy_resource.rb'
30
44
  autoload :DatabaseOperation, '2017-03-01-preview/generated/azure_mgmt_sql/models/database_operation.rb'
45
+ autoload :TrackedResource, '2017-03-01-preview/generated/azure_mgmt_sql/models/tracked_resource.rb'
46
+ autoload :Database, '2017-03-01-preview/generated/azure_mgmt_sql/models/database.rb'
47
+ autoload :ImportExportOperationResult, '2017-03-01-preview/generated/azure_mgmt_sql/models/import_export_operation_result.rb'
48
+ autoload :DatabaseRestorePoint, '2017-03-01-preview/generated/azure_mgmt_sql/models/database_restore_point.rb'
49
+ autoload :ServerAutomaticTuning, '2017-03-01-preview/generated/azure_mgmt_sql/models/server_automatic_tuning.rb'
50
+ autoload :ServerDnsAlias, '2017-03-01-preview/generated/azure_mgmt_sql/models/server_dns_alias.rb'
31
51
  autoload :ManagementOperationState, '2017-03-01-preview/generated/azure_mgmt_sql/models/management_operation_state.rb'
52
+ autoload :CreateMode, '2017-03-01-preview/generated/azure_mgmt_sql/models/create_mode.rb'
53
+ autoload :SampleName, '2017-03-01-preview/generated/azure_mgmt_sql/models/sample_name.rb'
54
+ autoload :Status, '2017-03-01-preview/generated/azure_mgmt_sql/models/status.rb'
55
+ autoload :CatalogCollationType, '2017-03-01-preview/generated/azure_mgmt_sql/models/catalog_collation_type.rb'
56
+ autoload :RestorePointType, '2017-03-01-preview/generated/azure_mgmt_sql/models/restore_point_type.rb'
57
+ autoload :AutomaticTuningServerMode, '2017-03-01-preview/generated/azure_mgmt_sql/models/automatic_tuning_server_mode.rb'
58
+ autoload :AutomaticTuningOptionModeDesired, '2017-03-01-preview/generated/azure_mgmt_sql/models/automatic_tuning_option_mode_desired.rb'
59
+ autoload :AutomaticTuningOptionModeActual, '2017-03-01-preview/generated/azure_mgmt_sql/models/automatic_tuning_option_mode_actual.rb'
60
+ autoload :AutomaticTuningServerReason, '2017-03-01-preview/generated/azure_mgmt_sql/models/automatic_tuning_server_reason.rb'
32
61
  end
33
62
  end
@@ -37,8 +37,8 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
37
37
  # will be added to the HTTP request.
38
38
  #
39
39
  #
40
- def cancel(resource_group_name, server_name, database_name, operation_id, custom_headers = nil)
41
- response = cancel_async(resource_group_name, server_name, database_name, operation_id, custom_headers).value!
40
+ def cancel(resource_group_name, server_name, database_name, operation_id, custom_headers:nil)
41
+ response = cancel_async(resource_group_name, server_name, database_name, operation_id, custom_headers:custom_headers).value!
42
42
  nil
43
43
  end
44
44
 
@@ -56,8 +56,8 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
56
56
  #
57
57
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
58
58
  #
59
- def cancel_with_http_info(resource_group_name, server_name, database_name, operation_id, custom_headers = nil)
60
- cancel_async(resource_group_name, server_name, database_name, operation_id, custom_headers).value!
59
+ def cancel_with_http_info(resource_group_name, server_name, database_name, operation_id, custom_headers:nil)
60
+ cancel_async(resource_group_name, server_name, database_name, operation_id, custom_headers:custom_headers).value!
61
61
  end
62
62
 
63
63
  #
@@ -74,7 +74,7 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
74
74
  #
75
75
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
76
76
  #
77
- def cancel_async(resource_group_name, server_name, database_name, operation_id, custom_headers = nil)
77
+ def cancel_async(resource_group_name, server_name, database_name, operation_id, custom_headers:nil)
78
78
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
79
79
  fail ArgumentError, 'server_name is nil' if server_name.nil?
80
80
  fail ArgumentError, 'database_name is nil' if database_name.nil?
@@ -84,6 +84,7 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
84
84
 
85
85
 
86
86
  request_headers = {}
87
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
87
88
 
88
89
  # Set Headers
89
90
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -131,8 +132,8 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
131
132
  #
132
133
  # @return [Array<DatabaseOperation>] operation results.
133
134
  #
134
- def list_by_database(resource_group_name, server_name, database_name, custom_headers = nil)
135
- first_page = list_by_database_as_lazy(resource_group_name, server_name, database_name, custom_headers)
135
+ def list_by_database(resource_group_name, server_name, database_name, custom_headers:nil)
136
+ first_page = list_by_database_as_lazy(resource_group_name, server_name, database_name, custom_headers:custom_headers)
136
137
  first_page.get_all_items
137
138
  end
138
139
 
@@ -149,8 +150,8 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
149
150
  #
150
151
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
151
152
  #
152
- def list_by_database_with_http_info(resource_group_name, server_name, database_name, custom_headers = nil)
153
- list_by_database_async(resource_group_name, server_name, database_name, custom_headers).value!
153
+ def list_by_database_with_http_info(resource_group_name, server_name, database_name, custom_headers:nil)
154
+ list_by_database_async(resource_group_name, server_name, database_name, custom_headers:custom_headers).value!
154
155
  end
155
156
 
156
157
  #
@@ -166,7 +167,7 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
166
167
  #
167
168
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
168
169
  #
169
- def list_by_database_async(resource_group_name, server_name, database_name, custom_headers = nil)
170
+ def list_by_database_async(resource_group_name, server_name, database_name, custom_headers:nil)
170
171
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
171
172
  fail ArgumentError, 'server_name is nil' if server_name.nil?
172
173
  fail ArgumentError, 'database_name is nil' if database_name.nil?
@@ -175,6 +176,7 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
175
176
 
176
177
 
177
178
  request_headers = {}
179
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
178
180
 
179
181
  # Set Headers
180
182
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -229,8 +231,8 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
229
231
  #
230
232
  # @return [DatabaseOperationListResult] operation results.
231
233
  #
232
- def list_by_database_next(next_page_link, custom_headers = nil)
233
- response = list_by_database_next_async(next_page_link, custom_headers).value!
234
+ def list_by_database_next(next_page_link, custom_headers:nil)
235
+ response = list_by_database_next_async(next_page_link, custom_headers:custom_headers).value!
234
236
  response.body unless response.nil?
235
237
  end
236
238
 
@@ -244,8 +246,8 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
244
246
  #
245
247
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
246
248
  #
247
- def list_by_database_next_with_http_info(next_page_link, custom_headers = nil)
248
- list_by_database_next_async(next_page_link, custom_headers).value!
249
+ def list_by_database_next_with_http_info(next_page_link, custom_headers:nil)
250
+ list_by_database_next_async(next_page_link, custom_headers:custom_headers).value!
249
251
  end
250
252
 
251
253
  #
@@ -258,11 +260,12 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
258
260
  #
259
261
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
260
262
  #
261
- def list_by_database_next_async(next_page_link, custom_headers = nil)
263
+ def list_by_database_next_async(next_page_link, custom_headers:nil)
262
264
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
263
265
 
264
266
 
265
267
  request_headers = {}
268
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
266
269
 
267
270
  # Set Headers
268
271
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -320,12 +323,12 @@ module Azure::SQL::Mgmt::V2017_03_01_preview
320
323
  # @return [DatabaseOperationListResult] which provide lazy access to pages of
321
324
  # the response.
322
325
  #
323
- def list_by_database_as_lazy(resource_group_name, server_name, database_name, custom_headers = nil)
324
- response = list_by_database_async(resource_group_name, server_name, database_name, custom_headers).value!
326
+ def list_by_database_as_lazy(resource_group_name, server_name, database_name, custom_headers:nil)
327
+ response = list_by_database_async(resource_group_name, server_name, database_name, custom_headers:custom_headers).value!
325
328
  unless response.nil?
326
329
  page = response.body
327
330
  page.next_method = Proc.new do |next_page_link|
328
- list_by_database_next_async(next_page_link, custom_headers)
331
+ list_by_database_next_async(next_page_link, custom_headers:custom_headers)
329
332
  end
330
333
  page
331
334
  end
@@ -0,0 +1,527 @@
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::SQL::Mgmt::V2017_03_01_preview
7
+ #
8
+ # The Azure SQL Database management API provides a RESTful set of web APIs
9
+ # that interact with Azure SQL Database services to manage your databases.
10
+ # The API enables users to create, retrieve, update, and delete databases,
11
+ # servers, and other entities.
12
+ #
13
+ class DatabaseRestorePoints
14
+ include MsRestAzure
15
+
16
+ #
17
+ # Creates and initializes a new instance of the DatabaseRestorePoints class.
18
+ # @param client service class for accessing basic functionality.
19
+ #
20
+ def initialize(client)
21
+ @client = client
22
+ end
23
+
24
+ # @return [SqlManagementClient] reference to the SqlManagementClient
25
+ attr_reader :client
26
+
27
+ #
28
+ # Gets a collection of restore points that belongs to the database.
29
+ #
30
+ # @param resource_group_name [String] The name of the resource group that
31
+ # contains the resource. You can obtain this value from the Azure Resource
32
+ # Manager API or the portal.
33
+ # @param server_name [String] The name of the server.
34
+ # @param database_name [String] The name of the database.
35
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
36
+ # will be added to the HTTP request.
37
+ #
38
+ # @return [Array<DatabaseRestorePoint>] operation results.
39
+ #
40
+ def list_by_database(resource_group_name, server_name, database_name, custom_headers:nil)
41
+ first_page = list_by_database_as_lazy(resource_group_name, server_name, database_name, custom_headers:custom_headers)
42
+ first_page.get_all_items
43
+ end
44
+
45
+ #
46
+ # Gets a collection of restore points that belongs to the database.
47
+ #
48
+ # @param resource_group_name [String] The name of the resource group that
49
+ # contains the resource. You can obtain this value from the Azure Resource
50
+ # Manager API or the portal.
51
+ # @param server_name [String] The name of the server.
52
+ # @param database_name [String] The name of the database.
53
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
54
+ # will be added to the HTTP request.
55
+ #
56
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
57
+ #
58
+ def list_by_database_with_http_info(resource_group_name, server_name, database_name, custom_headers:nil)
59
+ list_by_database_async(resource_group_name, server_name, database_name, custom_headers:custom_headers).value!
60
+ end
61
+
62
+ #
63
+ # Gets a collection of restore points that belongs to the database.
64
+ #
65
+ # @param resource_group_name [String] The name of the resource group that
66
+ # contains the resource. You can obtain this value from the Azure Resource
67
+ # Manager API or the portal.
68
+ # @param server_name [String] The name of the server.
69
+ # @param database_name [String] The name of the database.
70
+ # @param [Hash{String => String}] A hash of custom headers that will be added
71
+ # to the HTTP request.
72
+ #
73
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
74
+ #
75
+ def list_by_database_async(resource_group_name, server_name, database_name, custom_headers:nil)
76
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
77
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
78
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
79
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
80
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
81
+
82
+
83
+ request_headers = {}
84
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
85
+
86
+ # Set Headers
87
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
88
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
89
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints'
90
+
91
+ request_url = @base_url || @client.base_url
92
+
93
+ options = {
94
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
95
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'subscriptionId' => @client.subscription_id},
96
+ query_params: {'api-version' => @client.api_version},
97
+ headers: request_headers.merge(custom_headers || {}),
98
+ base_url: request_url
99
+ }
100
+ promise = @client.make_request_async(:get, path_template, options)
101
+
102
+ promise = promise.then do |result|
103
+ http_response = result.response
104
+ status_code = http_response.status
105
+ response_content = http_response.body
106
+ unless status_code == 200
107
+ error_model = JSON.load(response_content)
108
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
109
+ end
110
+
111
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
112
+ # Deserialize Response
113
+ if status_code == 200
114
+ begin
115
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
116
+ result_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::DatabaseRestorePointListResult.mapper()
117
+ result.body = @client.deserialize(result_mapper, parsed_response)
118
+ rescue Exception => e
119
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
120
+ end
121
+ end
122
+
123
+ result
124
+ end
125
+
126
+ promise.execute
127
+ end
128
+
129
+ #
130
+ # Creates a restore point for a data warehouse.
131
+ #
132
+ # @param resource_group_name [String] The name of the resource group that
133
+ # contains the resource. You can obtain this value from the Azure Resource
134
+ # Manager API or the portal.
135
+ # @param server_name [String] The name of the server.
136
+ # @param database_name [String] The name of the database.
137
+ # @param parameters [CreateDatabaseRestorePointDefinition] The definition for
138
+ # creating the restore point of this database.
139
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
140
+ # will be added to the HTTP request.
141
+ #
142
+ # @return [DatabaseRestorePoint] operation results.
143
+ #
144
+ def create(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
145
+ response = create_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers).value!
146
+ response.body unless response.nil?
147
+ end
148
+
149
+ #
150
+ # @param resource_group_name [String] The name of the resource group that
151
+ # contains the resource. You can obtain this value from the Azure Resource
152
+ # Manager API or the portal.
153
+ # @param server_name [String] The name of the server.
154
+ # @param database_name [String] The name of the database.
155
+ # @param parameters [CreateDatabaseRestorePointDefinition] The definition for
156
+ # creating the restore point of this database.
157
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
158
+ # will be added to the HTTP request.
159
+ #
160
+ # @return [Concurrent::Promise] promise which provides async access to http
161
+ # response.
162
+ #
163
+ def create_async(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
164
+ # Send request
165
+ promise = begin_create_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers)
166
+
167
+ promise = promise.then do |response|
168
+ # Defining deserialization method.
169
+ deserialize_method = lambda do |parsed_response|
170
+ result_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::DatabaseRestorePoint.mapper()
171
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
172
+ end
173
+
174
+ # Waiting for response.
175
+ @client.get_long_running_operation_result(response, deserialize_method)
176
+ end
177
+
178
+ promise
179
+ end
180
+
181
+ #
182
+ # Gets a restore point.
183
+ #
184
+ # @param resource_group_name [String] The name of the resource group that
185
+ # contains the resource. You can obtain this value from the Azure Resource
186
+ # Manager API or the portal.
187
+ # @param server_name [String] The name of the server.
188
+ # @param database_name [String] The name of the database.
189
+ # @param restore_point_name [String] The name of the restore point.
190
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
191
+ # will be added to the HTTP request.
192
+ #
193
+ # @return [DatabaseRestorePoint] operation results.
194
+ #
195
+ def get(resource_group_name, server_name, database_name, restore_point_name, custom_headers:nil)
196
+ response = get_async(resource_group_name, server_name, database_name, restore_point_name, custom_headers:custom_headers).value!
197
+ response.body unless response.nil?
198
+ end
199
+
200
+ #
201
+ # Gets a restore point.
202
+ #
203
+ # @param resource_group_name [String] The name of the resource group that
204
+ # contains the resource. You can obtain this value from the Azure Resource
205
+ # Manager API or the portal.
206
+ # @param server_name [String] The name of the server.
207
+ # @param database_name [String] The name of the database.
208
+ # @param restore_point_name [String] The name of the restore point.
209
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
210
+ # will be added to the HTTP request.
211
+ #
212
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
213
+ #
214
+ def get_with_http_info(resource_group_name, server_name, database_name, restore_point_name, custom_headers:nil)
215
+ get_async(resource_group_name, server_name, database_name, restore_point_name, custom_headers:custom_headers).value!
216
+ end
217
+
218
+ #
219
+ # Gets a restore point.
220
+ #
221
+ # @param resource_group_name [String] The name of the resource group that
222
+ # contains the resource. You can obtain this value from the Azure Resource
223
+ # Manager API or the portal.
224
+ # @param server_name [String] The name of the server.
225
+ # @param database_name [String] The name of the database.
226
+ # @param restore_point_name [String] The name of the restore point.
227
+ # @param [Hash{String => String}] A hash of custom headers that will be added
228
+ # to the HTTP request.
229
+ #
230
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
231
+ #
232
+ def get_async(resource_group_name, server_name, database_name, restore_point_name, custom_headers:nil)
233
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
234
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
235
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
236
+ fail ArgumentError, 'restore_point_name is nil' if restore_point_name.nil?
237
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
238
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
239
+
240
+
241
+ request_headers = {}
242
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
243
+
244
+ # Set Headers
245
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
246
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
247
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints/{restorePointName}'
248
+
249
+ request_url = @base_url || @client.base_url
250
+
251
+ options = {
252
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
253
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'restorePointName' => restore_point_name,'subscriptionId' => @client.subscription_id},
254
+ query_params: {'api-version' => @client.api_version},
255
+ headers: request_headers.merge(custom_headers || {}),
256
+ base_url: request_url
257
+ }
258
+ promise = @client.make_request_async(:get, path_template, options)
259
+
260
+ promise = promise.then do |result|
261
+ http_response = result.response
262
+ status_code = http_response.status
263
+ response_content = http_response.body
264
+ unless status_code == 200
265
+ error_model = JSON.load(response_content)
266
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
267
+ end
268
+
269
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
270
+ # Deserialize Response
271
+ if status_code == 200
272
+ begin
273
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
274
+ result_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::DatabaseRestorePoint.mapper()
275
+ result.body = @client.deserialize(result_mapper, parsed_response)
276
+ rescue Exception => e
277
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
278
+ end
279
+ end
280
+
281
+ result
282
+ end
283
+
284
+ promise.execute
285
+ end
286
+
287
+ #
288
+ # Creates a restore point for a data warehouse.
289
+ #
290
+ # @param resource_group_name [String] The name of the resource group that
291
+ # contains the resource. You can obtain this value from the Azure Resource
292
+ # Manager API or the portal.
293
+ # @param server_name [String] The name of the server.
294
+ # @param database_name [String] The name of the database.
295
+ # @param parameters [CreateDatabaseRestorePointDefinition] The definition for
296
+ # creating the restore point of this database.
297
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
298
+ # will be added to the HTTP request.
299
+ #
300
+ # @return [DatabaseRestorePoint] operation results.
301
+ #
302
+ def begin_create(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
303
+ response = begin_create_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers).value!
304
+ response.body unless response.nil?
305
+ end
306
+
307
+ #
308
+ # Creates a restore point for a data warehouse.
309
+ #
310
+ # @param resource_group_name [String] The name of the resource group that
311
+ # contains the resource. You can obtain this value from the Azure Resource
312
+ # Manager API or the portal.
313
+ # @param server_name [String] The name of the server.
314
+ # @param database_name [String] The name of the database.
315
+ # @param parameters [CreateDatabaseRestorePointDefinition] The definition for
316
+ # creating the restore point of this database.
317
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
318
+ # will be added to the HTTP request.
319
+ #
320
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
321
+ #
322
+ def begin_create_with_http_info(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
323
+ begin_create_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers).value!
324
+ end
325
+
326
+ #
327
+ # Creates a restore point for a data warehouse.
328
+ #
329
+ # @param resource_group_name [String] The name of the resource group that
330
+ # contains the resource. You can obtain this value from the Azure Resource
331
+ # Manager API or the portal.
332
+ # @param server_name [String] The name of the server.
333
+ # @param database_name [String] The name of the database.
334
+ # @param parameters [CreateDatabaseRestorePointDefinition] The definition for
335
+ # creating the restore point of this database.
336
+ # @param [Hash{String => String}] A hash of custom headers that will be added
337
+ # to the HTTP request.
338
+ #
339
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
340
+ #
341
+ def begin_create_async(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
342
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
343
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
344
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
345
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
346
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
347
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
348
+
349
+
350
+ request_headers = {}
351
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
352
+
353
+ # Set Headers
354
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
355
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
356
+
357
+ # Serialize Request
358
+ request_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::CreateDatabaseRestorePointDefinition.mapper()
359
+ request_content = @client.serialize(request_mapper, parameters)
360
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
361
+
362
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints'
363
+
364
+ request_url = @base_url || @client.base_url
365
+
366
+ options = {
367
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
368
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'subscriptionId' => @client.subscription_id},
369
+ query_params: {'api-version' => @client.api_version},
370
+ body: request_content,
371
+ headers: request_headers.merge(custom_headers || {}),
372
+ base_url: request_url
373
+ }
374
+ promise = @client.make_request_async(:post, path_template, options)
375
+
376
+ promise = promise.then do |result|
377
+ http_response = result.response
378
+ status_code = http_response.status
379
+ response_content = http_response.body
380
+ unless status_code == 200 || status_code == 202 || status_code == 201
381
+ error_model = JSON.load(response_content)
382
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
383
+ end
384
+
385
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
386
+ # Deserialize Response
387
+ if status_code == 200
388
+ begin
389
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
390
+ result_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::DatabaseRestorePoint.mapper()
391
+ result.body = @client.deserialize(result_mapper, parsed_response)
392
+ rescue Exception => e
393
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
394
+ end
395
+ end
396
+ # Deserialize Response
397
+ if status_code == 201
398
+ begin
399
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
400
+ result_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::DatabaseRestorePoint.mapper()
401
+ result.body = @client.deserialize(result_mapper, parsed_response)
402
+ rescue Exception => e
403
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
404
+ end
405
+ end
406
+
407
+ result
408
+ end
409
+
410
+ promise.execute
411
+ end
412
+
413
+ #
414
+ # Gets a collection of restore points that belongs to the database.
415
+ #
416
+ # @param next_page_link [String] The NextLink from the previous successful call
417
+ # to List operation.
418
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
419
+ # will be added to the HTTP request.
420
+ #
421
+ # @return [DatabaseRestorePointListResult] operation results.
422
+ #
423
+ def list_by_database_next(next_page_link, custom_headers:nil)
424
+ response = list_by_database_next_async(next_page_link, custom_headers:custom_headers).value!
425
+ response.body unless response.nil?
426
+ end
427
+
428
+ #
429
+ # Gets a collection of restore points that belongs to the database.
430
+ #
431
+ # @param next_page_link [String] The NextLink from the previous successful call
432
+ # to List operation.
433
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
434
+ # will be added to the HTTP request.
435
+ #
436
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
437
+ #
438
+ def list_by_database_next_with_http_info(next_page_link, custom_headers:nil)
439
+ list_by_database_next_async(next_page_link, custom_headers:custom_headers).value!
440
+ end
441
+
442
+ #
443
+ # Gets a collection of restore points that belongs to the database.
444
+ #
445
+ # @param next_page_link [String] The NextLink from the previous successful call
446
+ # to List operation.
447
+ # @param [Hash{String => String}] A hash of custom headers that will be added
448
+ # to the HTTP request.
449
+ #
450
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
451
+ #
452
+ def list_by_database_next_async(next_page_link, custom_headers:nil)
453
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
454
+
455
+
456
+ request_headers = {}
457
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
458
+
459
+ # Set Headers
460
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
461
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
462
+ path_template = '{nextLink}'
463
+
464
+ request_url = @base_url || @client.base_url
465
+
466
+ options = {
467
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
468
+ skip_encoding_path_params: {'nextLink' => next_page_link},
469
+ headers: request_headers.merge(custom_headers || {}),
470
+ base_url: request_url
471
+ }
472
+ promise = @client.make_request_async(:get, path_template, options)
473
+
474
+ promise = promise.then do |result|
475
+ http_response = result.response
476
+ status_code = http_response.status
477
+ response_content = http_response.body
478
+ unless status_code == 200
479
+ error_model = JSON.load(response_content)
480
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
481
+ end
482
+
483
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
484
+ # Deserialize Response
485
+ if status_code == 200
486
+ begin
487
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
488
+ result_mapper = Azure::SQL::Mgmt::V2017_03_01_preview::Models::DatabaseRestorePointListResult.mapper()
489
+ result.body = @client.deserialize(result_mapper, parsed_response)
490
+ rescue Exception => e
491
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
492
+ end
493
+ end
494
+
495
+ result
496
+ end
497
+
498
+ promise.execute
499
+ end
500
+
501
+ #
502
+ # Gets a collection of restore points that belongs to the database.
503
+ #
504
+ # @param resource_group_name [String] The name of the resource group that
505
+ # contains the resource. You can obtain this value from the Azure Resource
506
+ # Manager API or the portal.
507
+ # @param server_name [String] The name of the server.
508
+ # @param database_name [String] The name of the database.
509
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
510
+ # will be added to the HTTP request.
511
+ #
512
+ # @return [DatabaseRestorePointListResult] which provide lazy access to pages
513
+ # of the response.
514
+ #
515
+ def list_by_database_as_lazy(resource_group_name, server_name, database_name, custom_headers:nil)
516
+ response = list_by_database_async(resource_group_name, server_name, database_name, custom_headers:custom_headers).value!
517
+ unless response.nil?
518
+ page = response.body
519
+ page.next_method = Proc.new do |next_page_link|
520
+ list_by_database_next_async(next_page_link, custom_headers:custom_headers)
521
+ end
522
+ page
523
+ end
524
+ end
525
+
526
+ end
527
+ end