azure_mgmt_key_vault 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 (24) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/azure_mgmt_key_vault.rb +9 -4
  3. data/lib/generated/azure_mgmt_key_vault/key_vault_management_client.rb +2 -2
  4. data/lib/generated/azure_mgmt_key_vault/models/access_policy_entry.rb +2 -1
  5. data/lib/generated/azure_mgmt_key_vault/models/certificate_permissions.rb +3 -2
  6. data/lib/generated/azure_mgmt_key_vault/models/create_mode.rb +16 -0
  7. data/lib/generated/azure_mgmt_key_vault/models/deleted_vault.rb +79 -0
  8. data/lib/generated/azure_mgmt_key_vault/models/deleted_vault_list_result.rb +94 -0
  9. data/lib/generated/azure_mgmt_key_vault/models/deleted_vault_properties.rb +97 -0
  10. data/lib/generated/azure_mgmt_key_vault/models/key_permissions.rb +3 -2
  11. data/lib/generated/azure_mgmt_key_vault/models/permissions.rb +20 -2
  12. data/lib/generated/azure_mgmt_key_vault/models/resource_list_result.rb +2 -1
  13. data/lib/generated/azure_mgmt_key_vault/models/secret_permissions.rb +5 -2
  14. data/lib/generated/azure_mgmt_key_vault/models/sku.rb +2 -1
  15. data/lib/generated/azure_mgmt_key_vault/models/sku_name.rb +1 -1
  16. data/lib/generated/azure_mgmt_key_vault/models/storage_permissions.rb +24 -0
  17. data/lib/generated/azure_mgmt_key_vault/models/vault.rb +2 -1
  18. data/lib/generated/azure_mgmt_key_vault/models/vault_create_or_update_parameters.rb +2 -1
  19. data/lib/generated/azure_mgmt_key_vault/models/vault_list_result.rb +2 -1
  20. data/lib/generated/azure_mgmt_key_vault/models/vault_properties.rb +39 -13
  21. data/lib/generated/azure_mgmt_key_vault/module_definition.rb +1 -1
  22. data/lib/generated/azure_mgmt_key_vault/vaults.rb +425 -23
  23. data/lib/generated/azure_mgmt_key_vault/version.rb +2 -2
  24. metadata +9 -4
@@ -1,5 +1,5 @@
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
 
@@ -12,6 +12,7 @@ module Azure::ARM::KeyVault
12
12
 
13
13
  include MsRestAzure
14
14
 
15
+ include MsRest::JSONable
15
16
  # @return [Array<Resource>] Gets the list of vault resources.
16
17
  attr_accessor :value
17
18
 
@@ -1,5 +1,5 @@
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
 
@@ -9,11 +9,14 @@ module Azure::ARM::KeyVault
9
9
  # Defines values for SecretPermissions
10
10
  #
11
11
  module SecretPermissions
12
- All = "all"
13
12
  Get = "get"
14
13
  List = "list"
15
14
  Set = "set"
16
15
  Delete = "delete"
16
+ Backup = "backup"
17
+ Restore = "restore"
18
+ Recover = "recover"
19
+ Purge = "purge"
17
20
  end
18
21
  end
19
22
  end
@@ -1,5 +1,5 @@
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
 
@@ -12,6 +12,7 @@ module Azure::ARM::KeyVault
12
12
 
13
13
  include MsRestAzure
14
14
 
15
+ include MsRest::JSONable
15
16
  # @return [String] SKU family name. Default value: 'A' .
16
17
  attr_accessor :family
17
18
 
@@ -1,5 +1,5 @@
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
 
@@ -0,0 +1,24 @@
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::KeyVault
7
+ module Models
8
+ #
9
+ # Defines values for StoragePermissions
10
+ #
11
+ module StoragePermissions
12
+ Get = "get"
13
+ List = "list"
14
+ Delete = "delete"
15
+ Set = "set"
16
+ Update = "update"
17
+ Regeneratekey = "regeneratekey"
18
+ Setsas = "setsas"
19
+ Listsas = "listsas"
20
+ Getsas = "getsas"
21
+ Deletesas = "deletesas"
22
+ end
23
+ end
24
+ end
@@ -1,5 +1,5 @@
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
 
