azure_mgmt_key_vault 0.15.2 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-06-01/generated/azure_mgmt_key_vault/key_vault_management_client.rb +4 -1
  3. data/lib/2015-06-01/generated/azure_mgmt_key_vault/vaults.rb +48 -43
  4. data/lib/2016-10-01/generated/azure_mgmt_key_vault.rb +20 -6
  5. data/lib/2016-10-01/generated/azure_mgmt_key_vault/key_vault_management_client.rb +9 -2
  6. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/access_policy_update_kind.rb +17 -0
  7. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/check_name_availability_result.rb +77 -0
  8. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/log_specification.rb +68 -0
  9. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/operation.rb +83 -0
  10. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/operation_display.rb +79 -0
  11. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/operation_list_result.rb +100 -0
  12. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/reason.rb +16 -0
  13. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/resource.rb +2 -1
  14. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/resource_list_result.rb +2 -2
  15. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/service_specification.rb +55 -0
  16. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/vault.rb +2 -1
  17. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/vault_access_policy_parameters.rb +95 -0
  18. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/vault_access_policy_properties.rb +57 -0
  19. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/vault_check_name_availability_parameters.rb +60 -0
  20. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/vault_list_result.rb +2 -2
  21. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/vault_patch_parameters.rb +67 -0
  22. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/vault_patch_properties.rb +145 -0
  23. data/lib/2016-10-01/generated/azure_mgmt_key_vault/models/vault_properties.rb +1 -3
  24. data/lib/2016-10-01/generated/azure_mgmt_key_vault/operations.rb +216 -0
  25. data/lib/2016-10-01/generated/azure_mgmt_key_vault/vaults.rb +692 -91
  26. data/lib/profiles/latest/keyvault_latest_profile_client.rb +28 -9
  27. data/lib/profiles/latest/keyvault_module_definition.rb +0 -1
  28. data/lib/profiles/latest/modules/keyvault_profile_module.rb +142 -69
  29. data/lib/version.rb +1 -1
  30. metadata +17 -3
@@ -35,13 +35,11 @@ module Azure::KeyVault::Mgmt::V2016_10_01
35
35
  #
36
36
  # @return [Vault] operation results.
37
37
  #
38
- def create_or_update(resource_group_name, vault_name, parameters, custom_headers = nil)
39
- response = create_or_update_async(resource_group_name, vault_name, parameters, custom_headers).value!
38
+ def create_or_update(resource_group_name, vault_name, parameters, custom_headers:nil)
39
+ response = create_or_update_async(resource_group_name, vault_name, parameters, custom_headers:custom_headers).value!
40
40
  response.body unless response.nil?
41
41
  end
42
42
 
43
- #
44
- # Create or update a key vault in the specified subscription.
45
43
  #
46
44
  # @param resource_group_name [String] The name of the Resource Group to which
47
45
  # the server belongs.
@@ -51,26 +49,73 @@ module Azure::KeyVault::Mgmt::V2016_10_01
51
49
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
52
50
  # will be added to the HTTP request.
53
51
  #
52
+ # @return [Concurrent::Promise] promise which provides async access to http
53
+ # response.
54
+ #
55
+ def create_or_update_async(resource_group_name, vault_name, parameters, custom_headers:nil)
56
+ # Send request
57
+ promise = begin_create_or_update_async(resource_group_name, vault_name, parameters, custom_headers:custom_headers)
58
+
59
+ promise = promise.then do |response|
60
+ # Defining deserialization method.
61
+ deserialize_method = lambda do |parsed_response|
62
+ result_mapper = Azure::KeyVault::Mgmt::V2016_10_01::Models::Vault.mapper()
63
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
64
+ end
65
+
66
+ # Waiting for response.
67
+ @client.get_long_running_operation_result(response, deserialize_method)
68
+ end
69
+
70
+ promise
71
+ end
72
+
73
+ #
74
+ # Update a key vault in the specified subscription.
75
+ #
76
+ # @param resource_group_name [String] The name of the Resource Group to which
77
+ # the server belongs.
78
+ # @param vault_name [String] Name of the vault
79
+ # @param parameters [VaultPatchParameters] Parameters to patch the vault
80
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
81
+ # will be added to the HTTP request.
82
+ #
83
+ # @return [Vault] operation results.
84
+ #
85
+ def update(resource_group_name, vault_name, parameters, custom_headers:nil)
86
+ response = update_async(resource_group_name, vault_name, parameters, custom_headers:custom_headers).value!
87
+ response.body unless response.nil?
88
+ end
89
+
90
+ #
91
+ # Update a key vault in the specified subscription.
92
+ #
93
+ # @param resource_group_name [String] The name of the Resource Group to which
94
+ # the server belongs.
95
+ # @param vault_name [String] Name of the vault
96
+ # @param parameters [VaultPatchParameters] Parameters to patch the vault
97
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
98
+ # will be added to the HTTP request.
99
+ #
54
100
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
55
101
  #
56
- def create_or_update_with_http_info(resource_group_name, vault_name, parameters, custom_headers = nil)
57
- create_or_update_async(resource_group_name, vault_name, parameters, custom_headers).value!
102
+ def update_with_http_info(resource_group_name, vault_name, parameters, custom_headers:nil)
103
+ update_async(resource_group_name, vault_name, parameters, custom_headers:custom_headers).value!
58
104
  end
59
105
 
60
106
  #
61
- # Create or update a key vault in the specified subscription.
107
+ # Update a key vault in the specified subscription.
62
108
  #
63
109
  # @param resource_group_name [String] The name of the Resource Group to which
64
110
  # the server belongs.
65
111
  # @param vault_name [String] Name of the vault
66
- # @param parameters [VaultCreateOrUpdateParameters] Parameters to create or
67
- # update the vault
112
+ # @param parameters [VaultPatchParameters] Parameters to patch the vault
68
113
  # @param [Hash{String => String}] A hash of custom headers that will be added
69
114
  # to the HTTP request.
70
115
  #
71
116
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
72
117
  #
