Class: Azure::KeyVault::Mgmt::V2019_09_01::Vaults

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb

Overview

The Azure management API provides a RESTful set of web services that interact with Azure Key Vault.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Vaults

Creates and initializes a new instance of the Vaults class.



18
19
20
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 18

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientKeyVaultManagementClient (readonly)



23
24
25
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 23

def client
  @client
end

Instance Method Details

#begin_create_or_update(resource_group_name, vault_name, parameters, custom_headers: nil) ⇒ Vault

Create or update a key vault in the specified subscription.

the server belongs. update the vault will be added to the HTTP request.



1120
1121
1122
1123
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 1120

def begin_create_or_update(resource_group_name, vault_name, parameters, custom_headers:nil)
  response = begin_create_or_update_async(resource_group_name, vault_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_create_or_update_async(resource_group_name, vault_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

Create or update a key vault in the specified subscription.

the server belongs. update the vault to the HTTP request.



1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 1155

def begin_create_or_update_async(resource_group_name, vault_name, parameters, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'vault_name is nil' if vault_name.nil?
  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?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::VaultCreateOrUpdateParameters.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'vaultName' => vault_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 201 || status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::Vault.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::Vault.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#begin_create_or_update_with_http_info(resource_group_name, vault_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Create or update a key vault in the specified subscription.

the server belongs. update the vault will be added to the HTTP request.



1138
1139
1140
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 1138

def begin_create_or_update_with_http_info(resource_group_name, vault_name, parameters, custom_headers:nil)
  begin_create_or_update_async(resource_group_name, vault_name, parameters, custom_headers:custom_headers).value!
end

#begin_purge_deleted(vault_name, location, custom_headers: nil) ⇒ Object

Permanently deletes the specified vault. aka Purges the deleted Azure key vault.

will be added to the HTTP request.



1239
1240
1241
1242
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 1239

def begin_purge_deleted(vault_name, location, custom_headers:nil)
  response = begin_purge_deleted_async(vault_name, location, custom_headers:custom_headers).value!
  nil
end

#begin_purge_deleted_async(vault_name, location, custom_headers: nil) ⇒ Concurrent::Promise

Permanently deletes the specified vault. aka Purges the deleted Azure key vault.

to the HTTP request.



1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 1270

def begin_purge_deleted_async(vault_name, location, custom_headers:nil)
  fail ArgumentError, 'vault_name is nil' if vault_name.nil?
  fail ArgumentError, 'location is nil' if location.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedVaults/{vaultName}/purge'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'vaultName' => vault_name,'location' => location,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#begin_purge_deleted_with_http_info(vault_name, location, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Permanently deletes the specified vault. aka Purges the deleted Azure key vault.

will be added to the HTTP request.



1255
1256
1257
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 1255

def begin_purge_deleted_with_http_info(vault_name, location, custom_headers:nil)
  begin_purge_deleted_async(vault_name, location, custom_headers:custom_headers).value!
end

#check_name_availability(vault_name, custom_headers: nil) ⇒ CheckNameAvailabilityResult

Checks that the vault name is valid and is not already in use.

vault. will be added to the HTTP request.



1017
1018
1019
1020
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 1017

def check_name_availability(vault_name, custom_headers:nil)
  response = check_name_availability_async(vault_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#check_name_availability_async(vault_name, custom_headers: nil) ⇒ Concurrent::Promise

Checks that the vault name is valid and is not already in use.

vault. to the HTTP request.



1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 1046

def check_name_availability_async(vault_name, custom_headers:nil)
  fail ArgumentError, 'vault_name is nil' if vault_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::VaultCheckNameAvailabilityParameters.mapper()
  request_content = @client.serialize(request_mapper,  vault_name)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/checkNameAvailability'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::CheckNameAvailabilityResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#check_name_availability_with_http_info(vault_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Checks that the vault name is valid and is not already in use.

vault. will be added to the HTTP request.



1032
1033
1034
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 1032

def check_name_availability_with_http_info(vault_name, custom_headers:nil)
  check_name_availability_async(vault_name, custom_headers:custom_headers).value!
end

#create_or_update(resource_group_name, vault_name, parameters, custom_headers: nil) ⇒ Vault

Create or update a key vault in the specified subscription.

the server belongs. update the vault will be added to the HTTP request.



38
39
40
41
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 38

def create_or_update(resource_group_name, vault_name, parameters, custom_headers:nil)
  response = create_or_update_async(resource_group_name, vault_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_or_update_async(resource_group_name, vault_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

the server belongs. update the vault will be added to the HTTP request.

response.



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 55

def create_or_update_async(resource_group_name, vault_name, parameters, custom_headers:nil)
  # Send request
  promise = begin_create_or_update_async(resource_group_name, vault_name, parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::Vault.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#delete(resource_group_name, vault_name, custom_headers: nil) ⇒ Object

Deletes the specified Azure key vault.

the vault belongs. will be added to the HTTP request.



202
203
204
205
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 202

def delete(resource_group_name, vault_name, custom_headers:nil)
  response = delete_async(resource_group_name, vault_name, custom_headers:custom_headers).value!
  nil
end

#delete_async(resource_group_name, vault_name, custom_headers: nil) ⇒ Concurrent::Promise

Deletes the specified Azure key vault.

the vault belongs. to the HTTP request.



233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 233

def delete_async(resource_group_name, vault_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'vault_name is nil' if vault_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'vaultName' => vault_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 204
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#delete_with_http_info(resource_group_name, vault_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes the specified Azure key vault.

the vault belongs. will be added to the HTTP request.



218
219
220
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 218

def delete_with_http_info(resource_group_name, vault_name, custom_headers:nil)
  delete_async(resource_group_name, vault_name, custom_headers:custom_headers).value!
end

#get(resource_group_name, vault_name, custom_headers: nil) ⇒ Vault

Gets the specified Azure key vault.

the vault belongs. will be added to the HTTP request.



289
290
291
292
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 289

def get(resource_group_name, vault_name, custom_headers:nil)
  response = get_async(resource_group_name, vault_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_async(resource_group_name, vault_name, custom_headers: nil) ⇒ Concurrent::Promise

Gets the specified Azure key vault.

the vault belongs. to the HTTP request.



320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 320

def get_async(resource_group_name, vault_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'vault_name is nil' if vault_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'vaultName' => vault_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::Vault.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_deleted(vault_name, location, custom_headers: nil) ⇒ DeletedVault

Gets the deleted Azure key vault.

will be added to the HTTP request.



791
792
793
794
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 791

def get_deleted(vault_name, location, custom_headers:nil)
  response = get_deleted_async(vault_name, location, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_deleted_async(vault_name, location, custom_headers: nil) ⇒ Concurrent::Promise

Gets the deleted Azure key vault.

to the HTTP request.



820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 820

def get_deleted_async(vault_name, location, custom_headers:nil)
  fail ArgumentError, 'vault_name is nil' if vault_name.nil?
  fail ArgumentError, 'location is nil' if location.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedVaults/{vaultName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'vaultName' => vault_name,'location' => location,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::DeletedVault.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_deleted_with_http_info(vault_name, location, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the deleted Azure key vault.

will be added to the HTTP request.



806
807
808
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 806

def get_deleted_with_http_info(vault_name, location, custom_headers:nil)
  get_deleted_async(vault_name, location, custom_headers:custom_headers).value!
end

#get_with_http_info(resource_group_name, vault_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the specified Azure key vault.

the vault belongs. will be added to the HTTP request.



305
306
307
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 305

def get_with_http_info(resource_group_name, vault_name, custom_headers:nil)
  get_async(resource_group_name, vault_name, custom_headers:custom_headers).value!
end

#list(top: nil, custom_headers: nil) ⇒ Array<Resource>

The List operation gets information about the vaults associated with the subscription.

will be added to the HTTP request.



924
925
926
927
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 924

def list(top:nil, custom_headers:nil)
  first_page = list_as_lazy(top:top, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_as_lazy(top: nil, custom_headers: nil) ⇒ ResourceListResult

The List operation gets information about the vaults associated with the subscription.

will be added to the HTTP request.

response.



1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 1759

def list_as_lazy(top:nil, custom_headers:nil)
  response = list_async(top:top, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_async(top: nil, custom_headers: nil) ⇒ Concurrent::Promise

The List operation gets information about the vaults associated with the subscription.

to the HTTP request.



953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 953

def list_async(top:nil, custom_headers:nil)
  filter = 'resourceType eq \'Microsoft.KeyVault/vaults\''
  api_version = '2015-11-01'
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resources'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id},
      query_params: {'$filter' => filter,'$top' => top,'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::ResourceListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_resource_group(resource_group_name, top: nil, custom_headers: nil) ⇒ Array<Vault>

The List operation gets information about the vaults associated with the subscription and within the specified resource group.

the vault belongs. will be added to the HTTP request.



516
517
518
519
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 516

def list_by_resource_group(resource_group_name, top:nil, custom_headers:nil)
  first_page = list_by_resource_group_as_lazy(resource_group_name, top:top, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_by_resource_group_as_lazy(resource_group_name, top: nil, custom_headers: nil) ⇒ VaultListResult

The List operation gets information about the vaults associated with the subscription and within the specified resource group.

the vault belongs. will be added to the HTTP request.



1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 1696

def list_by_resource_group_as_lazy(resource_group_name, top:nil, custom_headers:nil)
  response = list_by_resource_group_async(resource_group_name, top:top, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_by_resource_group_async(resource_group_name, top: nil, custom_headers: nil) ⇒ Concurrent::Promise

The List operation gets information about the vaults associated with the subscription and within the specified resource group.

the vault belongs. to the HTTP request.



549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 549

def list_by_resource_group_async(resource_group_name, top:nil, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
      query_params: {'$top' => top,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::VaultListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_resource_group_next(next_page_link, custom_headers: nil) ⇒ VaultListResult

The List operation gets information about the vaults associated with the subscription and within the specified resource group.

to List operation. will be added to the HTTP request.



1326
1327
1328
1329
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 1326

def list_by_resource_group_next(next_page_link, custom_headers:nil)
  response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_by_resource_group_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

The List operation gets information about the vaults associated with the subscription and within the specified resource group.

to List operation. to the HTTP request.



1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 1357

def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::VaultListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_resource_group_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

The List operation gets information about the vaults associated with the subscription and within the specified resource group.

to List operation. will be added to the HTTP request.



1342
1343
1344
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 1342

def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
  list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_by_resource_group_with_http_info(resource_group_name, top: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

The List operation gets information about the vaults associated with the subscription and within the specified resource group.

the vault belongs. will be added to the HTTP request.



533
534
535
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 533

def list_by_resource_group_with_http_info(resource_group_name, top:nil, custom_headers:nil)
  list_by_resource_group_async(resource_group_name, top:top, custom_headers:custom_headers).value!
end

#list_by_subscription(top: nil, custom_headers: nil) ⇒ Array<Vault>

The List operation gets information about the vaults associated with the subscription.

will be added to the HTTP request.



613
614
615
616
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 613

def list_by_subscription(top:nil, custom_headers:nil)
  first_page = list_by_subscription_as_lazy(top:top, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_by_subscription_as_lazy(top: nil, custom_headers: nil) ⇒ VaultListResult

The List operation gets information about the vaults associated with the subscription.

will be added to the HTTP request.



1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 1717

def list_by_subscription_as_lazy(top:nil, custom_headers:nil)
  response = list_by_subscription_async(top:top, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_by_subscription_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_by_subscription_async(top: nil, custom_headers: nil) ⇒ Concurrent::Promise

The List operation gets information about the vaults associated with the subscription.

to the HTTP request.



642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 642

def list_by_subscription_async(top:nil, custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/vaults'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id},
      query_params: {'$top' => top,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::VaultListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_subscription_next(next_page_link, custom_headers: nil) ⇒ VaultListResult

The List operation gets information about the vaults associated with the subscription.

to List operation. will be added to the HTTP request.



1419
1420
1421
1422
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 1419

def list_by_subscription_next(next_page_link, custom_headers:nil)
  response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_by_subscription_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

The List operation gets information about the vaults associated with the subscription.

to List operation. to the HTTP request.



1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 1450

def list_by_subscription_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::VaultListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_subscription_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

The List operation gets information about the vaults associated with the subscription.

to List operation. will be added to the HTTP request.



1435
1436
1437
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 1435

def list_by_subscription_next_with_http_info(next_page_link, custom_headers:nil)
  list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_by_subscription_with_http_info(top: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

The List operation gets information about the vaults associated with the subscription.

will be added to the HTTP request.



628
629
630
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 628

def list_by_subscription_with_http_info(top:nil, custom_headers:nil)
  list_by_subscription_async(top:top, custom_headers:custom_headers).value!
end

#list_deleted(custom_headers: nil) ⇒ Array<DeletedVault>

Gets information about the deleted vaults in a subscription.

will be added to the HTTP request.



703
704
705
706
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 703

def list_deleted(custom_headers:nil)
  first_page = list_deleted_as_lazy(custom_headers:custom_headers)
  first_page.get_all_items
end

#list_deleted_as_lazy(custom_headers: nil) ⇒ DeletedVaultListResult

Gets information about the deleted vaults in a subscription.

will be added to the HTTP request.

response.



1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 1737

def list_deleted_as_lazy(custom_headers:nil)
  response = list_deleted_async(custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_deleted_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_deleted_async(custom_headers: nil) ⇒ Concurrent::Promise

Gets information about the deleted vaults in a subscription.

to the HTTP request.



728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 728

def list_deleted_async(custom_headers:nil)
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/deletedVaults'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::DeletedVaultListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_deleted_next(next_page_link, custom_headers: nil) ⇒ DeletedVaultListResult

Gets information about the deleted vaults in a subscription.

to List operation. will be added to the HTTP request.



1511
1512
1513
1514
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 1511

def list_deleted_next(next_page_link, custom_headers:nil)
  response = list_deleted_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_deleted_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

Gets information about the deleted vaults in a subscription.

to List operation. to the HTTP request.



1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 1540

def list_deleted_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::DeletedVaultListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_deleted_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets information about the deleted vaults in a subscription.

to List operation. will be added to the HTTP request.



1526
1527
1528
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 1526

def list_deleted_next_with_http_info(next_page_link, custom_headers:nil)
  list_deleted_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_deleted_with_http_info(custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets information about the deleted vaults in a subscription.

will be added to the HTTP request.



716
717
718
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 716

def list_deleted_with_http_info(custom_headers:nil)
  list_deleted_async(custom_headers:custom_headers).value!
end

#list_next(next_page_link, custom_headers: nil) ⇒ ResourceListResult

The List operation gets information about the vaults associated with the subscription.

to List operation. will be added to the HTTP request.



1602
1603
1604
1605
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 1602

def list_next(next_page_link, custom_headers:nil)
  response = list_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

The List operation gets information about the vaults associated with the subscription.

to List operation. to the HTTP request.



1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 1633

def list_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::ResourceListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

The List operation gets information about the vaults associated with the subscription.

to List operation. will be added to the HTTP request.



1618
1619
1620
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 1618

def list_next_with_http_info(next_page_link, custom_headers:nil)
  list_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_with_http_info(top: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

The List operation gets information about the vaults associated with the subscription.

will be added to the HTTP request.



939
940
941
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 939

def list_with_http_info(top:nil, custom_headers:nil)
  list_async(top:top, custom_headers:custom_headers).value!
end

#purge_deleted(vault_name, location, custom_headers: nil) ⇒ Object

Permanently deletes the specified vault. aka Purges the deleted Azure key vault.

will be added to the HTTP request.



884
885
886
887
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 884

def purge_deleted(vault_name, location, custom_headers:nil)
  response = purge_deleted_async(vault_name, location, custom_headers:custom_headers).value!
  nil
end

#purge_deleted_async(vault_name, location, custom_headers: nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.



898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 898

def purge_deleted_async(vault_name, location, custom_headers:nil)
  # Send request
  promise = begin_purge_deleted_async(vault_name, location, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#update(resource_group_name, vault_name, parameters, custom_headers: nil) ⇒ Vault

Update a key vault in the specified subscription.

the server belongs. will be added to the HTTP request.



85
86
87
88
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 85

def update(resource_group_name, vault_name, parameters, custom_headers:nil)
  response = update_async(resource_group_name, vault_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_access_policy(resource_group_name, vault_name, operation_kind, parameters, custom_headers: nil) ⇒ VaultAccessPolicyParameters

Update access policies in a key vault in the specified subscription.

the vault belongs. Possible values include: ‘add’, ‘replace’, ‘remove’ the vault will be added to the HTTP request.



390
391
392
393
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 390

def update_access_policy(resource_group_name, vault_name, operation_kind, parameters, custom_headers:nil)
  response = update_access_policy_async(resource_group_name, vault_name, operation_kind, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_access_policy_async(resource_group_name, vault_name, operation_kind, parameters, custom_headers: nil) ⇒ Concurrent::Promise

Update access policies in a key vault in the specified subscription.

the vault belongs. Possible values include: ‘add’, ‘replace’, ‘remove’ the vault to the HTTP request.



429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 429

def update_access_policy_async(resource_group_name, vault_name, operation_kind, parameters, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'vault_name is nil' if vault_name.nil?
  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?
  fail ArgumentError, 'operation_kind is nil' if operation_kind.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::VaultAccessPolicyParameters.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/accessPolicies/{operationKind}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'vaultName' => vault_name,'operationKind' => operation_kind,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 201 || status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::VaultAccessPolicyParameters.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::VaultAccessPolicyParameters.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#update_access_policy_with_http_info(resource_group_name, vault_name, operation_kind, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Update access policies in a key vault in the specified subscription.

the vault belongs. Possible values include: ‘add’, ‘replace’, ‘remove’ the vault will be added to the HTTP request.



410
411
412
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 410

def update_access_policy_with_http_info(resource_group_name, vault_name, operation_kind, parameters, custom_headers:nil)
  update_access_policy_async(resource_group_name, vault_name, operation_kind, parameters, custom_headers:custom_headers).value!
end

#update_async(resource_group_name, vault_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

Update a key vault in the specified subscription.

the server belongs. to the HTTP request.



118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 118

def update_async(resource_group_name, vault_name, parameters, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'vault_name is nil' if vault_name.nil?
  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?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::VaultPatchParameters.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'vaultName' => vault_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:patch, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 201 || status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::Vault.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::Vault.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#update_with_http_info(resource_group_name, vault_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Update a key vault in the specified subscription.

the server belongs. will be added to the HTTP request.



102
103
104
# File 'lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb', line 102

def update_with_http_info(resource_group_name, vault_name, parameters, custom_headers:nil)
  update_async(resource_group_name, vault_name, parameters, custom_headers:custom_headers).value!
end