azure_mgmt_recovery_services 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/azure_mgmt_recovery_services.rb +40 -1
  3. data/lib/generated/azure_mgmt_recovery_services/backup_storage_configs.rb +215 -0
  4. data/lib/generated/azure_mgmt_recovery_services/backup_vault_configs.rb +226 -0
  5. data/lib/generated/azure_mgmt_recovery_services/models/auth_type.rb +19 -0
  6. data/lib/generated/azure_mgmt_recovery_services/models/backup_storage_config.rb +100 -0
  7. data/lib/generated/azure_mgmt_recovery_services/models/backup_vault_config.rb +100 -0
  8. data/lib/generated/azure_mgmt_recovery_services/models/certificate_request.rb +46 -0
  9. data/lib/generated/azure_mgmt_recovery_services/models/client_discovery_display.rb +79 -0
  10. data/lib/generated/azure_mgmt_recovery_services/models/client_discovery_for_log_specification.rb +68 -0
  11. data/lib/generated/azure_mgmt_recovery_services/models/client_discovery_for_service_specification.rb +55 -0
  12. data/lib/generated/azure_mgmt_recovery_services/models/client_discovery_response.rb +97 -0
  13. data/lib/generated/azure_mgmt_recovery_services/models/client_discovery_value_for_single_api.rb +82 -0
  14. data/lib/generated/azure_mgmt_recovery_services/models/enhanced_security_state.rb +17 -0
  15. data/lib/generated/azure_mgmt_recovery_services/models/jobs_summary.rb +65 -0
  16. data/lib/generated/azure_mgmt_recovery_services/models/monitoring_summary.rb +97 -0
  17. data/lib/generated/azure_mgmt_recovery_services/models/name_info.rb +55 -0
  18. data/lib/generated/azure_mgmt_recovery_services/models/raw_certificate_data.rb +57 -0
  19. data/lib/generated/azure_mgmt_recovery_services/models/replication_usage.rb +100 -0
  20. data/lib/generated/azure_mgmt_recovery_services/models/replication_usage_list.rb +54 -0
  21. data/lib/generated/azure_mgmt_recovery_services/models/resource.rb +7 -29
  22. data/lib/generated/azure_mgmt_recovery_services/models/resource_certificate_and_aad_details.rb +155 -0
  23. data/lib/generated/azure_mgmt_recovery_services/models/resource_certificate_and_acs_details.rb +135 -0
  24. data/lib/generated/azure_mgmt_recovery_services/models/resource_certificate_details.rb +128 -0
  25. data/lib/generated/azure_mgmt_recovery_services/models/sku.rb +2 -1
  26. data/lib/generated/azure_mgmt_recovery_services/models/sku_name.rb +1 -1
  27. data/lib/generated/azure_mgmt_recovery_services/models/storage_model_type.rb +17 -0
  28. data/lib/generated/azure_mgmt_recovery_services/models/storage_type.rb +17 -0
  29. data/lib/generated/azure_mgmt_recovery_services/models/storage_type_state.rb +17 -0
  30. data/lib/generated/azure_mgmt_recovery_services/models/tracked_resource.rb +93 -0
  31. data/lib/generated/azure_mgmt_recovery_services/models/trigger_type.rb +16 -0
  32. data/lib/generated/azure_mgmt_recovery_services/models/upgrade_details.rb +138 -0
  33. data/lib/generated/azure_mgmt_recovery_services/models/usages_unit.rb +20 -0
  34. data/lib/generated/azure_mgmt_recovery_services/models/vault.rb +19 -19
  35. data/lib/generated/azure_mgmt_recovery_services/models/vault_certificate_response.rb +79 -0
  36. data/lib/generated/azure_mgmt_recovery_services/models/vault_extended_info_resource.rb +106 -0
  37. data/lib/generated/azure_mgmt_recovery_services/models/vault_list.rb +13 -32
  38. data/lib/generated/azure_mgmt_recovery_services/models/vault_properties.rb +13 -1
  39. data/lib/generated/azure_mgmt_recovery_services/models/vault_upgrade_state.rb +18 -0
  40. data/lib/generated/azure_mgmt_recovery_services/models/vault_usage.rb +98 -0
  41. data/lib/generated/azure_mgmt_recovery_services/models/vault_usage_list.rb +53 -0
  42. data/lib/generated/azure_mgmt_recovery_services/module_definition.rb +1 -1
  43. data/lib/generated/azure_mgmt_recovery_services/operations.rb +224 -0
  44. data/lib/generated/azure_mgmt_recovery_services/recovery_services_client.rb +33 -5
  45. data/lib/generated/azure_mgmt_recovery_services/registered_identities.rb +112 -0
  46. data/lib/generated/azure_mgmt_recovery_services/replication_usages.rb +119 -0
  47. data/lib/generated/azure_mgmt_recovery_services/usages.rb +119 -0
  48. data/lib/generated/azure_mgmt_recovery_services/vault_certificates.rb +139 -0
  49. data/lib/generated/azure_mgmt_recovery_services/vault_extended_info_operations.rb +339 -0
  50. data/lib/generated/azure_mgmt_recovery_services/vaults.rb +230 -139
  51. data/lib/generated/azure_mgmt_recovery_services/version.rb +2 -2
  52. metadata +43 -4