73
- def create_or_update_async(resource_group_name, vault_name, parameters, custom_headers = nil)
118
+ def update_async(resource_group_name, vault_name, parameters, custom_headers:nil)
74
119
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
75
120
  fail ArgumentError, 'vault_name is nil' if vault_name.nil?
76
121
  fail ArgumentError, "'vault_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]{3,24}$'" if !vault_name.nil? && vault_name.match(Regexp.new('^^[a-zA-Z0-9-]{3,24}$$')).nil?
@@ -80,15 +125,14 @@ module Azure::KeyVault::Mgmt::V2016_10_01
80
125
 
81
126
 
82
127
  request_headers = {}
128
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
83
129
 
84
130
  # Set Headers
85
131
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
86
132
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
87
133
 
88
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
89
-
90
134
  # Serialize Request
91
- request_mapper = Azure::KeyVault::Mgmt::V2016_10_01::Models::VaultCreateOrUpdateParameters.mapper()
135
+ request_mapper = Azure::KeyVault::Mgmt::V2016_10_01::Models::VaultPatchParameters.mapper()
92
136
  request_content = @client.serialize(request_mapper, parameters)
93
137
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
94
138
 
@@ -104,7 +148,7 @@ module Azure::KeyVault::Mgmt::V2016_10_01
104
148
  headers: request_headers.merge(custom_headers || {}),
105
149
  base_url: request_url
106
150
  }
107
- promise = @client.make_request_async(:put, path_template, options)
151
+ promise = @client.make_request_async(:patch, path_template, options)
108
152
 
109
153
  promise = promise.then do |result|
110
154
  http_response = result.response
@@ -153,8 +197,8 @@ module Azure::KeyVault::Mgmt::V2016_10_01
153
197
  # will be added to the HTTP request.
154
198
  #
155
199
  #
156
- def delete(resource_group_name, vault_name, custom_headers = nil)
157
- response = delete_async(resource_group_name, vault_name, custom_headers).value!
200
+ def delete(resource_group_name, vault_name, custom_headers:nil)
201
+ response = delete_async(resource_group_name, vault_name, custom_headers:custom_headers).value!
158
202
  nil
159
203
  end
160
204
 
@@ -169,8 +213,8 @@ module Azure::KeyVault::Mgmt::V2016_10_01
169
213
  #
170
214
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
171
215
  #
172
- def delete_with_http_info(resource_group_name, vault_name, custom_headers = nil)
173
- delete_async(resource_group_name, vault_name, custom_headers).value!
216
+ def delete_with_http_info(resource_group_name, vault_name, custom_headers:nil)
217
+ delete_async(resource_group_name, vault_name, custom_headers:custom_headers).value!
174
218
  end
175
219
 
176
220
  #
@@ -184,7 +228,7 @@ module Azure::KeyVault::Mgmt::V2016_10_01
184
228
  #
185
229
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
186
230
  #
187
- def delete_async(resource_group_name, vault_name, custom_headers = nil)
231
+ def delete_async(resource_group_name, vault_name, custom_headers:nil)
188
232
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
189
233
  fail ArgumentError, 'vault_name is nil' if vault_name.nil?
190
234
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
@@ -192,6 +236,7 @@ module Azure::KeyVault::Mgmt::V2016_10_01
192
236
 
193
237
 
194
238
  request_headers = {}
239
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
195
240
 
196
241
  # Set Headers
197
242
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -237,8 +282,8 @@ module Azure::KeyVault::Mgmt::V2016_10_01
237
282
  #
238
283
  # @return [Vault] operation results.
239
284
  #
240
- def get(resource_group_name, vault_name, custom_headers = nil)
241
- response = get_async(resource_group_name, vault_name, custom_headers).value!
285
+ def get(resource_group_name, vault_name, custom_headers:nil)
286
+ response = get_async(resource_group_name, vault_name, custom_headers:custom_headers).value!
242
287
  response.body unless response.nil?
243
288
  end
244
289
 
@@ -253,8 +298,8 @@ module Azure::KeyVault::Mgmt::V2016_10_01
253
298
  #
254
299
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
255
300
  #
256
- def get_with_http_info(resource_group_name, vault_name, custom_headers = nil)
257
- get_async(resource_group_name, vault_name, custom_headers).value!
301
+ def get_with_http_info(resource_group_name, vault_name, custom_headers:nil)
302
+ get_async(resource_group_name, vault_name, custom_headers:custom_headers).value!
258
303
  end
259
304
 
260
305
  #
@@ -268,7 +313,7 @@ module Azure::KeyVault::Mgmt::V2016_10_01
268
313
  #
269
314
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
270
315
  #
271
- def get_async(resource_group_name, vault_name, custom_headers = nil)
316
+ def get_async(resource_group_name, vault_name, custom_headers:nil)
272
317
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
273
318
  fail ArgumentError, 'vault_name is nil' if vault_name.nil?
274
319
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
@@ -276,6 +321,7 @@ module Azure::KeyVault::Mgmt::V2016_10_01
276
321
 
277
322
 
278
323
  request_headers = {}
324
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
279
325
 
280
326
  # Set Headers
281
327
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -320,6 +366,133 @@ module Azure::KeyVault::Mgmt::V2016_10_01
320
366
  promise.execute
321
367
  end
322
368
 