@@ -12,6 +12,7 @@ module Azure::ARM::KeyVault
12
12
 
13
13
  include MsRestAzure
14
14
 
15
+ include MsRest::JSONable
15
16
  # @return [VaultProperties] Properties of the vault
16
17
  attr_accessor :properties
17
18
 
@@ -1,5 +1,5 @@
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
 
@@ -12,6 +12,7 @@ module Azure::ARM::KeyVault
12
12
 
13
13
  include MsRestAzure
14
14
 
15
+ include MsRest::JSONable
15
16
  # @return [String] The supported Azure location where the key vault
16
17
  # should be created.
17
18
  attr_accessor :location
@@ -1,5 +1,5 @@
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
 
@@ -12,6 +12,7 @@ module Azure::ARM::KeyVault
12
12
 
13
13
  include MsRestAzure
14
14
 
15
+ include MsRest::JSONable
15
16
  # @return [Array<Vault>] Gets or sets the list of vaults.
16
17
  attr_accessor :value
17
18
 
@@ -1,5 +1,5 @@
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
 
@@ -12,10 +12,7 @@ module Azure::ARM::KeyVault
12
12
 
13
13
  include MsRestAzure
14
14
 
15
- # @return [String] The URI of the vault for performing operations on keys
16
- # and secrets.
17
- attr_accessor :vault_uri
18
-
15
+ include MsRest::JSONable
19
16
  # @return The Azure Active Directory tenant ID that should be used for
20
17
  # authenticating requests to the key vault.
21
18
  attr_accessor :tenant_id
@@ -28,6 +25,10 @@ module Azure::ARM::KeyVault
28
25
  # same tenant ID as the key vault's tenant ID.
29
26
  attr_accessor :access_policies
30
27
 
28
+ # @return [String] The URI of the vault for performing operations on keys
29
+ # and secrets.
30
+ attr_accessor :vault_uri
31
+
31
32
  # @return [Boolean] Property to specify whether Azure Virtual Machines
32
33
  # are permitted to retrieve certificates stored as secrets from the key
33
34
  # vault.
@@ -41,6 +42,16 @@ module Azure::ARM::KeyVault
41
42
  # permitted to retrieve secrets from the key vault.
42
43
  attr_accessor :enabled_for_template_deployment
43
44
 
45
+ # @return [Boolean] Property to specify whether the 'soft delete'
46
+ # functionality is enabled for this key vault. It does not accept false
47
+ # value.
48
+ attr_accessor :enable_soft_delete
49
+
50
+ # @return [CreateMode] The vault's create mode to indicate whether the
51
+ # vault need to be recovered or not. Possible values include: 'recover',
52
+ # 'default'
53
+ attr_accessor :create_mode
54
+
44
55
 
45
56
  #
46
57
  # Mapper for VaultProperties class as Ruby Hash.
@@ -54,13 +65,6 @@ module Azure::ARM::KeyVault
54
65
  name: 'Composite',
55
66
  class_name: 'VaultProperties',
56
67
  model_properties: {
57
- vault_uri: {
58
- required: false,
59
- serialized_name: 'vaultUri',
60
- type: {
61
- name: 'String'
62
- }
63
- },
64
68
  tenant_id: {
65
69
  required: true,
66
70
  serialized_name: 'tenantId',
@@ -78,7 +82,7 @@ module Azure::ARM::KeyVault
78
82
  }
79
83
  },
80
84
  access_policies: {
81
- required: true,
85
+ required: false,
82
86
  serialized_name: 'accessPolicies',
83
87
  constraints: {
84
88
  MaxItems: 16
@@ -95,6 +99,13 @@ module Azure::ARM::KeyVault
95
99
  }
96
100
  }