@@ -1,14 +1,13 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
6
6
  module Azure::ARM::RecoveryServices
7
7
  #
8
- # Vaults
8
+ # Recovery Services Client
9
9
  #
10
10
  class Vaults
11
- include Azure::ARM::RecoveryServices::Models
12
11
  include MsRestAzure
13
12
 
14
13
  #
@@ -22,6 +21,179 @@ module Azure::ARM::RecoveryServices
22
21
  # @return [RecoveryServicesClient] reference to the RecoveryServicesClient
23
22
  attr_reader :client
24
23
 
24
+ #
25
+ # Fetches all the resources of the specified type in the subscription.
26
+ #
27
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
28
+ # will be added to the HTTP request.
29
+ #
30
+ # @return [VaultList] operation results.
31
+ #
32
+ def list_by_subscription_id(custom_headers = nil)
33
+ response = list_by_subscription_id_async(custom_headers).value!
34
+ response.body unless response.nil?
35
+ end
36
+
37
+ #
38
+ # Fetches all the resources of the specified type in the subscription.
39
+ #
40
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
41
+ # will be added to the HTTP request.
42
+ #
43
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
44
+ #
45
+ def list_by_subscription_id_with_http_info(custom_headers = nil)
46
+ list_by_subscription_id_async(custom_headers).value!
47
+ end
48
+
49
+ #
50
+ # Fetches all the resources of the specified type in the subscription.
51
+ #
52
+ # @param [Hash{String => String}] A hash of custom headers that will be added
53
+ # to the HTTP request.
54
+ #
55
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
56
+ #
57
+ def list_by_subscription_id_async(custom_headers = nil)
58
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
59
+ api_version = '2016-06-01'
60
+
61
+
62
+ request_headers = {}
63
+
64
+ # Set Headers
65
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
66
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
67
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/vaults'
68
+
69
+ request_url = @base_url || @client.base_url
70
+
71
+ options = {
72
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
73
+ path_params: {'subscriptionId' => @client.subscription_id},
74
+ query_params: {'api-version' => api_version},
75
+ headers: request_headers.merge(custom_headers || {}),
76
+ base_url: request_url
77
+ }
78
+ promise = @client.make_request_async(:get, path_template, options)
79
+
80
+ promise = promise.then do |result|
81
+ http_response = result.response
82
+ status_code = http_response.status
83
+ response_content = http_response.body
84
+ unless status_code == 200
85
+ error_model = JSON.load(response_content)
86
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
87
+ end
88
+
89
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
90
+ # Deserialize Response
91
+ if status_code == 200
92
+ begin
93
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
94
+ result_mapper = Azure::ARM::RecoveryServices::Models::VaultList.mapper()
95
+ result.body = @client.deserialize(result_mapper, parsed_response)
96
+ rescue Exception => e
97
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
98
+ end
99
+ end
100
+
101
+ result
102
+ end
103
+
104
+ promise.execute
105
+ end
106
+
107
+ #
108
+ # Retrieve a list of Vaults.
109
+ #
110
+ # @param resource_group_name [String] The name of the resource group where the
111
+ # recovery services vault is present.
112
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
113
+ # will be added to the HTTP request.
114
+ #
115
+ # @return [VaultList] operation results.
116
+ #
117
+ def list_by_resource_group(resource_group_name, custom_headers = nil)
118
+ response = list_by_resource_group_async(resource_group_name, custom_headers).value!
119
+ response.body unless response.nil?
120
+ end
121
+
122
+ #
123
+ # Retrieve a list of Vaults.
124
+ #
125
+ # @param resource_group_name [String] The name of the resource group where the
126
+ # recovery services vault is present.
127
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
128
+ # will be added to the HTTP request.
129
+ #
130
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
131
+ #
132
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers = nil)
133
+ list_by_resource_group_async(resource_group_name, custom_headers).value!
134
+ end
135
+
136
+ #
137
+ # Retrieve a list of Vaults.
138
+ #
139
+ # @param resource_group_name [String] The name of the resource group where the
140
+ # recovery services vault is present.
141
+ # @param [Hash{String => String}] A hash of custom headers that will be added
142
+ # to the HTTP request.
143
+ #
144
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
145
+ #
146
+ def list_by_resource_group_async(resource_group_name, custom_headers = nil)
147
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
148
+ api_version = '2016-06-01'
149
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
150
+
151
+
152
+ request_headers = {}
153
+
154
+ # Set Headers
155
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
156
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
157
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults'
158
+
159
+ request_url = @base_url || @client.base_url
160
+
161
+ options = {
162
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
163
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
164
+ query_params: {'api-version' => api_version},
165
+ headers: request_headers.merge(custom_headers || {}),
166
+ base_url: request_url
167
+ }
168
+ promise = @client.make_request_async(:get, path_template, options)
169
+
170
+ promise = promise.then do |result|
171
+ http_response = result.response
172
+ status_code = http_response.status
173
+ response_content = http_response.body
174
+ unless status_code == 200
175
+ error_model = JSON.load(response_content)
176
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
177
+ end
178
+
179
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
180
+ # Deserialize Response
181
+ if status_code == 200
182
+ begin
183
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
184
+ result_mapper = Azure::ARM::RecoveryServices::Models::VaultList.mapper()
185
+ result.body = @client.deserialize(result_mapper, parsed_response)
186
+ rescue Exception => e
187
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
188
+ end
189
+ end
190
+
191
+ result
192
+ end
193
+
194
+ promise.execute
195
+ end
196
+
25
197
  #