369
+ #
370
+ # Update access policies in a key vault in the specified subscription.
371
+ #
372
+ # @param resource_group_name [String] The name of the Resource Group to which
373
+ # the vault belongs.
374
+ # @param vault_name [String] Name of the vault
375
+ # @param operation_kind [AccessPolicyUpdateKind] Name of the operation.
376
+ # Possible values include: 'add', 'replace', 'remove'
377
+ # @param parameters [VaultAccessPolicyParameters] Access policy to merge into
378
+ # the vault
379
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
380
+ # will be added to the HTTP request.
381
+ #
382
+ # @return [VaultAccessPolicyParameters] operation results.
383
+ #
384
+ def update_access_policy(resource_group_name, vault_name, operation_kind, parameters, custom_headers:nil)
385
+ response = update_access_policy_async(resource_group_name, vault_name, operation_kind, parameters, custom_headers:custom_headers).value!
386
+ response.body unless response.nil?
387
+ end
388
+
389
+ #
390
+ # Update access policies in a key vault in the specified subscription.
391
+ #
392
+ # @param resource_group_name [String] The name of the Resource Group to which
393
+ # the vault belongs.
394
+ # @param vault_name [String] Name of the vault
395
+ # @param operation_kind [AccessPolicyUpdateKind] Name of the operation.
396
+ # Possible values include: 'add', 'replace', 'remove'
397
+ # @param parameters [VaultAccessPolicyParameters] Access policy to merge into
398
+ # the vault
399
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
400
+ # will be added to the HTTP request.
401
+ #
402
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
403
+ #
404
+ def update_access_policy_with_http_info(resource_group_name, vault_name, operation_kind, parameters, custom_headers:nil)
405
+ update_access_policy_async(resource_group_name, vault_name, operation_kind, parameters, custom_headers:custom_headers).value!
406
+ end
407
+
408
+ #
409
+ # Update access policies in a key vault in the specified subscription.
410
+ #
411
+ # @param resource_group_name [String] The name of the Resource Group to which
412
+ # the vault belongs.
413
+ # @param vault_name [String] Name of the vault
414
+ # @param operation_kind [AccessPolicyUpdateKind] Name of the operation.
415
+ # Possible values include: 'add', 'replace', 'remove'
416
+ # @param parameters [VaultAccessPolicyParameters] Access policy to merge into
417
+ # the vault
418
+ # @param [Hash{String => String}] A hash of custom headers that will be added
419
+ # to the HTTP request.
420
+ #
421
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
422
+ #
423
+ def update_access_policy_async(resource_group_name, vault_name, operation_kind, parameters, custom_headers:nil)
424
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
425
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
426
+ fail ArgumentError, "'vault_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]{3,24}$'" if !vault_name.nil? && vault_name.match(Regexp.new('^^[a-zA-Z0-9-]{3,24}$$')).nil?
427
+ fail ArgumentError, 'operation_kind is nil' if operation_kind.nil?
428
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
429
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
430
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
431
+
432
+
433
+ request_headers = {}
434
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
435
+
436
+ # Set Headers
437
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
438
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
439
+
440
+ # Serialize Request
441
+ request_mapper = Azure::KeyVault::Mgmt::V2016_10_01::Models::VaultAccessPolicyParameters.mapper()
442
+ request_content = @client.serialize(request_mapper, parameters)
443
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
444
+
445
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/accessPolicies/{operationKind}'
446
+
447
+ request_url = @base_url || @client.base_url
448
+
449
+ options = {
450
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
451
+ path_params: {'resourceGroupName' => resource_group_name,'vaultName' => vault_name,'operationKind' => operation_kind,'subscriptionId' => @client.subscription_id},
452
+ query_params: {'api-version' => @client.api_version},
453
+ body: request_content,
454
+ headers: request_headers.merge(custom_headers || {}),
455
+ base_url: request_url
456
+ }
457
+ promise = @client.make_request_async(:put, path_template, options)
458
+
459
+ promise = promise.then do |result|
460
+ http_response = result.response
461
+ status_code = http_response.status
462
+ response_content = http_response.body
463
+ unless status_code == 201 || status_code == 200
464
+ error_model = JSON.load(response_content)
465
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
466
+ end
467
+
468
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
469
+ # Deserialize Response
470
+ if status_code == 201
471
+ begin
472
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
473
+ result_mapper = Azure::KeyVault::Mgmt::V2016_10_01::Models::VaultAccessPolicyParameters.mapper()
474
+ result.body = @client.deserialize(result_mapper, parsed_response)
475
+ rescue Exception => e
476
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
477
+ end
478
+ end
479
+ # Deserialize Response
480
+ if status_code == 200
481
+ begin
482
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
483
+ result_mapper = Azure::KeyVault::Mgmt::V2016_10_01::Models::VaultAccessPolicyParameters.mapper()
484
+ result.body = @client.deserialize(result_mapper, parsed_response)
485
+ rescue Exception => e
486
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
487
+ end
488
+ end
489
+
490
+ result
491
+ end
492
+
493
+ promise.execute
494
+ end
495
+
323
496
  #
324
497
  # The List operation gets information about the vaults associated with the
325
498
  # subscription and within the specified resource group.
@@ -332,8 +505,8 @@ module Azure::KeyVault::Mgmt::V2016_10_01
332
505
  #
333
506
  # @return [Array<Vault>] operation results.
334
507
  #
335
- def list_by_resource_group(resource_group_name, top = nil, custom_headers = nil)
336
- first_page = list_by_resource_group_as_lazy(resource_group_name, top, custom_headers)
508
+ def list_by_resource_group(resource_group_name, top:nil, custom_headers:nil)
509
+ first_page = list_by_resource_group_as_lazy(resource_group_name, top:top, custom_headers:custom_headers)
337
510
  first_page.get_all_items
338
511
  end
339
512
 
@@ -349,8 +522,8 @@ module Azure::KeyVault::Mgmt::V2016_10_01
349
522
  #
350
523
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
351
524
  #
352
- def list_by_resource_group_with_http_info(resource_group_name, top = nil, custom_headers = nil)
353
- list_by_resource_group_async(resource_group_name, top, custom_headers).value!
525
+ def list_by_resource_group_with_http_info(resource_group_name, top:nil, custom_headers:nil)
526
+ list_by_resource_group_async(resource_group_name, top:top, custom_headers:custom_headers).value!
354
527
  end
355
528
 
356
529
  #
@@ -365,13 +538,14 @@ module Azure::KeyVault::Mgmt::V2016_10_01
365
538
  #
366
539
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
367
540
  #
368
- def list_by_resource_group_async(resource_group_name, top = nil, custom_headers = nil)
541
+ def list_by_resource_group_async(resource_group_name, top:nil, custom_headers:nil)
369
542
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
370
543
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
371
544
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
372
545
 
373
546
 
374
547
  request_headers = {}
548
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
375
549
 
376
550
  # Set Headers
377
551
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -416,6 +590,96 @@ module Azure::KeyVault::Mgmt::V2016_10_01
416
590
  promise.execute