97
101
  },
102
+ vault_uri: {
103
+ required: false,
104
+ serialized_name: 'vaultUri',
105
+ type: {
106
+ name: 'String'
107
+ }
108
+ },
98
109
  enabled_for_deployment: {
99
110
  required: false,
100
111
  serialized_name: 'enabledForDeployment',
@@ -115,6 +126,21 @@ module Azure::ARM::KeyVault
115
126
  type: {
116
127
  name: 'Boolean'
117
128
  }
129
+ },
130
+ enable_soft_delete: {
131
+ required: false,
132
+ serialized_name: 'enableSoftDelete',
133
+ type: {
134
+ name: 'Boolean'
135
+ }
136
+ },
137
+ create_mode: {
138
+ required: false,
139
+ serialized_name: 'createMode',
140
+ type: {
141
+ name: 'Enum',
142
+ module: 'CreateMode'
143
+ }
118
144
  }
119
145
  }
120
146
  }
@@ -1,5 +1,5 @@
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
 
@@ -1,5 +1,5 @@
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
 
@@ -9,7 +9,6 @@ module Azure::ARM::KeyVault
9
9
  # interact with Azure Key Vault.
10
10
  #
11
11
  class Vaults
12
- include Azure::ARM::KeyVault::Models
13
12
  include MsRestAzure
14
13
 
15
14
  #
@@ -88,11 +87,11 @@ module Azure::ARM::KeyVault
88
87
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
89
88
 
90
89
  # Serialize Request
91
- request_mapper = VaultCreateOrUpdateParameters.mapper()
92
- request_content = @client.serialize(request_mapper, parameters, 'parameters')
90
+ request_mapper = Azure::ARM::KeyVault::Models::VaultCreateOrUpdateParameters.mapper()
91
+ request_content = @client.serialize(request_mapper, parameters)
93
92
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
94
93
 
95
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}'
94
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}'
96
95
 
97
96
  request_url = @base_url || @client.base_url
98
97
 
@@ -120,8 +119,8 @@ module Azure::ARM::KeyVault
120
119
  if status_code == 201
121
120
  begin
122
121
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
123
- result_mapper = Vault.mapper()
124
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
122
+ result_mapper = Azure::ARM::KeyVault::Models::Vault.mapper()
123
+ result.body = @client.deserialize(result_mapper, parsed_response)
125
124
  rescue Exception => e
126
125
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
127
126
  end
@@ -130,8 +129,8 @@ module Azure::ARM::KeyVault
130
129
  if status_code == 200
131
130
  begin
132
131
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
133
- result_mapper = Vault.mapper()
134
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
132
+ result_mapper = Azure::ARM::KeyVault::Models::Vault.mapper()
133
+ result.body = @client.deserialize(result_mapper, parsed_response)
135
134
  rescue Exception => e
136
135
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
137
136
  end
@@ -196,7 +195,7 @@ module Azure::ARM::KeyVault
196
195
  # Set Headers
197
196
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
198
197
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
199
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}'
198
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}'
200
199
 
201
200
  request_url = @base_url || @client.base_url
202
201
 
@@ -280,7 +279,7 @@ module Azure::ARM::KeyVault
280
279
  # Set Headers
281
280
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
282
281
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
283
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}'
282
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}'
284
283
 
285
284
  request_url = @base_url || @client.base_url
286
285
 
@@ -307,8 +306,8 @@ module Azure::ARM::KeyVault
307
306
  if status_code == 200
308
307
  begin
309
308
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
310
- result_mapper = Vault.mapper()
311
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
309
+ result_mapper = Azure::ARM::KeyVault::Models::Vault.mapper()
310
+ result.body = @client.deserialize(result_mapper, parsed_response)
312
311
  rescue Exception => e
313
312
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
314
313
  end
@@ -376,7 +375,7 @@ module Azure::ARM::KeyVault
376
375
  # Set Headers