26
198
  # Get the Vault details.
27
199
  #
@@ -66,9 +238,9 @@ module Azure::ARM::RecoveryServices
66
238
  #
67
239
  def get_async(resource_group_name, vault_name, custom_headers = nil)
68
240
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
241
+ api_version = '2016-06-01'
69
242
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
70
243
  fail ArgumentError, 'vault_name is nil' if vault_name.nil?
71
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
72
244
 
73
245
 
74
246
  request_headers = {}
@@ -76,14 +248,14 @@ module Azure::ARM::RecoveryServices
76
248
  # Set Headers
77
249
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
78
250
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
79
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}'
251
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}'
80
252
 
81
253
  request_url = @base_url || @client.base_url
82
254
 
83
255
  options = {
84
256
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
85
257
  path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'vaultName' => vault_name},
86
- query_params: {'api-version' => @client.api_version},
258
+ query_params: {'api-version' => api_version},
87
259
  headers: request_headers.merge(custom_headers || {}),
88
260
  base_url: request_url
89
261
  }
@@ -103,8 +275,8 @@ module Azure::ARM::RecoveryServices
103
275
  if status_code == 200
104
276
  begin
105
277
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
106
- result_mapper = Vault.mapper()
107
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
278
+ result_mapper = Azure::ARM::RecoveryServices::Models::Vault.mapper()
279
+ result.body = @client.deserialize(result_mapper, parsed_response)
108
280
  rescue Exception => e