417
591
  end
418
592
 
593
+ #
594
+ # The List operation gets information about the vaults associated with the
595
+ # subscription.
596
+ #
597
+ # @param top [Integer] Maximum number of results to return.
598
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
599
+ # will be added to the HTTP request.
600
+ #
601
+ # @return [Array<Vault>] operation results.
602
+ #
603
+ def list_by_subscription(top:nil, custom_headers:nil)
604
+ first_page = list_by_subscription_as_lazy(top:top, custom_headers:custom_headers)
605
+ first_page.get_all_items
606
+ end
607
+
608
+ #
609
+ # The List operation gets information about the vaults associated with the
610
+ # subscription.
611
+ #
612
+ # @param top [Integer] Maximum number of results to return.
613
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
614
+ # will be added to the HTTP request.
615
+ #
616
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
617
+ #
618
+ def list_by_subscription_with_http_info(top:nil, custom_headers:nil)
619
+ list_by_subscription_async(top:top, custom_headers:custom_headers).value!
620
+ end
621
+
622
+ #
623
+ # The List operation gets information about the vaults associated with the
624
+ # subscription.
625
+ #
626
+ # @param top [Integer] Maximum number of results to return.
627
+ # @param [Hash{String => String}] A hash of custom headers that will be added
628
+ # to the HTTP request.
629
+ #
630
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
631
+ #
632
+ def list_by_subscription_async(top:nil, custom_headers:nil)
633
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
634
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
635
+
636
+
637
+ request_headers = {}
638
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
639
+
640
+ # Set Headers
641
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
642
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
643
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/vaults'
644
+
645
+ request_url = @base_url || @client.base_url
646
+
647
+ options = {
648
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
649
+ path_params: {'subscriptionId' => @client.subscription_id},
650
+ query_params: {'$top' => top,'api-version' => @client.api_version},
651
+ headers: request_headers.merge(custom_headers || {}),
652
+ base_url: request_url
653
+ }
654
+ promise = @client.make_request_async(:get, path_template, options)
655
+
656
+ promise = promise.then do |result|
657
+ http_response = result.response
658
+ status_code = http_response.status
659
+ response_content = http_response.body
660
+ unless status_code == 200
661
+ error_model = JSON.load(response_content)
662
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
663
+ end
664
+
665
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
666
+ # Deserialize Response
667
+ if status_code == 200
668
+ begin
669
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
670
+ result_mapper = Azure::KeyVault::Mgmt::V2016_10_01::Models::VaultListResult.mapper()
671
+ result.body = @client.deserialize(result_mapper, parsed_response)
672
+ rescue Exception => e
673
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
674
+ end
675
+ end
676
+
677
+ result
678
+ end
679
+
680
+ promise.execute
681
+ end
682
+
419
683
  #
420
684
  # Gets information about the deleted vaults in a subscription.
421
685
  #
@@ -424,8 +688,8 @@ module Azure::KeyVault::Mgmt::V2016_10_01
424
688
  #
425
689
  # @return [Array<DeletedVault>] operation results.
426
690
  #
427
- def list_deleted(custom_headers = nil)
428
- first_page = list_deleted_as_lazy(custom_headers)
691
+ def list_deleted(custom_headers:nil)
692
+ first_page = list_deleted_as_lazy(custom_headers:custom_headers)
429
693
  first_page.get_all_items
430
694
  end
431
695
 
@@ -437,8 +701,8 @@ module Azure::KeyVault::Mgmt::V2016_10_01
437
701
  #
438
702
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
439
703
  #
440
- def list_deleted_with_http_info(custom_headers = nil)
441
- list_deleted_async(custom_headers).value!
704
+ def list_deleted_with_http_info(custom_headers:nil)
705
+ list_deleted_async(custom_headers:custom_headers).value!
442
706
  end
443
707
 
444
708
  #
@@ -449,12 +713,13 @@ module Azure::KeyVault::Mgmt::V2016_10_01
449
713
  #
450
714
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
451
715
  #
452
- def list_deleted_async(custom_headers = nil)
716
+ def list_deleted_async(custom_headers:nil)
453
717
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
454
718
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
455
719
 
456
720
 
457
721
  request_headers = {}
722
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
458
723
 
459
724
  # Set Headers
460
725
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -509,8 +774,8 @@ module Azure::KeyVault::Mgmt::V2016_10_01
509
774
  #
510
775
  # @return [DeletedVault] operation results.
511
776
  #
512
- def get_deleted(vault_name, location, custom_headers = nil)
513
- response = get_deleted_async(vault_name, location, custom_headers).value!
777
+ def get_deleted(vault_name, location, custom_headers:nil)
778
+ response = get_deleted_async(vault_name, location, custom_headers:custom_headers).value!
514
779
  response.body unless response.nil?
515
780
  end
516
781
 
@@ -524,8 +789,8 @@ module Azure::KeyVault::Mgmt::V2016_10_01
524
789
  #
525
790
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
526
791
  #
527
- def get_deleted_with_http_info(vault_name, location, custom_headers = nil)
528
- get_deleted_async(vault_name, location, custom_headers).value!
792
+ def get_deleted_with_http_info(vault_name, location, custom_headers:nil)
793
+ get_deleted_async(vault_name, location, custom_headers:custom_headers).value!
529
794
  end
530
795
 
531
796
  #
@@ -538,7 +803,7 @@ module Azure::KeyVault::Mgmt::V2016_10_01
538
803
  #
539
804
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
540
805
  #
541
- def get_deleted_async(vault_name, location, custom_headers = nil)
806
+ def get_deleted_async(vault_name, location, custom_headers:nil)
542
807
  fail ArgumentError, 'vault_name is nil' if vault_name.nil?
543
808
  fail ArgumentError, 'location is nil' if location.nil?
544
809
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
@@ -546,6 +811,7 @@ module Azure::KeyVault::Mgmt::V2016_10_01
546
811
 
547
812
 
548
813
  request_headers = {}
814
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
549
815
 
550
816
  # Set Headers