377
376
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
378
377
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
379
- path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults'
378
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults'
380
379
 
381
380
  request_url = @base_url || @client.base_url
382
381
 
@@ -403,8 +402,8 @@ module Azure::ARM::KeyVault
403
402
  if status_code == 200
404
403
  begin
405
404
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
406
- result_mapper = VaultListResult.mapper()
407
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
405
+ result_mapper = Azure::ARM::KeyVault::Models::VaultListResult.mapper()
406
+ result.body = @client.deserialize(result_mapper, parsed_response)
408
407
  rescue Exception => e
409
408
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
410
409
  end
@@ -416,6 +415,219 @@ module Azure::ARM::KeyVault
416
415
  promise.execute
417
416
  end
418
417
 
418
+ #
419
+ # Gets information about the deleted vaults in a subscription.
420
+ #
421
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
422
+ # will be added to the HTTP request.
423
+ #
424
+ # @return [Array<DeletedVault>] operation results.
425
+ #
426
+ def list_deleted(custom_headers = nil)
427
+ first_page = list_deleted_as_lazy(custom_headers)
428
+ first_page.get_all_items
429
+ end
430
+
431
+ #
432
+ # Gets information about the deleted vaults in a subscription.
433
+ #
434
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
435
+ # will be added to the HTTP request.
436
+ #
437
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
438
+ #
439
+ def list_deleted_with_http_info(custom_headers = nil)
440
+ list_deleted_async(custom_headers).value!
441
+ end
442
+
443
+ #
444
+ # Gets information about the deleted vaults in a subscription.
445
+ #
446
+ # @param [Hash{String => String}] A hash of custom headers that will be added
447
+ # to the HTTP request.
448
+ #
449
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
450
+ #
451
+ def list_deleted_async(custom_headers = nil)
452
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
453
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
454
+
455
+
456
+ request_headers = {}
457
+
458
+ # Set Headers
459
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
460
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
461
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/deletedVaults'
462
+
463
+ request_url = @base_url || @client.base_url
464
+
465
+ options = {
466
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
467
+ path_params: {'subscriptionId' => @client.subscription_id},
468
+ query_params: {'api-version' => @client.api_version},
469
+ headers: request_headers.merge(custom_headers || {}),
470
+ base_url: request_url
471
+ }
472
+ promise = @client.make_request_async(:get, path_template, options)
473
+
474
+ promise = promise.then do |result|
475
+ http_response = result.response
476
+ status_code = http_response.status
477
+ response_content = http_response.body
478
+ unless status_code == 200
479
+ error_model = JSON.load(response_content)
480
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
481
+ end
482
+
483
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
484
+ # Deserialize Response
485
+ if status_code == 200
486
+ begin
487
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
488
+ result_mapper = Azure::ARM::KeyVault::Models::DeletedVaultListResult.mapper()
489
+ result.body = @client.deserialize(result_mapper, parsed_response)
490
+ rescue Exception => e
491
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
492
+ end
493
+ end
494
+
495
+ result
496
+ end
497
+
498
+ promise.execute
499
+ end
500
+
501
+ #
502
+ # Gets the deleted Azure key vault.
503
+ #
504
+ # @param vault_name [String] The name of the vault.
505
+ # @param location [String] The location of the deleted vault.
506
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
507
+ # will be added to the HTTP request.
508
+ #
509
+ # @return [DeletedVault] operation results.
510
+ #
511
+ def get_deleted(vault_name, location, custom_headers = nil)
512
+ response = get_deleted_async(vault_name, location, custom_headers).value!
513
+ response.body unless response.nil?
514
+ end
515
+
516
+ #
517
+ # Gets the deleted Azure key vault.
518
+ #
519
+ # @param vault_name [String] The name of the vault.
520
+ # @param location [String] The location of the deleted vault.
521
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
522
+ # will be added to the HTTP request.
523
+ #
524
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
525
+ #
526
+ def get_deleted_with_http_info(vault_name, location, custom_headers = nil)
527
+ get_deleted_async(vault_name, location, custom_headers).value!
528
+ end
529
+
530
+ #
531
+ # Gets the deleted Azure key vault.
532
+ #
533
+ # @param vault_name [String] The name of the vault.
534
+ # @param location [String] The location of the deleted vault.
535
+ # @param [Hash{String => String}] A hash of custom headers that will be added
536
+ # to the HTTP request.
537
+ #
538
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
539
+ #
540
+ def get_deleted_async(vault_name, location, custom_headers = nil)
541
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
542
+ fail ArgumentError, 'location is nil' if location.nil?
543
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
544
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
545
+
546
+
547
+ request_headers = {}
548
+
549
+ # Set Headers
550
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
551
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
552
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedVaults/{vaultName}'
553
+
554
+ request_url = @base_url || @client.base_url
555
+
556
+ options = {
557
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
558
+ path_params: {'vaultName' => vault_name,'location' => location,'subscriptionId' => @client.subscription_id},
559
+ query_params: {'api-version' => @client.api_version},
560
+ headers: request_headers.merge(custom_headers || {}),
561
+ base_url: request_url
562
+ }
563
+ promise = @client.make_request_async(:get, path_template, options)
564
+
565
+ promise = promise.then do |result|
566
+ http_response = result.response
567
+ status_code = http_response.status
568
+ response_content = http_response.body
569
+ unless status_code == 200
570
+ error_model = JSON.load(response_content)
571
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
572
+ end
573
+
574
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
575
+ # Deserialize Response
576
+ if status_code == 200
577
+ begin
578
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
579
+ result_mapper = Azure::ARM::KeyVault::Models::DeletedVault.mapper()
580
+ result.body = @client.deserialize(result_mapper, parsed_response)
581
+ rescue Exception => e
582
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
583
+ end
584
+ end
585
+
586
+ result
587
+ end
588
+
589
+ promise.execute
590
+ end
591
+
592
+ #
593
+ # Permanently deletes the specified vault. aka Purges the deleted Azure key
594
+ # vault.
595
+ #
596
+ # @param vault_name [String] The name of the soft-deleted vault.
597
+ # @param location [String] The location of the soft-deleted vault.
598
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
599
+ # will be added to the HTTP request.
600
+ #
601
+ def purge_deleted(vault_name, location, custom_headers = nil)
602
+ response = purge_deleted_async(vault_name, location, custom_headers).value!
603
+ nil
604
+ end
605
+
606
+ #
607
+ # @param vault_name [String] The name of the soft-deleted vault.
608
+ # @param location [String] The location of the soft-deleted vault.
609
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
610
+ # will be added to the HTTP request.
611
+ #
612
+ # @return [Concurrent::Promise] promise which provides async access to http
613
+ # response.
614
+ #
615
+ def purge_deleted_async(vault_name, location, custom_headers = nil)
616
+ # Send request
617
+ promise = begin_purge_deleted_async(vault_name, location, custom_headers)
618
+
619
+ promise = promise.then do |response|
620
+ # Defining deserialization method.
621
+ deserialize_method = lambda do |parsed_response|
622
+ end
623
+
624
+ # Waiting for response.
625
+ @client.get_long_running_operation_result(response, deserialize_method)
626
+ end
627
+
628
+ promise
629
+ end
630
+
419
631
  #