109
281
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
110
282
  end
@@ -163,9 +335,9 @@ module Azure::ARM::RecoveryServices
163
335
  #
164
336
  def create_or_update_async(resource_group_name, vault_name, vault, custom_headers = nil)
165
337
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
338
+ api_version = '2016-06-01'
166
339
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
167
340
  fail ArgumentError, 'vault_name is nil' if vault_name.nil?
168
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
169
341
  fail ArgumentError, 'vault is nil' if vault.nil?
170
342
 
171
343
 
@@ -178,18 +350,18 @@ module Azure::ARM::RecoveryServices
178
350
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
179
351
 
180
352
  # Serialize Request
181
- request_mapper = Vault.mapper()
182
- request_content = @client.serialize(request_mapper, vault, 'vault')
353
+ request_mapper = Azure::ARM::RecoveryServices::Models::Vault.mapper()
354
+ request_content = @client.serialize(request_mapper, vault)
183
355
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
184
356
 
185
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}'
357
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}'
186
358
 
187
359
  request_url = @base_url || @client.base_url
188
360
 
189
361
  options = {
190
362
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
191
363
  path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'vaultName' => vault_name},
192
- query_params: {'api-version' => @client.api_version},
364
+ query_params: {'api-version' => api_version},
193
365
  body: request_content,
194
366
  headers: request_headers.merge(custom_headers || {}),
195
367
  base_url: request_url
@@ -210,8 +382,8 @@ module Azure::ARM::RecoveryServices
210
382
  if status_code == 200
211
383
  begin
212
384
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
213
- result_mapper = Vault.mapper()
214
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
385
+ result_mapper = Azure::ARM::RecoveryServices::Models::Vault.mapper()
386
+ result.body = @client.deserialize(result_mapper, parsed_response)
215
387
  rescue Exception => e
216
388
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
217
389
  end
@@ -220,8 +392,8 @@ module Azure::ARM::RecoveryServices
220
392
  if status_code == 201
221
393
  begin
222
394
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
223
- result_mapper = Vault.mapper()
224
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
395
+ result_mapper = Azure::ARM::RecoveryServices::Models::Vault.mapper()
396
+ result.body = @client.deserialize(result_mapper, parsed_response)
225
397
  rescue Exception => e
226
398
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
227
399
  end
@@ -276,9 +448,9 @@ module Azure::ARM::RecoveryServices
276
448
  #
277
449
  def delete_async(resource_group_name, vault_name, custom_headers = nil)
278
450
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
451
+ api_version = '2016-06-01'
279
452
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
280
453
  fail ArgumentError, 'vault_name is nil' if vault_name.nil?
281
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
282
454
 
283
455
 
284
456
  request_headers = {}
@@ -286,14 +458,14 @@ module Azure::ARM::RecoveryServices
286
458
  # Set Headers
287
459
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
288
460
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
289
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}'
461
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}'
290
462
 
291
463
  request_url = @base_url || @client.base_url
292
464
 
293
465
  options = {
294
466
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
295
467
  path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'vaultName' => vault_name},
296
- query_params: {'api-version' => @client.api_version},
468
+ query_params: {'api-version' => api_version},
297
469
  headers: request_headers.merge(custom_headers || {}),
298
470
  base_url: request_url
299
471
  }
@@ -317,48 +489,56 @@ module Azure::ARM::RecoveryServices
317
489
  end
318
490
 
319
491
  #
320
- # Retrieve a list of Vaults.
492
+ # Updates the vault.
321
493
  #