551
817
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -599,8 +865,8 @@ module Azure::KeyVault::Mgmt::V2016_10_01
599
865
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
600
866
  # will be added to the HTTP request.
601
867
  #
602
- def purge_deleted(vault_name, location, custom_headers = nil)
603
- response = purge_deleted_async(vault_name, location, custom_headers).value!
868
+ def purge_deleted(vault_name, location, custom_headers:nil)
869
+ response = purge_deleted_async(vault_name, location, custom_headers:custom_headers).value!
604
870
  nil
605
871
  end
606
872
 
@@ -613,9 +879,9 @@ module Azure::KeyVault::Mgmt::V2016_10_01
613
879
  # @return [Concurrent::Promise] promise which provides async access to http
614
880
  # response.
615
881
  #
616
- def purge_deleted_async(vault_name, location, custom_headers = nil)
882
+ def purge_deleted_async(vault_name, location, custom_headers:nil)
617
883
  # Send request
618
- promise = begin_purge_deleted_async(vault_name, location, custom_headers)
884
+ promise = begin_purge_deleted_async(vault_name, location, custom_headers:custom_headers)
619
885
 
620
886
  promise = promise.then do |response|
621
887
  # Defining deserialization method.
@@ -639,8 +905,8 @@ module Azure::KeyVault::Mgmt::V2016_10_01
639
905
  #
640
906
  # @return [Array<Resource>] operation results.
641
907
  #
642
- def list(top = nil, custom_headers = nil)
643
- first_page = list_as_lazy(top, custom_headers)
908
+ def list(top:nil, custom_headers:nil)
909
+ first_page = list_as_lazy(top:top, custom_headers:custom_headers)
644
910
  first_page.get_all_items
645
911
  end
646
912
 
@@ -654,8 +920,8 @@ module Azure::KeyVault::Mgmt::V2016_10_01
654
920
  #
655
921
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
656
922
  #
657
- def list_with_http_info(top = nil, custom_headers = nil)
658
- list_async(top, custom_headers).value!
923
+ def list_with_http_info(top:nil, custom_headers:nil)
924
+ list_async(top:top, custom_headers:custom_headers).value!
659
925
  end
660
926
 
661
927
  #
@@ -668,13 +934,14 @@ module Azure::KeyVault::Mgmt::V2016_10_01
668
934
  #
669
935
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
670
936
  #
671
- def list_async(top = nil, custom_headers = nil)
937
+ def list_async(top:nil, custom_headers:nil)
672
938
  filter = 'resourceType eq \'Microsoft.KeyVault/vaults\''
673
939
  api_version = '2015-11-01'
674
940
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
675
941
 
676
942
 
677
943
  request_headers = {}
944
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
678
945
 
679
946
  # Set Headers
680
947
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -720,54 +987,273 @@ module Azure::KeyVault::Mgmt::V2016_10_01
720
987
  end
721
988
 
722
989
  #
723
- # Permanently deletes the specified vault. aka Purges the deleted Azure key
724
- # vault.
990
+ # Checks that the vault name is valid and is not already in use.
725
991
  #
726
- # @param vault_name [String] The name of the soft-deleted vault.
727
- # @param location [String] The location of the soft-deleted vault.
992
+ # @param vault_name [VaultCheckNameAvailabilityParameters] The name of the
993
+ # vault.
728
994
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
729
995
  # will be added to the HTTP request.
730
996
  #
997
+ # @return [CheckNameAvailabilityResult] operation results.
731
998
  #
732
- def begin_purge_deleted(vault_name, location, custom_headers = nil)
733
- response = begin_purge_deleted_async(vault_name, location, custom_headers).value!
734
- nil
999
+ def check_name_availability(vault_name, custom_headers:nil)
1000
+ response = check_name_availability_async(vault_name, custom_headers:custom_headers).value!
1001
+ response.body unless response.nil?
735
1002
  end
736
1003
 
737
1004
  #
738
- # Permanently deletes the specified vault. aka Purges the deleted Azure key
739
- # vault.
1005
+ # Checks that the vault name is valid and is not already in use.
740
1006
  #
741
- # @param vault_name [String] The name of the soft-deleted vault.
742
- # @param location [String] The location of the soft-deleted vault.
1007
+ # @param vault_name [VaultCheckNameAvailabilityParameters] The name of the
1008
+ # vault.
743
1009
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
744
1010
  # will be added to the HTTP request.
745
1011
  #
746
1012
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
747
1013
  #
748
- def begin_purge_deleted_with_http_info(vault_name, location, custom_headers = nil)
749
- begin_purge_deleted_async(vault_name, location, custom_headers).value!
1014
+ def check_name_availability_with_http_info(vault_name, custom_headers:nil)
1015
+ check_name_availability_async(vault_name, custom_headers:custom_headers).value!
750
1016
  end
751
1017
 
752
1018
  #
753
- # Permanently deletes the specified vault. aka Purges the deleted Azure key
754
- # vault.
1019
+ # Checks that the vault name is valid and is not already in use.
755
1020
  #
756
- # @param vault_name [String] The name of the soft-deleted vault.
757
- # @param location [String] The location of the soft-deleted vault.
1021
+ # @param vault_name [VaultCheckNameAvailabilityParameters] The name of the
1022
+ # vault.
758
1023
  # @param [Hash{String => String}] A hash of custom headers that will be added
759
1024
  # to the HTTP request.
760
1025
  #
761
1026
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
762
1027
  #
763
- def begin_purge_deleted_async(vault_name, location, custom_headers = nil)
1028
+ def check_name_availability_async(vault_name, custom_headers:nil)
764
1029
  fail ArgumentError, 'vault_name is nil' if vault_name.nil?
765
- fail ArgumentError, 'location is nil' if location.nil?
766
1030
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
767
1031
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
768
1032
 
769
1033
 
770
1034
  request_headers = {}