420
632
  # The List operation gets information about the vaults associated with the
421
633
  # subscription.
@@ -466,7 +678,7 @@ module Azure::ARM::KeyVault
466
678
  # Set Headers
467
679
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
468
680
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
469
- path_template = '/subscriptions/{subscriptionId}/resources'
681
+ path_template = 'subscriptions/{subscriptionId}/resources'
470
682
 
471
683
  request_url = @base_url || @client.base_url
472
684
 
@@ -493,8 +705,8 @@ module Azure::ARM::KeyVault
493
705
  if status_code == 200
494
706
  begin
495
707
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
496
- result_mapper = ResourceListResult.mapper()
497
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
708
+ result_mapper = Azure::ARM::KeyVault::Models::ResourceListResult.mapper()
709
+ result.body = @client.deserialize(result_mapper, parsed_response)
498
710
  rescue Exception => e
499
711
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
500
712
  end
@@ -506,6 +718,89 @@ module Azure::ARM::KeyVault
506
718
  promise.execute
507
719
  end
508
720
 
721
+ #
722
+ # Permanently deletes the specified vault. aka Purges the deleted Azure key
723
+ # vault.
724
+ #
725
+ # @param vault_name [String] The name of the soft-deleted vault.
726
+ # @param location [String] The location of the soft-deleted vault.
727
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
728
+ # will be added to the HTTP request.
729
+ #
730
+ #
731
+ def begin_purge_deleted(vault_name, location, custom_headers = nil)
732
+ response = begin_purge_deleted_async(vault_name, location, custom_headers).value!
733
+ nil
734
+ end
735
+
736
+ #
737
+ # Permanently deletes the specified vault. aka Purges the deleted Azure key
738
+ # vault.
739
+ #
740
+ # @param vault_name [String] The name of the soft-deleted vault.
741
+ # @param location [String] The location of the soft-deleted vault.
742
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
743
+ # will be added to the HTTP request.
744
+ #
745
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
746
+ #
747
+ def begin_purge_deleted_with_http_info(vault_name, location, custom_headers = nil)
748
+ begin_purge_deleted_async(vault_name, location, custom_headers).value!
749
+ end
750
+
751
+ #
752
+ # Permanently deletes the specified vault. aka Purges the deleted Azure key
753
+ # vault.
754
+ #
755
+ # @param vault_name [String] The name of the soft-deleted vault.
756
+ # @param location [String] The location of the soft-deleted vault.
757
+ # @param [Hash{String => String}] A hash of custom headers that will be added
758
+ # to the HTTP request.
759
+ #
760
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
761
+ #
762
+ def begin_purge_deleted_async(vault_name, location, custom_headers = nil)
763
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
764
+ fail ArgumentError, 'location is nil' if location.nil?
765
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
766
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
767
+
768
+
769
+ request_headers = {}
770
+
771
+ # Set Headers
772
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
773
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
774
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedVaults/{vaultName}/purge'
775
+
776
+ request_url = @base_url || @client.base_url
777
+
778
+ options = {
779
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
780
+ path_params: {'vaultName' => vault_name,'location' => location,'subscriptionId' => @client.subscription_id},
781
+ query_params: {'api-version' => @client.api_version},
782
+ headers: request_headers.merge(custom_headers || {}),
783
+ base_url: request_url
784
+ }
785
+ promise = @client.make_request_async(:post, path_template, options)
786
+
787
+ promise = promise.then do |result|
788
+ http_response = result.response
789
+ status_code = http_response.status
790
+ response_content = http_response.body
791
+ unless status_code == 200 || status_code == 202
792
+ error_model = JSON.load(response_content)
793
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
794
+ end
795
+
796
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
797
+
798
+ result
799
+ end
800
+
801
+ promise.execute
802
+ end
803
+
509
804
  #