322
494
  # @param resource_group_name [String] The name of the resource group where the
323
495
  # recovery services vault is present.
496
+ # @param vault_name [String] The name of the recovery services vault.
497
+ # @param vault [Vault] Recovery Services Vault to be created.
324
498
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
325
499
  # will be added to the HTTP request.
326
500
  #
327
- # @return [Array<Vault>] operation results.
501
+ # @return [Vault] operation results.
328
502
  #
329
- def list_by_resource_group(resource_group_name, custom_headers = nil)
330
- first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers)
331
- first_page.get_all_items
503
+ def update(resource_group_name, vault_name, vault, custom_headers = nil)
504
+ response = update_async(resource_group_name, vault_name, vault, custom_headers).value!
505
+ response.body unless response.nil?
332
506
  end
333
507
 
334
508
  #
335
- # Retrieve a list of Vaults.
509
+ # Updates the vault.
336
510
  #
337
511
  # @param resource_group_name [String] The name of the resource group where the
338
512
  # recovery services vault is present.
513
+ # @param vault_name [String] The name of the recovery services vault.
514
+ # @param vault [Vault] Recovery Services Vault to be created.
339
515
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
340
516
  # will be added to the HTTP request.
341
517
  #
342
518
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
343
519
  #
344
- def list_by_resource_group_with_http_info(resource_group_name, custom_headers = nil)
345
- list_by_resource_group_async(resource_group_name, custom_headers).value!
520
+ def update_with_http_info(resource_group_name, vault_name, vault, custom_headers = nil)
521
+ update_async(resource_group_name, vault_name, vault, custom_headers).value!
346
522
  end
347
523
 
348
524
  #
349
- # Retrieve a list of Vaults.
525
+ # Updates the vault.
350
526
  #
351
527
  # @param resource_group_name [String] The name of the resource group where the
352
528
  # recovery services vault is present.
529
+ # @param vault_name [String] The name of the recovery services vault.
530
+ # @param vault [Vault] Recovery Services Vault to be created.
353
531
  # @param [Hash{String => String}] A hash of custom headers that will be added
354
532
  # to the HTTP request.
355
533
  #
356
534
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
357
535
  #
358
- def list_by_resource_group_async(resource_group_name, custom_headers = nil)
536
+ def update_async(resource_group_name, vault_name, vault, custom_headers = nil)
359
537
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
538
+ api_version = '2016-06-01'
360
539
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
361
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
540
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
541
+ fail ArgumentError, 'vault is nil' if vault.nil?
362
542
 
363
543
 
364
544
  request_headers = {}
@@ -366,24 +546,33 @@ module Azure::ARM::RecoveryServices
366
546
  # Set Headers
367
547
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
368
548
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
369
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults'
549
+
550
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
551
+
552
+ # Serialize Request
553
+ request_mapper = Azure::ARM::RecoveryServices::Models::Vault.mapper()
554
+ request_content = @client.serialize(request_mapper, vault)
555
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
556
+
557
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}'
370
558
 
371
559
  request_url = @base_url || @client.base_url
372
560
 
373
561
  options = {
374
562
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
375
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
376
- query_params: {'api-version' => @client.api_version},
563
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'vaultName' => vault_name},
564
+ query_params: {'api-version' => api_version},
565
+ body: request_content,
377
566
  headers: request_headers.merge(custom_headers || {}),
378
567
  base_url: request_url
379
568
  }
380
- promise = @client.make_request_async(:get, path_template, options)
569
+ promise = @client.make_request_async(:patch, path_template, options)
381
570
 
382
571
  promise = promise.then do |result|
383
572
  http_response = result.response
384
573
  status_code = http_response.status
385
574
  response_content = http_response.body
386
- unless status_code == 200
575
+ unless status_code == 200 || status_code == 201
387
576
  error_model = JSON.load(response_content)
388
577
  fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
389
578
  end
