azure_mgmt_sql 0.11.0 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/azure_mgmt_sql.rb +95 -46
  3. data/lib/generated/azure_mgmt_sql/backup_long_term_retention_policies.rb +310 -0
  4. data/lib/generated/azure_mgmt_sql/backup_long_term_retention_vaults.rb +300 -0
  5. data/lib/generated/azure_mgmt_sql/data_masking_policies.rb +248 -0
  6. data/lib/generated/azure_mgmt_sql/data_masking_rules.rb +262 -0
  7. data/lib/generated/azure_mgmt_sql/database_blob_auditing_policies.rb +264 -0
  8. data/lib/generated/azure_mgmt_sql/database_threat_detection_policies.rb +264 -0
  9. data/lib/generated/azure_mgmt_sql/database_usages.rb +129 -0
  10. data/lib/generated/azure_mgmt_sql/databases.rb +357 -2825
  11. data/lib/generated/azure_mgmt_sql/elastic_pool_activities.rb +132 -0
  12. data/lib/generated/azure_mgmt_sql/elastic_pool_database_activities.rb +129 -0
  13. data/lib/generated/azure_mgmt_sql/elastic_pools.rb +0 -417
  14. data/lib/generated/azure_mgmt_sql/encryption_protectors.rb +498 -0
  15. data/lib/generated/azure_mgmt_sql/failover_groups.rb +6 -6
  16. data/lib/generated/azure_mgmt_sql/geo_backup_policies.rb +359 -0
  17. data/lib/generated/azure_mgmt_sql/models/database_usage.rb +4 -9
  18. data/lib/generated/azure_mgmt_sql/models/encryption_protector.rb +3 -4
  19. data/lib/generated/azure_mgmt_sql/models/failover_group.rb +2 -2
  20. data/lib/generated/azure_mgmt_sql/models/failover_group_read_write_endpoint.rb +6 -4
  21. data/lib/generated/azure_mgmt_sql/models/failover_group_update.rb +93 -0
  22. data/lib/generated/azure_mgmt_sql/models/firewall_rule.rb +11 -14
  23. data/lib/generated/azure_mgmt_sql/models/metric_value.rb +1 -17
  24. data/lib/generated/azure_mgmt_sql/models/operation.rb +36 -3
  25. data/lib/generated/azure_mgmt_sql/models/operation_display.rb +20 -5
  26. data/lib/generated/azure_mgmt_sql/models/operation_list_result.rb +36 -6
  27. data/lib/generated/azure_mgmt_sql/models/operation_origin.rb +16 -0
  28. data/lib/generated/azure_mgmt_sql/models/partner_info.rb +1 -1
  29. data/lib/generated/azure_mgmt_sql/models/replication_link.rb +9 -12
  30. data/lib/generated/azure_mgmt_sql/models/server_azure_adadministrator.rb +11 -3
  31. data/lib/generated/azure_mgmt_sql/models/server_key.rb +3 -4
  32. data/lib/generated/azure_mgmt_sql/models/service_objective.rb +11 -3
  33. data/lib/generated/azure_mgmt_sql/models/service_tier_advisor.rb +11 -3
  34. data/lib/generated/azure_mgmt_sql/models/sync_agent.rb +137 -0
  35. data/lib/generated/azure_mgmt_sql/models/{sql_sub_resource.rb → sync_agent_key_properties.rb} +9 -20
  36. data/lib/generated/azure_mgmt_sql/models/sync_agent_linked_database.rb +126 -0
  37. data/lib/generated/azure_mgmt_sql/models/sync_agent_linked_database_list_result.rb +96 -0
  38. data/lib/generated/azure_mgmt_sql/models/sync_agent_list_result.rb +96 -0
  39. data/lib/generated/azure_mgmt_sql/models/sync_agent_state.rb +17 -0
  40. data/lib/generated/azure_mgmt_sql/models/sync_conflict_resolution_policy.rb +16 -0
  41. data/lib/generated/azure_mgmt_sql/models/sync_database_id_list_result.rb +96 -0
  42. data/lib/generated/azure_mgmt_sql/models/{sub_resource.rb → sync_database_id_properties.rb} +7 -15
  43. data/lib/generated/azure_mgmt_sql/models/sync_direction.rb +17 -0
  44. data/lib/generated/azure_mgmt_sql/models/sync_full_schema_properties.rb +66 -0
  45. data/lib/generated/azure_mgmt_sql/models/sync_full_schema_properties_list_result.rb +96 -0
  46. data/lib/generated/azure_mgmt_sql/models/sync_full_schema_table.rb +99 -0
  47. data/lib/generated/azure_mgmt_sql/models/sync_full_schema_table_column.rb +112 -0
  48. data/lib/generated/azure_mgmt_sql/models/sync_group.rb +145 -0
  49. data/lib/generated/azure_mgmt_sql/models/sync_group_list_result.rb +96 -0
  50. data/lib/generated/azure_mgmt_sql/models/sync_group_log_list_result.rb +96 -0
  51. data/lib/generated/azure_mgmt_sql/models/sync_group_log_properties.rb +102 -0
  52. data/lib/generated/azure_mgmt_sql/models/sync_group_log_type.rb +18 -0
  53. data/lib/generated/azure_mgmt_sql/models/sync_group_schema.rb +64 -0
  54. data/lib/generated/azure_mgmt_sql/models/sync_group_schema_table.rb +64 -0
  55. data/lib/generated/azure_mgmt_sql/models/sync_group_schema_table_column.rb +65 -0
  56. data/lib/generated/azure_mgmt_sql/models/sync_group_state.rb +19 -0
  57. data/lib/generated/azure_mgmt_sql/models/sync_member.rb +160 -0
  58. data/lib/generated/azure_mgmt_sql/models/sync_member_db_type.rb +16 -0
  59. data/lib/generated/azure_mgmt_sql/models/sync_member_list_result.rb +96 -0
  60. data/lib/generated/azure_mgmt_sql/models/sync_member_state.rb +32 -0
  61. data/lib/generated/azure_mgmt_sql/models/transparent_data_encryption.rb +22 -3
  62. data/lib/generated/azure_mgmt_sql/models/transparent_data_encryption_activity.rb +22 -3
  63. data/lib/generated/azure_mgmt_sql/models/virtual_network_rule.rb +2 -2
  64. data/lib/generated/azure_mgmt_sql/operations.rb +111 -4
  65. data/lib/generated/azure_mgmt_sql/recommended_elastic_pools.rb +3 -215
  66. data/lib/generated/azure_mgmt_sql/replication_links.rb +629 -0
  67. data/lib/generated/azure_mgmt_sql/restore_points.rb +132 -0
  68. data/lib/generated/azure_mgmt_sql/server_azure_adadministrators.rb +5 -5
  69. data/lib/generated/azure_mgmt_sql/server_connection_policies.rb +250 -0
  70. data/lib/generated/azure_mgmt_sql/server_keys.rb +10 -10
  71. data/lib/generated/azure_mgmt_sql/server_usages.rb +125 -0
  72. data/lib/generated/azure_mgmt_sql/servers.rb +161 -1423
  73. data/lib/generated/azure_mgmt_sql/service_objectives.rb +229 -0
  74. data/lib/generated/azure_mgmt_sql/service_tier_advisors.rb +234 -0
  75. data/lib/generated/azure_mgmt_sql/sql_management_client.rb +100 -9
  76. data/lib/generated/azure_mgmt_sql/sync_agents.rb +983 -0
  77. data/lib/generated/azure_mgmt_sql/sync_groups.rb +1863 -0
  78. data/lib/generated/azure_mgmt_sql/sync_members.rb +1290 -0
  79. data/lib/generated/azure_mgmt_sql/transparent_data_encryption_activities.rb +133 -0
  80. data/lib/generated/azure_mgmt_sql/transparent_data_encryptions.rb +264 -0
  81. data/lib/generated/azure_mgmt_sql/version.rb +1 -1
  82. metadata +55 -6