1035
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1036
+
1037
+ # Set Headers
1038
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1039
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1040
+
1041
+ # Serialize Request
1042
+ request_mapper = Azure::KeyVault::Mgmt::V2016_10_01::Models::VaultCheckNameAvailabilityParameters.mapper()
1043
+ request_content = @client.serialize(request_mapper, vault_name)
1044
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1045
+
1046
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/checkNameAvailability'
1047
+
1048
+ request_url = @base_url || @client.base_url
1049
+
1050
+ options = {
1051
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1052
+ path_params: {'subscriptionId' => @client.subscription_id},
1053
+ query_params: {'api-version' => @client.api_version},
1054
+ body: request_content,
1055
+ headers: request_headers.merge(custom_headers || {}),
1056
+ base_url: request_url
1057
+ }
1058
+ promise = @client.make_request_async(:post, path_template, options)
1059
+
1060
+ promise = promise.then do |result|
1061
+ http_response = result.response
1062
+ status_code = http_response.status
1063
+ response_content = http_response.body
1064
+ unless status_code == 200
1065
+ error_model = JSON.load(response_content)
1066
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1067
+ end
1068
+
1069
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1070
+ # Deserialize Response
1071
+ if status_code == 200
1072
+ begin
1073
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1074
+ result_mapper = Azure::KeyVault::Mgmt::V2016_10_01::Models::CheckNameAvailabilityResult.mapper()
1075
+ result.body = @client.deserialize(result_mapper, parsed_response)
1076
+ rescue Exception => e
1077
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1078
+ end
1079
+ end
1080
+
1081
+ result
1082
+ end
1083
+
1084
+ promise.execute
1085
+ end
1086
+
1087
+ #
1088
+ # Create or update a key vault in the specified subscription.
1089
+ #
1090
+ # @param resource_group_name [String] The name of the Resource Group to which
1091
+ # the server belongs.
1092
+ # @param vault_name [String] Name of the vault
1093
+ # @param parameters [VaultCreateOrUpdateParameters] Parameters to create or
1094
+ # update the vault
1095
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1096
+ # will be added to the HTTP request.
1097
+ #
1098
+ # @return [Vault] operation results.
1099
+ #
1100
+ def begin_create_or_update(resource_group_name, vault_name, parameters, custom_headers:nil)
1101
+ response = begin_create_or_update_async(resource_group_name, vault_name, parameters, custom_headers:custom_headers).value!
1102
+ response.body unless response.nil?
1103
+ end
1104
+
1105
+ #
1106
+ # Create or update a key vault in the specified subscription.
1107
+ #
1108
+ # @param resource_group_name [String] The name of the Resource Group to which
1109
+ # the server belongs.
1110
+ # @param vault_name [String] Name of the vault
1111
+ # @param parameters [VaultCreateOrUpdateParameters] Parameters to create or
1112
+ # update the vault
1113
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1114
+ # will be added to the HTTP request.
1115
+ #
1116
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1117
+ #
1118
+ def begin_create_or_update_with_http_info(resource_group_name, vault_name, parameters, custom_headers:nil)
1119
+ begin_create_or_update_async(resource_group_name, vault_name, parameters, custom_headers:custom_headers).value!
1120
+ end
1121
+
1122
+ #
1123
+ # Create or update a key vault in the specified subscription.
1124
+ #
1125
+ # @param resource_group_name [String] The name of the Resource Group to which
1126
+ # the server belongs.
1127
+ # @param vault_name [String] Name of the vault
1128
+ # @param parameters [VaultCreateOrUpdateParameters] Parameters to create or
1129
+ # update the vault
1130
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1131
+ # to the HTTP request.
1132
+ #
1133
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1134
+ #
1135
+ def begin_create_or_update_async(resource_group_name, vault_name, parameters, custom_headers:nil)
1136
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1137
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
1138
+ fail ArgumentError, "'vault_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]{3,24}$'" if !vault_name.nil? && vault_name.match(Regexp.new('^^[a-zA-Z0-9-]{3,24}$$')).nil?
1139
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1140
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1141
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1142
+
1143
+
1144
+ request_headers = {}
1145
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1146
+
1147
+ # Set Headers
1148
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1149
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1150
+
1151
+ # Serialize Request
1152
+ request_mapper = Azure::KeyVault::Mgmt::V2016_10_01::Models::VaultCreateOrUpdateParameters.mapper()
1153
+ request_content = @client.serialize(request_mapper, parameters)
1154
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1155
+
1156
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}'
1157
+
1158
+ request_url = @base_url || @client.base_url
1159
+
1160
+ options = {
1161
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1162
+ path_params: {'resourceGroupName' => resource_group_name,'vaultName' => vault_name,'subscriptionId' => @client.subscription_id},
1163
+ query_params: {'api-version' => @client.api_version},
1164
+ body: request_content,
1165
+ headers: request_headers.merge(custom_headers || {}),
1166
+ base_url: request_url
1167
+ }
1168
+ promise = @client.make_request_async(:put, path_template, options)
1169
+
1170
+ promise = promise.then do |result|
1171
+ http_response = result.response
1172
+ status_code = http_response.status
1173
+ response_content = http_response.body
1174
+ unless status_code == 201 || status_code == 200
1175
+ error_model = JSON.load(response_content)
1176
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1177
+ end
1178
+
1179
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1180
+ # Deserialize Response
1181
+ if status_code == 201
1182
+ begin
1183
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1184
+ result_mapper = Azure::KeyVault::Mgmt::V2016_10_01::Models::Vault.mapper()
1185
+ result.body = @client.deserialize(result_mapper, parsed_response)
1186
+ rescue Exception => e
1187
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1188
+ end
1189
+ end
1190
+ # Deserialize Response
1191
+ if status_code == 200
1192
+ begin
1193
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1194
+ result_mapper = Azure::KeyVault::Mgmt::V2016_10_01::Models::Vault.mapper()
1195
+ result.body = @client.deserialize(result_mapper, parsed_response)
1196
+ rescue Exception => e
1197
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1198
+ end
1199
+ end
1200
+
1201
+ result
1202
+ end
1203
+
1204
+ promise.execute
1205
+ end
1206
+
1207
+ #
1208
+ # Permanently deletes the specified vault. aka Purges the deleted Azure key
1209
+ # vault.
1210
+ #
1211
+ # @param vault_name [String] The name of the soft-deleted vault.
1212
+ # @param location [String] The location of the soft-deleted vault.
1213
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1214
+ # will be added to the HTTP request.
1215
+ #
1216
+ #
1217
+ def begin_purge_deleted(vault_name, location, custom_headers:nil)
1218
+ response = begin_purge_deleted_async(vault_name, location, custom_headers:custom_headers).value!
1219
+ nil
1220
+ end
1221
+
1222
+ #
1223
+ # Permanently deletes the specified vault. aka Purges the deleted Azure key
1224
+ # vault.
1225
+ #
1226
+ # @param vault_name [String] The name of the soft-deleted vault.
1227
+ # @param location [String] The location of the soft-deleted vault.
1228
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1229
+ # will be added to the HTTP request.
1230
+ #
1231
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1232
+ #
1233
+ def begin_purge_deleted_with_http_info(vault_name, location, custom_headers:nil)
1234
+ begin_purge_deleted_async(vault_name, location, custom_headers:custom_headers).value!
1235
+ end
1236
+
1237
+ #
1238
+ # Permanently deletes the specified vault. aka Purges the deleted Azure key
1239
+ # vault.
1240
+ #
1241
+ # @param vault_name [String] The name of the soft-deleted vault.
1242
+ # @param location [String] The location of the soft-deleted vault.
1243
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1244
+ # to the HTTP request.
1245
+ #
1246
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1247
+ #
1248
+ def begin_purge_deleted_async(vault_name, location, custom_headers:nil)
1249
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
1250
+ fail ArgumentError, 'location is nil' if location.nil?
1251
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1252
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1253
+
1254
+
1255
+ request_headers = {}
1256
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
771
1257
 