@@ -393,95 +582,18 @@ module Azure::ARM::RecoveryServices
393
582
  if status_code == 200
394
583
  begin
395
584
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
396
- result_mapper = VaultList.mapper()
397
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
585
+ result_mapper = Azure::ARM::RecoveryServices::Models::Vault.mapper()
586
+ result.body = @client.deserialize(result_mapper, parsed_response)
398
587
  rescue Exception => e
399
588
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
400
589
  end
401
590
  end
402
-
403
- result
404
- end
405
-
406
- promise.execute
407
- end
408
-
409
- #
410
- # Retrieve a list of Vaults.
411
- #
412
- # @param next_page_link [String] The NextLink from the previous successful call
413
- # to List operation.
414
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
415
- # will be added to the HTTP request.
416
- #
417
- # @return [VaultList] operation results.
418
- #
419
- def list_by_resource_group_next(next_page_link, custom_headers = nil)
420
- response = list_by_resource_group_next_async(next_page_link, custom_headers).value!
421
- response.body unless response.nil?
422
- end
423
-
424
- #
425
- # Retrieve a list of Vaults.
426
- #
427
- # @param next_page_link [String] The NextLink from the previous successful call
428
- # to List operation.
429
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
430
- # will be added to the HTTP request.
431
- #
432
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
433
- #
434
- def list_by_resource_group_next_with_http_info(next_page_link, custom_headers = nil)
435
- list_by_resource_group_next_async(next_page_link, custom_headers).value!
436
- end
437
-
438
- #
439
- # Retrieve a list of Vaults.
440
- #
441
- # @param next_page_link [String] The NextLink from the previous successful call
442
- # to List operation.
443
- # @param [Hash{String => String}] A hash of custom headers that will be added
444
- # to the HTTP request.
445
- #
446
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
447
- #
448
- def list_by_resource_group_next_async(next_page_link, custom_headers = nil)
449
- fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
450
-
451
-
452
- request_headers = {}
453
-
454
- # Set Headers
455
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
456
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
457
- path_template = '{nextLink}'
458
-
459
- request_url = @base_url || @client.base_url
460
-
461
- options = {
462
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
463
- skip_encoding_path_params: {'nextLink' => next_page_link},
464
- headers: request_headers.merge(custom_headers || {}),
465
- base_url: request_url
466
- }
467
- promise = @client.make_request_async(:get, path_template, options)
468
-
469
- promise = promise.then do |result|
470
- http_response = result.response
471
- status_code = http_response.status
472
- response_content = http_response.body
473
- unless status_code == 200
474
- error_model = JSON.load(response_content)
475
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
476
- end
477
-
478
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
479
591
  # Deserialize Response
480
- if status_code == 200
592
+ if status_code == 201
481
593
  begin
482
594
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
483
- result_mapper = VaultList.mapper()
484
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
595
+ result_mapper = Azure::ARM::RecoveryServices::Models::Vault.mapper()
596
+ result.body = @client.deserialize(result_mapper, parsed_response)
485
597
  rescue Exception => e
486
598
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
487
599
  end
@@ -493,26 +605,5 @@ module Azure::ARM::RecoveryServices
493
605
  promise.execute
494
606
  end
495
607
 
496
- #
497
- # Retrieve a list of Vaults.
498
- #
499
- # @param resource_group_name [String] The name of the resource group where the
500
- # recovery services vault is present.
501
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
502
- # will be added to the HTTP request.
503
- #
504
- # @return [VaultList] which provide lazy access to pages of the response.
505
- #
506
- def list_by_resource_group_as_lazy(resource_group_name, custom_headers = nil)
507
- response = list_by_resource_group_async(resource_group_name, custom_headers).value!
508
- unless response.nil?
509
- page = response.body
510
- page.next_method = Proc.new do |next_page_link|
511
- list_by_resource_group_next_async(next_page_link, custom_headers)
512
- end
513
- page
514
- end
515
- end
516
-
517
608
  end
518
609
  end