@@ -0,0 +1,1290 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::SQL
7
+ #
8
+ # The Azure SQL Database management API provides a RESTful set of web
9
+ # services that interact with Azure SQL Database services to manage your
10
+ # databases. The API enables you to create, retrieve, update, and delete
11
+ # databases.
12
+ #
13
+ class SyncMembers
14
+ include MsRestAzure
15
+
16
+ #
17
+ # Creates and initializes a new instance of the SyncMembers 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 sync member.
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 on which the sync
35
+ # group is hosted.
36
+ # @param sync_group_name [String] The name of the sync group on which the sync
37
+ # member is hosted.
38
+ # @param sync_member_name [String] The name of the sync member.
39
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
40
+ # will be added to the HTTP request.
41
+ #
42
+ # @return [SyncMember] operation results.
43
+ #
44
+ def get(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, custom_headers = nil)
45
+ response = get_async(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, custom_headers).value!
46
+ response.body unless response.nil?
47
+ end
48
+
49
+ #
50
+ # Gets a sync member.
51
+ #
52
+ # @param resource_group_name [String] The name of the resource group that
53
+ # contains the resource. You can obtain this value from the Azure Resource
54
+ # Manager API or the portal.
55
+ # @param server_name [String] The name of the server.
56
+ # @param database_name [String] The name of the database on which the sync
57
+ # group is hosted.
58
+ # @param sync_group_name [String] The name of the sync group on which the sync
59
+ # member is hosted.
60
+ # @param sync_member_name [String] The name of the sync member.
61
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
62
+ # will be added to the HTTP request.
63
+ #
64
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
65
+ #
66
+ def get_with_http_info(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, custom_headers = nil)
67
+ get_async(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, custom_headers).value!
68
+ end
69
+
70
+ #
71
+ # Gets a sync member.
72
+ #
73
+ # @param resource_group_name [String] The name of the resource group that
74
+ # contains the resource. You can obtain this value from the Azure Resource
75
+ # Manager API or the portal.
76
+ # @param server_name [String] The name of the server.
77
+ # @param database_name [String] The name of the database on which the sync
78
+ # group is hosted.
79
+ # @param sync_group_name [String] The name of the sync group on which the sync
80
+ # member is hosted.
81
+ # @param sync_member_name [String] The name of the sync member.
82
+ # @param [Hash{String => String}] A hash of custom headers that will be added
83
+ # to the HTTP request.
84
+ #
85
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
86
+ #
87
+ def get_async(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, custom_headers = nil)
88
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
89
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
90
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
91
+ fail ArgumentError, 'sync_group_name is nil' if sync_group_name.nil?
92
+ fail ArgumentError, 'sync_member_name is nil' if sync_member_name.nil?
93
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
94
+ api_version = '2015-05-01-preview'
95
+
96
+
97
+ request_headers = {}
98
+
99
+ # Set Headers
100
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
101
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
102
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}'
103
+
104
+ request_url = @base_url || @client.base_url
105
+
106
+ options = {
107
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
108
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'syncGroupName' => sync_group_name,'syncMemberName' => sync_member_name,'subscriptionId' => @client.subscription_id},
109
+ query_params: {'api-version' => api_version},
110
+ headers: request_headers.merge(custom_headers || {}),
111
+ base_url: request_url
112
+ }
113
+ promise = @client.make_request_async(:get, path_template, options)
114
+
115
+ promise = promise.then do |result|
116
+ http_response = result.response
117
+ status_code = http_response.status
118
+ response_content = http_response.body
119
+ unless status_code == 200
120
+ error_model = JSON.load(response_content)
121
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
122
+ end
123
+
124
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
125
+ # Deserialize Response
126
+ if status_code == 200
127
+ begin
128
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
129
+ result_mapper = Azure::ARM::SQL::Models::SyncMember.mapper()
130
+ result.body = @client.deserialize(result_mapper, parsed_response)
131
+ rescue Exception => e
132
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
133
+ end
134
+ end
135
+
136
+ result
137
+ end
138
+
139
+ promise.execute
140
+ end
141
+
142
+ #
143
+ # Creates or updates a sync member.
144
+ #
145
+ # @param resource_group_name [String] The name of the resource group that
146
+ # contains the resource. You can obtain this value from the Azure Resource
147
+ # Manager API or the portal.
148
+ # @param server_name [String] The name of the server.
149
+ # @param database_name [String] The name of the database on which the sync
150
+ # group is hosted.
151
+ # @param sync_group_name [String] The name of the sync group on which the sync
152
+ # member is hosted.
153
+ # @param sync_member_name [String] The name of the sync member.
154
+ # @param parameters [SyncMember] The requested sync member resource state.
155
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
156
+ # will be added to the HTTP request.
157
+ #
158
+ # @return [SyncMember] operation results.
159
+ #
160
+ def create_or_update(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, parameters, custom_headers = nil)
161
+ response = create_or_update_async(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, parameters, custom_headers).value!
162
+ response.body unless response.nil?
163
+ end
164
+
165
+ #
166
+ # @param resource_group_name [String] The name of the resource group that
167
+ # contains the resource. You can obtain this value from the Azure Resource
168
+ # Manager API or the portal.
169
+ # @param server_name [String] The name of the server.
170
+ # @param database_name [String] The name of the database on which the sync
171
+ # group is hosted.
172
+ # @param sync_group_name [String] The name of the sync group on which the sync
173
+ # member is hosted.
174
+ # @param sync_member_name [String] The name of the sync member.
175
+ # @param parameters [SyncMember] The requested sync member resource state.
176
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
177
+ # will be added to the HTTP request.
178
+ #
179
+ # @return [Concurrent::Promise] promise which provides async access to http
180
+ # response.
181
+ #
182
+ def create_or_update_async(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, parameters, custom_headers = nil)
183
+ # Send request
184
+ promise = begin_create_or_update_async(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, parameters, custom_headers)
185
+
186
+ promise = promise.then do |response|
187
+ # Defining deserialization method.
188
+ deserialize_method = lambda do |parsed_response|
189
+ result_mapper = Azure::ARM::SQL::Models::SyncMember.mapper()
190
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
191
+ end
192
+
193
+ # Waiting for response.
194
+ @client.get_long_running_operation_result(response, deserialize_method)
195
+ end
196
+
197
+ promise
198
+ end
199
+
200
+ #
201
+ # Deletes a sync member.
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 on which the sync
208
+ # group is hosted.
209
+ # @param sync_group_name [String] The name of the sync group on which the sync
210
+ # member is hosted.
211
+ # @param sync_member_name [String] The name of the sync member.
212
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
213
+ # will be added to the HTTP request.
214
+ #
215
+ def delete(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, custom_headers = nil)
216
+ response = delete_async(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, custom_headers).value!
217
+ nil
218
+ end
219
+
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 on which the sync
226
+ # group is hosted.
227
+ # @param sync_group_name [String] The name of the sync group on which the sync
228
+ # member is hosted.
229
+ # @param sync_member_name [String] The name of the sync member.
230
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
231
+ # will be added to the HTTP request.
232
+ #
233
+ # @return [Concurrent::Promise] promise which provides async access to http
234
+ # response.
235
+ #
236
+ def delete_async(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, custom_headers = nil)
237
+ # Send request
238
+ promise = begin_delete_async(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, custom_headers)
239
+
240
+ promise = promise.then do |response|
241
+ # Defining deserialization method.
242
+ deserialize_method = lambda do |parsed_response|
243
+ end
244
+
245
+ # Waiting for response.
246
+ @client.get_long_running_operation_result(response, deserialize_method)
247
+ end
248
+
249
+ promise
250
+ end
251
+
252
+ #
253
+ # Updates an existing sync member.
254
+ #
255
+ # @param resource_group_name [String] The name of the resource group that
256
+ # contains the resource. You can obtain this value from the Azure Resource
257
+ # Manager API or the portal.
258
+ # @param server_name [String] The name of the server.
259
+ # @param database_name [String] The name of the database on which the sync
260
+ # group is hosted.
261
+ # @param sync_group_name [String] The name of the sync group on which the sync
262
+ # member is hosted.
263
+ # @param sync_member_name [String] The name of the sync member.
264
+ # @param parameters [SyncMember] The requested sync member resource state.
265
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
266
+ # will be added to the HTTP request.
267
+ #
268
+ # @return [SyncMember] operation results.
269
+ #
270
+ def update(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, parameters, custom_headers = nil)
271
+ response = update_async(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, parameters, custom_headers).value!
272
+ response.body unless response.nil?
273
+ end
274
+
275
+ #
276
+ # @param resource_group_name [String] The name of the resource group that
277
+ # contains the resource. You can obtain this value from the Azure Resource
278
+ # Manager API or the portal.
279
+ # @param server_name [String] The name of the server.
280
+ # @param database_name [String] The name of the database on which the sync
281
+ # group is hosted.
282
+ # @param sync_group_name [String] The name of the sync group on which the sync
283
+ # member is hosted.
284
+ # @param sync_member_name [String] The name of the sync member.
285
+ # @param parameters [SyncMember] The requested sync member resource state.
286
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
287
+ # will be added to the HTTP request.
288
+ #
289
+ # @return [Concurrent::Promise] promise which provides async access to http
290
+ # response.
291
+ #
292
+ def update_async(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, parameters, custom_headers = nil)
293
+ # Send request
294
+ promise = begin_update_async(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, parameters, custom_headers)
295
+
296
+ promise = promise.then do |response|
297
+ # Defining deserialization method.
298
+ deserialize_method = lambda do |parsed_response|
299
+ result_mapper = Azure::ARM::SQL::Models::SyncMember.mapper()
300
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
301
+ end
302
+
303
+ # Waiting for response.
304
+ @client.get_long_running_operation_result(response, deserialize_method)
305
+ end
306
+
307
+ promise
308
+ end
309
+
310
+ #
311
+ # Lists sync members in the given sync group.
312
+ #
313
+ # @param resource_group_name [String] The name of the resource group that
314
+ # contains the resource. You can obtain this value from the Azure Resource
315
+ # Manager API or the portal.
316
+ # @param server_name [String] The name of the server.
317
+ # @param database_name [String] The name of the database on which the sync
318
+ # group is hosted.
319
+ # @param sync_group_name [String] The name of the sync group.
320
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
321
+ # will be added to the HTTP request.
322
+ #
323
+ # @return [Array<SyncMember>] operation results.
324
+ #
325
+ def list_by_sync_group(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil)
326
+ first_page = list_by_sync_group_as_lazy(resource_group_name, server_name, database_name, sync_group_name, custom_headers)
327
+ first_page.get_all_items
328
+ end
329
+
330
+ #
331
+ # Lists sync members in the given sync group.
332
+ #
333
+ # @param resource_group_name [String] The name of the resource group that
334
+ # contains the resource. You can obtain this value from the Azure Resource
335
+ # Manager API or the portal.
336
+ # @param server_name [String] The name of the server.
337
+ # @param database_name [String] The name of the database on which the sync
338
+ # group is hosted.
339
+ # @param sync_group_name [String] The name of the sync group.
340
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
341
+ # will be added to the HTTP request.
342
+ #
343
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
344
+ #
345
+ def list_by_sync_group_with_http_info(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil)
346
+ list_by_sync_group_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers).value!
347
+ end
348
+
349
+ #
350
+ # Lists sync members in the given sync group.
351
+ #
352
+ # @param resource_group_name [String] The name of the resource group that
353
+ # contains the resource. You can obtain this value from the Azure Resource
354
+ # Manager API or the portal.
355
+ # @param server_name [String] The name of the server.
356
+ # @param database_name [String] The name of the database on which the sync
357
+ # group is hosted.
358
+ # @param sync_group_name [String] The name of the sync group.
359
+ # @param [Hash{String => String}] A hash of custom headers that will be added
360
+ # to the HTTP request.
361
+ #
362
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
363
+ #
364
+ def list_by_sync_group_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil)
365
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
366
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
367
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
368
+ fail ArgumentError, 'sync_group_name is nil' if sync_group_name.nil?
369
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
370
+ api_version = '2015-05-01-preview'
371
+
372
+
373
+ request_headers = {}
374
+
375
+ # Set Headers
376
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
377
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
378
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers'
379
+
380
+ request_url = @base_url || @client.base_url
381
+
382
+ options = {
383
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
384
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'syncGroupName' => sync_group_name,'subscriptionId' => @client.subscription_id},
385
+ query_params: {'api-version' => api_version},
386
+ headers: request_headers.merge(custom_headers || {}),
387
+ base_url: request_url
388
+ }
389
+ promise = @client.make_request_async(:get, path_template, options)
390
+
391
+ promise = promise.then do |result|
392
+ http_response = result.response
393
+ status_code = http_response.status
394
+ response_content = http_response.body
395
+ unless status_code == 200
396
+ error_model = JSON.load(response_content)
397
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
398
+ end
399
+
400
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
401
+ # Deserialize Response
402
+ if status_code == 200
403
+ begin
404
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
405
+ result_mapper = Azure::ARM::SQL::Models::SyncMemberListResult.mapper()
406
+ result.body = @client.deserialize(result_mapper, parsed_response)
407
+ rescue Exception => e
408
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
409
+ end
410
+ end
411
+
412
+ result
413
+ end
414
+
415
+ promise.execute
416
+ end
417
+
418
+ #
419
+ # Gets a sync member database schema.
420
+ #
421
+ # @param resource_group_name [String] The name of the resource group that
422
+ # contains the resource. You can obtain this value from the Azure Resource
423
+ # Manager API or the portal.
424
+ # @param server_name [String] The name of the server.
425
+ # @param database_name [String] The name of the database on which the sync
426
+ # group is hosted.
427
+ # @param sync_group_name [String] The name of the sync group on which the sync
428
+ # member is hosted.
429
+ # @param sync_member_name [String] The name of the sync member.
430
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
431
+ # will be added to the HTTP request.
432
+ #
433
+ # @return [Array<SyncFullSchemaProperties>] operation results.
434
+ #
435
+ def list_member_schemas(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, custom_headers = nil)
436
+ first_page = list_member_schemas_as_lazy(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, custom_headers)
437
+ first_page.get_all_items
438
+ end
439
+
440
+ #
441
+ # Gets a sync member database schema.
442
+ #
443
+ # @param resource_group_name [String] The name of the resource group that
444
+ # contains the resource. You can obtain this value from the Azure Resource
445
+ # Manager API or the portal.
446
+ # @param server_name [String] The name of the server.
447
+ # @param database_name [String] The name of the database on which the sync
448
+ # group is hosted.
449
+ # @param sync_group_name [String] The name of the sync group on which the sync
450
+ # member is hosted.
451
+ # @param sync_member_name [String] The name of the sync member.
452
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
453
+ # will be added to the HTTP request.
454
+ #
455
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
456
+ #
457
+ def list_member_schemas_with_http_info(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, custom_headers = nil)
458
+ list_member_schemas_async(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, custom_headers).value!
459
+ end
460
+
461
+ #
462
+ # Gets a sync member database schema.
463
+ #
464
+ # @param resource_group_name [String] The name of the resource group that
465
+ # contains the resource. You can obtain this value from the Azure Resource
466
+ # Manager API or the portal.
467
+ # @param server_name [String] The name of the server.
468
+ # @param database_name [String] The name of the database on which the sync
469
+ # group is hosted.
470
+ # @param sync_group_name [String] The name of the sync group on which the sync
471
+ # member is hosted.
472
+ # @param sync_member_name [String] The name of the sync member.
473
+ # @param [Hash{String => String}] A hash of custom headers that will be added
474
+ # to the HTTP request.
475
+ #
476
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
477
+ #
478
+ def list_member_schemas_async(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, custom_headers = nil)
479
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
480
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
481
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
482
+ fail ArgumentError, 'sync_group_name is nil' if sync_group_name.nil?
483
+ fail ArgumentError, 'sync_member_name is nil' if sync_member_name.nil?
484
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
485
+ api_version = '2015-05-01-preview'
486
+
487
+
488
+ request_headers = {}
489
+
490
+ # Set Headers
491
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
492
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
493
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/schemas'
494
+
495
+ request_url = @base_url || @client.base_url
496
+
497
+ options = {
498
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
499
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'syncGroupName' => sync_group_name,'syncMemberName' => sync_member_name,'subscriptionId' => @client.subscription_id},
500
+ query_params: {'api-version' => api_version},
501
+ headers: request_headers.merge(custom_headers || {}),
502
+ base_url: request_url
503
+ }
504
+ promise = @client.make_request_async(:get, path_template, options)
505
+
506
+ promise = promise.then do |result|
507
+ http_response = result.response
508
+ status_code = http_response.status
509
+ response_content = http_response.body
510
+ unless status_code == 200
511
+ error_model = JSON.load(response_content)
512
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
513
+ end
514
+
515
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
516
+ # Deserialize Response
517
+ if status_code == 200
518
+ begin
519
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
520
+ result_mapper = Azure::ARM::SQL::Models::SyncFullSchemaPropertiesListResult.mapper()
521
+ result.body = @client.deserialize(result_mapper, parsed_response)
522
+ rescue Exception => e
523
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
524
+ end
525
+ end
526
+
527
+ result
528
+ end
529
+
530
+ promise.execute
531
+ end
532
+
533
+ #
534
+ # Refreshes a sync member database schema.
535
+ #
536
+ # @param resource_group_name [String] The name of the resource group that
537
+ # contains the resource. You can obtain this value from the Azure Resource
538
+ # Manager API or the portal.
539
+ # @param server_name [String] The name of the server.
540
+ # @param database_name [String] The name of the database on which the sync
541
+ # group is hosted.
542
+ # @param sync_group_name [String] The name of the sync group on which the sync
543
+ # member is hosted.
544
+ # @param sync_member_name [String] The name of the sync member.
545
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
546
+ # will be added to the HTTP request.
547
+ #
548
+ def refresh_member_schema(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, custom_headers = nil)
549
+ response = refresh_member_schema_async(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, custom_headers).value!
550
+ nil
551
+ end
552
+
553
+ #
554
+ # @param resource_group_name [String] The name of the resource group that
555
+ # contains the resource. You can obtain this value from the Azure Resource
556
+ # Manager API or the portal.
557
+ # @param server_name [String] The name of the server.
558
+ # @param database_name [String] The name of the database on which the sync
559
+ # group is hosted.
560
+ # @param sync_group_name [String] The name of the sync group on which the sync
561
+ # member is hosted.
562
+ # @param sync_member_name [String] The name of the sync member.
563
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
564
+ # will be added to the HTTP request.
565
+ #
566
+ # @return [Concurrent::Promise] promise which provides async access to http
567
+ # response.
568
+ #
569
+ def refresh_member_schema_async(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, custom_headers = nil)
570
+ # Send request
571
+ promise = begin_refresh_member_schema_async(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, custom_headers)
572
+
573
+ promise = promise.then do |response|
574
+ # Defining deserialization method.
575
+ deserialize_method = lambda do |parsed_response|
576
+ end
577
+
578
+ # Waiting for response.
579
+ @client.get_long_running_operation_result(response, deserialize_method)
580
+ end
581
+
582
+ promise
583
+ end
584
+
585
+ #
586
+ # Creates or updates a sync member.
587
+ #
588
+ # @param resource_group_name [String] The name of the resource group that
589
+ # contains the resource. You can obtain this value from the Azure Resource
590
+ # Manager API or the portal.
591
+ # @param server_name [String] The name of the server.
592
+ # @param database_name [String] The name of the database on which the sync
593
+ # group is hosted.
594
+ # @param sync_group_name [String] The name of the sync group on which the sync
595
+ # member is hosted.
596
+ # @param sync_member_name [String] The name of the sync member.
597
+ # @param parameters [SyncMember] The requested sync member resource state.
598
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
599
+ # will be added to the HTTP request.
600
+ #
601
+ # @return [SyncMember] operation results.
602
+ #
603
+ def begin_create_or_update(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, parameters, custom_headers = nil)
604
+ response = begin_create_or_update_async(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, parameters, custom_headers).value!
605
+ response.body unless response.nil?
606
+ end
607
+
608
+ #
609
+ # Creates or updates a sync member.
610
+ #
611
+ # @param resource_group_name [String] The name of the resource group that
612
+ # contains the resource. You can obtain this value from the Azure Resource
613
+ # Manager API or the portal.
614
+ # @param server_name [String] The name of the server.
615
+ # @param database_name [String] The name of the database on which the sync
616
+ # group is hosted.
617
+ # @param sync_group_name [String] The name of the sync group on which the sync
618
+ # member is hosted.
619
+ # @param sync_member_name [String] The name of the sync member.
620
+ # @param parameters [SyncMember] The requested sync member resource state.
621
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
622
+ # will be added to the HTTP request.
623
+ #
624
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
625
+ #
626
+ def begin_create_or_update_with_http_info(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, parameters, custom_headers = nil)
627
+ begin_create_or_update_async(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, parameters, custom_headers).value!
628
+ end
629
+
630
+ #
631
+ # Creates or updates a sync member.
632
+ #
633
+ # @param resource_group_name [String] The name of the resource group that
634
+ # contains the resource. You can obtain this value from the Azure Resource
635
+ # Manager API or the portal.
636
+ # @param server_name [String] The name of the server.
637
+ # @param database_name [String] The name of the database on which the sync
638
+ # group is hosted.
639
+ # @param sync_group_name [String] The name of the sync group on which the sync
640
+ # member is hosted.
641
+ # @param sync_member_name [String] The name of the sync member.
642
+ # @param parameters [SyncMember] The requested sync member resource state.
643
+ # @param [Hash{String => String}] A hash of custom headers that will be added
644
+ # to the HTTP request.
645
+ #
646
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
647
+ #
648
+ def begin_create_or_update_async(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, parameters, custom_headers = nil)
649
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
650
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
651
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
652
+ fail ArgumentError, 'sync_group_name is nil' if sync_group_name.nil?
653
+ fail ArgumentError, 'sync_member_name is nil' if sync_member_name.nil?
654
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
655
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
656
+ api_version = '2015-05-01-preview'
657
+
658
+
659
+ request_headers = {}
660
+
661
+ # Set Headers
662
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
663
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
664
+
665
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
666
+
667
+ # Serialize Request
668
+ request_mapper = Azure::ARM::SQL::Models::SyncMember.mapper()
669
+ request_content = @client.serialize(request_mapper, parameters)
670
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
671
+
672
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}'
673
+
674
+ request_url = @base_url || @client.base_url
675
+
676
+ options = {
677
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
678
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'syncGroupName' => sync_group_name,'syncMemberName' => sync_member_name,'subscriptionId' => @client.subscription_id},
679
+ query_params: {'api-version' => api_version},
680
+ body: request_content,
681
+ headers: request_headers.merge(custom_headers || {}),
682
+ base_url: request_url
683
+ }
684
+ promise = @client.make_request_async(:put, path_template, options)
685
+
686
+ promise = promise.then do |result|
687
+ http_response = result.response
688
+ status_code = http_response.status
689
+ response_content = http_response.body
690
+ unless status_code == 200 || status_code == 202 || status_code == 201
691
+ error_model = JSON.load(response_content)
692
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
693
+ end
694
+
695
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
696
+ # Deserialize Response
697
+ if status_code == 200
698
+ begin
699
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
700
+ result_mapper = Azure::ARM::SQL::Models::SyncMember.mapper()
701
+ result.body = @client.deserialize(result_mapper, parsed_response)
702
+ rescue Exception => e
703
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
704
+ end
705
+ end
706
+ # Deserialize Response
707
+ if status_code == 201
708
+ begin
709
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
710
+ result_mapper = Azure::ARM::SQL::Models::SyncMember.mapper()
711
+ result.body = @client.deserialize(result_mapper, parsed_response)
712
+ rescue Exception => e
713
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
714
+ end
715
+ end
716
+
717
+ result
718
+ end
719
+
720
+ promise.execute
721
+ end
722
+
723
+ #
724
+ # Deletes a sync member.
725
+ #
726
+ # @param resource_group_name [String] The name of the resource group that
727
+ # contains the resource. You can obtain this value from the Azure Resource
728
+ # Manager API or the portal.
729
+ # @param server_name [String] The name of the server.
730
+ # @param database_name [String] The name of the database on which the sync
731
+ # group is hosted.
732
+ # @param sync_group_name [String] The name of the sync group on which the sync
733
+ # member is hosted.
734
+ # @param sync_member_name [String] The name of the sync member.
735
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
736
+ # will be added to the HTTP request.
737
+ #
738
+ #
739
+ def begin_delete(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, custom_headers = nil)
740
+ response = begin_delete_async(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, custom_headers).value!
741
+ nil
742
+ end
743
+
744
+ #
745
+ # Deletes a sync member.
746
+ #
747
+ # @param resource_group_name [String] The name of the resource group that
748
+ # contains the resource. You can obtain this value from the Azure Resource
749
+ # Manager API or the portal.
750
+ # @param server_name [String] The name of the server.
751
+ # @param database_name [String] The name of the database on which the sync
752
+ # group is hosted.
753
+ # @param sync_group_name [String] The name of the sync group on which the sync
754
+ # member is hosted.
755
+ # @param sync_member_name [String] The name of the sync member.
756
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
757
+ # will be added to the HTTP request.
758
+ #
759
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
760
+ #
761
+ def begin_delete_with_http_info(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, custom_headers = nil)
762
+ begin_delete_async(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, custom_headers).value!
763
+ end
764
+
765
+ #
766
+ # Deletes a sync member.
767
+ #
768
+ # @param resource_group_name [String] The name of the resource group that
769
+ # contains the resource. You can obtain this value from the Azure Resource
770
+ # Manager API or the portal.
771
+ # @param server_name [String] The name of the server.
772
+ # @param database_name [String] The name of the database on which the sync
773
+ # group is hosted.
774
+ # @param sync_group_name [String] The name of the sync group on which the sync
775
+ # member is hosted.
776
+ # @param sync_member_name [String] The name of the sync member.
777
+ # @param [Hash{String => String}] A hash of custom headers that will be added
778
+ # to the HTTP request.
779
+ #
780
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
781
+ #
782
+ def begin_delete_async(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, custom_headers = nil)
783
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
784
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
785
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
786
+ fail ArgumentError, 'sync_group_name is nil' if sync_group_name.nil?
787
+ fail ArgumentError, 'sync_member_name is nil' if sync_member_name.nil?
788
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
789
+ api_version = '2015-05-01-preview'
790
+
791
+
792
+ request_headers = {}
793
+
794
+ # Set Headers
795
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
796
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
797
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}'
798
+
799
+ request_url = @base_url || @client.base_url
800
+
801
+ options = {
802
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
803
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'syncGroupName' => sync_group_name,'syncMemberName' => sync_member_name,'subscriptionId' => @client.subscription_id},
804
+ query_params: {'api-version' => api_version},
805
+ headers: request_headers.merge(custom_headers || {}),
806
+ base_url: request_url
807
+ }
808
+ promise = @client.make_request_async(:delete, path_template, options)
809
+
810
+ promise = promise.then do |result|
811
+ http_response = result.response
812
+ status_code = http_response.status
813
+ response_content = http_response.body
814
+ unless status_code == 200 || status_code == 202 || status_code == 204
815
+ error_model = JSON.load(response_content)
816
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
817
+ end
818
+
819
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
820
+
821
+ result
822
+ end
823
+
824
+ promise.execute
825
+ end
826
+
827
+ #
828
+ # Updates an existing sync member.
829
+ #
830
+ # @param resource_group_name [String] The name of the resource group that
831
+ # contains the resource. You can obtain this value from the Azure Resource
832
+ # Manager API or the portal.
833
+ # @param server_name [String] The name of the server.
834
+ # @param database_name [String] The name of the database on which the sync
835
+ # group is hosted.
836
+ # @param sync_group_name [String] The name of the sync group on which the sync
837
+ # member is hosted.
838
+ # @param sync_member_name [String] The name of the sync member.
839
+ # @param parameters [SyncMember] The requested sync member resource state.
840
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
841
+ # will be added to the HTTP request.
842
+ #
843
+ # @return [SyncMember] operation results.
844
+ #
845
+ def begin_update(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, parameters, custom_headers = nil)
846
+ response = begin_update_async(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, parameters, custom_headers).value!
847
+ response.body unless response.nil?
848
+ end
849
+
850
+ #
851
+ # Updates an existing sync member.
852
+ #
853
+ # @param resource_group_name [String] The name of the resource group that
854
+ # contains the resource. You can obtain this value from the Azure Resource
855
+ # Manager API or the portal.
856
+ # @param server_name [String] The name of the server.
857
+ # @param database_name [String] The name of the database on which the sync
858
+ # group is hosted.
859
+ # @param sync_group_name [String] The name of the sync group on which the sync
860
+ # member is hosted.
861
+ # @param sync_member_name [String] The name of the sync member.
862
+ # @param parameters [SyncMember] The requested sync member resource state.
863
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
864
+ # will be added to the HTTP request.
865
+ #
866
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
867
+ #
868
+ def begin_update_with_http_info(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, parameters, custom_headers = nil)
869
+ begin_update_async(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, parameters, custom_headers).value!
870
+ end
871
+
872
+ #
873
+ # Updates an existing sync member.
874
+ #
875
+ # @param resource_group_name [String] The name of the resource group that
876
+ # contains the resource. You can obtain this value from the Azure Resource
877
+ # Manager API or the portal.
878
+ # @param server_name [String] The name of the server.
879
+ # @param database_name [String] The name of the database on which the sync
880
+ # group is hosted.
881
+ # @param sync_group_name [String] The name of the sync group on which the sync
882
+ # member is hosted.
883
+ # @param sync_member_name [String] The name of the sync member.
884
+ # @param parameters [SyncMember] The requested sync member resource state.
885
+ # @param [Hash{String => String}] A hash of custom headers that will be added
886
+ # to the HTTP request.
887
+ #
888
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
889
+ #
890
+ def begin_update_async(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, parameters, custom_headers = nil)
891
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
892
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
893
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
894
+ fail ArgumentError, 'sync_group_name is nil' if sync_group_name.nil?
895
+ fail ArgumentError, 'sync_member_name is nil' if sync_member_name.nil?
896
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
897
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
898
+ api_version = '2015-05-01-preview'
899
+
900
+
901
+ request_headers = {}
902
+
903
+ # Set Headers
904
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
905
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
906
+
907
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
908
+
909
+ # Serialize Request
910
+ request_mapper = Azure::ARM::SQL::Models::SyncMember.mapper()
911
+ request_content = @client.serialize(request_mapper, parameters)
912
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
913
+
914
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}'
915
+
916
+ request_url = @base_url || @client.base_url
917
+
918
+ options = {
919
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
920
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'syncGroupName' => sync_group_name,'syncMemberName' => sync_member_name,'subscriptionId' => @client.subscription_id},
921
+ query_params: {'api-version' => api_version},
922
+ body: request_content,
923
+ headers: request_headers.merge(custom_headers || {}),
924
+ base_url: request_url
925
+ }
926
+ promise = @client.make_request_async(:patch, path_template, options)
927
+
928
+ promise = promise.then do |result|
929
+ http_response = result.response
930
+ status_code = http_response.status
931
+ response_content = http_response.body
932
+ unless status_code == 200 || status_code == 202
933
+ error_model = JSON.load(response_content)
934
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
935
+ end
936
+
937
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
938
+ # Deserialize Response
939
+ if status_code == 200
940
+ begin
941
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
942
+ result_mapper = Azure::ARM::SQL::Models::SyncMember.mapper()
943
+ result.body = @client.deserialize(result_mapper, parsed_response)
944
+ rescue Exception => e
945
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
946
+ end
947
+ end
948
+
949
+ result
950
+ end
951
+
952
+ promise.execute
953
+ end
954
+
955
+ #
956
+ # Refreshes a sync member database schema.
957
+ #
958
+ # @param resource_group_name [String] The name of the resource group that
959
+ # contains the resource. You can obtain this value from the Azure Resource
960
+ # Manager API or the portal.
961
+ # @param server_name [String] The name of the server.
962
+ # @param database_name [String] The name of the database on which the sync
963
+ # group is hosted.
964
+ # @param sync_group_name [String] The name of the sync group on which the sync
965
+ # member is hosted.
966
+ # @param sync_member_name [String] The name of the sync member.
967
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
968
+ # will be added to the HTTP request.
969
+ #
970
+ #
971
+ def begin_refresh_member_schema(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, custom_headers = nil)
972
+ response = begin_refresh_member_schema_async(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, custom_headers).value!
973
+ nil
974
+ end
975
+
976
+ #
977
+ # Refreshes a sync member database schema.
978
+ #
979
+ # @param resource_group_name [String] The name of the resource group that
980
+ # contains the resource. You can obtain this value from the Azure Resource
981
+ # Manager API or the portal.
982
+ # @param server_name [String] The name of the server.
983
+ # @param database_name [String] The name of the database on which the sync
984
+ # group is hosted.
985
+ # @param sync_group_name [String] The name of the sync group on which the sync
986
+ # member is hosted.
987
+ # @param sync_member_name [String] The name of the sync member.
988
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
989
+ # will be added to the HTTP request.
990
+ #
991
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
992
+ #
993
+ def begin_refresh_member_schema_with_http_info(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, custom_headers = nil)
994
+ begin_refresh_member_schema_async(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, custom_headers).value!
995
+ end
996
+
997
+ #
998
+ # Refreshes a sync member database schema.
999
+ #
1000
+ # @param resource_group_name [String] The name of the resource group that
1001
+ # contains the resource. You can obtain this value from the Azure Resource
1002
+ # Manager API or the portal.
1003
+ # @param server_name [String] The name of the server.
1004
+ # @param database_name [String] The name of the database on which the sync
1005
+ # group is hosted.
1006
+ # @param sync_group_name [String] The name of the sync group on which the sync
1007
+ # member is hosted.
1008
+ # @param sync_member_name [String] The name of the sync member.
1009
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1010
+ # to the HTTP request.
1011
+ #
1012
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1013
+ #
1014
+ def begin_refresh_member_schema_async(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, custom_headers = nil)
1015
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1016
+ fail ArgumentError, 'server_name is nil' if server_name.nil?
1017
+ fail ArgumentError, 'database_name is nil' if database_name.nil?
1018
+ fail ArgumentError, 'sync_group_name is nil' if sync_group_name.nil?
1019
+ fail ArgumentError, 'sync_member_name is nil' if sync_member_name.nil?
1020
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1021
+ api_version = '2015-05-01-preview'
1022
+
1023
+
1024
+ request_headers = {}
1025
+
1026
+ # Set Headers
1027
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1028
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1029
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/refreshSchema'
1030
+
1031
+ request_url = @base_url || @client.base_url
1032
+
1033
+ options = {
1034
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1035
+ path_params: {'resourceGroupName' => resource_group_name,'serverName' => server_name,'databaseName' => database_name,'syncGroupName' => sync_group_name,'syncMemberName' => sync_member_name,'subscriptionId' => @client.subscription_id},
1036
+ query_params: {'api-version' => api_version},
1037
+ headers: request_headers.merge(custom_headers || {}),
1038
+ base_url: request_url
1039
+ }
1040
+ promise = @client.make_request_async(:post, path_template, options)
1041
+
1042
+ promise = promise.then do |result|
1043
+ http_response = result.response
1044
+ status_code = http_response.status
1045
+ response_content = http_response.body
1046
+ unless status_code == 200 || status_code == 202
1047
+ error_model = JSON.load(response_content)
1048
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1049
+ end
1050
+
1051
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1052
+
1053
+ result
1054
+ end
1055
+
1056
+ promise.execute
1057
+ end
1058
+
1059
+ #
1060
+ # Lists sync members in the given sync group.
1061
+ #
1062
+ # @param next_page_link [String] The NextLink from the previous successful call
1063
+ # to List operation.
1064
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1065
+ # will be added to the HTTP request.
1066
+ #
1067
+ # @return [SyncMemberListResult] operation results.
1068
+ #
1069
+ def list_by_sync_group_next(next_page_link, custom_headers = nil)
1070
+ response = list_by_sync_group_next_async(next_page_link, custom_headers).value!
1071
+ response.body unless response.nil?
1072
+ end
1073
+
1074
+ #
1075
+ # Lists sync members in the given sync group.
1076
+ #
1077
+ # @param next_page_link [String] The NextLink from the previous successful call
1078
+ # to List operation.
1079
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1080
+ # will be added to the HTTP request.
1081
+ #
1082
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1083
+ #
1084
+ def list_by_sync_group_next_with_http_info(next_page_link, custom_headers = nil)
1085
+ list_by_sync_group_next_async(next_page_link, custom_headers).value!
1086
+ end
1087
+
1088
+ #
1089
+ # Lists sync members in the given sync group.
1090
+ #
1091
+ # @param next_page_link [String] The NextLink from the previous successful call
1092
+ # to List operation.
1093
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1094
+ # to the HTTP request.
1095
+ #
1096
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1097
+ #
1098
+ def list_by_sync_group_next_async(next_page_link, custom_headers = nil)
1099
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1100
+
1101
+
1102
+ request_headers = {}
1103
+
1104
+ # Set Headers
1105
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1106
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1107
+ path_template = '{nextLink}'
1108
+
1109
+ request_url = @base_url || @client.base_url
1110
+
1111
+ options = {
1112
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1113
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1114
+ headers: request_headers.merge(custom_headers || {}),
1115
+ base_url: request_url
1116
+ }
1117
+ promise = @client.make_request_async(:get, path_template, options)
1118
+
1119
+ promise = promise.then do |result|
1120
+ http_response = result.response
1121
+ status_code = http_response.status
1122
+ response_content = http_response.body
1123
+ unless status_code == 200
1124
+ error_model = JSON.load(response_content)
1125
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1126
+ end
1127
+
1128
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1129
+ # Deserialize Response
1130
+ if status_code == 200
1131
+ begin
1132
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1133
+ result_mapper = Azure::ARM::SQL::Models::SyncMemberListResult.mapper()
1134
+ result.body = @client.deserialize(result_mapper, parsed_response)
1135
+ rescue Exception => e
1136
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1137
+ end
1138
+ end
1139
+
1140
+ result
1141
+ end
1142
+
1143
+ promise.execute
1144
+ end
1145
+
1146
+ #
1147
+ # Gets a sync member database schema.
1148
+ #
1149
+ # @param next_page_link [String] The NextLink from the previous successful call
1150
+ # to List operation.
1151
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1152
+ # will be added to the HTTP request.
1153
+ #
1154
+ # @return [SyncFullSchemaPropertiesListResult] operation results.
1155
+ #
1156
+ def list_member_schemas_next(next_page_link, custom_headers = nil)
1157
+ response = list_member_schemas_next_async(next_page_link, custom_headers).value!
1158
+ response.body unless response.nil?
1159
+ end
1160
+
1161
+ #
1162
+ # Gets a sync member database schema.
1163
+ #
1164
+ # @param next_page_link [String] The NextLink from the previous successful call
1165
+ # to List operation.
1166
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1167
+ # will be added to the HTTP request.
1168
+ #
1169
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1170
+ #
1171
+ def list_member_schemas_next_with_http_info(next_page_link, custom_headers = nil)
1172
+ list_member_schemas_next_async(next_page_link, custom_headers).value!
1173
+ end
1174
+
1175
+ #
1176
+ # Gets a sync member database schema.
1177
+ #
1178
+ # @param next_page_link [String] The NextLink from the previous successful call
1179
+ # to List operation.
1180
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1181
+ # to the HTTP request.
1182
+ #
1183
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1184
+ #
1185
+ def list_member_schemas_next_async(next_page_link, custom_headers = nil)
1186
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1187
+
1188
+
1189
+ request_headers = {}
1190
+
1191
+ # Set Headers
1192
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1193
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1194
+ path_template = '{nextLink}'
1195
+
1196
+ request_url = @base_url || @client.base_url
1197
+
1198
+ options = {
1199
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1200
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1201
+ headers: request_headers.merge(custom_headers || {}),
1202
+ base_url: request_url
1203
+ }
1204
+ promise = @client.make_request_async(:get, path_template, options)
1205
+
1206
+ promise = promise.then do |result|
1207
+ http_response = result.response
1208
+ status_code = http_response.status
1209
+ response_content = http_response.body
1210
+ unless status_code == 200
1211
+ error_model = JSON.load(response_content)
1212
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1213
+ end
1214
+
1215
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1216
+ # Deserialize Response
1217
+ if status_code == 200
1218
+ begin
1219
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1220
+ result_mapper = Azure::ARM::SQL::Models::SyncFullSchemaPropertiesListResult.mapper()
1221
+ result.body = @client.deserialize(result_mapper, parsed_response)
1222
+ rescue Exception => e
1223
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1224
+ end
1225
+ end
1226
+
1227
+ result
1228
+ end
1229
+
1230
+ promise.execute
1231
+ end
1232
+
1233
+ #
1234
+ # Lists sync members in the given sync group.
1235
+ #
1236
+ # @param resource_group_name [String] The name of the resource group that
1237
+ # contains the resource. You can obtain this value from the Azure Resource
1238
+ # Manager API or the portal.
1239
+ # @param server_name [String] The name of the server.
1240
+ # @param database_name [String] The name of the database on which the sync
1241
+ # group is hosted.
1242
+ # @param sync_group_name [String] The name of the sync group.
1243
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1244
+ # will be added to the HTTP request.
1245
+ #
1246
+ # @return [SyncMemberListResult] which provide lazy access to pages of the
1247
+ # response.
1248
+ #
1249
+ def list_by_sync_group_as_lazy(resource_group_name, server_name, database_name, sync_group_name, custom_headers = nil)
1250
+ response = list_by_sync_group_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers).value!
1251
+ unless response.nil?
1252
+ page = response.body
1253
+ page.next_method = Proc.new do |next_page_link|
1254
+ list_by_sync_group_next_async(next_page_link, custom_headers)
1255
+ end
1256
+ page
1257
+ end
1258
+ end
1259
+
1260
+ #
1261
+ # Gets a sync member database schema.
1262
+ #
1263
+ # @param resource_group_name [String] The name of the resource group that
1264
+ # contains the resource. You can obtain this value from the Azure Resource
1265
+ # Manager API or the portal.
1266
+ # @param server_name [String] The name of the server.
1267
+ # @param database_name [String] The name of the database on which the sync
1268
+ # group is hosted.
1269
+ # @param sync_group_name [String] The name of the sync group on which the sync
1270
+ # member is hosted.
1271
+ # @param sync_member_name [String] The name of the sync member.
1272
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1273
+ # will be added to the HTTP request.
1274
+ #
1275
+ # @return [SyncFullSchemaPropertiesListResult] which provide lazy access to
1276
+ # pages of the response.
1277
+ #
1278
+ def list_member_schemas_as_lazy(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, custom_headers = nil)
1279
+ response = list_member_schemas_async(resource_group_name, server_name, database_name, sync_group_name, sync_member_name, custom_headers).value!
1280
+ unless response.nil?
1281
+ page = response.body
1282
+ page.next_method = Proc.new do |next_page_link|
1283
+ list_member_schemas_next_async(next_page_link, custom_headers)
1284
+ end
1285
+ page
1286
+ end
1287
+ end
1288
+
1289
+ end
1290
+ end