772
1258
  # Set Headers
773
1259
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -813,8 +1299,8 @@ module Azure::KeyVault::Mgmt::V2016_10_01
813
1299
  #
814
1300
  # @return [VaultListResult] operation results.
815
1301
  #
816
- def list_by_resource_group_next(next_page_link, custom_headers = nil)
817
- response = list_by_resource_group_next_async(next_page_link, custom_headers).value!
1302
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
1303
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
818
1304
  response.body unless response.nil?
819
1305
  end
820
1306
 
@@ -829,8 +1315,8 @@ module Azure::KeyVault::Mgmt::V2016_10_01
829
1315
  #
830
1316
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
831
1317
  #
832
- def list_by_resource_group_next_with_http_info(next_page_link, custom_headers = nil)
833
- list_by_resource_group_next_async(next_page_link, custom_headers).value!
1318
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
1319
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
834
1320
  end
835
1321
 
836
1322
  #
@@ -844,11 +1330,103 @@ module Azure::KeyVault::Mgmt::V2016_10_01
844
1330
  #
845
1331
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
846
1332
  #
847
- def list_by_resource_group_next_async(next_page_link, custom_headers = nil)
1333
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
848
1334
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
849
1335
 
850
1336
 
851
1337
  request_headers = {}
1338
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1339
+
1340
+ # Set Headers
1341
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1342
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1343
+ path_template = '{nextLink}'
1344
+
1345
+ request_url = @base_url || @client.base_url
1346
+
1347
+ options = {
1348
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1349
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1350
+ headers: request_headers.merge(custom_headers || {}),
1351
+ base_url: request_url
1352
+ }
1353
+ promise = @client.make_request_async(:get, path_template, options)
1354
+
1355
+ promise = promise.then do |result|
1356
+ http_response = result.response
1357
+ status_code = http_response.status
1358
+ response_content = http_response.body
1359
+ unless status_code == 200
1360
+ error_model = JSON.load(response_content)
1361
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1362
+ end
1363
+
1364
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1365
+ # Deserialize Response
1366
+ if status_code == 200
1367
+ begin
1368
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1369
+ result_mapper = Azure::KeyVault::Mgmt::V2016_10_01::Models::VaultListResult.mapper()
1370
+ result.body = @client.deserialize(result_mapper, parsed_response)
1371
+ rescue Exception => e
1372
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1373
+ end
1374
+ end
1375
+
1376
+ result
1377
+ end
1378
+
1379
+ promise.execute
1380
+ end
1381
+
1382
+ #
1383
+ # The List operation gets information about the vaults associated with the
1384
+ # subscription.
1385
+ #
1386
+ # @param next_page_link [String] The NextLink from the previous successful call
1387
+ # to List operation.
1388
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1389
+ # will be added to the HTTP request.
1390
+ #
1391
+ # @return [VaultListResult] operation results.
1392
+ #
1393
+ def list_by_subscription_next(next_page_link, custom_headers:nil)
1394
+ response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
1395
+ response.body unless response.nil?
1396
+ end
1397
+
1398
+ #
1399
+ # The List operation gets information about the vaults associated with the
1400
+ # subscription.
1401
+ #
1402
+ # @param next_page_link [String] The NextLink from the previous successful call
1403
+ # to List operation.
1404
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1405
+ # will be added to the HTTP request.
1406
+ #
1407
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1408
+ #
1409
+ def list_by_subscription_next_with_http_info(next_page_link, custom_headers:nil)
1410
+ list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
1411
+ end
1412
+
1413
+ #
1414
+ # The List operation gets information about the vaults associated with the
1415
+ # subscription.
1416
+ #
1417
+ # @param next_page_link [String] The NextLink from the previous successful call
1418
+ # to List operation.
1419
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1420
+ # to the HTTP request.
1421
+ #
1422
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1423
+ #
1424
+ def list_by_subscription_next_async(next_page_link, custom_headers:nil)
1425
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1426
+
1427
+
1428
+ request_headers = {}
1429
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
852
1430
 
853
1431
  # Set Headers
854
1432
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -902,8 +1480,8 @@ module Azure::KeyVault::Mgmt::V2016_10_01
902
1480
  #
903
1481
  # @return [DeletedVaultListResult] operation results.
904
1482
  #
905
- def list_deleted_next(next_page_link, custom_headers = nil)
906
- response = list_deleted_next_async(next_page_link, custom_headers).value!
1483
+ def list_deleted_next(next_page_link, custom_headers:nil)
1484
+ response = list_deleted_next_async(next_page_link, custom_headers:custom_headers).value!
907
1485
  response.body unless response.nil?