510
805
  # The List operation gets information about the vaults associated with the
511
806
  # subscription and within the specified resource group.
@@ -583,8 +878,95 @@ module Azure::ARM::KeyVault
583
878
  if status_code == 200
584
879
  begin
585
880
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
586
- result_mapper = VaultListResult.mapper()
587
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
881
+ result_mapper = Azure::ARM::KeyVault::Models::VaultListResult.mapper()
882
+ result.body = @client.deserialize(result_mapper, parsed_response)
883
+ rescue Exception => e
884
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
885
+ end
886
+ end
887
+
888
+ result
889
+ end
890
+
891
+ promise.execute
892
+ end
893
+
894
+ #
895
+ # Gets information about the deleted vaults in a subscription.
896
+ #
897
+ # @param next_page_link [String] The NextLink from the previous successful call
898
+ # to List operation.
899
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
900
+ # will be added to the HTTP request.
901
+ #
902
+ # @return [DeletedVaultListResult] operation results.
903
+ #
904
+ def list_deleted_next(next_page_link, custom_headers = nil)
905
+ response = list_deleted_next_async(next_page_link, custom_headers).value!
906
+ response.body unless response.nil?
907
+ end
908
+
909
+ #
910
+ # Gets information about the deleted vaults in a subscription.
911
+ #
912
+ # @param next_page_link [String] The NextLink from the previous successful call
913
+ # to List operation.
914
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
915
+ # will be added to the HTTP request.
916
+ #
917
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
918
+ #
919
+ def list_deleted_next_with_http_info(next_page_link, custom_headers = nil)
920
+ list_deleted_next_async(next_page_link, custom_headers).value!
921
+ end
922
+
923
+ #
924
+ # Gets information about the deleted vaults in a subscription.
925
+ #
926
+ # @param next_page_link [String] The NextLink from the previous successful call
927
+ # to List operation.
928
+ # @param [Hash{String => String}] A hash of custom headers that will be added
929
+ # to the HTTP request.
930
+ #
931
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
932
+ #
933
+ def list_deleted_next_async(next_page_link, custom_headers = nil)
934
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
935
+
936
+
937
+ request_headers = {}
938
+
939
+ # Set Headers
940
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
941
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
942
+ path_template = '{nextLink}'
943
+
944
+ request_url = @base_url || @client.base_url
945
+
946
+ options = {
947
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
948
+ skip_encoding_path_params: {'nextLink' => next_page_link},
949
+ headers: request_headers.merge(custom_headers || {}),
950
+ base_url: request_url
951
+ }
952
+ promise = @client.make_request_async(:get, path_template, options)
953
+
954
+ promise = promise.then do |result|
955
+ http_response = result.response
956
+ status_code = http_response.status
957
+ response_content = http_response.body
958
+ unless status_code == 200
959
+ error_model = JSON.load(response_content)
960
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
961
+ end
962
+
963
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
964
+ # Deserialize Response
965
+ if status_code == 200
966
+ begin
967
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
968
+ result_mapper = Azure::ARM::KeyVault::Models::DeletedVaultListResult.mapper()
969
+ result.body = @client.deserialize(result_mapper, parsed_response)
588
970
  rescue Exception => e