908
1486
  end
909
1487
 
@@ -917,8 +1495,8 @@ module Azure::KeyVault::Mgmt::V2016_10_01
917
1495
  #
918
1496
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
919
1497
  #
920
- def list_deleted_next_with_http_info(next_page_link, custom_headers = nil)
921
- list_deleted_next_async(next_page_link, custom_headers).value!
1498
+ def list_deleted_next_with_http_info(next_page_link, custom_headers:nil)
1499
+ list_deleted_next_async(next_page_link, custom_headers:custom_headers).value!
922
1500
  end
923
1501
 
924
1502
  #
@@ -931,11 +1509,12 @@ module Azure::KeyVault::Mgmt::V2016_10_01
931
1509
  #
932
1510
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
933
1511
  #
934
- def list_deleted_next_async(next_page_link, custom_headers = nil)
1512
+ def list_deleted_next_async(next_page_link, custom_headers:nil)
935
1513
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
936
1514
 
937
1515
 
938
1516
  request_headers = {}
1517
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
939
1518
 
940
1519
  # Set Headers
941
1520
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -990,8 +1569,8 @@ module Azure::KeyVault::Mgmt::V2016_10_01
990
1569
  #
991
1570
  # @return [ResourceListResult] operation results.
992
1571
  #
993
- def list_next(next_page_link, custom_headers = nil)
994
- response = list_next_async(next_page_link, custom_headers).value!
1572
+ def list_next(next_page_link, custom_headers:nil)
1573
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
995
1574
  response.body unless response.nil?
996
1575
  end
997
1576
 
@@ -1006,8 +1585,8 @@ module Azure::KeyVault::Mgmt::V2016_10_01
1006
1585
  #
1007
1586
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1008
1587
  #
1009
- def list_next_with_http_info(next_page_link, custom_headers = nil)
1010
- list_next_async(next_page_link, custom_headers).value!
1588
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
1589
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
1011
1590
  end
1012
1591
 
1013
1592
  #
@@ -1021,11 +1600,12 @@ module Azure::KeyVault::Mgmt::V2016_10_01
1021
1600
  #
1022
1601
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1023
1602
  #
1024
- def list_next_async(next_page_link, custom_headers = nil)
1603
+ def list_next_async(next_page_link, custom_headers:nil)
1025
1604
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1026
1605
 
1027
1606
 
1028
1607
  request_headers = {}
1608
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1029
1609
 
1030
1610
  # Set Headers
1031
1611
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -1081,12 +1661,33 @@ module Azure::KeyVault::Mgmt::V2016_10_01
1081
1661
  #
1082
1662
  # @return [VaultListResult] which provide lazy access to pages of the response.
1083
1663
  #
1084
- def list_by_resource_group_as_lazy(resource_group_name, top = nil, custom_headers = nil)
1085
- response = list_by_resource_group_async(resource_group_name, top, custom_headers).value!
1664
+ def list_by_resource_group_as_lazy(resource_group_name, top:nil, custom_headers:nil)
1665
+ response = list_by_resource_group_async(resource_group_name, top:top, custom_headers:custom_headers).value!
1666
+ unless response.nil?
1667
+ page = response.body
1668
+ page.next_method = Proc.new do |next_page_link|
1669
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
1670
+ end
1671
+ page
1672
+ end
1673
+ end
1674
+
1675
+ #
1676
+ # The List operation gets information about the vaults associated with the
1677
+ # subscription.
1678
+ #
1679
+ # @param top [Integer] Maximum number of results to return.
1680
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1681
+ # will be added to the HTTP request.
1682
+ #
1683
+ # @return [VaultListResult] which provide lazy access to pages of the response.
1684
+ #
1685
+ def list_by_subscription_as_lazy(top:nil, custom_headers:nil)
1686
+ response = list_by_subscription_async(top:top, custom_headers:custom_headers).value!
1086
1687
  unless response.nil?
1087
1688
  page = response.body
1088
1689
  page.next_method = Proc.new do |next_page_link|
1089
- list_by_resource_group_next_async(next_page_link, custom_headers)
1690
+ list_by_subscription_next_async(next_page_link, custom_headers:custom_headers)
1090
1691
  end
1091
1692
  page
1092
1693
  end
@@ -1101,12 +1702,12 @@ module Azure::KeyVault::Mgmt::V2016_10_01
1101
1702
  # @return [DeletedVaultListResult] which provide lazy access to pages of the
1102
1703
  # response.
1103
1704
  #
1104
- def list_deleted_as_lazy(custom_headers = nil)
1105
- response = list_deleted_async(custom_headers).value!
1705
+ def list_deleted_as_lazy(custom_headers:nil)
1706
+ response = list_deleted_async(custom_headers:custom_headers).value!
1106
1707
  unless response.nil?
1107
1708
  page = response.body
1108
1709
  page.next_method = Proc.new do |next_page_link|
1109
- list_deleted_next_async(next_page_link, custom_headers)
1710
+ list_deleted_next_async(next_page_link, custom_headers:custom_headers)
1110
1711
  end
1111
1712
  page
1112
1713
  end
@@ -1123,12 +1724,12 @@ module Azure::KeyVault::Mgmt::V2016_10_01
1123
1724
  # @return [ResourceListResult] which provide lazy access to pages of the
1124
1725
  # response.
1125
1726
  #
1126
- def list_as_lazy(top = nil, custom_headers = nil)
1127
- response = list_async(top, custom_headers).value!
1727
+ def list_as_lazy(top:nil, custom_headers:nil)
1728
+ response = list_async(top:top, custom_headers:custom_headers).value!
1128
1729
  unless response.nil?
1129
1730
  page = response.body
1130
1731
  page.next_method = Proc.new do |next_page_link|
1131
- list_next_async(next_page_link, custom_headers)
1732
+ list_next_async(next_page_link, custom_headers:custom_headers)
1132
1733
  end
1133
1734
  page
1134
1735
  end