589
971
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
590
972
  end
@@ -673,8 +1055,8 @@ module Azure::ARM::KeyVault
673
1055
  if status_code == 200
674
1056
  begin
675
1057
  parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
676
- result_mapper = ResourceListResult.mapper()
677
- result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
1058
+ result_mapper = Azure::ARM::KeyVault::Models::ResourceListResult.mapper()
1059
+ result.body = @client.deserialize(result_mapper, parsed_response)
678
1060
  rescue Exception => e
679
1061
  fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
680
1062
  end
@@ -709,6 +1091,26 @@ module Azure::ARM::KeyVault
709
1091
  end
710
1092
  end
711
1093
 
1094
+ #
1095
+ # Gets information about the deleted vaults in a subscription.
1096
+ #
1097
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1098
+ # will be added to the HTTP request.
1099
+ #
1100
+ # @return [DeletedVaultListResult] which provide lazy access to pages of the
1101
+ # response.
1102
+ #
1103
+ def list_deleted_as_lazy(custom_headers = nil)
1104
+ response = list_deleted_async(custom_headers).value!
1105
+ unless response.nil?
1106
+ page = response.body
1107
+ page.next_method = Proc.new do |next_page_link|
1108
+ list_deleted_next_async(next_page_link, custom_headers)
1109
+ end
1110
+ page
1111
+ end
1112
+ end
1113
+
712
1114
  #
713
1115
  # The List operation gets information about the vaults associated with the
714
1116
  # subscription.