Class: Azure::KeyVault::V7_2_preview::KeyVaultClient

Inherits:
MsRestAzure::AzureServiceClient
  • Object
show all
Includes:
MsRestAzure, MsRestAzure::Serialization
Defined in:
lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb

Overview

A service client - single point of access to the REST API.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(credentials = nil, options = nil) ⇒ KeyVaultClient

Creates initializes a new instance of the KeyVaultClient class.



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 49

def initialize(credentials = nil, options = nil)
  super(credentials, options)
  @base_url = '{vaultBaseUrl}'

  fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
  @credentials = credentials

  @role_definitions = RoleDefinitions.new(self)
  @role_assignments = RoleAssignments.new(self)
  @hsmsecurity_domain = HSMSecurityDomain.new(self)
  @api_version = '7.2-preview'
  @accept_language = 'en-US'
  @long_running_operation_retry_timeout = 30
  @generate_client_request_id = true
  add_telemetry
end

Instance Attribute Details

#accept_languageString



24
25
26
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 24

def accept_language
  @accept_language
end

#api_versionString (readonly)



21
22
23
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 21

def api_version
  @api_version
end

#base_urlString (readonly)



15
16
17
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 15

def base_url
  @base_url
end

#credentialsObject (readonly)



18
19
20
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 18

def credentials
  @credentials
end

#generate_client_request_idBoolean

generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.



33
34
35
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 33

def generate_client_request_id
  @generate_client_request_id
end

#hsmsecurity_domainHSMSecurityDomain (readonly)



42
43
44
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 42

def hsmsecurity_domain
  @hsmsecurity_domain
end

#long_running_operation_retry_timeoutInteger

Operations. Default value is 30.



28
29
30
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 28

def long_running_operation_retry_timeout
  @long_running_operation_retry_timeout
end

#role_assignmentsRoleAssignments (readonly)



39
40
41
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 39

def role_assignments
  @role_assignments
end

#role_definitionsRoleDefinitions (readonly)



36
37
38
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 36

def role_definitions
  @role_definitions
end

Instance Method Details

#backup_certificate(vault_base_url, certificate_name, custom_headers: nil) ⇒ BackupCertificateResult

Backs up the specified certificate.

Requests that a backup of the specified certificate be downloaded to the client. All versions of the certificate will be downloaded. This operation requires the certificates/backup permission.

myvault.vault.azure.net. will be added to the HTTP request.



2697
2698
2699
2700
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 2697

def backup_certificate(vault_base_url, certificate_name, custom_headers:nil)
  response = backup_certificate_async(vault_base_url, certificate_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#backup_certificate_async(vault_base_url, certificate_name, custom_headers: nil) ⇒ Concurrent::Promise

Backs up the specified certificate.

Requests that a backup of the specified certificate be downloaded to the client. All versions of the certificate will be downloaded. This operation requires the certificates/backup permission.

myvault.vault.azure.net. to the HTTP request.



2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 2736

def backup_certificate_async(vault_base_url, certificate_name, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'certificate_name is nil' if certificate_name.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'certificates/{certificate-name}/backup'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'certificate-name' => certificate_name},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::BackupCertificateResult.mapper()
        result.body = self.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

#backup_certificate_with_http_info(vault_base_url, certificate_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Backs up the specified certificate.

Requests that a backup of the specified certificate be downloaded to the client. All versions of the certificate will be downloaded. This operation requires the certificates/backup permission.

myvault.vault.azure.net. will be added to the HTTP request.



2717
2718
2719
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 2717

def backup_certificate_with_http_info(vault_base_url, certificate_name, custom_headers:nil)
  backup_certificate_async(vault_base_url, certificate_name, custom_headers:custom_headers).value!
end

#backup_key(vault_base_url, key_name, custom_headers: nil) ⇒ BackupKeyResult

Requests that a backup of the specified key be downloaded to the client.

The Key Backup operation exports a key from Azure Key Vault in a protected form. Note that this operation does NOT return key material in a form that can be used outside the Azure Key Vault system, the returned key material is either protected to a Azure Key Vault HSM or to Azure Key Vault itself. The intent of this operation is to allow a client to GENERATE a key in one Azure Key Vault instance, BACKUP the key, and then RESTORE it into another Azure Key Vault instance. The BACKUP operation may be used to export, in protected form, any key type from Azure Key Vault. Individual versions of a key cannot be backed up. BACKUP / RESTORE can be performed within geographical boundaries only; meaning that a BACKUP from one geographical area cannot be restored to another geographical area. For example, a backup from the US geographical area cannot be restored in an EU geographical area. This operation requires the key/backup permission.

myvault.vault.azure.net. will be added to the HTTP request.



4323
4324
4325
4326
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 4323

def backup_key(vault_base_url, key_name, custom_headers:nil)
  response = backup_key_async(vault_base_url, key_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#backup_key_async(vault_base_url, key_name, custom_headers: nil) ⇒ Concurrent::Promise

Requests that a backup of the specified key be downloaded to the client.

The Key Backup operation exports a key from Azure Key Vault in a protected form. Note that this operation does NOT return key material in a form that can be used outside the Azure Key Vault system, the returned key material is either protected to a Azure Key Vault HSM or to Azure Key Vault itself. The intent of this operation is to allow a client to GENERATE a key in one Azure Key Vault instance, BACKUP the key, and then RESTORE it into another Azure Key Vault instance. The BACKUP operation may be used to export, in protected form, any key type from Azure Key Vault. Individual versions of a key cannot be backed up. BACKUP / RESTORE can be performed within geographical boundaries only; meaning that a BACKUP from one geographical area cannot be restored to another geographical area. For example, a backup from the US geographical area cannot be restored in an EU geographical area. This operation requires the key/backup permission.

myvault.vault.azure.net. to the HTTP request.



4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 4382

def backup_key_async(vault_base_url, key_name, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'key_name is nil' if key_name.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'keys/{key-name}/backup'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'key-name' => key_name},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::BackupKeyResult.mapper()
        result.body = self.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

#backup_key_with_http_info(vault_base_url, key_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Requests that a backup of the specified key be downloaded to the client.

The Key Backup operation exports a key from Azure Key Vault in a protected form. Note that this operation does NOT return key material in a form that can be used outside the Azure Key Vault system, the returned key material is either protected to a Azure Key Vault HSM or to Azure Key Vault itself. The intent of this operation is to allow a client to GENERATE a key in one Azure Key Vault instance, BACKUP the key, and then RESTORE it into another Azure Key Vault instance. The BACKUP operation may be used to export, in protected form, any key type from Azure Key Vault. Individual versions of a key cannot be backed up. BACKUP / RESTORE can be performed within geographical boundaries only; meaning that a BACKUP from one geographical area cannot be restored to another geographical area. For example, a backup from the US geographical area cannot be restored in an EU geographical area. This operation requires the key/backup permission.

myvault.vault.azure.net. will be added to the HTTP request.



4353
4354
4355
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 4353

def backup_key_with_http_info(vault_base_url, key_name, custom_headers:nil)
  backup_key_async(vault_base_url, key_name, custom_headers:custom_headers).value!
end

#backup_secret(vault_base_url, secret_name, custom_headers: nil) ⇒ BackupSecretResult

Backs up the specified secret.

Requests that a backup of the specified secret be downloaded to the client. All versions of the secret will be downloaded. This operation requires the secrets/backup permission.

myvault.vault.azure.net. will be added to the HTTP request.



7223
7224
7225
7226
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 7223

def backup_secret(vault_base_url, secret_name, custom_headers:nil)
  response = backup_secret_async(vault_base_url, secret_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#backup_secret_async(vault_base_url, secret_name, custom_headers: nil) ⇒ Concurrent::Promise

Backs up the specified secret.

Requests that a backup of the specified secret be downloaded to the client. All versions of the secret will be downloaded. This operation requires the secrets/backup permission.

myvault.vault.azure.net. to the HTTP request.



7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 7262

def backup_secret_async(vault_base_url, secret_name, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'secret_name is nil' if secret_name.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'secrets/{secret-name}/backup'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'secret-name' => secret_name},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::BackupSecretResult.mapper()
        result.body = self.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

#backup_secret_with_http_info(vault_base_url, secret_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Backs up the specified secret.

Requests that a backup of the specified secret be downloaded to the client. All versions of the secret will be downloaded. This operation requires the secrets/backup permission.

myvault.vault.azure.net. will be added to the HTTP request.



7243
7244
7245
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 7243

def backup_secret_with_http_info(vault_base_url, secret_name, custom_headers:nil)
  backup_secret_async(vault_base_url, secret_name, custom_headers:custom_headers).value!
end

#backup_storage_account(vault_base_url, storage_account_name, custom_headers: nil) ⇒ BackupStorageResult

Backs up the specified storage account.

Requests that a backup of the specified storage account be downloaded to the client. This operation requires the storage/backup permission.

myvault.vault.azure.net. will be added to the HTTP request.



7984
7985
7986
7987
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 7984

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

#backup_storage_account_async(vault_base_url, storage_account_name, custom_headers: nil) ⇒ Concurrent::Promise

Backs up the specified storage account.

Requests that a backup of the specified storage account be downloaded to the client. This operation requires the storage/backup permission.

myvault.vault.azure.net. to the HTTP request.



8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 8021

def (vault_base_url, , custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'storage_account_name is nil' if .nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'storage/{storage-account-name}/backup'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'storage-account-name' => },
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::BackupStorageResult.mapper()
        result.body = self.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

#backup_storage_account_with_http_info(vault_base_url, storage_account_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Backs up the specified storage account.

Requests that a backup of the specified storage account be downloaded to the client. This operation requires the storage/backup permission.

myvault.vault.azure.net. will be added to the HTTP request.



8003
8004
8005
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 8003

def (vault_base_url, , custom_headers:nil)
  (vault_base_url, , custom_headers:custom_headers).value!
end

#begin_full_backup(vault_base_url, azure_storage_blob_container_uri: nil, custom_headers: nil) ⇒ FullBackupOperation

Creates a full backup using a user-provided SAS token to an Azure blob storage container.

myvault.vault.azure.net. access signature token pointing to a valid Azure blob container where full backup needs to be stored. This token needs to be valid for at least next 24 hours from the time of making this call will be added to the HTTP request.



10339
10340
10341
10342
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 10339

def begin_full_backup(vault_base_url, azure_storage_blob_container_uri:nil, custom_headers:nil)
  response = begin_full_backup_async(vault_base_url, azure_storage_blob_container_uri:azure_storage_blob_container_uri, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_full_backup_async(vault_base_url, azure_storage_blob_container_uri: nil, custom_headers: nil) ⇒ Concurrent::Promise

Creates a full backup using a user-provided SAS token to an Azure blob storage container.

myvault.vault.azure.net. access signature token pointing to a valid Azure blob container where full backup needs to be stored. This token needs to be valid for at least next 24 hours from the time of making this call to the HTTP request.



10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 10378

def begin_full_backup_async(vault_base_url, azure_storage_blob_container_uri:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::SASTokenParameter.mapper()
  request_content = self.serialize(request_mapper,  azure_storage_blob_container_uri)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'backup'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 == 202
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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 == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::KeyVault::V7_2_preview::Models::FullBackupOperation.mapper()
        result.body = self.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_full_backup_with_http_info(vault_base_url, azure_storage_blob_container_uri: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Creates a full backup using a user-provided SAS token to an Azure blob storage container.

myvault.vault.azure.net. access signature token pointing to a valid Azure blob container where full backup needs to be stored. This token needs to be valid for at least next 24 hours from the time of making this call will be added to the HTTP request.



10359
10360
10361
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 10359

def begin_full_backup_with_http_info(vault_base_url, azure_storage_blob_container_uri:nil, custom_headers:nil)
  begin_full_backup_async(vault_base_url, azure_storage_blob_container_uri:azure_storage_blob_container_uri, custom_headers:custom_headers).value!
end

#begin_full_restore_operation(vault_base_url, restore_blob_details: nil, custom_headers: nil) ⇒ RestoreOperation

Restores all key materials using the SAS token pointing to a previously stored Azure Blob storage backup folder

myvault.vault.azure.net. token pointing to a folder where the previous successful full backup was stored will be added to the HTTP request.



10452
10453
10454
10455
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 10452

def begin_full_restore_operation(vault_base_url, restore_blob_details:nil, custom_headers:nil)
  response = begin_full_restore_operation_async(vault_base_url, restore_blob_details:restore_blob_details, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_full_restore_operation_async(vault_base_url, restore_blob_details: nil, custom_headers: nil) ⇒ Concurrent::Promise

Restores all key materials using the SAS token pointing to a previously stored Azure Blob storage backup folder

myvault.vault.azure.net. token pointing to a folder where the previous successful full backup was stored to the HTTP request.



10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 10489

def begin_full_restore_operation_async(vault_base_url, restore_blob_details:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::RestoreOperationParameters.mapper()
  request_content = self.serialize(request_mapper,  restore_blob_details)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'restore'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 == 202
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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 == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::KeyVault::V7_2_preview::Models::RestoreOperation.mapper()
        result.body = self.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_full_restore_operation_with_http_info(vault_base_url, restore_blob_details: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Restores all key materials using the SAS token pointing to a previously stored Azure Blob storage backup folder

myvault.vault.azure.net. token pointing to a folder where the previous successful full backup was stored will be added to the HTTP request.



10471
10472
10473
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 10471

def begin_full_restore_operation_with_http_info(vault_base_url, restore_blob_details:nil, custom_headers:nil)
  begin_full_restore_operation_async(vault_base_url, restore_blob_details:restore_blob_details, custom_headers:custom_headers).value!
end

#begin_selective_key_restore_operation_method(vault_base_url, key_name, restore_blob_details: nil, custom_headers: nil) ⇒ SelectiveKeyRestoreOperation

Restores all key versions of a given key using user supplied SAS token pointing to a previously stored Azure Blob storage backup folder

myvault.vault.azure.net. supplied backup Azure blob SAS token pointing to a folder where the previous successful full backup was stored will be added to the HTTP request.



10565
10566
10567
10568
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 10565

def begin_selective_key_restore_operation_method(vault_base_url, key_name, restore_blob_details:nil, custom_headers:nil)
  response = begin_selective_key_restore_operation_method_async(vault_base_url, key_name, restore_blob_details:restore_blob_details, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_selective_key_restore_operation_method_async(vault_base_url, key_name, restore_blob_details: nil, custom_headers: nil) ⇒ Concurrent::Promise

Restores all key versions of a given key using user supplied SAS token pointing to a previously stored Azure Blob storage backup folder

myvault.vault.azure.net. supplied backup Azure blob SAS token pointing to a folder where the previous successful full backup was stored to the HTTP request.



10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 10606

def begin_selective_key_restore_operation_method_async(vault_base_url, key_name, restore_blob_details:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'key_name is nil' if key_name.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::SelectiveKeyRestoreOperationParameters.mapper()
  request_content = self.serialize(request_mapper,  restore_blob_details)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'keys/{keyName}/restore'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'keyName' => key_name},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 == 202
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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 == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::KeyVault::V7_2_preview::Models::SelectiveKeyRestoreOperation.mapper()
        result.body = self.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_selective_key_restore_operation_method_with_http_info(vault_base_url, key_name, restore_blob_details: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Restores all key versions of a given key using user supplied SAS token pointing to a previously stored Azure Blob storage backup folder

myvault.vault.azure.net. supplied backup Azure blob SAS token pointing to a folder where the previous successful full backup was stored will be added to the HTTP request.



10586
10587
10588
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 10586

def begin_selective_key_restore_operation_method_with_http_info(vault_base_url, key_name, restore_blob_details:nil, custom_headers:nil)
  begin_selective_key_restore_operation_method_async(vault_base_url, key_name, restore_blob_details:restore_blob_details, custom_headers:custom_headers).value!
end

#create_certificate(vault_base_url, certificate_name, certificate_policy: nil, certificate_attributes: nil, tags: nil, custom_headers: nil) ⇒ CertificateOperation

Creates a new certificate.

If this is the first version, the certificate resource is created. This operation requires the certificates/create permission.

myvault.vault.azure.net. certificate. certificate (optional). form of key-value pairs. will be added to the HTTP request.



1301
1302
1303
1304
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 1301

def create_certificate(vault_base_url, certificate_name, certificate_policy:nil, certificate_attributes:nil, tags:nil, custom_headers:nil)
  response = create_certificate_async(vault_base_url, certificate_name, certificate_policy:certificate_policy, certificate_attributes:certificate_attributes, tags:tags, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_certificate_async(vault_base_url, certificate_name, certificate_policy: nil, certificate_attributes: nil, tags: nil, custom_headers: nil) ⇒ Concurrent::Promise

Creates a new certificate.

If this is the first version, the certificate resource is created. This operation requires the certificates/create permission.

myvault.vault.azure.net. certificate. certificate (optional). form of key-value pairs. to the HTTP request.



1350
1351
1352
1353
1354
1355
1356
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
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 1350

def create_certificate_async(vault_base_url, certificate_name, certificate_policy:nil, certificate_attributes:nil, tags:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'certificate_name is nil' if certificate_name.nil?
  fail ArgumentError, "'certificate_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z-]+$'" if !certificate_name.nil? && certificate_name.match(Regexp.new('^^[0-9a-zA-Z-]+$$')).nil?
  fail ArgumentError, 'api_version is nil' if api_version.nil?

  parameters = Azure::KeyVault::V7_2_preview::Models::CertificateCreateParameters.new
  unless certificate_policy.nil? && certificate_attributes.nil? && tags.nil?
    parameters.certificate_policy = certificate_policy
    parameters.certificate_attributes = certificate_attributes
    parameters.tags = tags
  end

  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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateCreateParameters.mapper()
  request_content = self.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'certificates/{certificate-name}/create'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'certificate-name' => certificate_name},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 == 202
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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 == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateOperation.mapper()
        result.body = self.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

#create_certificate_with_http_info(vault_base_url, certificate_name, certificate_policy: nil, certificate_attributes: nil, tags: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Creates a new certificate.

If this is the first version, the certificate resource is created. This operation requires the certificates/create permission.

myvault.vault.azure.net. certificate. certificate (optional). form of key-value pairs. will be added to the HTTP request.



1326
1327
1328
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 1326

def create_certificate_with_http_info(vault_base_url, certificate_name, certificate_policy:nil, certificate_attributes:nil, tags:nil, custom_headers:nil)
  create_certificate_async(vault_base_url, certificate_name, certificate_policy:certificate_policy, certificate_attributes:certificate_attributes, tags:tags, custom_headers:custom_headers).value!
end

#create_key(vault_base_url, key_name, kty, key_size: nil, public_exponent: nil, key_ops: nil, key_attributes: nil, tags: nil, curve: nil, custom_headers: nil) ⇒ KeyBundle

Creates a new key, stores it, then returns key parameters and attributes to the client.

The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. It requires the keys/create permission.

myvault.vault.azure.net. the version name for the new key. JsonWebKeyType. Possible values include: ‘EC’, ‘EC-HSM’, ‘RSA’, ‘RSA-HSM’, ‘oct’, ‘oct-HSM’ 4096 for RSA. form of key-value pairs. JsonWebKeyCurveName. Possible values include: ‘P-256’, ‘P-384’, ‘P-521’, ‘P-256K’ will be added to the HTTP request.



3398
3399
3400
3401
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 3398

def create_key(vault_base_url, key_name, kty, key_size:nil, public_exponent:nil, key_ops:nil, key_attributes:nil, tags:nil, curve:nil, custom_headers:nil)
  response = create_key_async(vault_base_url, key_name, kty, key_size:key_size, public_exponent:public_exponent, key_ops:key_ops, key_attributes:key_attributes, tags:tags, curve:curve, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_key_async(vault_base_url, key_name, kty, key_size: nil, public_exponent: nil, key_ops: nil, key_attributes: nil, tags: nil, curve: nil, custom_headers: nil) ⇒ Concurrent::Promise

Creates a new key, stores it, then returns key parameters and attributes to the client.

The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. It requires the keys/create permission.

myvault.vault.azure.net. the version name for the new key. JsonWebKeyType. Possible values include: ‘EC’, ‘EC-HSM’, ‘RSA’, ‘RSA-HSM’, ‘oct’, ‘oct-HSM’ 4096 for RSA. form of key-value pairs. JsonWebKeyCurveName. Possible values include: ‘P-256’, ‘P-384’, ‘P-521’, ‘P-256K’ to the HTTP request.



3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 3467

def create_key_async(vault_base_url, key_name, kty, key_size:nil, public_exponent:nil, key_ops:nil, key_attributes:nil, tags:nil, curve:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'key_name is nil' if key_name.nil?
  fail ArgumentError, "'key_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z-]+$'" if !key_name.nil? && key_name.match(Regexp.new('^^[0-9a-zA-Z-]+$$')).nil?
  fail ArgumentError, 'api_version is nil' if api_version.nil?
  fail ArgumentError, 'kty is nil' if kty.nil?
  fail ArgumentError, "'kty' should satisfy the constraint - 'MinLength': '1'" if !kty.nil? && kty.length < 1

  parameters = Azure::KeyVault::V7_2_preview::Models::KeyCreateParameters.new
  unless kty.nil? && key_size.nil? && public_exponent.nil? && key_ops.nil? && key_attributes.nil? && tags.nil? && curve.nil?
    parameters.kty = kty
    parameters.key_size = key_size
    parameters.public_exponent = public_exponent
    parameters.key_ops = key_ops
    parameters.key_attributes = key_attributes
    parameters.tags = tags
    parameters.curve = curve
  end

  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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::KeyCreateParameters.mapper()
  request_content = self.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'keys/{key-name}/create'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'key-name' => key_name},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::KeyBundle.mapper()
        result.body = self.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

#create_key_with_http_info(vault_base_url, key_name, kty, key_size: nil, public_exponent: nil, key_ops: nil, key_attributes: nil, tags: nil, curve: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Creates a new key, stores it, then returns key parameters and attributes to the client.

The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. It requires the keys/create permission.

myvault.vault.azure.net. the version name for the new key. JsonWebKeyType. Possible values include: ‘EC’, ‘EC-HSM’, ‘RSA’, ‘RSA-HSM’, ‘oct’, ‘oct-HSM’ 4096 for RSA. form of key-value pairs. JsonWebKeyCurveName. Possible values include: ‘P-256’, ‘P-384’, ‘P-521’, ‘P-256K’ will be added to the HTTP request.



3433
3434
3435
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 3433

def create_key_with_http_info(vault_base_url, key_name, kty, key_size:nil, public_exponent:nil, key_ops:nil, key_attributes:nil, tags:nil, curve:nil, custom_headers:nil)
  create_key_async(vault_base_url, key_name, kty, key_size:key_size, public_exponent:public_exponent, key_ops:key_ops, key_attributes:key_attributes, tags:tags, curve:curve, custom_headers:custom_headers).value!
end

#decrypt(vault_base_url, key_name, key_version, algorithm, value, iv: nil, aad: nil, tag: nil, custom_headers: nil) ⇒ KeyOperationResult

Decrypts a single block of encrypted data.

The DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption key and specified algorithm. This operation is the reverse of the ENCRYPT operation; only a single block of data may be decrypted, the size of this block is dependent on the target key and the algorithm to be used. The DECRYPT operation applies to asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of the key. This operation requires the keys/decrypt permission.

myvault.vault.azure.net. Possible values include: ‘RSA-OAEP’, ‘RSA-OAEP-256’, ‘RSA1_5’, ‘A128GCM’, ‘A192GCM’, ‘A256GCM’, ‘A128KW’, ‘A192KW’, ‘A256KW’, ‘A128CBC’, ‘A192CBC’, ‘A256CBC’, ‘A128CBCPAD’, ‘A192CBCPAD’, ‘A256CBCPAD’ authenticated crypto algorithms. authenticated algorithm. will be added to the HTTP request.



4801
4802
4803
4804
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 4801

def decrypt(vault_base_url, key_name, key_version, algorithm, value, iv:nil, aad:nil, tag:nil, custom_headers:nil)
  response = decrypt_async(vault_base_url, key_name, key_version, algorithm, value, iv:iv, aad:aad, tag:tag, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#decrypt_async(vault_base_url, key_name, key_version, algorithm, value, iv: nil, aad: nil, tag: nil, custom_headers: nil) ⇒ Concurrent::Promise

Decrypts a single block of encrypted data.

The DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption key and specified algorithm. This operation is the reverse of the ENCRYPT operation; only a single block of data may be decrypted, the size of this block is dependent on the target key and the algorithm to be used. The DECRYPT operation applies to asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of the key. This operation requires the keys/decrypt permission.

myvault.vault.azure.net. Possible values include: ‘RSA-OAEP’, ‘RSA-OAEP-256’, ‘RSA1_5’, ‘A128GCM’, ‘A192GCM’, ‘A256GCM’, ‘A128KW’, ‘A192KW’, ‘A256KW’, ‘A128CBC’, ‘A192CBC’, ‘A256CBC’, ‘A128CBCPAD’, ‘A192CBCPAD’, ‘A256CBCPAD’ authenticated crypto algorithms. authenticated algorithm. to the HTTP request.



4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 4870

def decrypt_async(vault_base_url, key_name, key_version, algorithm, value, iv:nil, aad:nil, tag:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'key_name is nil' if key_name.nil?
  fail ArgumentError, 'key_version is nil' if key_version.nil?
  fail ArgumentError, 'api_version is nil' if api_version.nil?
  fail ArgumentError, 'algorithm is nil' if algorithm.nil?
  fail ArgumentError, "'algorithm' should satisfy the constraint - 'MinLength': '1'" if !algorithm.nil? && algorithm.length < 1
  fail ArgumentError, 'value is nil' if value.nil?

  parameters = Azure::KeyVault::V7_2_preview::Models::KeyOperationsParameters.new
  unless algorithm.nil? && value.nil? && iv.nil? && aad.nil? && tag.nil?
    parameters.algorithm = algorithm
    parameters.value = value
    parameters.iv = iv
    parameters.aad = aad
    parameters.tag = tag
  end

  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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::KeyOperationsParameters.mapper()
  request_content = self.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'keys/{key-name}/{key-version}/decrypt'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'key-name' => key_name,'key-version' => key_version},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::KeyOperationResult.mapper()
        result.body = self.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

#decrypt_with_http_info(vault_base_url, key_name, key_version, algorithm, value, iv: nil, aad: nil, tag: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Decrypts a single block of encrypted data.

The DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption key and specified algorithm. This operation is the reverse of the ENCRYPT operation; only a single block of data may be decrypted, the size of this block is dependent on the target key and the algorithm to be used. The DECRYPT operation applies to asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of the key. This operation requires the keys/decrypt permission.

myvault.vault.azure.net. Possible values include: ‘RSA-OAEP’, ‘RSA-OAEP-256’, ‘RSA1_5’, ‘A128GCM’, ‘A192GCM’, ‘A256GCM’, ‘A128KW’, ‘A192KW’, ‘A256KW’, ‘A128CBC’, ‘A192CBC’, ‘A256CBC’, ‘A128CBCPAD’, ‘A192CBCPAD’, ‘A256CBCPAD’ authenticated crypto algorithms. authenticated algorithm. will be added to the HTTP request.



4836
4837
4838
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 4836

def decrypt_with_http_info(vault_base_url, key_name, key_version, algorithm, value, iv:nil, aad:nil, tag:nil, custom_headers:nil)
  decrypt_async(vault_base_url, key_name, key_version, algorithm, value, iv:iv, aad:aad, tag:tag, custom_headers:custom_headers).value!
end

#delete_certificate(vault_base_url, certificate_name, custom_headers: nil) ⇒ DeletedCertificateBundle

Deletes a certificate from a specified key vault.

Deletes all versions of a certificate object along with its associated policy. Delete certificate cannot be used to remove individual versions of a certificate object. This operation requires the certificates/delete permission.

myvault.vault.azure.net. will be added to the HTTP request.



258
259
260
261
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 258

def delete_certificate(vault_base_url, certificate_name, custom_headers:nil)
  response = delete_certificate_async(vault_base_url, certificate_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#delete_certificate_async(vault_base_url, certificate_name, custom_headers: nil) ⇒ Concurrent::Promise

Deletes a certificate from a specified key vault.

Deletes all versions of a certificate object along with its associated policy. Delete certificate cannot be used to remove individual versions of a certificate object. This operation requires the certificates/delete permission.

myvault.vault.azure.net. to the HTTP request.



299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
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
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 299

def delete_certificate_async(vault_base_url, certificate_name, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'certificate_name is nil' if certificate_name.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'certificates/{certificate-name}'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'certificate-name' => certificate_name},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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::V7_2_preview::Models::DeletedCertificateBundle.mapper()
        result.body = self.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

#delete_certificate_contacts(vault_base_url, custom_headers: nil) ⇒ Contacts

Deletes the certificate contacts for a specified key vault.

Deletes the certificate contacts for a specified key vault certificate. This operation requires the certificates/managecontacts permission.

myvault.vault.azure.net. will be added to the HTTP request.



583
584
585
586
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 583

def delete_certificate_contacts(vault_base_url, custom_headers:nil)
  response = delete_certificate_contacts_async(vault_base_url, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#delete_certificate_contacts_async(vault_base_url, custom_headers: nil) ⇒ Concurrent::Promise

Deletes the certificate contacts for a specified key vault.

Deletes the certificate contacts for a specified key vault certificate. This operation requires the certificates/managecontacts permission.

myvault.vault.azure.net. to the HTTP request.



618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
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
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 618

def delete_certificate_contacts_async(vault_base_url, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'certificates/contacts'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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::V7_2_preview::Models::Contacts.mapper()
        result.body = self.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

#delete_certificate_contacts_with_http_info(vault_base_url, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes the certificate contacts for a specified key vault.

Deletes the certificate contacts for a specified key vault certificate. This operation requires the certificates/managecontacts permission.

myvault.vault.azure.net. will be added to the HTTP request.



601
602
603
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 601

def delete_certificate_contacts_with_http_info(vault_base_url, custom_headers:nil)
  delete_certificate_contacts_async(vault_base_url, custom_headers:custom_headers).value!
end

#delete_certificate_issuer(vault_base_url, issuer_name, custom_headers: nil) ⇒ IssuerBundle

Deletes the specified certificate issuer.

The DeleteCertificateIssuer operation permanently removes the specified certificate issuer from the vault. This operation requires the certificates/manageissuers/deleteissuers permission.

myvault.vault.azure.net. will be added to the HTTP request.



1187
1188
1189
1190
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 1187

def delete_certificate_issuer(vault_base_url, issuer_name, custom_headers:nil)
  response = delete_certificate_issuer_async(vault_base_url, issuer_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#delete_certificate_issuer_async(vault_base_url, issuer_name, custom_headers: nil) ⇒ Concurrent::Promise

Deletes the specified certificate issuer.

The DeleteCertificateIssuer operation permanently removes the specified certificate issuer from the vault. This operation requires the certificates/manageissuers/deleteissuers permission.

myvault.vault.azure.net. to the HTTP request.



1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 1226

def delete_certificate_issuer_async(vault_base_url, issuer_name, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'issuer_name is nil' if issuer_name.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'certificates/issuers/{issuer-name}'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'issuer-name' => issuer_name},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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::V7_2_preview::Models::IssuerBundle.mapper()
        result.body = self.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

#delete_certificate_issuer_with_http_info(vault_base_url, issuer_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes the specified certificate issuer.

The DeleteCertificateIssuer operation permanently removes the specified certificate issuer from the vault. This operation requires the certificates/manageissuers/deleteissuers permission.

myvault.vault.azure.net. will be added to the HTTP request.



1207
1208
1209
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 1207

def delete_certificate_issuer_with_http_info(vault_base_url, issuer_name, custom_headers:nil)
  delete_certificate_issuer_async(vault_base_url, issuer_name, custom_headers:custom_headers).value!
end

#delete_certificate_operation(vault_base_url, certificate_name, custom_headers: nil) ⇒ CertificateOperation

Deletes the creation operation for a specific certificate.

Deletes the creation operation for a specified certificate that is in the process of being created. The certificate is no longer created. This operation requires the certificates/update permission.

myvault.vault.azure.net. will be added to the HTTP request.



2444
2445
2446
2447
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 2444

def delete_certificate_operation(vault_base_url, certificate_name, custom_headers:nil)
  response = delete_certificate_operation_async(vault_base_url, certificate_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#delete_certificate_operation_async(vault_base_url, certificate_name, custom_headers: nil) ⇒ Concurrent::Promise

Deletes the creation operation for a specific certificate.

Deletes the creation operation for a specified certificate that is in the process of being created. The certificate is no longer created. This operation requires the certificates/update permission.

myvault.vault.azure.net. to the HTTP request.



2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 2483

def delete_certificate_operation_async(vault_base_url, certificate_name, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'certificate_name is nil' if certificate_name.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'certificates/{certificate-name}/pending'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'certificate-name' => certificate_name},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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::V7_2_preview::Models::CertificateOperation.mapper()
        result.body = self.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

#delete_certificate_operation_with_http_info(vault_base_url, certificate_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes the creation operation for a specific certificate.

Deletes the creation operation for a specified certificate that is in the process of being created. The certificate is no longer created. This operation requires the certificates/update permission.

myvault.vault.azure.net. will be added to the HTTP request.



2464
2465
2466
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 2464

def delete_certificate_operation_with_http_info(vault_base_url, certificate_name, custom_headers:nil)
  delete_certificate_operation_async(vault_base_url, certificate_name, custom_headers:custom_headers).value!
end

#delete_certificate_with_http_info(vault_base_url, certificate_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes a certificate from a specified key vault.

Deletes all versions of a certificate object along with its associated policy. Delete certificate cannot be used to remove individual versions of a certificate object. This operation requires the certificates/delete permission.

myvault.vault.azure.net. will be added to the HTTP request.



279
280
281
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 279

def delete_certificate_with_http_info(vault_base_url, certificate_name, custom_headers:nil)
  delete_certificate_async(vault_base_url, certificate_name, custom_headers:custom_headers).value!
end

#delete_key(vault_base_url, key_name, custom_headers: nil) ⇒ DeletedKeyBundle

Deletes a key of any type from storage in Azure Key Vault.

The delete key operation cannot be used to remove individual versions of a key. This operation removes the cryptographic material associated with the key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the keys/delete permission.

myvault.vault.azure.net. will be added to the HTTP request.



3705
3706
3707
3708
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 3705

def delete_key(vault_base_url, key_name, custom_headers:nil)
  response = delete_key_async(vault_base_url, key_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#delete_key_async(vault_base_url, key_name, custom_headers: nil) ⇒ Concurrent::Promise

Deletes a key of any type from storage in Azure Key Vault.

The delete key operation cannot be used to remove individual versions of a key. This operation removes the cryptographic material associated with the key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the keys/delete permission.

myvault.vault.azure.net. to the HTTP request.



3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 3748

def delete_key_async(vault_base_url, key_name, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'key_name is nil' if key_name.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'keys/{key-name}'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'key-name' => key_name},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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::V7_2_preview::Models::DeletedKeyBundle.mapper()
        result.body = self.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

#delete_key_with_http_info(vault_base_url, key_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes a key of any type from storage in Azure Key Vault.

The delete key operation cannot be used to remove individual versions of a key. This operation removes the cryptographic material associated with the key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the keys/delete permission.

myvault.vault.azure.net. will be added to the HTTP request.



3727
3728
3729
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 3727

def delete_key_with_http_info(vault_base_url, key_name, custom_headers:nil)
  delete_key_async(vault_base_url, key_name, custom_headers:custom_headers).value!
end

#delete_sas_definition(vault_base_url, storage_account_name, sas_definition_name, custom_headers: nil) ⇒ DeletedSasDefinitionBundle

Deletes a SAS definition from a specified storage account. This operation requires the storage/deletesas permission.

myvault.vault.azure.net. will be added to the HTTP request.



9276
9277
9278
9279
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 9276

def delete_sas_definition(vault_base_url, , sas_definition_name, custom_headers:nil)
  response = delete_sas_definition_async(vault_base_url, , sas_definition_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#delete_sas_definition_async(vault_base_url, storage_account_name, sas_definition_name, custom_headers: nil) ⇒ Concurrent::Promise

Deletes a SAS definition from a specified storage account. This operation requires the storage/deletesas permission.

myvault.vault.azure.net. to the HTTP request.



9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 9311

def delete_sas_definition_async(vault_base_url, , sas_definition_name, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'storage_account_name is nil' if .nil?
  fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !.nil? && .match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil?
  fail ArgumentError, 'sas_definition_name is nil' if sas_definition_name.nil?
  fail ArgumentError, "'sas_definition_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !sas_definition_name.nil? && sas_definition_name.match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'storage/{storage-account-name}/sas/{sas-definition-name}'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'storage-account-name' => ,'sas-definition-name' => sas_definition_name},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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::V7_2_preview::Models::DeletedSasDefinitionBundle.mapper()
        result.body = self.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

#delete_sas_definition_with_http_info(vault_base_url, storage_account_name, sas_definition_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes a SAS definition from a specified storage account. This operation requires the storage/deletesas permission.

myvault.vault.azure.net. will be added to the HTTP request.



9294
9295
9296
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 9294

def delete_sas_definition_with_http_info(vault_base_url, , sas_definition_name, custom_headers:nil)
  delete_sas_definition_async(vault_base_url, , sas_definition_name, custom_headers:custom_headers).value!
end

#delete_secret(vault_base_url, secret_name, custom_headers: nil) ⇒ DeletedSecretBundle

Deletes a secret from a specified key vault.

The DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied to an individual version of a secret. This operation requires the secrets/delete permission.

myvault.vault.azure.net. will be added to the HTTP request.



6197
6198
6199
6200
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 6197

def delete_secret(vault_base_url, secret_name, custom_headers:nil)
  response = delete_secret_async(vault_base_url, secret_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#delete_secret_async(vault_base_url, secret_name, custom_headers: nil) ⇒ Concurrent::Promise

Deletes a secret from a specified key vault.

The DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied to an individual version of a secret. This operation requires the secrets/delete permission.

myvault.vault.azure.net. to the HTTP request.



6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 6236

def delete_secret_async(vault_base_url, secret_name, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'secret_name is nil' if secret_name.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'secrets/{secret-name}'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'secret-name' => secret_name},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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::V7_2_preview::Models::DeletedSecretBundle.mapper()
        result.body = self.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

#delete_secret_with_http_info(vault_base_url, secret_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes a secret from a specified key vault.

The DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied to an individual version of a secret. This operation requires the secrets/delete permission.

myvault.vault.azure.net. will be added to the HTTP request.



6217
6218
6219
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 6217

def delete_secret_with_http_info(vault_base_url, secret_name, custom_headers:nil)
  delete_secret_async(vault_base_url, secret_name, custom_headers:custom_headers).value!
end

#delete_storage_account(vault_base_url, storage_account_name, custom_headers: nil) ⇒ DeletedStorageBundle

Deletes a storage account. This operation requires the storage/delete permission.

myvault.vault.azure.net. will be added to the HTTP request.



8207
8208
8209
8210
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 8207

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

#delete_storage_account_async(vault_base_url, storage_account_name, custom_headers: nil) ⇒ Concurrent::Promise

Deletes a storage account. This operation requires the storage/delete permission.

myvault.vault.azure.net. to the HTTP request.



8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 8240

def (vault_base_url, , custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'storage_account_name is nil' if .nil?
  fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !.nil? && .match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'storage/{storage-account-name}'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'storage-account-name' => },
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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::V7_2_preview::Models::DeletedStorageBundle.mapper()
        result.body = self.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

#delete_storage_account_with_http_info(vault_base_url, storage_account_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes a storage account. This operation requires the storage/delete permission.

myvault.vault.azure.net. will be added to the HTTP request.



8224
8225
8226
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 8224

def (vault_base_url, , custom_headers:nil)
  (vault_base_url, , custom_headers:custom_headers).value!
end

#encrypt(vault_base_url, key_name, key_version, algorithm, value, iv: nil, aad: nil, tag: nil, custom_headers: nil) ⇒ KeyOperationResult

Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault.

The ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is stored in Azure Key Vault. Note that the ENCRYPT operation only supports a single block of data, the size of which is dependent on the target key and the encryption algorithm to be used. The ENCRYPT operation is only strictly necessary for symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be performed using public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have access to the public key material. This operation requires the keys/encrypt permission.

myvault.vault.azure.net. Possible values include: ‘RSA-OAEP’, ‘RSA-OAEP-256’, ‘RSA1_5’, ‘A128GCM’, ‘A192GCM’, ‘A256GCM’, ‘A128KW’, ‘A192KW’, ‘A256KW’, ‘A128CBC’, ‘A192CBC’, ‘A256CBC’, ‘A128CBCPAD’, ‘A192CBCPAD’, ‘A256CBCPAD’ authenticated crypto algorithms. authenticated algorithm. will be added to the HTTP request.



4620
4621
4622
4623
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 4620

def encrypt(vault_base_url, key_name, key_version, algorithm, value, iv:nil, aad:nil, tag:nil, custom_headers:nil)
  response = encrypt_async(vault_base_url, key_name, key_version, algorithm, value, iv:iv, aad:aad, tag:tag, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#encrypt_async(vault_base_url, key_name, key_version, algorithm, value, iv: nil, aad: nil, tag: nil, custom_headers: nil) ⇒ Concurrent::Promise

Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault.

The ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is stored in Azure Key Vault. Note that the ENCRYPT operation only supports a single block of data, the size of which is dependent on the target key and the encryption algorithm to be used. The ENCRYPT operation is only strictly necessary for symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be performed using public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have access to the public key material. This operation requires the keys/encrypt permission.

myvault.vault.azure.net. Possible values include: ‘RSA-OAEP’, ‘RSA-OAEP-256’, ‘RSA1_5’, ‘A128GCM’, ‘A192GCM’, ‘A256GCM’, ‘A128KW’, ‘A192KW’, ‘A256KW’, ‘A128CBC’, ‘A192CBC’, ‘A256CBC’, ‘A128CBCPAD’, ‘A192CBCPAD’, ‘A256CBCPAD’ authenticated crypto algorithms. authenticated algorithm. to the HTTP request.



4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 4697

def encrypt_async(vault_base_url, key_name, key_version, algorithm, value, iv:nil, aad:nil, tag:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'key_name is nil' if key_name.nil?
  fail ArgumentError, 'key_version is nil' if key_version.nil?
  fail ArgumentError, 'api_version is nil' if api_version.nil?
  fail ArgumentError, 'algorithm is nil' if algorithm.nil?
  fail ArgumentError, "'algorithm' should satisfy the constraint - 'MinLength': '1'" if !algorithm.nil? && algorithm.length < 1
  fail ArgumentError, 'value is nil' if value.nil?

  parameters = Azure::KeyVault::V7_2_preview::Models::KeyOperationsParameters.new
  unless algorithm.nil? && value.nil? && iv.nil? && aad.nil? && tag.nil?
    parameters.algorithm = algorithm
    parameters.value = value
    parameters.iv = iv
    parameters.aad = aad
    parameters.tag = tag
  end

  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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::KeyOperationsParameters.mapper()
  request_content = self.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'keys/{key-name}/{key-version}/encrypt'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'key-name' => key_name,'key-version' => key_version},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::KeyOperationResult.mapper()
        result.body = self.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

#encrypt_with_http_info(vault_base_url, key_name, key_version, algorithm, value, iv: nil, aad: nil, tag: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault.

The ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is stored in Azure Key Vault. Note that the ENCRYPT operation only supports a single block of data, the size of which is dependent on the target key and the encryption algorithm to be used. The ENCRYPT operation is only strictly necessary for symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be performed using public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have access to the public key material. This operation requires the keys/encrypt permission.

myvault.vault.azure.net. Possible values include: ‘RSA-OAEP’, ‘RSA-OAEP-256’, ‘RSA1_5’, ‘A128GCM’, ‘A192GCM’, ‘A256GCM’, ‘A128KW’, ‘A192KW’, ‘A256KW’, ‘A128CBC’, ‘A192CBC’, ‘A256CBC’, ‘A128CBCPAD’, ‘A192CBCPAD’, ‘A256CBCPAD’ authenticated crypto algorithms. authenticated algorithm. will be added to the HTTP request.



4659
4660
4661
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 4659

def encrypt_with_http_info(vault_base_url, key_name, key_version, algorithm, value, iv:nil, aad:nil, tag:nil, custom_headers:nil)
  encrypt_async(vault_base_url, key_name, key_version, algorithm, value, iv:iv, aad:aad, tag:tag, custom_headers:custom_headers).value!
end

#full_backup(vault_base_url, azure_storage_blob_container_uri: nil, custom_headers: nil) ⇒ FullBackupOperation

Creates a full backup using a user-provided SAS token to an Azure blob storage container.

myvault.vault.azure.net. access signature token pointing to a valid Azure blob container where full backup needs to be stored. This token needs to be valid for at least next 24 hours from the time of making this call will be added to the HTTP request.



9801
9802
9803
9804
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 9801

def full_backup(vault_base_url, azure_storage_blob_container_uri:nil, custom_headers:nil)
  response = full_backup_async(vault_base_url, azure_storage_blob_container_uri:azure_storage_blob_container_uri, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#full_backup_async(vault_base_url, azure_storage_blob_container_uri: nil, custom_headers: nil) ⇒ Concurrent::Promise

Creates a full backup using a user-provided SAS token to an Azure blob storage container.

myvault.vault.azure.net. access signature token pointing to a valid Azure blob container where full backup needs to be stored. This token needs to be valid for at least next 24 hours from the time of making this call to the HTTP request.



9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 9840

def full_backup_async(vault_base_url, azure_storage_blob_container_uri:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::SASTokenParameter.mapper()
  request_content = self.serialize(request_mapper,  azure_storage_blob_container_uri)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'backup'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 == 202
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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 == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::KeyVault::V7_2_preview::Models::FullBackupOperation.mapper()
        result.body = self.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

#full_backup_status(vault_base_url, job_id, custom_headers: nil) ⇒ FullBackupOperation

Returns the status of full backup operation

myvault.vault.azure.net. will be added to the HTTP request.



9911
9912
9913
9914
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 9911

def full_backup_status(vault_base_url, job_id, custom_headers:nil)
  response = full_backup_status_async(vault_base_url, job_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#full_backup_status_async(vault_base_url, job_id, custom_headers: nil) ⇒ Concurrent::Promise

Returns the status of full backup operation

myvault.vault.azure.net. to the HTTP request.



9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 9942

def full_backup_status_async(vault_base_url, job_id, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'job_id is nil' if job_id.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'backup/{jobId}/pending'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'jobId' => job_id},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::FullBackupOperation.mapper()
        result.body = self.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

#full_backup_status_with_http_info(vault_base_url, job_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Returns the status of full backup operation

myvault.vault.azure.net. will be added to the HTTP request.



9927
9928
9929
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 9927

def full_backup_status_with_http_info(vault_base_url, job_id, custom_headers:nil)
  full_backup_status_async(vault_base_url, job_id, custom_headers:custom_headers).value!
end

#full_backup_with_http_info(vault_base_url, azure_storage_blob_container_uri: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Creates a full backup using a user-provided SAS token to an Azure blob storage container.

myvault.vault.azure.net. access signature token pointing to a valid Azure blob container where full backup needs to be stored. This token needs to be valid for at least next 24 hours from the time of making this call will be added to the HTTP request.



9821
9822
9823
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 9821

def full_backup_with_http_info(vault_base_url, azure_storage_blob_container_uri:nil, custom_headers:nil)
  full_backup_async(vault_base_url, azure_storage_blob_container_uri:azure_storage_blob_container_uri, custom_headers:custom_headers).value!
end

#full_restore_operation(vault_base_url, restore_blob_details: nil, custom_headers: nil) ⇒ RestoreOperation

Restores all key materials using the SAS token pointing to a previously stored Azure Blob storage backup folder

myvault.vault.azure.net. token pointing to a folder where the previous successful full backup was stored will be added to the HTTP request.



10011
10012
10013
10014
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 10011

def full_restore_operation(vault_base_url, restore_blob_details:nil, custom_headers:nil)
  response = full_restore_operation_async(vault_base_url, restore_blob_details:restore_blob_details, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#full_restore_operation_async(vault_base_url, restore_blob_details: nil, custom_headers: nil) ⇒ Concurrent::Promise

Restores all key materials using the SAS token pointing to a previously stored Azure Blob storage backup folder

myvault.vault.azure.net. token pointing to a folder where the previous successful full backup was stored to the HTTP request.



10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 10048

def full_restore_operation_async(vault_base_url, restore_blob_details:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::RestoreOperationParameters.mapper()
  request_content = self.serialize(request_mapper,  restore_blob_details)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'restore'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 == 202
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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 == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::KeyVault::V7_2_preview::Models::RestoreOperation.mapper()
        result.body = self.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

#full_restore_operation_with_http_info(vault_base_url, restore_blob_details: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Restores all key materials using the SAS token pointing to a previously stored Azure Blob storage backup folder

myvault.vault.azure.net. token pointing to a folder where the previous successful full backup was stored will be added to the HTTP request.



10030
10031
10032
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 10030

def full_restore_operation_with_http_info(vault_base_url, restore_blob_details:nil, custom_headers:nil)
  full_restore_operation_async(vault_base_url, restore_blob_details:restore_blob_details, custom_headers:custom_headers).value!
end

#get_certificate(vault_base_url, certificate_name, certificate_version, custom_headers: nil) ⇒ CertificateBundle

Gets information about a certificate.

Gets information about a specific certificate. This operation requires the certificates/get permission.

myvault.vault.azure.net. vault. fragment is optional. If not specified, the latest version of the certificate is returned. will be added to the HTTP request.



2098
2099
2100
2101
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 2098

def get_certificate(vault_base_url, certificate_name, certificate_version, custom_headers:nil)
  response = get_certificate_async(vault_base_url, certificate_name, certificate_version, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_certificate_async(vault_base_url, certificate_name, certificate_version, custom_headers: nil) ⇒ Concurrent::Promise

Gets information about a certificate.

Gets information about a specific certificate. This operation requires the certificates/get permission.

myvault.vault.azure.net. vault. fragment is optional. If not specified, the latest version of the certificate is returned. to the HTTP request.



2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 2143

def get_certificate_async(vault_base_url, certificate_name, certificate_version, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'certificate_name is nil' if certificate_name.nil?
  fail ArgumentError, 'certificate_version is nil' if certificate_version.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'certificates/{certificate-name}/{certificate-version}'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'certificate-name' => certificate_name,'certificate-version' => certificate_version},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::CertificateBundle.mapper()
        result.body = self.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_certificate_contacts(vault_base_url, custom_headers: nil) ⇒ Contacts

Lists the certificate contacts for a specified key vault.

The GetCertificateContacts operation returns the set of certificate contact resources in the specified key vault. This operation requires the certificates/managecontacts permission.

myvault.vault.azure.net. will be added to the HTTP request.



480
481
482
483
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 480

def get_certificate_contacts(vault_base_url, custom_headers:nil)
  response = get_certificate_contacts_async(vault_base_url, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_certificate_contacts_async(vault_base_url, custom_headers: nil) ⇒ Concurrent::Promise

Lists the certificate contacts for a specified key vault.

The GetCertificateContacts operation returns the set of certificate contact resources in the specified key vault. This operation requires the certificates/managecontacts permission.

myvault.vault.azure.net. to the HTTP request.



517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 517

def get_certificate_contacts_async(vault_base_url, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'certificates/contacts'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::Contacts.mapper()
        result.body = self.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_certificate_contacts_with_http_info(vault_base_url, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists the certificate contacts for a specified key vault.

The GetCertificateContacts operation returns the set of certificate contact resources in the specified key vault. This operation requires the certificates/managecontacts permission.

myvault.vault.azure.net. will be added to the HTTP request.



499
500
501
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 499

def get_certificate_contacts_with_http_info(vault_base_url, custom_headers:nil)
  get_certificate_contacts_async(vault_base_url, custom_headers:custom_headers).value!
end

#get_certificate_issuer(vault_base_url, issuer_name, custom_headers: nil) ⇒ IssuerBundle

Lists the specified certificate issuer.

The GetCertificateIssuer operation returns the specified certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission.

myvault.vault.azure.net. will be added to the HTTP request.



1078
1079
1080
1081
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 1078

def get_certificate_issuer(vault_base_url, issuer_name, custom_headers:nil)
  response = get_certificate_issuer_async(vault_base_url, issuer_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_certificate_issuer_async(vault_base_url, issuer_name, custom_headers: nil) ⇒ Concurrent::Promise

Lists the specified certificate issuer.

The GetCertificateIssuer operation returns the specified certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission.

myvault.vault.azure.net. to the HTTP request.



1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 1117

def get_certificate_issuer_async(vault_base_url, issuer_name, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'issuer_name is nil' if issuer_name.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'certificates/issuers/{issuer-name}'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'issuer-name' => issuer_name},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::IssuerBundle.mapper()
        result.body = self.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_certificate_issuer_with_http_info(vault_base_url, issuer_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists the specified certificate issuer.

The GetCertificateIssuer operation returns the specified certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission.

myvault.vault.azure.net. will be added to the HTTP request.



1098
1099
1100
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 1098

def get_certificate_issuer_with_http_info(vault_base_url, issuer_name, custom_headers:nil)
  get_certificate_issuer_async(vault_base_url, issuer_name, custom_headers:custom_headers).value!
end

#get_certificate_issuers(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ Array<CertificateIssuerItem>

List certificate issuers for a specified key vault.

The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



687
688
689
690
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 687

def get_certificate_issuers(vault_base_url, maxresults:nil, custom_headers:nil)
  first_page = get_certificate_issuers_as_lazy(vault_base_url, maxresults:maxresults, custom_headers:custom_headers)
  first_page.get_all_items
end

#get_certificate_issuers_as_lazy(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ CertificateIssuerListResult

List certificate issuers for a specified key vault.

The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



12231
12232
12233
12234
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 12231

def get_certificate_issuers_as_lazy(vault_base_url, maxresults:nil, custom_headers:nil)
  first_page = get_certificate_issuers_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers)
  first_page.get_all_items
end

#get_certificate_issuers_as_lazy_async(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ Concurrent::Promise

List certificate issuers for a specified key vault.

The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. to the HTTP request.



12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 12272

def get_certificate_issuers_as_lazy_async(vault_base_url, maxresults:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1


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

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'maxresults' => maxresults},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::CertificateIssuerListResult.mapper()
        result.body = self.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_certificate_issuers_as_lazy_with_http_info(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List certificate issuers for a specified key vault.

The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



12252
12253
12254
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 12252

def get_certificate_issuers_as_lazy_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil)
  get_certificate_issuers_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value!
end

#get_certificate_issuers_async(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ Concurrent::Promise

List certificate issuers for a specified key vault.

The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. 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
780
781
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 728

def get_certificate_issuers_async(vault_base_url, maxresults:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'certificates/issuers'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'maxresults' => maxresults,'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::CertificateIssuerListResult.mapper()
        result.body = self.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_certificate_issuers_next(next_page_link, custom_headers: nil) ⇒ CertificateIssuerListResult

List certificate issuers for a specified key vault.

The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission.

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



10784
10785
10786
10787
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 10784

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

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

List certificate issuers for a specified key vault.

The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission.

to List operation. to the HTTP request.



10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 10821

def get_certificate_issuers_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'] = accept_language unless accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || self.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 = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::CertificateIssuerListResult.mapper()
        result.body = self.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_certificate_issuers_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List certificate issuers for a specified key vault.

The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission.

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



10803
10804
10805
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 10803

def get_certificate_issuers_next_with_http_info(next_page_link, custom_headers:nil)
  get_certificate_issuers_next_async(next_page_link, custom_headers:custom_headers).value!
end

#get_certificate_issuers_with_http_info(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List certificate issuers for a specified key vault.

The GetCertificateIssuers operation returns the set of certificate issuer resources in the specified key vault. This operation requires the certificates/manageissuers/getissuers permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



708
709
710
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 708

def get_certificate_issuers_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil)
  get_certificate_issuers_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value!
end

#get_certificate_operation(vault_base_url, certificate_name, custom_headers: nil) ⇒ CertificateOperation

Gets the creation operation of a certificate.

Gets the creation operation associated with a specified certificate. This operation requires the certificates/get permission.

myvault.vault.azure.net. will be added to the HTTP request.



2337
2338
2339
2340
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 2337

def get_certificate_operation(vault_base_url, certificate_name, custom_headers:nil)
  response = get_certificate_operation_async(vault_base_url, certificate_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_certificate_operation_async(vault_base_url, certificate_name, custom_headers: nil) ⇒ Concurrent::Promise

Gets the creation operation of a certificate.

Gets the creation operation associated with a specified certificate. This operation requires the certificates/get permission.

myvault.vault.azure.net. to the HTTP request.



2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 2374

def get_certificate_operation_async(vault_base_url, certificate_name, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'certificate_name is nil' if certificate_name.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'certificates/{certificate-name}/pending'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'certificate-name' => certificate_name},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::CertificateOperation.mapper()
        result.body = self.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_certificate_operation_with_http_info(vault_base_url, certificate_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the creation operation of a certificate.

Gets the creation operation associated with a specified certificate. This operation requires the certificates/get permission.

myvault.vault.azure.net. will be added to the HTTP request.



2356
2357
2358
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 2356

def get_certificate_operation_with_http_info(vault_base_url, certificate_name, custom_headers:nil)
  get_certificate_operation_async(vault_base_url, certificate_name, custom_headers:custom_headers).value!
end

#get_certificate_policy(vault_base_url, certificate_name, custom_headers: nil) ⇒ CertificatePolicy

Lists the policy for a certificate.

The GetCertificatePolicy operation returns the specified certificate policy resources in the specified key vault. This operation requires the certificates/get permission.

myvault.vault.azure.net. vault. will be added to the HTTP request.



1717
1718
1719
1720
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 1717

def get_certificate_policy(vault_base_url, certificate_name, custom_headers:nil)
  response = get_certificate_policy_async(vault_base_url, certificate_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_certificate_policy_async(vault_base_url, certificate_name, custom_headers: nil) ⇒ Concurrent::Promise

Lists the policy for a certificate.

The GetCertificatePolicy operation returns the specified certificate policy resources in the specified key vault. This operation requires the certificates/get permission.

myvault.vault.azure.net. vault. to the HTTP request.



1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 1758

def get_certificate_policy_async(vault_base_url, certificate_name, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'certificate_name is nil' if certificate_name.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'certificates/{certificate-name}/policy'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'certificate-name' => certificate_name},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::CertificatePolicy.mapper()
        result.body = self.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_certificate_policy_with_http_info(vault_base_url, certificate_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists the policy for a certificate.

The GetCertificatePolicy operation returns the specified certificate policy resources in the specified key vault. This operation requires the certificates/get permission.

myvault.vault.azure.net. vault. will be added to the HTTP request.



1738
1739
1740
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 1738

def get_certificate_policy_with_http_info(vault_base_url, certificate_name, custom_headers:nil)
  get_certificate_policy_async(vault_base_url, certificate_name, custom_headers:custom_headers).value!
end

#get_certificate_versions(vault_base_url, certificate_name, maxresults: nil, custom_headers: nil) ⇒ Array<CertificateItem>

List the versions of a certificate.

The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



1601
1602
1603
1604
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 1601

def get_certificate_versions(vault_base_url, certificate_name, maxresults:nil, custom_headers:nil)
  first_page = get_certificate_versions_as_lazy(vault_base_url, certificate_name, maxresults:maxresults, custom_headers:custom_headers)
  first_page.get_all_items
end

#get_certificate_versions_as_lazy(vault_base_url, certificate_name, maxresults: nil, custom_headers: nil) ⇒ CertificateListResult

List the versions of a certificate.

The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



12339
12340
12341
12342
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 12339

def get_certificate_versions_as_lazy(vault_base_url, certificate_name, maxresults:nil, custom_headers:nil)
  first_page = get_certificate_versions_as_lazy_async(vault_base_url, certificate_name, maxresults:maxresults, custom_headers:custom_headers)
  first_page.get_all_items
end

#get_certificate_versions_as_lazy_async(vault_base_url, certificate_name, maxresults: nil, custom_headers: nil) ⇒ Concurrent::Promise

List the versions of a certificate.

The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. to the HTTP request.



12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 12382

def get_certificate_versions_as_lazy_async(vault_base_url, certificate_name, maxresults:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'certificate_name is nil' if certificate_name.nil?
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
  path_template = 'certificates/{certificate-name}/versions'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'certificate-name' => certificate_name},
      query_params: {'maxresults' => maxresults},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::CertificateListResult.mapper()
        result.body = self.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_certificate_versions_as_lazy_with_http_info(vault_base_url, certificate_name, maxresults: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List the versions of a certificate.

The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



12361
12362
12363
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 12361

def get_certificate_versions_as_lazy_with_http_info(vault_base_url, certificate_name, maxresults:nil, custom_headers:nil)
  get_certificate_versions_as_lazy_async(vault_base_url, certificate_name, maxresults:maxresults, custom_headers:custom_headers).value!
end

#get_certificate_versions_async(vault_base_url, certificate_name, maxresults: nil, custom_headers: nil) ⇒ Concurrent::Promise

List the versions of a certificate.

The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. to the HTTP request.



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
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 1644

def get_certificate_versions_async(vault_base_url, certificate_name, maxresults:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'certificate_name is nil' if certificate_name.nil?
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'certificates/{certificate-name}/versions'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'certificate-name' => certificate_name},
      query_params: {'maxresults' => maxresults,'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::CertificateListResult.mapper()
        result.body = self.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_certificate_versions_next(next_page_link, custom_headers: nil) ⇒ CertificateListResult

List the versions of a certificate.

The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission.

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



10886
10887
10888
10889
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 10886

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

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

List the versions of a certificate.

The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission.

to List operation. to the HTTP request.



10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 10923

def get_certificate_versions_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'] = accept_language unless accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || self.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 = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::CertificateListResult.mapper()
        result.body = self.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_certificate_versions_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List the versions of a certificate.

The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission.

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



10905
10906
10907
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 10905

def get_certificate_versions_next_with_http_info(next_page_link, custom_headers:nil)
  get_certificate_versions_next_async(next_page_link, custom_headers:custom_headers).value!
end

#get_certificate_versions_with_http_info(vault_base_url, certificate_name, maxresults: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List the versions of a certificate.

The GetCertificateVersions operation returns the versions of a certificate in the specified key vault. This operation requires the certificates/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



1623
1624
1625
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 1623

def get_certificate_versions_with_http_info(vault_base_url, certificate_name, maxresults:nil, custom_headers:nil)
  get_certificate_versions_async(vault_base_url, certificate_name, maxresults:maxresults, custom_headers:custom_headers).value!
end

#get_certificate_with_http_info(vault_base_url, certificate_name, certificate_version, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets information about a certificate.

Gets information about a specific certificate. This operation requires the certificates/get permission.

myvault.vault.azure.net. vault. fragment is optional. If not specified, the latest version of the certificate is returned. will be added to the HTTP request.



2121
2122
2123
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 2121

def get_certificate_with_http_info(vault_base_url, certificate_name, certificate_version, custom_headers:nil)
  get_certificate_async(vault_base_url, certificate_name, certificate_version, custom_headers:custom_headers).value!
end

#get_certificates(vault_base_url, maxresults: nil, include_pending: nil, custom_headers: nil) ⇒ Array<CertificateItem>

List certificates in a specified key vault

The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. which are not completely provisioned. will be added to the HTTP request.



142
143
144
145
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 142

def get_certificates(vault_base_url, maxresults:nil, include_pending:nil, custom_headers:nil)
  first_page = get_certificates_as_lazy(vault_base_url, maxresults:maxresults, include_pending:include_pending, custom_headers:custom_headers)
  first_page.get_all_items
end

#get_certificates_as_lazy(vault_base_url, maxresults: nil, include_pending: nil, custom_headers: nil) ⇒ CertificateListResult

List certificates in a specified key vault

The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. which are not completely provisioned. will be added to the HTTP request.



12120
12121
12122
12123
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 12120

def get_certificates_as_lazy(vault_base_url, maxresults:nil, include_pending:nil, custom_headers:nil)
  first_page = get_certificates_as_lazy_async(vault_base_url, maxresults:maxresults, include_pending:include_pending, custom_headers:custom_headers)
  first_page.get_all_items
end

#get_certificates_as_lazy_async(vault_base_url, maxresults: nil, include_pending: nil, custom_headers: nil) ⇒ Concurrent::Promise

List certificates in a specified key vault

The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. which are not completely provisioned. to the HTTP request.



12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 12165

def get_certificates_as_lazy_async(vault_base_url, maxresults:nil, include_pending:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1


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

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'maxresults' => maxresults,'includePending' => include_pending},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::CertificateListResult.mapper()
        result.body = self.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_certificates_as_lazy_with_http_info(vault_base_url, maxresults: nil, include_pending: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List certificates in a specified key vault

The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. which are not completely provisioned. will be added to the HTTP request.



12143
12144
12145
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 12143

def get_certificates_as_lazy_with_http_info(vault_base_url, maxresults:nil, include_pending:nil, custom_headers:nil)
  get_certificates_as_lazy_async(vault_base_url, maxresults:maxresults, include_pending:include_pending, custom_headers:custom_headers).value!
end

#get_certificates_async(vault_base_url, maxresults: nil, include_pending: nil, custom_headers: nil) ⇒ Concurrent::Promise

List certificates in a specified key vault

The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. which are not completely provisioned. to the HTTP request.



187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 187

def get_certificates_async(vault_base_url, maxresults:nil, include_pending:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'certificates'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'maxresults' => maxresults,'includePending' => include_pending,'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::CertificateListResult.mapper()
        result.body = self.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_certificates_next(next_page_link, custom_headers: nil) ⇒ CertificateListResult

List certificates in a specified key vault

The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission.

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



10682
10683
10684
10685
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 10682

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

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

List certificates in a specified key vault

The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission.

to List operation. to the HTTP request.



10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 10719

def get_certificates_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'] = accept_language unless accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || self.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 = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::CertificateListResult.mapper()
        result.body = self.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_certificates_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List certificates in a specified key vault

The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission.

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



10701
10702
10703
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 10701

def get_certificates_next_with_http_info(next_page_link, custom_headers:nil)
  get_certificates_next_async(next_page_link, custom_headers:custom_headers).value!
end

#get_certificates_with_http_info(vault_base_url, maxresults: nil, include_pending: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List certificates in a specified key vault

The GetCertificates operation returns the set of certificates resources in the specified key vault. This operation requires the certificates/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. which are not completely provisioned. will be added to the HTTP request.



165
166
167
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 165

def get_certificates_with_http_info(vault_base_url, maxresults:nil, include_pending:nil, custom_headers:nil)
  get_certificates_async(vault_base_url, maxresults:maxresults, include_pending:include_pending, custom_headers:custom_headers).value!
end

#get_deleted_certificate(vault_base_url, certificate_name, custom_headers: nil) ⇒ DeletedCertificateBundle

Retrieves information about the specified deleted certificate.

The GetDeletedCertificate operation retrieves the deleted certificate information plus its attributes, such as retention interval, scheduled permanent deletion and the current deletion recovery level. This operation requires the certificates/get permission.

myvault.vault.azure.net. will be added to the HTTP request.



3053
3054
3055
3056
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 3053

def get_deleted_certificate(vault_base_url, certificate_name, custom_headers:nil)
  response = get_deleted_certificate_async(vault_base_url, certificate_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_deleted_certificate_async(vault_base_url, certificate_name, custom_headers: nil) ⇒ Concurrent::Promise

Retrieves information about the specified deleted certificate.

The GetDeletedCertificate operation retrieves the deleted certificate information plus its attributes, such as retention interval, scheduled permanent deletion and the current deletion recovery level. This operation requires the certificates/get permission.

myvault.vault.azure.net. to the HTTP request.



3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 3094

def get_deleted_certificate_async(vault_base_url, certificate_name, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'certificate_name is nil' if certificate_name.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'deletedcertificates/{certificate-name}'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'certificate-name' => certificate_name},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::DeletedCertificateBundle.mapper()
        result.body = self.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_certificate_with_http_info(vault_base_url, certificate_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Retrieves information about the specified deleted certificate.

The GetDeletedCertificate operation retrieves the deleted certificate information plus its attributes, such as retention interval, scheduled permanent deletion and the current deletion recovery level. This operation requires the certificates/get permission.

myvault.vault.azure.net. will be added to the HTTP request.



3074
3075
3076
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 3074

def get_deleted_certificate_with_http_info(vault_base_url, certificate_name, custom_headers:nil)
  get_deleted_certificate_async(vault_base_url, certificate_name, custom_headers:custom_headers).value!
end

#get_deleted_certificates(vault_base_url, maxresults: nil, include_pending: nil, custom_headers: nil) ⇒ Array<DeletedCertificateItem>

Lists the deleted certificates in the specified vault currently available for recovery.

The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults.

myvault.vault.azure.net. not specified the service will return up to 25 results. which are not completely provisioned. will be added to the HTTP request.



2931
2932
2933
2934
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 2931

def get_deleted_certificates(vault_base_url, maxresults:nil, include_pending:nil, custom_headers:nil)
  first_page = get_deleted_certificates_as_lazy(vault_base_url, maxresults:maxresults, include_pending:include_pending, custom_headers:custom_headers)
  first_page.get_all_items
end

#get_deleted_certificates_as_lazy(vault_base_url, maxresults: nil, include_pending: nil, custom_headers: nil) ⇒ DeletedCertificateListResult

Lists the deleted certificates in the specified vault currently available for recovery.

The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults.

myvault.vault.azure.net. not specified the service will return up to 25 results. which are not completely provisioned. will be added to the HTTP request.



12455
12456
12457
12458
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 12455

def get_deleted_certificates_as_lazy(vault_base_url, maxresults:nil, include_pending:nil, custom_headers:nil)
  first_page = get_deleted_certificates_as_lazy_async(vault_base_url, maxresults:maxresults, include_pending:include_pending, custom_headers:custom_headers)
  first_page.get_all_items
end

#get_deleted_certificates_as_lazy_async(vault_base_url, maxresults: nil, include_pending: nil, custom_headers: nil) ⇒ Concurrent::Promise

Lists the deleted certificates in the specified vault currently available for recovery.

The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults.

myvault.vault.azure.net. not specified the service will return up to 25 results. which are not completely provisioned. to the HTTP request.



12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 12506

def get_deleted_certificates_as_lazy_async(vault_base_url, maxresults:nil, include_pending:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1


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

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'maxresults' => maxresults,'includePending' => include_pending},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::DeletedCertificateListResult.mapper()
        result.body = self.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_certificates_as_lazy_with_http_info(vault_base_url, maxresults: nil, include_pending: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists the deleted certificates in the specified vault currently available for recovery.

The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults.

myvault.vault.azure.net. not specified the service will return up to 25 results. which are not completely provisioned. will be added to the HTTP request.



12481
12482
12483
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 12481

def get_deleted_certificates_as_lazy_with_http_info(vault_base_url, maxresults:nil, include_pending:nil, custom_headers:nil)
  get_deleted_certificates_as_lazy_async(vault_base_url, maxresults:maxresults, include_pending:include_pending, custom_headers:custom_headers).value!
end

#get_deleted_certificates_async(vault_base_url, maxresults: nil, include_pending: nil, custom_headers: nil) ⇒ Concurrent::Promise

Lists the deleted certificates in the specified vault currently available for recovery.

The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults.

myvault.vault.azure.net. not specified the service will return up to 25 results. which are not completely provisioned. to the HTTP request.



2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 2982

def get_deleted_certificates_async(vault_base_url, maxresults:nil, include_pending:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'deletedcertificates'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'maxresults' => maxresults,'includePending' => include_pending,'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::DeletedCertificateListResult.mapper()
        result.body = self.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_certificates_next(next_page_link, custom_headers: nil) ⇒ DeletedCertificateListResult

Lists the deleted certificates in the specified vault currently available for recovery.

The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults.

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



10991
10992
10993
10994
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 10991

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

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

Lists the deleted certificates in the specified vault currently available for recovery.

The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults.

to List operation. to the HTTP request.



11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 11034

def get_deleted_certificates_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'] = accept_language unless accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || self.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 = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::DeletedCertificateListResult.mapper()
        result.body = self.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_certificates_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists the deleted certificates in the specified vault currently available for recovery.

The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults.

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



11013
11014
11015
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 11013

def get_deleted_certificates_next_with_http_info(next_page_link, custom_headers:nil)
  get_deleted_certificates_next_async(next_page_link, custom_headers:custom_headers).value!
end

#get_deleted_certificates_with_http_info(vault_base_url, maxresults: nil, include_pending: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists the deleted certificates in the specified vault currently available for recovery.

The GetDeletedCertificates operation retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging. This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can only be enabled on soft-delete enabled vaults.

myvault.vault.azure.net. not specified the service will return up to 25 results. which are not completely provisioned. will be added to the HTTP request.



2957
2958
2959
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 2957

def get_deleted_certificates_with_http_info(vault_base_url, maxresults:nil, include_pending:nil, custom_headers:nil)
  get_deleted_certificates_async(vault_base_url, maxresults:maxresults, include_pending:include_pending, custom_headers:custom_headers).value!
end

#get_deleted_key(vault_base_url, key_name, custom_headers: nil) ⇒ DeletedKeyBundle

Gets the public part of a deleted key.

The Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/get permission.

myvault.vault.azure.net. will be added to the HTTP request.



5730
5731
5732
5733
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 5730

def get_deleted_key(vault_base_url, key_name, custom_headers:nil)
  response = get_deleted_key_async(vault_base_url, key_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_deleted_key_async(vault_base_url, key_name, custom_headers: nil) ⇒ Concurrent::Promise

Gets the public part of a deleted key.

The Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/get permission.

myvault.vault.azure.net. to the HTTP request.



5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 5771

def get_deleted_key_async(vault_base_url, key_name, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'key_name is nil' if key_name.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'deletedkeys/{key-name}'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'key-name' => key_name},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::DeletedKeyBundle.mapper()
        result.body = self.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_key_with_http_info(vault_base_url, key_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the public part of a deleted key.

The Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/get permission.

myvault.vault.azure.net. will be added to the HTTP request.



5751
5752
5753
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 5751

def get_deleted_key_with_http_info(vault_base_url, key_name, custom_headers:nil)
  get_deleted_key_async(vault_base_url, key_name, custom_headers:custom_headers).value!
end

#get_deleted_keys(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ Array<DeletedKeyItem>

Lists the deleted keys in the specified vault.

Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



5612
5613
5614
5615
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 5612

def get_deleted_keys(vault_base_url, maxresults:nil, custom_headers:nil)
  first_page = get_deleted_keys_as_lazy(vault_base_url, maxresults:maxresults, custom_headers:custom_headers)
  first_page.get_all_items
end

#get_deleted_keys_as_lazy(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ DeletedKeyListResult

Lists the deleted keys in the specified vault.

Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



12797
12798
12799
12800
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 12797

def get_deleted_keys_as_lazy(vault_base_url, maxresults:nil, custom_headers:nil)
  first_page = get_deleted_keys_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers)
  first_page.get_all_items
end

#get_deleted_keys_as_lazy_async(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ Concurrent::Promise

Lists the deleted keys in the specified vault.

Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. to the HTTP request.



12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 12844

def get_deleted_keys_as_lazy_async(vault_base_url, maxresults:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1


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

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'maxresults' => maxresults},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::DeletedKeyListResult.mapper()
        result.body = self.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_keys_as_lazy_with_http_info(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists the deleted keys in the specified vault.

Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



12821
12822
12823
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 12821

def get_deleted_keys_as_lazy_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil)
  get_deleted_keys_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value!
end

#get_deleted_keys_async(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ Concurrent::Promise

Lists the deleted keys in the specified vault.

Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. to the HTTP request.



5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 5659

def get_deleted_keys_async(vault_base_url, maxresults:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'deletedkeys'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'maxresults' => maxresults,'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::DeletedKeyListResult.mapper()
        result.body = self.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_keys_next(next_page_link, custom_headers: nil) ⇒ DeletedKeyListResult

Lists the deleted keys in the specified vault.

Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission.

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



11309
11310
11311
11312
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 11309

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

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

Lists the deleted keys in the specified vault.

Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission.

to List operation. to the HTTP request.



11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 11352

def get_deleted_keys_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'] = accept_language unless accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || self.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 = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::DeletedKeyListResult.mapper()
        result.body = self.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_keys_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists the deleted keys in the specified vault.

Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission.

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



11331
11332
11333
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 11331

def get_deleted_keys_next_with_http_info(next_page_link, custom_headers:nil)
  get_deleted_keys_next_async(next_page_link, custom_headers:custom_headers).value!
end

#get_deleted_keys_with_http_info(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists the deleted keys in the specified vault.

Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



5636
5637
5638
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 5636

def get_deleted_keys_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil)
  get_deleted_keys_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value!
end

#get_deleted_sas_definition(vault_base_url, storage_account_name, sas_definition_name, custom_headers: nil) ⇒ DeletedSasDefinitionBundle

Gets the specified deleted sas definition.

The Get Deleted SAS Definition operation returns the specified deleted SAS definition along with its attributes. This operation requires the storage/getsas permission.

myvault.vault.azure.net. will be added to the HTTP request.



9049
9050
9051
9052
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 9049

def get_deleted_sas_definition(vault_base_url, , sas_definition_name, custom_headers:nil)
  response = get_deleted_sas_definition_async(vault_base_url, , sas_definition_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_deleted_sas_definition_async(vault_base_url, storage_account_name, sas_definition_name, custom_headers: nil) ⇒ Concurrent::Promise

Gets the specified deleted sas definition.

The Get Deleted SAS Definition operation returns the specified deleted SAS definition along with its attributes. This operation requires the storage/getsas permission.

myvault.vault.azure.net. to the HTTP request.



9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 9090

def get_deleted_sas_definition_async(vault_base_url, , sas_definition_name, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'storage_account_name is nil' if .nil?
  fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !.nil? && .match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil?
  fail ArgumentError, 'sas_definition_name is nil' if sas_definition_name.nil?
  fail ArgumentError, "'sas_definition_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !sas_definition_name.nil? && sas_definition_name.match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'deletedstorage/{storage-account-name}/sas/{sas-definition-name}'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'storage-account-name' => ,'sas-definition-name' => sas_definition_name},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::DeletedSasDefinitionBundle.mapper()
        result.body = self.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_sas_definition_with_http_info(vault_base_url, storage_account_name, sas_definition_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the specified deleted sas definition.

The Get Deleted SAS Definition operation returns the specified deleted SAS definition along with its attributes. This operation requires the storage/getsas permission.

myvault.vault.azure.net. will be added to the HTTP request.



9070
9071
9072
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 9070

def get_deleted_sas_definition_with_http_info(vault_base_url, , sas_definition_name, custom_headers:nil)
  get_deleted_sas_definition_async(vault_base_url, , sas_definition_name, custom_headers:custom_headers).value!
end

#get_deleted_sas_definitions(vault_base_url, storage_account_name, maxresults: nil, custom_headers: nil) ⇒ Array<DeletedSasDefinitionItem>

Lists deleted SAS definitions for the specified vault and storage account.

The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



8932
8933
8934
8935
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 8932

def get_deleted_sas_definitions(vault_base_url, , maxresults:nil, custom_headers:nil)
  first_page = get_deleted_sas_definitions_as_lazy(vault_base_url, , maxresults:maxresults, custom_headers:custom_headers)
  first_page.get_all_items
end

#get_deleted_sas_definitions_as_lazy(vault_base_url, storage_account_name, maxresults: nil, custom_headers: nil) ⇒ DeletedSasDefinitionListResult

Lists deleted SAS definitions for the specified vault and storage account.

The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



13549
13550
13551
13552
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 13549

def get_deleted_sas_definitions_as_lazy(vault_base_url, , maxresults:nil, custom_headers:nil)
  first_page = get_deleted_sas_definitions_as_lazy_async(vault_base_url, , maxresults:maxresults, custom_headers:custom_headers)
  first_page.get_all_items
end

#get_deleted_sas_definitions_as_lazy_async(vault_base_url, storage_account_name, maxresults: nil, custom_headers: nil) ⇒ Concurrent::Promise

Lists deleted SAS definitions for the specified vault and storage account.

The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. to the HTTP request.



13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
13624
13625
13626
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 13592

def get_deleted_sas_definitions_as_lazy_async(vault_base_url, , maxresults:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'storage_account_name is nil' if .nil?
  fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !.nil? && .match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil?
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
  path_template = 'deletedstorage/{storage-account-name}/sas'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'storage-account-name' => },
      query_params: {'maxresults' => maxresults},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::DeletedSasDefinitionListResult.mapper()
        result.body = self.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_sas_definitions_as_lazy_with_http_info(vault_base_url, storage_account_name, maxresults: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists deleted SAS definitions for the specified vault and storage account.

The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



13571
13572
13573
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 13571

def get_deleted_sas_definitions_as_lazy_with_http_info(vault_base_url, , maxresults:nil, custom_headers:nil)
  get_deleted_sas_definitions_as_lazy_async(vault_base_url, , maxresults:maxresults, custom_headers:custom_headers).value!
end

#get_deleted_sas_definitions_async(vault_base_url, storage_account_name, maxresults: nil, custom_headers: nil) ⇒ Concurrent::Promise

Lists deleted SAS definitions for the specified vault and storage account.

The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. to the HTTP request.



8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 8975

def get_deleted_sas_definitions_async(vault_base_url, , maxresults:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'storage_account_name is nil' if .nil?
  fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !.nil? && .match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil?
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'deletedstorage/{storage-account-name}/sas'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'storage-account-name' => },
      query_params: {'maxresults' => maxresults,'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::DeletedSasDefinitionListResult.mapper()
        result.body = self.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_sas_definitions_next(next_page_link, custom_headers: nil) ⇒ DeletedSasDefinitionListResult

Lists deleted SAS definitions for the specified vault and storage account.

The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission.

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



12014
12015
12016
12017
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 12014

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

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

Lists deleted SAS definitions for the specified vault and storage account.

The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission.

to List operation. to the HTTP request.



12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 12051

def get_deleted_sas_definitions_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'] = accept_language unless accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || self.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 = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::DeletedSasDefinitionListResult.mapper()
        result.body = self.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_sas_definitions_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists deleted SAS definitions for the specified vault and storage account.

The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission.

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



12033
12034
12035
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 12033

def get_deleted_sas_definitions_next_with_http_info(next_page_link, custom_headers:nil)
  get_deleted_sas_definitions_next_async(next_page_link, custom_headers:custom_headers).value!
end

#get_deleted_sas_definitions_with_http_info(vault_base_url, storage_account_name, maxresults: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists deleted SAS definitions for the specified vault and storage account.

The Get Deleted Sas Definitions operation returns the SAS definitions that have been deleted for a vault enabled for soft-delete. This operation requires the storage/listsas permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



8954
8955
8956
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 8954

def get_deleted_sas_definitions_with_http_info(vault_base_url, , maxresults:nil, custom_headers:nil)
  get_deleted_sas_definitions_async(vault_base_url, , maxresults:maxresults, custom_headers:custom_headers).value!
end

#get_deleted_secret(vault_base_url, secret_name, custom_headers: nil) ⇒ DeletedSecretBundle

Gets the specified deleted secret.

The Get Deleted Secret operation returns the specified deleted secret along with its attributes. This operation requires the secrets/get permission.

myvault.vault.azure.net. will be added to the HTTP request.



6906
6907
6908
6909
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 6906

def get_deleted_secret(vault_base_url, secret_name, custom_headers:nil)
  response = get_deleted_secret_async(vault_base_url, secret_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_deleted_secret_async(vault_base_url, secret_name, custom_headers: nil) ⇒ Concurrent::Promise

Gets the specified deleted secret.

The Get Deleted Secret operation returns the specified deleted secret along with its attributes. This operation requires the secrets/get permission.

myvault.vault.azure.net. to the HTTP request.



6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 6943

def get_deleted_secret_async(vault_base_url, secret_name, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'secret_name is nil' if secret_name.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'deletedsecrets/{secret-name}'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'secret-name' => secret_name},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::DeletedSecretBundle.mapper()
        result.body = self.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_secret_with_http_info(vault_base_url, secret_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the specified deleted secret.

The Get Deleted Secret operation returns the specified deleted secret along with its attributes. This operation requires the secrets/get permission.

myvault.vault.azure.net. will be added to the HTTP request.



6925
6926
6927
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 6925

def get_deleted_secret_with_http_info(vault_base_url, secret_name, custom_headers:nil)
  get_deleted_secret_async(vault_base_url, secret_name, custom_headers:custom_headers).value!
end

#get_deleted_secrets(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ Array<DeletedSecretItem>

Lists deleted secrets for the specified vault.

The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



6796
6797
6798
6799
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 6796

def get_deleted_secrets(vault_base_url, maxresults:nil, custom_headers:nil)
  first_page = get_deleted_secrets_as_lazy(vault_base_url, maxresults:maxresults, custom_headers:custom_headers)
  first_page.get_all_items
end

#get_deleted_secrets_as_lazy(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ DeletedSecretListResult

Lists deleted secrets for the specified vault.

The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



13132
13133
13134
13135
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 13132

def get_deleted_secrets_as_lazy(vault_base_url, maxresults:nil, custom_headers:nil)
  first_page = get_deleted_secrets_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers)
  first_page.get_all_items
end

#get_deleted_secrets_as_lazy_async(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ Concurrent::Promise

Lists deleted secrets for the specified vault.

The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. to the HTTP request.



13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 13173

def get_deleted_secrets_as_lazy_async(vault_base_url, maxresults:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1


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

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'maxresults' => maxresults},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::DeletedSecretListResult.mapper()
        result.body = self.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_secrets_as_lazy_with_http_info(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists deleted secrets for the specified vault.

The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



13153
13154
13155
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 13153

def get_deleted_secrets_as_lazy_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil)
  get_deleted_secrets_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value!
end

#get_deleted_secrets_async(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ Concurrent::Promise

Lists deleted secrets for the specified vault.

The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. to the HTTP request.



6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 6837

def get_deleted_secrets_async(vault_base_url, maxresults:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'deletedsecrets'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'maxresults' => maxresults,'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::DeletedSecretListResult.mapper()
        result.body = self.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_secrets_next(next_page_link, custom_headers: nil) ⇒ DeletedSecretListResult

Lists deleted secrets for the specified vault.

The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission.

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



11624
11625
11626
11627
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 11624

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

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

Lists deleted secrets for the specified vault.

The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission.

to List operation. to the HTTP request.



11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 11661

def get_deleted_secrets_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'] = accept_language unless accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || self.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 = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::DeletedSecretListResult.mapper()
        result.body = self.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_secrets_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists deleted secrets for the specified vault.

The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission.

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



11643
11644
11645
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 11643

def get_deleted_secrets_next_with_http_info(next_page_link, custom_headers:nil)
  get_deleted_secrets_next_async(next_page_link, custom_headers:custom_headers).value!
end

#get_deleted_secrets_with_http_info(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists deleted secrets for the specified vault.

The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



6817
6818
6819
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 6817

def get_deleted_secrets_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil)
  get_deleted_secrets_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value!
end

#get_deleted_storage_account(vault_base_url, storage_account_name, custom_headers: nil) ⇒ DeletedStorageBundle

Gets the specified deleted storage account.

The Get Deleted Storage Account operation returns the specified deleted storage account along with its attributes. This operation requires the storage/get permission.

myvault.vault.azure.net. will be added to the HTTP request.



7663
7664
7665
7666
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 7663

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

#get_deleted_storage_account_async(vault_base_url, storage_account_name, custom_headers: nil) ⇒ Concurrent::Promise

Gets the specified deleted storage account.

The Get Deleted Storage Account operation returns the specified deleted storage account along with its attributes. This operation requires the storage/get permission.

myvault.vault.azure.net. to the HTTP request.



7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 7702

def (vault_base_url, , custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'storage_account_name is nil' if .nil?
  fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !.nil? && .match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'deletedstorage/{storage-account-name}'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'storage-account-name' => },
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::DeletedStorageBundle.mapper()
        result.body = self.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_storage_account_with_http_info(vault_base_url, storage_account_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the specified deleted storage account.

The Get Deleted Storage Account operation returns the specified deleted storage account along with its attributes. This operation requires the storage/get permission.

myvault.vault.azure.net. will be added to the HTTP request.



7683
7684
7685
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 7683

def (vault_base_url, , custom_headers:nil)
  (vault_base_url, , custom_headers:custom_headers).value!
end

#get_deleted_storage_accounts(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ Array<DeletedStorageAccountItem>

Lists deleted storage accounts for the specified vault.

The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



7552
7553
7554
7555
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 7552

def get_deleted_storage_accounts(vault_base_url, maxresults:nil, custom_headers:nil)
  first_page = get_deleted_storage_accounts_as_lazy(vault_base_url, maxresults:maxresults, custom_headers:custom_headers)
  first_page.get_all_items
end

#get_deleted_storage_accounts_as_lazy(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ DeletedStorageListResult

Lists deleted storage accounts for the specified vault.

The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



13337
13338
13339
13340
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 13337

def get_deleted_storage_accounts_as_lazy(vault_base_url, maxresults:nil, custom_headers:nil)
  first_page = get_deleted_storage_accounts_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers)
  first_page.get_all_items
end

#get_deleted_storage_accounts_as_lazy_async(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ Concurrent::Promise

Lists deleted storage accounts for the specified vault.

The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. to the HTTP request.



13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 13378

def get_deleted_storage_accounts_as_lazy_async(vault_base_url, maxresults:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1


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

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'maxresults' => maxresults},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::DeletedStorageListResult.mapper()
        result.body = self.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_storage_accounts_as_lazy_with_http_info(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists deleted storage accounts for the specified vault.

The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



13358
13359
13360
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 13358

def get_deleted_storage_accounts_as_lazy_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil)
  get_deleted_storage_accounts_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value!
end

#get_deleted_storage_accounts_async(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ Concurrent::Promise

Lists deleted storage accounts for the specified vault.

The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. to the HTTP request.



7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 7593

def get_deleted_storage_accounts_async(vault_base_url, maxresults:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'deletedstorage'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'maxresults' => maxresults,'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::DeletedStorageListResult.mapper()
        result.body = self.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_storage_accounts_next(next_page_link, custom_headers: nil) ⇒ DeletedStorageListResult

Lists deleted storage accounts for the specified vault.

The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission.

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



11819
11820
11821
11822
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 11819

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

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

Lists deleted storage accounts for the specified vault.

The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission.

to List operation. to the HTTP request.



11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 11856

def get_deleted_storage_accounts_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'] = accept_language unless accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || self.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 = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::DeletedStorageListResult.mapper()
        result.body = self.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_storage_accounts_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists deleted storage accounts for the specified vault.

The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission.

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



11838
11839
11840
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 11838

def get_deleted_storage_accounts_next_with_http_info(next_page_link, custom_headers:nil)
  get_deleted_storage_accounts_next_async(next_page_link, custom_headers:custom_headers).value!
end

#get_deleted_storage_accounts_with_http_info(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists deleted storage accounts for the specified vault.

The Get Deleted Storage Accounts operation returns the storage accounts that have been deleted for a vault enabled for soft-delete. This operation requires the storage/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



7573
7574
7575
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 7573

def get_deleted_storage_accounts_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil)
  get_deleted_storage_accounts_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value!
end

#get_key(vault_base_url, key_name, key_version, custom_headers: nil) ⇒ KeyBundle

Gets the public part of a stored key.

The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. This operation requires the keys/get permission.

myvault.vault.azure.net. version of a key. This URI fragment is optional. If not specified, the latest version of the key is returned. will be added to the HTTP request.



3965
3966
3967
3968
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 3965

def get_key(vault_base_url, key_name, key_version, custom_headers:nil)
  response = get_key_async(vault_base_url, key_name, key_version, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_key_async(vault_base_url, key_name, key_version, custom_headers: nil) ⇒ Concurrent::Promise

Gets the public part of a stored key.

The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. This operation requires the keys/get permission.

myvault.vault.azure.net. version of a key. This URI fragment is optional. If not specified, the latest version of the key is returned. to the HTTP request.



4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 4010

def get_key_async(vault_base_url, key_name, key_version, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'key_name is nil' if key_name.nil?
  fail ArgumentError, 'key_version is nil' if key_version.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'keys/{key-name}/{key-version}'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'key-name' => key_name,'key-version' => key_version},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::KeyBundle.mapper()
        result.body = self.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_key_versions(vault_base_url, key_name, maxresults: nil, custom_headers: nil) ⇒ Array<KeyItem>

Retrieves a list of individual key versions with the same key name.

The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



4082
4083
4084
4085
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 4082

def get_key_versions(vault_base_url, key_name, maxresults:nil, custom_headers:nil)
  first_page = get_key_versions_as_lazy(vault_base_url, key_name, maxresults:maxresults, custom_headers:custom_headers)
  first_page.get_all_items
end

#get_key_versions_as_lazy(vault_base_url, key_name, maxresults: nil, custom_headers: nil) ⇒ KeyListResult

Retrieves a list of individual key versions with the same key name.

The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



12572
12573
12574
12575
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 12572

def get_key_versions_as_lazy(vault_base_url, key_name, maxresults:nil, custom_headers:nil)
  first_page = get_key_versions_as_lazy_async(vault_base_url, key_name, maxresults:maxresults, custom_headers:custom_headers)
  first_page.get_all_items
end

#get_key_versions_as_lazy_async(vault_base_url, key_name, maxresults: nil, custom_headers: nil) ⇒ Concurrent::Promise

Retrieves a list of individual key versions with the same key name.

The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. to the HTTP request.



12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 12613

def get_key_versions_as_lazy_async(vault_base_url, key_name, maxresults:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'key_name is nil' if key_name.nil?
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
  path_template = 'keys/{key-name}/versions'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'key-name' => key_name},
      query_params: {'maxresults' => maxresults},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::KeyListResult.mapper()
        result.body = self.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_key_versions_as_lazy_with_http_info(vault_base_url, key_name, maxresults: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Retrieves a list of individual key versions with the same key name.

The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



12593
12594
12595
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 12593

def get_key_versions_as_lazy_with_http_info(vault_base_url, key_name, maxresults:nil, custom_headers:nil)
  get_key_versions_as_lazy_async(vault_base_url, key_name, maxresults:maxresults, custom_headers:custom_headers).value!
end

#get_key_versions_async(vault_base_url, key_name, maxresults: nil, custom_headers: nil) ⇒ Concurrent::Promise

Retrieves a list of individual key versions with the same key name.

The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. to the HTTP request.



4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 4123

def get_key_versions_async(vault_base_url, key_name, maxresults:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'key_name is nil' if key_name.nil?
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'keys/{key-name}/versions'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'key-name' => key_name},
      query_params: {'maxresults' => maxresults,'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::KeyListResult.mapper()
        result.body = self.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_key_versions_next(next_page_link, custom_headers: nil) ⇒ KeyListResult

Retrieves a list of individual key versions with the same key name.

The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission.

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



11098
11099
11100
11101
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 11098

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

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

Retrieves a list of individual key versions with the same key name.

The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission.

to List operation. to the HTTP request.



11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 11133

def get_key_versions_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'] = accept_language unless accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || self.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 = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::KeyListResult.mapper()
        result.body = self.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_key_versions_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Retrieves a list of individual key versions with the same key name.

The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission.

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



11116
11117
11118
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 11116

def get_key_versions_next_with_http_info(next_page_link, custom_headers:nil)
  get_key_versions_next_async(next_page_link, custom_headers:custom_headers).value!
end

#get_key_versions_with_http_info(vault_base_url, key_name, maxresults: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Retrieves a list of individual key versions with the same key name.

The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



4103
4104
4105
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 4103

def get_key_versions_with_http_info(vault_base_url, key_name, maxresults:nil, custom_headers:nil)
  get_key_versions_async(vault_base_url, key_name, maxresults:maxresults, custom_headers:custom_headers).value!
end

#get_key_with_http_info(vault_base_url, key_name, key_version, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the public part of a stored key.

The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. This operation requires the keys/get permission.

myvault.vault.azure.net. version of a key. This URI fragment is optional. If not specified, the latest version of the key is returned. will be added to the HTTP request.



3988
3989
3990
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 3988

def get_key_with_http_info(vault_base_url, key_name, key_version, custom_headers:nil)
  get_key_async(vault_base_url, key_name, key_version, custom_headers:custom_headers).value!
end

#get_keys(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ Array<KeyItem>

List keys in the specified vault.

Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



4198
4199
4200
4201
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 4198

def get_keys(vault_base_url, maxresults:nil, custom_headers:nil)
  first_page = get_keys_as_lazy(vault_base_url, maxresults:maxresults, custom_headers:custom_headers)
  first_page.get_all_items
end

#get_keys_as_lazy(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ KeyListResult

List keys in the specified vault.

Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



12683
12684
12685
12686
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 12683

def get_keys_as_lazy(vault_base_url, maxresults:nil, custom_headers:nil)
  first_page = get_keys_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers)
  first_page.get_all_items
end

#get_keys_as_lazy_async(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ Concurrent::Promise

List keys in the specified vault.

Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. to the HTTP request.



12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 12728

def get_keys_as_lazy_async(vault_base_url, maxresults:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1


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

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'maxresults' => maxresults},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::KeyListResult.mapper()
        result.body = self.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_keys_as_lazy_with_http_info(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List keys in the specified vault.

Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



12706
12707
12708
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 12706

def get_keys_as_lazy_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil)
  get_keys_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value!
end

#get_keys_async(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ Concurrent::Promise

List keys in the specified vault.

Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. to the HTTP request.



4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 4243

def get_keys_async(vault_base_url, maxresults:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'keys'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'maxresults' => maxresults,'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::KeyListResult.mapper()
        result.body = self.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_keys_next(next_page_link, custom_headers: nil) ⇒ KeyListResult

List keys in the specified vault.

Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission.

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



11200
11201
11202
11203
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 11200

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

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

List keys in the specified vault.

Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission.

to List operation. to the HTTP request.



11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 11241

def get_keys_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'] = accept_language unless accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || self.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 = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::KeyListResult.mapper()
        result.body = self.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_keys_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List keys in the specified vault.

Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission.

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



11221
11222
11223
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 11221

def get_keys_next_with_http_info(next_page_link, custom_headers:nil)
  get_keys_next_async(next_page_link, custom_headers:custom_headers).value!
end

#get_keys_with_http_info(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List keys in the specified vault.

Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



4221
4222
4223
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 4221

def get_keys_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil)
  get_keys_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value!
end

#get_sas_definition(vault_base_url, storage_account_name, sas_definition_name, custom_headers: nil) ⇒ SasDefinitionBundle

Gets information about a SAS definition for the specified storage account. This operation requires the storage/getsas permission.

myvault.vault.azure.net. will be added to the HTTP request.



9382
9383
9384
9385
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 9382

def get_sas_definition(vault_base_url, , sas_definition_name, custom_headers:nil)
  response = get_sas_definition_async(vault_base_url, , sas_definition_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_sas_definition_async(vault_base_url, storage_account_name, sas_definition_name, custom_headers: nil) ⇒ Concurrent::Promise

Gets information about a SAS definition for the specified storage account. This operation requires the storage/getsas permission.

myvault.vault.azure.net. to the HTTP request.



9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 9417

def get_sas_definition_async(vault_base_url, , sas_definition_name, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'storage_account_name is nil' if .nil?
  fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !.nil? && .match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil?
  fail ArgumentError, 'sas_definition_name is nil' if sas_definition_name.nil?
  fail ArgumentError, "'sas_definition_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !sas_definition_name.nil? && sas_definition_name.match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'storage/{storage-account-name}/sas/{sas-definition-name}'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'storage-account-name' => ,'sas-definition-name' => sas_definition_name},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::SasDefinitionBundle.mapper()
        result.body = self.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_sas_definition_with_http_info(vault_base_url, storage_account_name, sas_definition_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets information about a SAS definition for the specified storage account. This operation requires the storage/getsas permission.

myvault.vault.azure.net. will be added to the HTTP request.



9400
9401
9402
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 9400

def get_sas_definition_with_http_info(vault_base_url, , sas_definition_name, custom_headers:nil)
  get_sas_definition_async(vault_base_url, , sas_definition_name, custom_headers:custom_headers).value!
end

#get_sas_definitions(vault_base_url, storage_account_name, maxresults: nil, custom_headers: nil) ⇒ Array<SasDefinitionItem>

List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



8820
8821
8822
8823
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 8820

def get_sas_definitions(vault_base_url, , maxresults:nil, custom_headers:nil)
  first_page = get_sas_definitions_as_lazy(vault_base_url, , maxresults:maxresults, custom_headers:custom_headers)
  first_page.get_all_items
end

#get_sas_definitions_as_lazy(vault_base_url, storage_account_name, maxresults: nil, custom_headers: nil) ⇒ SasDefinitionListResult

List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



13442
13443
13444
13445
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 13442

def get_sas_definitions_as_lazy(vault_base_url, , maxresults:nil, custom_headers:nil)
  first_page = get_sas_definitions_as_lazy_async(vault_base_url, , maxresults:maxresults, custom_headers:custom_headers)
  first_page.get_all_items
end

#get_sas_definitions_as_lazy_async(vault_base_url, storage_account_name, maxresults: nil, custom_headers: nil) ⇒ Concurrent::Promise

List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. to the HTTP request.



13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 13479

def get_sas_definitions_as_lazy_async(vault_base_url, , maxresults:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'storage_account_name is nil' if .nil?
  fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !.nil? && .match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil?
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
  path_template = 'storage/{storage-account-name}/sas'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'storage-account-name' => },
      query_params: {'maxresults' => maxresults},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::SasDefinitionListResult.mapper()
        result.body = self.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_sas_definitions_as_lazy_with_http_info(vault_base_url, storage_account_name, maxresults: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



13461
13462
13463
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 13461

def get_sas_definitions_as_lazy_with_http_info(vault_base_url, , maxresults:nil, custom_headers:nil)
  get_sas_definitions_as_lazy_async(vault_base_url, , maxresults:maxresults, custom_headers:custom_headers).value!
end

#get_sas_definitions_async(vault_base_url, storage_account_name, maxresults: nil, custom_headers: nil) ⇒ Concurrent::Promise

List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. to the HTTP request.



8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 8857

def get_sas_definitions_async(vault_base_url, , maxresults:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'storage_account_name is nil' if .nil?
  fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !.nil? && .match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil?
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'storage/{storage-account-name}/sas'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'storage-account-name' => },
      query_params: {'maxresults' => maxresults,'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::SasDefinitionListResult.mapper()
        result.body = self.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_sas_definitions_next(next_page_link, custom_headers: nil) ⇒ SasDefinitionListResult

List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission.

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



11918
11919
11920
11921
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 11918

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

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

List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission.

to List operation. to the HTTP request.



11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 11949

def get_sas_definitions_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'] = accept_language unless accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || self.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 = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::SasDefinitionListResult.mapper()
        result.body = self.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_sas_definitions_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission.

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



11934
11935
11936
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 11934

def get_sas_definitions_next_with_http_info(next_page_link, custom_headers:nil)
  get_sas_definitions_next_async(next_page_link, custom_headers:custom_headers).value!
end

#get_sas_definitions_with_http_info(vault_base_url, storage_account_name, maxresults: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List storage SAS definitions for the given storage account. This operation requires the storage/listsas permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



8839
8840
8841
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 8839

def get_sas_definitions_with_http_info(vault_base_url, , maxresults:nil, custom_headers:nil)
  get_sas_definitions_async(vault_base_url, , maxresults:maxresults, custom_headers:custom_headers).value!
end

#get_secret(vault_base_url, secret_name, secret_version, custom_headers: nil) ⇒ SecretBundle

Get a specified secret from a given key vault.

The GET operation is applicable to any secret stored in Azure Key Vault. This operation requires the secrets/get permission.

myvault.vault.azure.net. is optional. If not specified, the latest version of the secret is returned. will be added to the HTTP request.



6451
6452
6453
6454
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 6451

def get_secret(vault_base_url, secret_name, secret_version, custom_headers:nil)
  response = get_secret_async(vault_base_url, secret_name, secret_version, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_secret_async(vault_base_url, secret_name, secret_version, custom_headers: nil) ⇒ Concurrent::Promise

Get a specified secret from a given key vault.

The GET operation is applicable to any secret stored in Azure Key Vault. This operation requires the secrets/get permission.

myvault.vault.azure.net. is optional. If not specified, the latest version of the secret is returned. to the HTTP request.



6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 6492

def get_secret_async(vault_base_url, secret_name, secret_version, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'secret_name is nil' if secret_name.nil?
  fail ArgumentError, 'secret_version is nil' if secret_version.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'secrets/{secret-name}/{secret-version}'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'secret-name' => secret_name,'secret-version' => secret_version},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::SecretBundle.mapper()
        result.body = self.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_secret_versions(vault_base_url, secret_name, maxresults: nil, custom_headers: nil) ⇒ Array<SecretItem>

List all versions of the specified secret.

The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission.

myvault.vault.azure.net. not specified, the service will return up to 25 results. will be added to the HTTP request.



6680
6681
6682
6683
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 6680

def get_secret_versions(vault_base_url, secret_name, maxresults:nil, custom_headers:nil)
  first_page = get_secret_versions_as_lazy(vault_base_url, secret_name, maxresults:maxresults, custom_headers:custom_headers)
  first_page.get_all_items
end

#get_secret_versions_as_lazy(vault_base_url, secret_name, maxresults: nil, custom_headers: nil) ⇒ SecretListResult

List all versions of the specified secret.

The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission.

myvault.vault.azure.net. not specified, the service will return up to 25 results. will be added to the HTTP request.



13021
13022
13023
13024
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 13021

def get_secret_versions_as_lazy(vault_base_url, secret_name, maxresults:nil, custom_headers:nil)
  first_page = get_secret_versions_as_lazy_async(vault_base_url, secret_name, maxresults:maxresults, custom_headers:custom_headers)
  first_page.get_all_items
end

#get_secret_versions_as_lazy_async(vault_base_url, secret_name, maxresults: nil, custom_headers: nil) ⇒ Concurrent::Promise

List all versions of the specified secret.

The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission.

myvault.vault.azure.net. not specified, the service will return up to 25 results. to the HTTP request.



13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 13064

def get_secret_versions_as_lazy_async(vault_base_url, secret_name, maxresults:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'secret_name is nil' if secret_name.nil?
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'
  path_template = 'secrets/{secret-name}/versions'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'secret-name' => secret_name},
      query_params: {'maxresults' => maxresults},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::SecretListResult.mapper()
        result.body = self.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_secret_versions_as_lazy_with_http_info(vault_base_url, secret_name, maxresults: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List all versions of the specified secret.

The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission.

myvault.vault.azure.net. not specified, the service will return up to 25 results. will be added to the HTTP request.



13043
13044
13045
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 13043

def get_secret_versions_as_lazy_with_http_info(vault_base_url, secret_name, maxresults:nil, custom_headers:nil)
  get_secret_versions_as_lazy_async(vault_base_url, secret_name, maxresults:maxresults, custom_headers:custom_headers).value!
end

#get_secret_versions_async(vault_base_url, secret_name, maxresults: nil, custom_headers: nil) ⇒ Concurrent::Promise

List all versions of the specified secret.

The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission.

myvault.vault.azure.net. not specified, the service will return up to 25 results. to the HTTP request.



6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 6723

def get_secret_versions_async(vault_base_url, secret_name, maxresults:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'secret_name is nil' if secret_name.nil?
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'secrets/{secret-name}/versions'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'secret-name' => secret_name},
      query_params: {'maxresults' => maxresults,'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::SecretListResult.mapper()
        result.body = self.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_secret_versions_next(next_page_link, custom_headers: nil) ⇒ SecretListResult

List all versions of the specified secret.

The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission.

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



11522
11523
11524
11525
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 11522

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

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

List all versions of the specified secret.

The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission.

to List operation. to the HTTP request.



11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 11559

def get_secret_versions_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'] = accept_language unless accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || self.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 = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::SecretListResult.mapper()
        result.body = self.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_secret_versions_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List all versions of the specified secret.

The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission.

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



11541
11542
11543
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 11541

def get_secret_versions_next_with_http_info(next_page_link, custom_headers:nil)
  get_secret_versions_next_async(next_page_link, custom_headers:custom_headers).value!
end

#get_secret_versions_with_http_info(vault_base_url, secret_name, maxresults: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List all versions of the specified secret.

The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires the secrets/list permission.

myvault.vault.azure.net. not specified, the service will return up to 25 results. will be added to the HTTP request.



6702
6703
6704
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 6702

def get_secret_versions_with_http_info(vault_base_url, secret_name, maxresults:nil, custom_headers:nil)
  get_secret_versions_async(vault_base_url, secret_name, maxresults:maxresults, custom_headers:custom_headers).value!
end

#get_secret_with_http_info(vault_base_url, secret_name, secret_version, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get a specified secret from a given key vault.

The GET operation is applicable to any secret stored in Azure Key Vault. This operation requires the secrets/get permission.

myvault.vault.azure.net. is optional. If not specified, the latest version of the secret is returned. will be added to the HTTP request.



6472
6473
6474
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 6472

def get_secret_with_http_info(vault_base_url, secret_name, secret_version, custom_headers:nil)
  get_secret_async(vault_base_url, secret_name, secret_version, custom_headers:custom_headers).value!
end

#get_secrets(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ Array<SecretItem>

List secrets in a specified key vault.

The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission.

myvault.vault.azure.net. not specified, the service will return up to 25 results. will be added to the HTTP request.



6565
6566
6567
6568
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 6565

def get_secrets(vault_base_url, maxresults:nil, custom_headers:nil)
  first_page = get_secrets_as_lazy(vault_base_url, maxresults:maxresults, custom_headers:custom_headers)
  first_page.get_all_items
end

#get_secrets_as_lazy(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ SecretListResult

List secrets in a specified key vault.

The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission.

myvault.vault.azure.net. not specified, the service will return up to 25 results. will be added to the HTTP request.



12911
12912
12913
12914
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 12911

def get_secrets_as_lazy(vault_base_url, maxresults:nil, custom_headers:nil)
  first_page = get_secrets_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers)
  first_page.get_all_items
end

#get_secrets_as_lazy_async(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ Concurrent::Promise

List secrets in a specified key vault.

The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission.

myvault.vault.azure.net. not specified, the service will return up to 25 results. to the HTTP request.



12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 12954

def get_secrets_as_lazy_async(vault_base_url, maxresults:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1


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

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'maxresults' => maxresults},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::SecretListResult.mapper()
        result.body = self.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_secrets_as_lazy_with_http_info(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List secrets in a specified key vault.

The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission.

myvault.vault.azure.net. not specified, the service will return up to 25 results. will be added to the HTTP request.



12933
12934
12935
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 12933

def get_secrets_as_lazy_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil)
  get_secrets_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value!
end

#get_secrets_async(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ Concurrent::Promise

List secrets in a specified key vault.

The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission.

myvault.vault.azure.net. not specified, the service will return up to 25 results. to the HTTP request.



6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 6608

def get_secrets_async(vault_base_url, maxresults:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'secrets'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'maxresults' => maxresults,'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::SecretListResult.mapper()
        result.body = self.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_secrets_next(next_page_link, custom_headers: nil) ⇒ SecretListResult

List secrets in a specified key vault.

The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission.

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



11418
11419
11420
11421
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 11418

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

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

List secrets in a specified key vault.

The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission.

to List operation. to the HTTP request.



11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 11457

def get_secrets_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'] = accept_language unless accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || self.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 = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::SecretListResult.mapper()
        result.body = self.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_secrets_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List secrets in a specified key vault.

The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission.

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



11438
11439
11440
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 11438

def get_secrets_next_with_http_info(next_page_link, custom_headers:nil)
  get_secrets_next_async(next_page_link, custom_headers:custom_headers).value!
end

#get_secrets_with_http_info(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List secrets in a specified key vault.

The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission.

myvault.vault.azure.net. not specified, the service will return up to 25 results. will be added to the HTTP request.



6587
6588
6589
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 6587

def get_secrets_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil)
  get_secrets_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value!
end

#get_storage_account(vault_base_url, storage_account_name, custom_headers: nil) ⇒ StorageBundle

Gets information about a specified storage account. This operation requires the storage/get permission.

myvault.vault.azure.net. will be added to the HTTP request.



8308
8309
8310
8311
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 8308

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

#get_storage_account_async(vault_base_url, storage_account_name, custom_headers: nil) ⇒ Concurrent::Promise

Gets information about a specified storage account. This operation requires the storage/get permission.

myvault.vault.azure.net. to the HTTP request.



8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 8341

def (vault_base_url, , custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'storage_account_name is nil' if .nil?
  fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !.nil? && .match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'storage/{storage-account-name}'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'storage-account-name' => },
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::StorageBundle.mapper()
        result.body = self.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_storage_account_with_http_info(vault_base_url, storage_account_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets information about a specified storage account. This operation requires the storage/get permission.

myvault.vault.azure.net. will be added to the HTTP request.



8325
8326
8327
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 8325

def (vault_base_url, , custom_headers:nil)
  (vault_base_url, , custom_headers:custom_headers).value!
end

#get_storage_accounts(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ Array<StorageAccountItem>

List storage accounts managed by the specified key vault. This operation requires the storage/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



7446
7447
7448
7449
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 7446

def get_storage_accounts(vault_base_url, maxresults:nil, custom_headers:nil)
  first_page = get_storage_accounts_as_lazy(vault_base_url, maxresults:maxresults, custom_headers:custom_headers)
  first_page.get_all_items
end

#get_storage_accounts_as_lazy(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ StorageListResult

List storage accounts managed by the specified key vault. This operation requires the storage/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



13236
13237
13238
13239
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 13236

def get_storage_accounts_as_lazy(vault_base_url, maxresults:nil, custom_headers:nil)
  first_page = get_storage_accounts_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers)
  first_page.get_all_items
end

#get_storage_accounts_as_lazy_async(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ Concurrent::Promise

List storage accounts managed by the specified key vault. This operation requires the storage/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. to the HTTP request.



13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 13271

def get_storage_accounts_as_lazy_async(vault_base_url, maxresults:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1


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

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'maxresults' => maxresults},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::StorageListResult.mapper()
        result.body = self.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_storage_accounts_as_lazy_with_http_info(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List storage accounts managed by the specified key vault. This operation requires the storage/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



13254
13255
13256
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 13254

def get_storage_accounts_as_lazy_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil)
  get_storage_accounts_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value!
end

#get_storage_accounts_async(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ Concurrent::Promise

List storage accounts managed by the specified key vault. This operation requires the storage/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. to the HTTP request.



7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 7481

def get_storage_accounts_async(vault_base_url, maxresults:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMaximum': '25'" if !maxresults.nil? && maxresults > 25
  fail ArgumentError, "'maxresults' should satisfy the constraint - 'InclusiveMinimum': '1'" if !maxresults.nil? && maxresults < 1
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'storage'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'maxresults' => maxresults,'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::StorageListResult.mapper()
        result.body = self.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_storage_accounts_next(next_page_link, custom_headers: nil) ⇒ StorageListResult

List storage accounts managed by the specified key vault. This operation requires the storage/list permission.

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



11723
11724
11725
11726
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 11723

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

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

List storage accounts managed by the specified key vault. This operation requires the storage/list permission.

to List operation. to the HTTP request.



11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 11754

def get_storage_accounts_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'] = accept_language unless accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || self.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 = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::StorageListResult.mapper()
        result.body = self.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_storage_accounts_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List storage accounts managed by the specified key vault. This operation requires the storage/list permission.

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



11739
11740
11741
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 11739

def get_storage_accounts_next_with_http_info(next_page_link, custom_headers:nil)
  get_storage_accounts_next_async(next_page_link, custom_headers:custom_headers).value!
end

#get_storage_accounts_with_http_info(vault_base_url, maxresults: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List storage accounts managed by the specified key vault. This operation requires the storage/list permission.

myvault.vault.azure.net. not specified the service will return up to 25 results. will be added to the HTTP request.



7464
7465
7466
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 7464

def get_storage_accounts_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil)
  get_storage_accounts_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value!
end

#import_certificate(vault_base_url, certificate_name, base64encoded_certificate, password: nil, certificate_policy: nil, certificate_attributes: nil, tags: nil, custom_headers: nil) ⇒ CertificateBundle

Imports a certificate into a specified key vault.

Imports an existing valid certificate, containing a private key, into Azure Key Vault. The certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM format the PEM file must contain the key as well as x509 certificates. This operation requires the certificates/import permission.

myvault.vault.azure.net. the certificate object to import. This certificate needs to contain the private key. encrypted, the password used for encryption. certificate. certificate (optional). form of key-value pairs. will be added to the HTTP request.



1447
1448
1449
1450
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 1447

def import_certificate(vault_base_url, certificate_name, base64encoded_certificate, password:nil, certificate_policy:nil, certificate_attributes:nil, tags:nil, custom_headers:nil)
  response = import_certificate_async(vault_base_url, certificate_name, base64encoded_certificate, password:password, certificate_policy:certificate_policy, certificate_attributes:certificate_attributes, tags:tags, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#import_certificate_async(vault_base_url, certificate_name, base64encoded_certificate, password: nil, certificate_policy: nil, certificate_attributes: nil, tags: nil, custom_headers: nil) ⇒ Concurrent::Promise

Imports a certificate into a specified key vault.

Imports an existing valid certificate, containing a private key, into Azure Key Vault. The certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM format the PEM file must contain the key as well as x509 certificates. This operation requires the certificates/import permission.

myvault.vault.azure.net. the certificate object to import. This certificate needs to contain the private key. encrypted, the password used for encryption. certificate. certificate (optional). form of key-value pairs. to the HTTP request.



1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
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
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 1512

def import_certificate_async(vault_base_url, certificate_name, base64encoded_certificate, password:nil, certificate_policy:nil, certificate_attributes:nil, tags:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'certificate_name is nil' if certificate_name.nil?
  fail ArgumentError, "'certificate_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z-]+$'" if !certificate_name.nil? && certificate_name.match(Regexp.new('^^[0-9a-zA-Z-]+$$')).nil?
  fail ArgumentError, 'api_version is nil' if api_version.nil?
  fail ArgumentError, 'base64encoded_certificate is nil' if base64encoded_certificate.nil?

  parameters = Azure::KeyVault::V7_2_preview::Models::CertificateImportParameters.new
  unless base64encoded_certificate.nil? && password.nil? && certificate_policy.nil? && certificate_attributes.nil? && tags.nil?
    parameters.base64encoded_certificate = base64encoded_certificate
    parameters.password = password
    parameters.certificate_policy = certificate_policy
    parameters.certificate_attributes = certificate_attributes
    parameters.tags = tags
  end

  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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateImportParameters.mapper()
  request_content = self.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'certificates/{certificate-name}/import'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'certificate-name' => certificate_name},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::CertificateBundle.mapper()
        result.body = self.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

#import_certificate_with_http_info(vault_base_url, certificate_name, base64encoded_certificate, password: nil, certificate_policy: nil, certificate_attributes: nil, tags: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Imports a certificate into a specified key vault.

Imports an existing valid certificate, containing a private key, into Azure Key Vault. The certificate to be imported can be in either PFX or PEM format. If the certificate is in PEM format the PEM file must contain the key as well as x509 certificates. This operation requires the certificates/import permission.

myvault.vault.azure.net. the certificate object to import. This certificate needs to contain the private key. encrypted, the password used for encryption. certificate. certificate (optional). form of key-value pairs. will be added to the HTTP request.



1480
1481
1482
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 1480

def import_certificate_with_http_info(vault_base_url, certificate_name, base64encoded_certificate, password:nil, certificate_policy:nil, certificate_attributes:nil, tags:nil, custom_headers:nil)
  import_certificate_async(vault_base_url, certificate_name, base64encoded_certificate, password:password, certificate_policy:certificate_policy, certificate_attributes:certificate_attributes, tags:tags, custom_headers:custom_headers).value!
end

#import_key(vault_base_url, key_name, key, hsm: nil, key_attributes: nil, tags: nil, custom_headers: nil) ⇒ KeyBundle

Imports an externally created key, stores it, and returns key parameters and attributes to the client.

The import key operation may be used to import any key type into an Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. This operation requires the keys/import permission.

myvault.vault.azure.net. key. form of key-value pairs. will be added to the HTTP request.



3564
3565
3566
3567
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 3564

def import_key(vault_base_url, key_name, key, hsm:nil, key_attributes:nil, tags:nil, custom_headers:nil)
  response = import_key_async(vault_base_url, key_name, key, hsm:hsm, key_attributes:key_attributes, tags:tags, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#import_key_async(vault_base_url, key_name, key, hsm: nil, key_attributes: nil, tags: nil, custom_headers: nil) ⇒ Concurrent::Promise

Imports an externally created key, stores it, and returns key parameters and attributes to the client.

The import key operation may be used to import any key type into an Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. This operation requires the keys/import permission.

myvault.vault.azure.net. key. form of key-value pairs. to the HTTP request.



3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 3617

def import_key_async(vault_base_url, key_name, key, hsm:nil, key_attributes:nil, tags:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'key_name is nil' if key_name.nil?
  fail ArgumentError, "'key_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z-]+$'" if !key_name.nil? && key_name.match(Regexp.new('^^[0-9a-zA-Z-]+$$')).nil?
  fail ArgumentError, 'api_version is nil' if api_version.nil?
  fail ArgumentError, 'key is nil' if key.nil?

  parameters = Azure::KeyVault::V7_2_preview::Models::KeyImportParameters.new
  unless hsm.nil? && key.nil? && key_attributes.nil? && tags.nil?
    parameters.hsm = hsm
    parameters.key = key
    parameters.key_attributes = key_attributes
    parameters.tags = tags
  end

  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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::KeyImportParameters.mapper()
  request_content = self.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'keys/{key-name}'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'key-name' => key_name},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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::V7_2_preview::Models::KeyBundle.mapper()
        result.body = self.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

#import_key_with_http_info(vault_base_url, key_name, key, hsm: nil, key_attributes: nil, tags: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Imports an externally created key, stores it, and returns key parameters and attributes to the client.

The import key operation may be used to import any key type into an Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. This operation requires the keys/import permission.

myvault.vault.azure.net. key. form of key-value pairs. will be added to the HTTP request.



3591
3592
3593
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 3591

def import_key_with_http_info(vault_base_url, key_name, key, hsm:nil, key_attributes:nil, tags:nil, custom_headers:nil)
  import_key_async(vault_base_url, key_name, key, hsm:hsm, key_attributes:key_attributes, tags:tags, custom_headers:custom_headers).value!
end

#make_request(method, path, options = {}) ⇒ Hash{String=>String}

Makes a request and returns the body of the response. Example:

request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
path = "/path"
options = {
  body: request_content,
  query_params: {'api-version' => '2016-02-01'}
}
result = @client.make_request(:put, path, options)


82
83
84
85
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 82

def make_request(method, path, options = {})
  result = make_request_with_http_info(method, path, options)
  result.body unless result.nil?
end

#make_request_async(method, path, options = {}) ⇒ Concurrent::Promise

Makes a request asynchronously.



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 107

def make_request_async(method, path, options = {})
  fail ArgumentError, 'method is nil' if method.nil?
  fail ArgumentError, 'path is nil' if path.nil?

  request_url = options[:base_url] || @base_url
  if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
    @request_headers['Content-Type'] = options[:headers]['Content-Type']
  end

  request_headers = @request_headers
  request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
  options.merge!({headers: request_headers.merge(options[:headers] || {})})
  options.merge!({credentials: @credentials}) unless @credentials.nil?

  super(request_url, method, path, options)
end

#make_request_with_http_info(method, path, options = {}) ⇒ MsRestAzure::AzureOperationResponse

Makes a request and returns the operation response.



94
95
96
97
98
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 94

def make_request_with_http_info(method, path, options = {})
  result = make_request_async(method, path, options).value!
  result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
  result
end

#merge_certificate(vault_base_url, certificate_name, x509certificates, certificate_attributes: nil, tags: nil, custom_headers: nil) ⇒ CertificateBundle

Merges a certificate or a certificate chain with a key pair existing on the server.

The MergeCertificate operation performs the merging of a certificate or certificate chain with a key pair currently available in the service. This operation requires the certificates/create permission.

myvault.vault.azure.net. certificate chain to merge. certificate (optional). form of key-value pairs. will be added to the HTTP request.



2560
2561
2562
2563
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 2560

def merge_certificate(vault_base_url, certificate_name, x509certificates, certificate_attributes:nil, tags:nil, custom_headers:nil)
  response = merge_certificate_async(vault_base_url, certificate_name, x509certificates, certificate_attributes:certificate_attributes, tags:tags, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#merge_certificate_async(vault_base_url, certificate_name, x509certificates, certificate_attributes: nil, tags: nil, custom_headers: nil) ⇒ Concurrent::Promise

Merges a certificate or a certificate chain with a key pair existing on the server.

The MergeCertificate operation performs the merging of a certificate or certificate chain with a key pair currently available in the service. This operation requires the certificates/create permission.

myvault.vault.azure.net. certificate chain to merge. certificate (optional). form of key-value pairs. to the HTTP request.



2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 2613

def merge_certificate_async(vault_base_url, certificate_name, x509certificates, certificate_attributes:nil, tags:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'certificate_name is nil' if certificate_name.nil?
  fail ArgumentError, 'api_version is nil' if api_version.nil?
  fail ArgumentError, 'x509certificates is nil' if x509certificates.nil?

  parameters = Azure::KeyVault::V7_2_preview::Models::CertificateMergeParameters.new
  unless x509certificates.nil? && certificate_attributes.nil? && tags.nil?
    parameters.x509certificates = x509certificates
    parameters.certificate_attributes = certificate_attributes
    parameters.tags = tags
  end

  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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateMergeParameters.mapper()
  request_content = self.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'certificates/{certificate-name}/pending/merge'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'certificate-name' => certificate_name},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 == 201
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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::V7_2_preview::Models::CertificateBundle.mapper()
        result.body = self.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

#merge_certificate_with_http_info(vault_base_url, certificate_name, x509certificates, certificate_attributes: nil, tags: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Merges a certificate or a certificate chain with a key pair existing on the server.

The MergeCertificate operation performs the merging of a certificate or certificate chain with a key pair currently available in the service. This operation requires the certificates/create permission.

myvault.vault.azure.net. certificate chain to merge. certificate (optional). form of key-value pairs. will be added to the HTTP request.



2587
2588
2589
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 2587

def merge_certificate_with_http_info(vault_base_url, certificate_name, x509certificates, certificate_attributes:nil, tags:nil, custom_headers:nil)
  merge_certificate_async(vault_base_url, certificate_name, x509certificates, certificate_attributes:certificate_attributes, tags:tags, custom_headers:custom_headers).value!
end

#purge_deleted_certificate(vault_base_url, certificate_name, custom_headers: nil) ⇒ Object

Permanently deletes the specified deleted certificate.

The PurgeDeletedCertificate operation performs an irreversible deletion of the specified certificate, without possibility for recovery. The operation is not available if the recovery level does not specify ‘Purgeable’. This operation requires the certificate/purge permission.

myvault.vault.azure.net. will be added to the HTTP request.



3164
3165
3166
3167
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 3164

def purge_deleted_certificate(vault_base_url, certificate_name, custom_headers:nil)
  response = purge_deleted_certificate_async(vault_base_url, certificate_name, custom_headers:custom_headers).value!
  nil
end

#purge_deleted_certificate_async(vault_base_url, certificate_name, custom_headers: nil) ⇒ Concurrent::Promise

Permanently deletes the specified deleted certificate.

The PurgeDeletedCertificate operation performs an irreversible deletion of the specified certificate, without possibility for recovery. The operation is not available if the recovery level does not specify ‘Purgeable’. This operation requires the certificate/purge permission.

myvault.vault.azure.net. to the HTTP request.



3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 3205

def purge_deleted_certificate_async(vault_base_url, certificate_name, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'certificate_name is nil' if certificate_name.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'deletedcertificates/{certificate-name}'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'certificate-name' => certificate_name},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 == 204
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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

#purge_deleted_certificate_with_http_info(vault_base_url, certificate_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Permanently deletes the specified deleted certificate.

The PurgeDeletedCertificate operation performs an irreversible deletion of the specified certificate, without possibility for recovery. The operation is not available if the recovery level does not specify ‘Purgeable’. This operation requires the certificate/purge permission.

myvault.vault.azure.net. will be added to the HTTP request.



3185
3186
3187
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 3185

def purge_deleted_certificate_with_http_info(vault_base_url, certificate_name, custom_headers:nil)
  purge_deleted_certificate_async(vault_base_url, certificate_name, custom_headers:custom_headers).value!
end

#purge_deleted_key(vault_base_url, key_name, custom_headers: nil) ⇒ Object

Permanently deletes the specified key.

The Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/purge permission.

myvault.vault.azure.net. will be added to the HTTP request.



5841
5842
5843
5844
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 5841

def purge_deleted_key(vault_base_url, key_name, custom_headers:nil)
  response = purge_deleted_key_async(vault_base_url, key_name, custom_headers:custom_headers).value!
  nil
end

#purge_deleted_key_async(vault_base_url, key_name, custom_headers: nil) ⇒ Concurrent::Promise

Permanently deletes the specified key.

The Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/purge permission.

myvault.vault.azure.net. to the HTTP request.



5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 5882

def purge_deleted_key_async(vault_base_url, key_name, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'key_name is nil' if key_name.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'deletedkeys/{key-name}'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'key-name' => key_name},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 == 204
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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

#purge_deleted_key_with_http_info(vault_base_url, key_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Permanently deletes the specified key.

The Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/purge permission.

myvault.vault.azure.net. will be added to the HTTP request.



5862
5863
5864
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 5862

def purge_deleted_key_with_http_info(vault_base_url, key_name, custom_headers:nil)
  purge_deleted_key_async(vault_base_url, key_name, custom_headers:custom_headers).value!
end

#purge_deleted_secret(vault_base_url, secret_name, custom_headers: nil) ⇒ Object

Permanently deletes the specified secret.

The purge deleted secret operation removes the secret permanently, without the possibility of recovery. This operation can only be enabled on a soft-delete enabled vault. This operation requires the secrets/purge permission.

myvault.vault.azure.net. will be added to the HTTP request.



7013
7014
7015
7016
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 7013

def purge_deleted_secret(vault_base_url, secret_name, custom_headers:nil)
  response = purge_deleted_secret_async(vault_base_url, secret_name, custom_headers:custom_headers).value!
  nil
end

#purge_deleted_secret_async(vault_base_url, secret_name, custom_headers: nil) ⇒ Concurrent::Promise

Permanently deletes the specified secret.

The purge deleted secret operation removes the secret permanently, without the possibility of recovery. This operation can only be enabled on a soft-delete enabled vault. This operation requires the secrets/purge permission.

myvault.vault.azure.net. to the HTTP request.



7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 7054

def purge_deleted_secret_async(vault_base_url, secret_name, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'secret_name is nil' if secret_name.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'deletedsecrets/{secret-name}'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'secret-name' => secret_name},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 == 204
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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

#purge_deleted_secret_with_http_info(vault_base_url, secret_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Permanently deletes the specified secret.

The purge deleted secret operation removes the secret permanently, without the possibility of recovery. This operation can only be enabled on a soft-delete enabled vault. This operation requires the secrets/purge permission.

myvault.vault.azure.net. will be added to the HTTP request.



7034
7035
7036
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 7034

def purge_deleted_secret_with_http_info(vault_base_url, secret_name, custom_headers:nil)
  purge_deleted_secret_async(vault_base_url, secret_name, custom_headers:custom_headers).value!
end

#purge_deleted_storage_account(vault_base_url, storage_account_name, custom_headers: nil) ⇒ Object

Permanently deletes the specified storage account.

The purge deleted storage account operation removes the secret permanently, without the possibility of recovery. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/purge permission.

myvault.vault.azure.net. will be added to the HTTP request.



7773
7774
7775
7776
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 7773

def (vault_base_url, , custom_headers:nil)
  response = (vault_base_url, , custom_headers:custom_headers).value!
  nil
end

#purge_deleted_storage_account_async(vault_base_url, storage_account_name, custom_headers: nil) ⇒ Concurrent::Promise

Permanently deletes the specified storage account.

The purge deleted storage account operation removes the secret permanently, without the possibility of recovery. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/purge permission.

myvault.vault.azure.net. to the HTTP request.



7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 7814

def (vault_base_url, , custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'storage_account_name is nil' if .nil?
  fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !.nil? && .match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'deletedstorage/{storage-account-name}'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'storage-account-name' => },
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 == 204
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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

#purge_deleted_storage_account_with_http_info(vault_base_url, storage_account_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Permanently deletes the specified storage account.

The purge deleted storage account operation removes the secret permanently, without the possibility of recovery. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/purge permission.

myvault.vault.azure.net. will be added to the HTTP request.



7794
7795
7796
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 7794

def (vault_base_url, , custom_headers:nil)
  (vault_base_url, , custom_headers:custom_headers).value!
end

#recover_deleted_certificate(vault_base_url, certificate_name, custom_headers: nil) ⇒ CertificateBundle

Recovers the deleted certificate back to its current version under /certificates.

The RecoverDeletedCertificate operation performs the reversal of the Delete operation. The operation is applicable in vaults enabled for soft-delete, and must be issued during the retention interval (available in the deleted certificate’s attributes). This operation requires the certificates/recover permission.

myvault.vault.azure.net. will be added to the HTTP request.



3268
3269
3270
3271
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 3268

def recover_deleted_certificate(vault_base_url, certificate_name, custom_headers:nil)
  response = recover_deleted_certificate_async(vault_base_url, certificate_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#recover_deleted_certificate_async(vault_base_url, certificate_name, custom_headers: nil) ⇒ Concurrent::Promise

Recovers the deleted certificate back to its current version under /certificates.

The RecoverDeletedCertificate operation performs the reversal of the Delete operation. The operation is applicable in vaults enabled for soft-delete, and must be issued during the retention interval (available in the deleted certificate’s attributes). This operation requires the certificates/recover permission.

myvault.vault.azure.net. to the HTTP request.



3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 3313

def recover_deleted_certificate_async(vault_base_url, certificate_name, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'certificate_name is nil' if certificate_name.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'deletedcertificates/{certificate-name}/recover'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'certificate-name' => certificate_name},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::CertificateBundle.mapper()
        result.body = self.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

#recover_deleted_certificate_with_http_info(vault_base_url, certificate_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Recovers the deleted certificate back to its current version under /certificates.

The RecoverDeletedCertificate operation performs the reversal of the Delete operation. The operation is applicable in vaults enabled for soft-delete, and must be issued during the retention interval (available in the deleted certificate’s attributes). This operation requires the certificates/recover permission.

myvault.vault.azure.net. will be added to the HTTP request.



3291
3292
3293
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 3291

def recover_deleted_certificate_with_http_info(vault_base_url, certificate_name, custom_headers:nil)
  recover_deleted_certificate_async(vault_base_url, certificate_name, custom_headers:custom_headers).value!
end

#recover_deleted_key(vault_base_url, key_name, custom_headers: nil) ⇒ KeyBundle

Recovers the deleted key to its latest version.

The Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults. It recovers the deleted key back to its latest version under /keys. An attempt to recover an non-deleted key will return an error. Consider this the inverse of the delete operation on soft-delete enabled vaults. This operation requires the keys/recover permission.

myvault.vault.azure.net. will be added to the HTTP request.



5944
5945
5946
5947
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 5944

def recover_deleted_key(vault_base_url, key_name, custom_headers:nil)
  response = recover_deleted_key_async(vault_base_url, key_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#recover_deleted_key_async(vault_base_url, key_name, custom_headers: nil) ⇒ Concurrent::Promise

Recovers the deleted key to its latest version.

The Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults. It recovers the deleted key back to its latest version under /keys. An attempt to recover an non-deleted key will return an error. Consider this the inverse of the delete operation on soft-delete enabled vaults. This operation requires the keys/recover permission.

myvault.vault.azure.net. to the HTTP request.



5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 5987

def recover_deleted_key_async(vault_base_url, key_name, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'key_name is nil' if key_name.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'deletedkeys/{key-name}/recover'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'key-name' => key_name},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::KeyBundle.mapper()
        result.body = self.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

#recover_deleted_key_with_http_info(vault_base_url, key_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Recovers the deleted key to its latest version.

The Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults. It recovers the deleted key back to its latest version under /keys. An attempt to recover an non-deleted key will return an error. Consider this the inverse of the delete operation on soft-delete enabled vaults. This operation requires the keys/recover permission.

myvault.vault.azure.net. will be added to the HTTP request.



5966
5967
5968
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 5966

def recover_deleted_key_with_http_info(vault_base_url, key_name, custom_headers:nil)
  recover_deleted_key_async(vault_base_url, key_name, custom_headers:custom_headers).value!
end

#recover_deleted_sas_definition(vault_base_url, storage_account_name, sas_definition_name, custom_headers: nil) ⇒ SasDefinitionBundle

Recovers the deleted SAS definition.

Recovers the deleted SAS definition for the specified storage account. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission.

myvault.vault.azure.net. will be added to the HTTP request.



9164
9165
9166
9167
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 9164

def recover_deleted_sas_definition(vault_base_url, , sas_definition_name, custom_headers:nil)
  response = recover_deleted_sas_definition_async(vault_base_url, , sas_definition_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#recover_deleted_sas_definition_async(vault_base_url, storage_account_name, sas_definition_name, custom_headers: nil) ⇒ Concurrent::Promise

Recovers the deleted SAS definition.

Recovers the deleted SAS definition for the specified storage account. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission.

myvault.vault.azure.net. to the HTTP request.



9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 9205

def recover_deleted_sas_definition_async(vault_base_url, , sas_definition_name, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'storage_account_name is nil' if .nil?
  fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !.nil? && .match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil?
  fail ArgumentError, 'sas_definition_name is nil' if sas_definition_name.nil?
  fail ArgumentError, "'sas_definition_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !sas_definition_name.nil? && sas_definition_name.match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'deletedstorage/{storage-account-name}/sas/{sas-definition-name}/recover'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'storage-account-name' => ,'sas-definition-name' => sas_definition_name},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::SasDefinitionBundle.mapper()
        result.body = self.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

#recover_deleted_sas_definition_with_http_info(vault_base_url, storage_account_name, sas_definition_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Recovers the deleted SAS definition.

Recovers the deleted SAS definition for the specified storage account. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission.

myvault.vault.azure.net. will be added to the HTTP request.



9185
9186
9187
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 9185

def recover_deleted_sas_definition_with_http_info(vault_base_url, , sas_definition_name, custom_headers:nil)
  recover_deleted_sas_definition_async(vault_base_url, , sas_definition_name, custom_headers:custom_headers).value!
end

#recover_deleted_secret(vault_base_url, secret_name, custom_headers: nil) ⇒ SecretBundle

Recovers the deleted secret to the latest version.

Recovers the deleted secret in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the secrets/recover permission.

myvault.vault.azure.net. will be added to the HTTP request.



7114
7115
7116
7117
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 7114

def recover_deleted_secret(vault_base_url, secret_name, custom_headers:nil)
  response = recover_deleted_secret_async(vault_base_url, secret_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#recover_deleted_secret_async(vault_base_url, secret_name, custom_headers: nil) ⇒ Concurrent::Promise

Recovers the deleted secret to the latest version.

Recovers the deleted secret in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the secrets/recover permission.

myvault.vault.azure.net. to the HTTP request.



7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 7153

def recover_deleted_secret_async(vault_base_url, secret_name, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'secret_name is nil' if secret_name.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'deletedsecrets/{secret-name}/recover'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'secret-name' => secret_name},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::SecretBundle.mapper()
        result.body = self.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

#recover_deleted_secret_with_http_info(vault_base_url, secret_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Recovers the deleted secret to the latest version.

Recovers the deleted secret in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the secrets/recover permission.

myvault.vault.azure.net. will be added to the HTTP request.



7134
7135
7136
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 7134

def recover_deleted_secret_with_http_info(vault_base_url, secret_name, custom_headers:nil)
  recover_deleted_secret_async(vault_base_url, secret_name, custom_headers:custom_headers).value!
end

#recover_deleted_storage_account(vault_base_url, storage_account_name, custom_headers: nil) ⇒ StorageBundle

Recovers the deleted storage account.

Recovers the deleted storage account in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission.

myvault.vault.azure.net. will be added to the HTTP request.



7875
7876
7877
7878
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 7875

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

#recover_deleted_storage_account_async(vault_base_url, storage_account_name, custom_headers: nil) ⇒ Concurrent::Promise

Recovers the deleted storage account.

Recovers the deleted storage account in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission.

myvault.vault.azure.net. to the HTTP request.



7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 7914

def (vault_base_url, , custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'storage_account_name is nil' if .nil?
  fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !.nil? && .match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'deletedstorage/{storage-account-name}/recover'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'storage-account-name' => },
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::StorageBundle.mapper()
        result.body = self.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

#recover_deleted_storage_account_with_http_info(vault_base_url, storage_account_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Recovers the deleted storage account.

Recovers the deleted storage account in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the storage/recover permission.

myvault.vault.azure.net. will be added to the HTTP request.



7895
7896
7897
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 7895

def (vault_base_url, , custom_headers:nil)
  (vault_base_url, , custom_headers:custom_headers).value!
end

#regenerate_storage_account_key(vault_base_url, storage_account_name, key_name, custom_headers: nil) ⇒ StorageBundle

Regenerates the specified key value for the given storage account. This operation requires the storage/regeneratekey permission.

myvault.vault.azure.net. will be added to the HTTP request.



8703
8704
8705
8706
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 8703

def (vault_base_url, , key_name, custom_headers:nil)
  response = (vault_base_url, , key_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#regenerate_storage_account_key_async(vault_base_url, storage_account_name, key_name, custom_headers: nil) ⇒ Concurrent::Promise

Regenerates the specified key value for the given storage account. This operation requires the storage/regeneratekey permission.

myvault.vault.azure.net. to the HTTP request.



8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 8738

def (vault_base_url, , key_name, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'storage_account_name is nil' if .nil?
  fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !.nil? && .match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil?
  fail ArgumentError, 'api_version is nil' if api_version.nil?
  fail ArgumentError, 'key_name is nil' if key_name.nil?

  parameters = Azure::KeyVault::V7_2_preview::Models::StorageAccountRegenerteKeyParameters.new
  unless key_name.nil?
    parameters.key_name = key_name
  end

  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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::StorageAccountRegenerteKeyParameters.mapper()
  request_content = self.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'storage/{storage-account-name}/regeneratekey'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'storage-account-name' => },
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::StorageBundle.mapper()
        result.body = self.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

#regenerate_storage_account_key_with_http_info(vault_base_url, storage_account_name, key_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Regenerates the specified key value for the given storage account. This operation requires the storage/regeneratekey permission.

myvault.vault.azure.net. will be added to the HTTP request.



8721
8722
8723
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 8721

def (vault_base_url, , key_name, custom_headers:nil)
  (vault_base_url, , key_name, custom_headers:custom_headers).value!
end

#restore_certificate(vault_base_url, certificate_bundle_backup, custom_headers: nil) ⇒ CertificateBundle

Restores a backed up certificate to a vault.

Restores a backed up certificate, and all its versions, to a vault. This operation requires the certificates/restore permission.

myvault.vault.azure.net. certificate bundle. will be added to the HTTP request.



2806
2807
2808
2809
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 2806

def restore_certificate(vault_base_url, certificate_bundle_backup, custom_headers:nil)
  response = restore_certificate_async(vault_base_url, certificate_bundle_backup, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#restore_certificate_async(vault_base_url, certificate_bundle_backup, custom_headers: nil) ⇒ Concurrent::Promise

Restores a backed up certificate to a vault.

Restores a backed up certificate, and all its versions, to a vault. This operation requires the certificates/restore permission.

myvault.vault.azure.net. certificate bundle. to the HTTP request.



2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 2845

def restore_certificate_async(vault_base_url, certificate_bundle_backup, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'api_version is nil' if api_version.nil?
  fail ArgumentError, 'certificate_bundle_backup is nil' if certificate_bundle_backup.nil?

  parameters = Azure::KeyVault::V7_2_preview::Models::CertificateRestoreParameters.new
  unless certificate_bundle_backup.nil?
    parameters.certificate_bundle_backup = certificate_bundle_backup
  end

  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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateRestoreParameters.mapper()
  request_content = self.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'certificates/restore'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::CertificateBundle.mapper()
        result.body = self.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

#restore_certificate_with_http_info(vault_base_url, certificate_bundle_backup, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Restores a backed up certificate to a vault.

Restores a backed up certificate, and all its versions, to a vault. This operation requires the certificates/restore permission.

myvault.vault.azure.net. certificate bundle. will be added to the HTTP request.



2826
2827
2828
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 2826

def restore_certificate_with_http_info(vault_base_url, certificate_bundle_backup, custom_headers:nil)
  restore_certificate_async(vault_base_url, certificate_bundle_backup, custom_headers:custom_headers).value!
end

#restore_key(vault_base_url, key_bundle_backup, custom_headers: nil) ⇒ KeyBundle

Restores a backed up key to a vault.

Imports a previously backed up key into Azure Key Vault, restoring the key, its key identifier, attributes and access control policies. The RESTORE operation may be used to import a previously backed up key. Individual versions of a key cannot be restored. The key is restored in its entirety with the same key name as it had when it was backed up. If the key name is not available in the target Key Vault, the RESTORE operation will be rejected. While the key name is retained during restore, the final key identifier will change if the key is restored to a different vault. Restore will restore all versions and preserve version identifiers. The RESTORE operation is subject to security constraints: The target Key Vault must be owned by the same Microsoft Azure Subscription as the source Key Vault The user must have RESTORE permission in the target Key Vault. This operation requires the keys/restore permission.

myvault.vault.azure.net. will be added to the HTTP request.



4462
4463
4464
4465
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 4462

def restore_key(vault_base_url, key_bundle_backup, custom_headers:nil)
  response = restore_key_async(vault_base_url, key_bundle_backup, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#restore_key_async(vault_base_url, key_bundle_backup, custom_headers: nil) ⇒ Concurrent::Promise

Restores a backed up key to a vault.

Imports a previously backed up key into Azure Key Vault, restoring the key, its key identifier, attributes and access control policies. The RESTORE operation may be used to import a previously backed up key. Individual versions of a key cannot be restored. The key is restored in its entirety with the same key name as it had when it was backed up. If the key name is not available in the target Key Vault, the RESTORE operation will be rejected. While the key name is retained during restore, the final key identifier will change if the key is restored to a different vault. Restore will restore all versions and preserve version identifiers. The RESTORE operation is subject to security constraints: The target Key Vault must be owned by the same Microsoft Azure Subscription as the source Key Vault The user must have RESTORE permission in the target Key Vault. This operation requires the keys/restore permission.

myvault.vault.azure.net. to the HTTP request.



4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 4521

def restore_key_async(vault_base_url, key_bundle_backup, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'api_version is nil' if api_version.nil?
  fail ArgumentError, 'key_bundle_backup is nil' if key_bundle_backup.nil?

  parameters = Azure::KeyVault::V7_2_preview::Models::KeyRestoreParameters.new
  unless key_bundle_backup.nil?
    parameters.key_bundle_backup = key_bundle_backup
  end

  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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::KeyRestoreParameters.mapper()
  request_content = self.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'keys/restore'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::KeyBundle.mapper()
        result.body = self.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

#restore_key_with_http_info(vault_base_url, key_bundle_backup, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Restores a backed up key to a vault.

Imports a previously backed up key into Azure Key Vault, restoring the key, its key identifier, attributes and access control policies. The RESTORE operation may be used to import a previously backed up key. Individual versions of a key cannot be restored. The key is restored in its entirety with the same key name as it had when it was backed up. If the key name is not available in the target Key Vault, the RESTORE operation will be rejected. While the key name is retained during restore, the final key identifier will change if the key is restored to a different vault. Restore will restore all versions and preserve version identifiers. The RESTORE operation is subject to security constraints: The target Key Vault must be owned by the same Microsoft Azure Subscription as the source Key Vault The user must have RESTORE permission in the target Key Vault. This operation requires the keys/restore permission.

myvault.vault.azure.net. will be added to the HTTP request.



4492
4493
4494
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 4492

def restore_key_with_http_info(vault_base_url, key_bundle_backup, custom_headers:nil)
  restore_key_async(vault_base_url, key_bundle_backup, custom_headers:custom_headers).value!
end

#restore_secret(vault_base_url, secret_bundle_backup, custom_headers: nil) ⇒ SecretBundle

Restores a backed up secret to a vault.

Restores a backed up secret, and all its versions, to a vault. This operation requires the secrets/restore permission.

myvault.vault.azure.net. will be added to the HTTP request.



7331
7332
7333
7334
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 7331

def restore_secret(vault_base_url, secret_bundle_backup, custom_headers:nil)
  response = restore_secret_async(vault_base_url, secret_bundle_backup, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#restore_secret_async(vault_base_url, secret_bundle_backup, custom_headers: nil) ⇒ Concurrent::Promise

Restores a backed up secret to a vault.

Restores a backed up secret, and all its versions, to a vault. This operation requires the secrets/restore permission.

myvault.vault.azure.net. to the HTTP request.



7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 7368

def restore_secret_async(vault_base_url, secret_bundle_backup, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'api_version is nil' if api_version.nil?
  fail ArgumentError, 'secret_bundle_backup is nil' if secret_bundle_backup.nil?

  parameters = Azure::KeyVault::V7_2_preview::Models::SecretRestoreParameters.new
  unless secret_bundle_backup.nil?
    parameters.secret_bundle_backup = secret_bundle_backup
  end

  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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::SecretRestoreParameters.mapper()
  request_content = self.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'secrets/restore'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::SecretBundle.mapper()
        result.body = self.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

#restore_secret_with_http_info(vault_base_url, secret_bundle_backup, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Restores a backed up secret to a vault.

Restores a backed up secret, and all its versions, to a vault. This operation requires the secrets/restore permission.

myvault.vault.azure.net. will be added to the HTTP request.



7350
7351
7352
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 7350

def restore_secret_with_http_info(vault_base_url, secret_bundle_backup, custom_headers:nil)
  restore_secret_async(vault_base_url, secret_bundle_backup, custom_headers:custom_headers).value!
end

#restore_status(vault_base_url, job_id, custom_headers: nil) ⇒ RestoreOperation

Returns the status of restore operation

myvault.vault.azure.net. will be added to the HTTP request.



10119
10120
10121
10122
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 10119

def restore_status(vault_base_url, job_id, custom_headers:nil)
  response = restore_status_async(vault_base_url, job_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#restore_status_async(vault_base_url, job_id, custom_headers: nil) ⇒ Concurrent::Promise

Returns the status of restore operation

myvault.vault.azure.net. to the HTTP request.



10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 10150

def restore_status_async(vault_base_url, job_id, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'job_id is nil' if job_id.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?
  path_template = 'restore/{jobId}/pending'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'jobId' => job_id},
      query_params: {'api-version' => api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::RestoreOperation.mapper()
        result.body = self.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

#restore_status_with_http_info(vault_base_url, job_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Returns the status of restore operation

myvault.vault.azure.net. will be added to the HTTP request.



10135
10136
10137
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 10135

def restore_status_with_http_info(vault_base_url, job_id, custom_headers:nil)
  restore_status_async(vault_base_url, job_id, custom_headers:custom_headers).value!
end

#restore_storage_account(vault_base_url, storage_bundle_backup, custom_headers: nil) ⇒ StorageBundle

Restores a backed up storage account to a vault.

Restores a backed up storage account to a vault. This operation requires the storage/restore permission.

myvault.vault.azure.net. account. will be added to the HTTP request.



8091
8092
8093
8094
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 8091

def (vault_base_url, storage_bundle_backup, custom_headers:nil)
  response = (vault_base_url, storage_bundle_backup, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#restore_storage_account_async(vault_base_url, storage_bundle_backup, custom_headers: nil) ⇒ Concurrent::Promise

Restores a backed up storage account to a vault.

Restores a backed up storage account to a vault. This operation requires the storage/restore permission.

myvault.vault.azure.net. account. to the HTTP request.



8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 8130

def (vault_base_url, storage_bundle_backup, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'api_version is nil' if api_version.nil?
  fail ArgumentError, 'storage_bundle_backup is nil' if storage_bundle_backup.nil?

  parameters = Azure::KeyVault::V7_2_preview::Models::StorageRestoreParameters.new
  unless storage_bundle_backup.nil?
    parameters.storage_bundle_backup = storage_bundle_backup
  end

  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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::StorageRestoreParameters.mapper()
  request_content = self.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'storage/restore'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::StorageBundle.mapper()
        result.body = self.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

#restore_storage_account_with_http_info(vault_base_url, storage_bundle_backup, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Restores a backed up storage account to a vault.

Restores a backed up storage account to a vault. This operation requires the storage/restore permission.

myvault.vault.azure.net. account. will be added to the HTTP request.



8111
8112
8113
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 8111

def (vault_base_url, storage_bundle_backup, custom_headers:nil)
  (vault_base_url, storage_bundle_backup, custom_headers:custom_headers).value!
end

#selective_key_restore_operation_method(vault_base_url, key_name, restore_blob_details: nil, custom_headers: nil) ⇒ SelectiveKeyRestoreOperation

Restores all key versions of a given key using user supplied SAS token pointing to a previously stored Azure Blob storage backup folder

myvault.vault.azure.net. supplied backup Azure blob SAS token pointing to a folder where the previous successful full backup was stored will be added to the HTTP request.



10221
10222
10223
10224
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 10221

def selective_key_restore_operation_method(vault_base_url, key_name, restore_blob_details:nil, custom_headers:nil)
  response = selective_key_restore_operation_method_async(vault_base_url, key_name, restore_blob_details:restore_blob_details, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#selective_key_restore_operation_method_async(vault_base_url, key_name, restore_blob_details: nil, custom_headers: nil) ⇒ Concurrent::Promise

Restores all key versions of a given key using user supplied SAS token pointing to a previously stored Azure Blob storage backup folder

myvault.vault.azure.net. supplied backup Azure blob SAS token pointing to a folder where the previous successful full backup was stored to the HTTP request.



10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 10262

def selective_key_restore_operation_method_async(vault_base_url, key_name, restore_blob_details:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'key_name is nil' if key_name.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::SelectiveKeyRestoreOperationParameters.mapper()
  request_content = self.serialize(request_mapper,  restore_blob_details)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'keys/{keyName}/restore'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'keyName' => key_name},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 == 202
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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 == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::KeyVault::V7_2_preview::Models::SelectiveKeyRestoreOperation.mapper()
        result.body = self.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

#selective_key_restore_operation_method_with_http_info(vault_base_url, key_name, restore_blob_details: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Restores all key versions of a given key using user supplied SAS token pointing to a previously stored Azure Blob storage backup folder

myvault.vault.azure.net. supplied backup Azure blob SAS token pointing to a folder where the previous successful full backup was stored will be added to the HTTP request.



10242
10243
10244
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 10242

def selective_key_restore_operation_method_with_http_info(vault_base_url, key_name, restore_blob_details:nil, custom_headers:nil)
  selective_key_restore_operation_method_async(vault_base_url, key_name, restore_blob_details:restore_blob_details, custom_headers:custom_headers).value!
end

#set_certificate_contacts(vault_base_url, contacts, custom_headers: nil) ⇒ Contacts

Sets the certificate contacts for the specified key vault.

Sets the certificate contacts for the specified key vault. This operation requires the certificates/managecontacts permission.

myvault.vault.azure.net. will be added to the HTTP request.



368
369
370
371
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 368

def set_certificate_contacts(vault_base_url, contacts, custom_headers:nil)
  response = set_certificate_contacts_async(vault_base_url, contacts, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#set_certificate_contacts_async(vault_base_url, contacts, custom_headers: nil) ⇒ Concurrent::Promise

Sets the certificate contacts for the specified key vault.

Sets the certificate contacts for the specified key vault. This operation requires the certificates/managecontacts permission.

myvault.vault.azure.net. to the HTTP request.



405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
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
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 405

def set_certificate_contacts_async(vault_base_url, contacts, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'contacts is nil' if contacts.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::Contacts.mapper()
  request_content = self.serialize(request_mapper,  contacts)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'certificates/contacts'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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::V7_2_preview::Models::Contacts.mapper()
        result.body = self.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

#set_certificate_contacts_with_http_info(vault_base_url, contacts, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Sets the certificate contacts for the specified key vault.

Sets the certificate contacts for the specified key vault. This operation requires the certificates/managecontacts permission.

myvault.vault.azure.net. will be added to the HTTP request.



387
388
389
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 387

def set_certificate_contacts_with_http_info(vault_base_url, contacts, custom_headers:nil)
  set_certificate_contacts_async(vault_base_url, contacts, custom_headers:custom_headers).value!
end

#set_certificate_issuer(vault_base_url, issuer_name, provider, credentials: nil, organization_details: nil, attributes: nil, custom_headers: nil) ⇒ IssuerBundle

Sets the specified certificate issuer.

The SetCertificateIssuer operation adds or updates the specified certificate issuer. This operation requires the certificates/setissuers permission.

myvault.vault.azure.net. issuer. as provided to the issuer. will be added to the HTTP request.



803
804
805
806
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 803

def set_certificate_issuer(vault_base_url, issuer_name, provider, credentials:nil, organization_details:nil, attributes:nil, custom_headers:nil)
  response = set_certificate_issuer_async(vault_base_url, issuer_name, provider, credentials:credentials, organization_details:organization_details, attributes:attributes, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#set_certificate_issuer_async(vault_base_url, issuer_name, provider, credentials: nil, organization_details: nil, attributes: nil, custom_headers: nil) ⇒ Concurrent::Promise

Sets the specified certificate issuer.

The SetCertificateIssuer operation adds or updates the specified certificate issuer. This operation requires the certificates/setissuers permission.

myvault.vault.azure.net. issuer. as provided to the issuer. to the HTTP request.



852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 852

def set_certificate_issuer_async(vault_base_url, issuer_name, provider, credentials:nil, organization_details:nil, attributes:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'issuer_name is nil' if issuer_name.nil?
  fail ArgumentError, 'api_version is nil' if api_version.nil?
  fail ArgumentError, 'provider is nil' if provider.nil?

  parameter = Azure::KeyVault::V7_2_preview::Models::CertificateIssuerSetParameters.new
  unless provider.nil? && credentials.nil? && organization_details.nil? && attributes.nil?
    parameter.provider = provider
    parameter.credentials = credentials
    parameter.organization_details = organization_details
    parameter.attributes = attributes
  end

  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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateIssuerSetParameters.mapper()
  request_content = self.serialize(request_mapper,  parameter)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'certificates/issuers/{issuer-name}'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'issuer-name' => issuer_name},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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::V7_2_preview::Models::IssuerBundle.mapper()
        result.body = self.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

#set_certificate_issuer_with_http_info(vault_base_url, issuer_name, provider, credentials: nil, organization_details: nil, attributes: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Sets the specified certificate issuer.

The SetCertificateIssuer operation adds or updates the specified certificate issuer. This operation requires the certificates/setissuers permission.

myvault.vault.azure.net. issuer. as provided to the issuer. will be added to the HTTP request.



828
829
830
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 828

def set_certificate_issuer_with_http_info(vault_base_url, issuer_name, provider, credentials:nil, organization_details:nil, attributes:nil, custom_headers:nil)
  set_certificate_issuer_async(vault_base_url, issuer_name, provider, credentials:credentials, organization_details:organization_details, attributes:attributes, custom_headers:custom_headers).value!
end

#set_sas_definition(vault_base_url, storage_account_name, sas_definition_name, template_uri, sas_type, validity_period, sas_definition_attributes: nil, tags: nil, custom_headers: nil) ⇒ SasDefinitionBundle

Creates or updates a new SAS definition for the specified storage account. This operation requires the storage/setsas permission.

myvault.vault.azure.net. arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. create. Possible values include: ‘account’, ‘service’ according to the SAS definition. the SAS definition. form of key-value pairs. will be added to the HTTP request.



9499
9500
9501
9502
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 9499

def set_sas_definition(vault_base_url, , sas_definition_name, template_uri, sas_type, validity_period, sas_definition_attributes:nil, tags:nil, custom_headers:nil)
  response = set_sas_definition_async(vault_base_url, , sas_definition_name, template_uri, sas_type, validity_period, sas_definition_attributes:sas_definition_attributes, tags:tags, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#set_sas_definition_async(vault_base_url, storage_account_name, sas_definition_name, template_uri, sas_type, validity_period, sas_definition_attributes: nil, tags: nil, custom_headers: nil) ⇒ Concurrent::Promise

Creates or updates a new SAS definition for the specified storage account. This operation requires the storage/setsas permission.

myvault.vault.azure.net. arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. create. Possible values include: ‘account’, ‘service’ according to the SAS definition. the SAS definition. form of key-value pairs. to the HTTP request.



9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 9556

def set_sas_definition_async(vault_base_url, , sas_definition_name, template_uri, sas_type, validity_period, sas_definition_attributes:nil, tags:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'storage_account_name is nil' if .nil?
  fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !.nil? && .match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil?
  fail ArgumentError, 'sas_definition_name is nil' if sas_definition_name.nil?
  fail ArgumentError, "'sas_definition_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !sas_definition_name.nil? && sas_definition_name.match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil?
  fail ArgumentError, 'api_version is nil' if api_version.nil?
  fail ArgumentError, 'template_uri is nil' if template_uri.nil?
  fail ArgumentError, 'sas_type is nil' if sas_type.nil?
  fail ArgumentError, 'validity_period is nil' if validity_period.nil?

  parameters = Azure::KeyVault::V7_2_preview::Models::SasDefinitionCreateParameters.new
  unless template_uri.nil? && sas_type.nil? && validity_period.nil? && sas_definition_attributes.nil? && tags.nil?
    parameters.template_uri = template_uri
    parameters.sas_type = sas_type
    parameters.validity_period = validity_period
    parameters.sas_definition_attributes = sas_definition_attributes
    parameters.tags = tags
  end

  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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::SasDefinitionCreateParameters.mapper()
  request_content = self.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'storage/{storage-account-name}/sas/{sas-definition-name}'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'storage-account-name' => ,'sas-definition-name' => sas_definition_name},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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::V7_2_preview::Models::SasDefinitionBundle.mapper()
        result.body = self.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

#set_sas_definition_with_http_info(vault_base_url, storage_account_name, sas_definition_name, template_uri, sas_type, validity_period, sas_definition_attributes: nil, tags: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Creates or updates a new SAS definition for the specified storage account. This operation requires the storage/setsas permission.

myvault.vault.azure.net. arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. create. Possible values include: ‘account’, ‘service’ according to the SAS definition. the SAS definition. form of key-value pairs. will be added to the HTTP request.



9528
9529
9530
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 9528

def set_sas_definition_with_http_info(vault_base_url, , sas_definition_name, template_uri, sas_type, validity_period, sas_definition_attributes:nil, tags:nil, custom_headers:nil)
  set_sas_definition_async(vault_base_url, , sas_definition_name, template_uri, sas_type, validity_period, sas_definition_attributes:sas_definition_attributes, tags:tags, custom_headers:custom_headers).value!
end

#set_secret(vault_base_url, secret_name, value, tags: nil, content_type: nil, secret_attributes: nil, custom_headers: nil) ⇒ SecretBundle

Sets a secret in a specified key vault.

The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key Vault creates a new version of that secret. This operation requires the secrets/set permission.

myvault.vault.azure.net. form of key-value pairs. will be added to the HTTP request.



6062
6063
6064
6065
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 6062

def set_secret(vault_base_url, secret_name, value, tags:nil, content_type:nil, secret_attributes:nil, custom_headers:nil)
  response = set_secret_async(vault_base_url, secret_name, value, tags:tags, content_type:content_type, secret_attributes:secret_attributes, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#set_secret_async(vault_base_url, secret_name, value, tags: nil, content_type: nil, secret_attributes: nil, custom_headers: nil) ⇒ Concurrent::Promise

Sets a secret in a specified key vault.

The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key Vault creates a new version of that secret. This operation requires the secrets/set permission.

myvault.vault.azure.net. form of key-value pairs. to the HTTP request.



6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 6111

def set_secret_async(vault_base_url, secret_name, value, tags:nil, content_type:nil, secret_attributes:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'secret_name is nil' if secret_name.nil?
  fail ArgumentError, "'secret_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z-]+$'" if !secret_name.nil? && secret_name.match(Regexp.new('^^[0-9a-zA-Z-]+$$')).nil?
  fail ArgumentError, 'api_version is nil' if api_version.nil?
  fail ArgumentError, 'value is nil' if value.nil?

  parameters = Azure::KeyVault::V7_2_preview::Models::SecretSetParameters.new
  unless value.nil? && tags.nil? && content_type.nil? && secret_attributes.nil?
    parameters.value = value
    parameters.tags = tags
    parameters.content_type = content_type
    parameters.secret_attributes = secret_attributes
  end

  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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::SecretSetParameters.mapper()
  request_content = self.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'secrets/{secret-name}'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'secret-name' => secret_name},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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::V7_2_preview::Models::SecretBundle.mapper()
        result.body = self.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

#set_secret_with_http_info(vault_base_url, secret_name, value, tags: nil, content_type: nil, secret_attributes: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Sets a secret in a specified key vault.

The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key Vault creates a new version of that secret. This operation requires the secrets/set permission.

myvault.vault.azure.net. form of key-value pairs. will be added to the HTTP request.



6087
6088
6089
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 6087

def set_secret_with_http_info(vault_base_url, secret_name, value, tags:nil, content_type:nil, secret_attributes:nil, custom_headers:nil)
  set_secret_async(vault_base_url, secret_name, value, tags:tags, content_type:content_type, secret_attributes:secret_attributes, custom_headers:custom_headers).value!
end

#set_storage_account(vault_base_url, storage_account_name, resource_id, active_key_name, auto_regenerate_key, regeneration_period: nil, storage_account_attributes: nil, tags: nil, custom_headers: nil) ⇒ StorageBundle

Creates or updates a new storage account. This operation requires the storage/set permission.

myvault.vault.azure.net. storage account for the user. specified in ISO-8601 format. of the storage account. form of key-value pairs. will be added to the HTTP request.



8419
8420
8421
8422
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 8419

def (vault_base_url, , resource_id, active_key_name, auto_regenerate_key, regeneration_period:nil, storage_account_attributes:nil, tags:nil, custom_headers:nil)
  response = (vault_base_url, , resource_id, active_key_name, auto_regenerate_key, regeneration_period:regeneration_period, storage_account_attributes:, tags:tags, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#set_storage_account_async(vault_base_url, storage_account_name, resource_id, active_key_name, auto_regenerate_key, regeneration_period: nil, storage_account_attributes: nil, tags: nil, custom_headers: nil) ⇒ Concurrent::Promise

Creates or updates a new storage account. This operation requires the storage/set permission.

myvault.vault.azure.net. storage account for the user. specified in ISO-8601 format. of the storage account. form of key-value pairs. to the HTTP request.



8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 8472

def (vault_base_url, , resource_id, active_key_name, auto_regenerate_key, regeneration_period:nil, storage_account_attributes:nil, tags:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'storage_account_name is nil' if .nil?
  fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !.nil? && .match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil?
  fail ArgumentError, 'api_version is nil' if api_version.nil?
  fail ArgumentError, 'resource_id is nil' if resource_id.nil?
  fail ArgumentError, 'active_key_name is nil' if active_key_name.nil?
  fail ArgumentError, 'auto_regenerate_key is nil' if auto_regenerate_key.nil?

  parameters = Azure::KeyVault::V7_2_preview::Models::StorageAccountCreateParameters.new
  unless resource_id.nil? && active_key_name.nil? && auto_regenerate_key.nil? && regeneration_period.nil? && .nil? && tags.nil?
    parameters.resource_id = resource_id
    parameters.active_key_name = active_key_name
    parameters.auto_regenerate_key = auto_regenerate_key
    parameters.regeneration_period = regeneration_period
    parameters. = 
    parameters.tags = tags
  end

  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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::StorageAccountCreateParameters.mapper()
  request_content = self.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'storage/{storage-account-name}'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'storage-account-name' => },
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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::V7_2_preview::Models::StorageBundle.mapper()
        result.body = self.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

#set_storage_account_with_http_info(vault_base_url, storage_account_name, resource_id, active_key_name, auto_regenerate_key, regeneration_period: nil, storage_account_attributes: nil, tags: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Creates or updates a new storage account. This operation requires the storage/set permission.

myvault.vault.azure.net. storage account for the user. specified in ISO-8601 format. of the storage account. form of key-value pairs. will be added to the HTTP request.



8446
8447
8448
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 8446

def (vault_base_url, , resource_id, active_key_name, auto_regenerate_key, regeneration_period:nil, storage_account_attributes:nil, tags:nil, custom_headers:nil)
  (vault_base_url, , resource_id, active_key_name, auto_regenerate_key, regeneration_period:regeneration_period, storage_account_attributes:, tags:tags, custom_headers:custom_headers).value!
end

#sign(vault_base_url, key_name, key_version, algorithm, value, custom_headers: nil) ⇒ KeyOperationResult

Creates a signature from a digest using the specified key.

The SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault since this operation uses the private portion of the key. This operation requires the keys/sign permission.

myvault.vault.azure.net. algorithm identifier. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: ‘PS256’, ‘PS384’, ‘PS512’, ‘RS256’, ‘RS384’, ‘RS512’, ‘RSNULL’, ‘ES256’, ‘ES384’, ‘ES512’, ‘ES256K’ will be added to the HTTP request.



4966
4967
4968
4969
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 4966

def sign(vault_base_url, key_name, key_version, algorithm, value, custom_headers:nil)
  response = sign_async(vault_base_url, key_name, key_version, algorithm, value, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#sign_async(vault_base_url, key_name, key_version, algorithm, value, custom_headers: nil) ⇒ Concurrent::Promise

Creates a signature from a digest using the specified key.

The SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault since this operation uses the private portion of the key. This operation requires the keys/sign permission.

myvault.vault.azure.net. algorithm identifier. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: ‘PS256’, ‘PS384’, ‘PS512’, ‘RS256’, ‘RS384’, ‘RS512’, ‘RSNULL’, ‘ES256’, ‘ES384’, ‘ES512’, ‘ES256K’ to the HTTP request.



5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 5019

def sign_async(vault_base_url, key_name, key_version, algorithm, value, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'key_name is nil' if key_name.nil?
  fail ArgumentError, 'key_version is nil' if key_version.nil?
  fail ArgumentError, 'api_version is nil' if api_version.nil?
  fail ArgumentError, 'algorithm is nil' if algorithm.nil?
  fail ArgumentError, "'algorithm' should satisfy the constraint - 'MinLength': '1'" if !algorithm.nil? && algorithm.length < 1
  fail ArgumentError, 'value is nil' if value.nil?

  parameters = Azure::KeyVault::V7_2_preview::Models::KeySignParameters.new
  unless algorithm.nil? && value.nil?
    parameters.algorithm = algorithm
    parameters.value = value
  end

  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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::KeySignParameters.mapper()
  request_content = self.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'keys/{key-name}/{key-version}/sign'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'key-name' => key_name,'key-version' => key_version},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::KeyOperationResult.mapper()
        result.body = self.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

#sign_with_http_info(vault_base_url, key_name, key_version, algorithm, value, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Creates a signature from a digest using the specified key.

The SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault since this operation uses the private portion of the key. This operation requires the keys/sign permission.

myvault.vault.azure.net. algorithm identifier. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: ‘PS256’, ‘PS384’, ‘PS512’, ‘RS256’, ‘RS384’, ‘RS512’, ‘RSNULL’, ‘ES256’, ‘ES384’, ‘ES512’, ‘ES256K’ will be added to the HTTP request.



4993
4994
4995
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 4993

def sign_with_http_info(vault_base_url, key_name, key_version, algorithm, value, custom_headers:nil)
  sign_async(vault_base_url, key_name, key_version, algorithm, value, custom_headers:custom_headers).value!
end

#unwrap_key(vault_base_url, key_name, key_version, algorithm, value, iv: nil, aad: nil, tag: nil, custom_headers: nil) ⇒ KeyOperationResult

Unwraps a symmetric key using the specified key that was initially used for wrapping that key.

The UNWRAP operation supports decryption of a symmetric key using the target key encryption key. This operation is the reverse of the WRAP operation. The UNWRAP operation applies to asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of the key. This operation requires the keys/unwrapKey permission.

myvault.vault.azure.net. Possible values include: ‘RSA-OAEP’, ‘RSA-OAEP-256’, ‘RSA1_5’, ‘A128GCM’, ‘A192GCM’, ‘A256GCM’, ‘A128KW’, ‘A192KW’, ‘A256KW’, ‘A128CBC’, ‘A192CBC’, ‘A256CBC’, ‘A128CBCPAD’, ‘A192CBCPAD’, ‘A256CBCPAD’ authenticated crypto algorithms. authenticated algorithm. will be added to the HTTP request.



5452
5453
5454
5455
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 5452

def unwrap_key(vault_base_url, key_name, key_version, algorithm, value, iv:nil, aad:nil, tag:nil, custom_headers:nil)
  response = unwrap_key_async(vault_base_url, key_name, key_version, algorithm, value, iv:iv, aad:aad, tag:tag, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#unwrap_key_async(vault_base_url, key_name, key_version, algorithm, value, iv: nil, aad: nil, tag: nil, custom_headers: nil) ⇒ Concurrent::Promise

Unwraps a symmetric key using the specified key that was initially used for wrapping that key.

The UNWRAP operation supports decryption of a symmetric key using the target key encryption key. This operation is the reverse of the WRAP operation. The UNWRAP operation applies to asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of the key. This operation requires the keys/unwrapKey permission.

myvault.vault.azure.net. Possible values include: ‘RSA-OAEP’, ‘RSA-OAEP-256’, ‘RSA1_5’, ‘A128GCM’, ‘A192GCM’, ‘A256GCM’, ‘A128KW’, ‘A192KW’, ‘A256KW’, ‘A128CBC’, ‘A192CBC’, ‘A256CBC’, ‘A128CBCPAD’, ‘A192CBCPAD’, ‘A256CBCPAD’ authenticated crypto algorithms. authenticated algorithm. to the HTTP request.



5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 5519

def unwrap_key_async(vault_base_url, key_name, key_version, algorithm, value, iv:nil, aad:nil, tag:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'key_name is nil' if key_name.nil?
  fail ArgumentError, 'key_version is nil' if key_version.nil?
  fail ArgumentError, 'api_version is nil' if api_version.nil?
  fail ArgumentError, 'algorithm is nil' if algorithm.nil?
  fail ArgumentError, "'algorithm' should satisfy the constraint - 'MinLength': '1'" if !algorithm.nil? && algorithm.length < 1
  fail ArgumentError, 'value is nil' if value.nil?

  parameters = Azure::KeyVault::V7_2_preview::Models::KeyOperationsParameters.new
  unless algorithm.nil? && value.nil? && iv.nil? && aad.nil? && tag.nil?
    parameters.algorithm = algorithm
    parameters.value = value
    parameters.iv = iv
    parameters.aad = aad
    parameters.tag = tag
  end

  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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::KeyOperationsParameters.mapper()
  request_content = self.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'keys/{key-name}/{key-version}/unwrapkey'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'key-name' => key_name,'key-version' => key_version},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::KeyOperationResult.mapper()
        result.body = self.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

#unwrap_key_with_http_info(vault_base_url, key_name, key_version, algorithm, value, iv: nil, aad: nil, tag: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Unwraps a symmetric key using the specified key that was initially used for wrapping that key.

The UNWRAP operation supports decryption of a symmetric key using the target key encryption key. This operation is the reverse of the WRAP operation. The UNWRAP operation applies to asymmetric and symmetric keys stored in Azure Key Vault since it uses the private portion of the key. This operation requires the keys/unwrapKey permission.

myvault.vault.azure.net. Possible values include: ‘RSA-OAEP’, ‘RSA-OAEP-256’, ‘RSA1_5’, ‘A128GCM’, ‘A192GCM’, ‘A256GCM’, ‘A128KW’, ‘A192KW’, ‘A256KW’, ‘A128CBC’, ‘A192CBC’, ‘A256CBC’, ‘A128CBCPAD’, ‘A192CBCPAD’, ‘A256CBCPAD’ authenticated crypto algorithms. authenticated algorithm. will be added to the HTTP request.



5486
5487
5488
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 5486

def unwrap_key_with_http_info(vault_base_url, key_name, key_version, algorithm, value, iv:nil, aad:nil, tag:nil, custom_headers:nil)
  unwrap_key_async(vault_base_url, key_name, key_version, algorithm, value, iv:iv, aad:aad, tag:tag, custom_headers:custom_headers).value!
end

#update_certificate(vault_base_url, certificate_name, certificate_version, certificate_policy: nil, certificate_attributes: nil, tags: nil, custom_headers: nil) ⇒ CertificateBundle

Updates the specified attributes associated with the given certificate.

The UpdateCertificate operation applies the specified update on the given certificate; the only elements updated are the certificate’s attributes. This operation requires the certificates/update permission.

myvault.vault.azure.net. vault. certificate. certificate (optional). form of key-value pairs. will be added to the HTTP request.



1956
1957
1958
1959
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 1956

def update_certificate(vault_base_url, certificate_name, certificate_version, certificate_policy:nil, certificate_attributes:nil, tags:nil, custom_headers:nil)
  response = update_certificate_async(vault_base_url, certificate_name, certificate_version, certificate_policy:certificate_policy, certificate_attributes:certificate_attributes, tags:tags, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_certificate_async(vault_base_url, certificate_name, certificate_version, certificate_policy: nil, certificate_attributes: nil, tags: nil, custom_headers: nil) ⇒ Concurrent::Promise

Updates the specified attributes associated with the given certificate.

The UpdateCertificate operation applies the specified update on the given certificate; the only elements updated are the certificate’s attributes. This operation requires the certificates/update permission.

myvault.vault.azure.net. vault. certificate. certificate (optional). form of key-value pairs. to the HTTP request.



2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 2011

def update_certificate_async(vault_base_url, certificate_name, certificate_version, certificate_policy:nil, certificate_attributes:nil, tags:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'certificate_name is nil' if certificate_name.nil?
  fail ArgumentError, 'certificate_version is nil' if certificate_version.nil?
  fail ArgumentError, 'api_version is nil' if api_version.nil?

  parameters = Azure::KeyVault::V7_2_preview::Models::CertificateUpdateParameters.new
  unless certificate_policy.nil? && certificate_attributes.nil? && tags.nil?
    parameters.certificate_policy = certificate_policy
    parameters.certificate_attributes = certificate_attributes
    parameters.tags = tags
  end

  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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateUpdateParameters.mapper()
  request_content = self.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'certificates/{certificate-name}/{certificate-version}'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'certificate-name' => certificate_name,'certificate-version' => certificate_version},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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::V7_2_preview::Models::CertificateBundle.mapper()
        result.body = self.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_certificate_issuer(vault_base_url, issuer_name, provider: nil, credentials: nil, organization_details: nil, attributes: nil, custom_headers: nil) ⇒ IssuerBundle

Updates the specified certificate issuer.

The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. This operation requires the certificates/setissuers permission.

myvault.vault.azure.net. issuer. as provided to the issuer. will be added to the HTTP request.



943
944
945
946
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 943

def update_certificate_issuer(vault_base_url, issuer_name, provider:nil, credentials:nil, organization_details:nil, attributes:nil, custom_headers:nil)
  response = update_certificate_issuer_async(vault_base_url, issuer_name, provider:provider, credentials:credentials, organization_details:organization_details, attributes:attributes, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_certificate_issuer_async(vault_base_url, issuer_name, provider: nil, credentials: nil, organization_details: nil, attributes: nil, custom_headers: nil) ⇒ Concurrent::Promise

Updates the specified certificate issuer.

The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. This operation requires the certificates/setissuers permission.

myvault.vault.azure.net. issuer. as provided to the issuer. to the HTTP request.



994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 994

def update_certificate_issuer_async(vault_base_url, issuer_name, provider:nil, credentials:nil, organization_details:nil, attributes:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'issuer_name is nil' if issuer_name.nil?
  fail ArgumentError, 'api_version is nil' if api_version.nil?

  parameter = Azure::KeyVault::V7_2_preview::Models::CertificateIssuerUpdateParameters.new
  unless provider.nil? && credentials.nil? && organization_details.nil? && attributes.nil?
    parameter.provider = provider
    parameter.credentials = credentials
    parameter.organization_details = organization_details
    parameter.attributes = attributes
  end

  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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateIssuerUpdateParameters.mapper()
  request_content = self.serialize(request_mapper,  parameter)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'certificates/issuers/{issuer-name}'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'issuer-name' => issuer_name},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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::V7_2_preview::Models::IssuerBundle.mapper()
        result.body = self.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_certificate_issuer_with_http_info(vault_base_url, issuer_name, provider: nil, credentials: nil, organization_details: nil, attributes: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Updates the specified certificate issuer.

The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. This operation requires the certificates/setissuers permission.

myvault.vault.azure.net. issuer. as provided to the issuer. will be added to the HTTP request.



969
970
971
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 969

def update_certificate_issuer_with_http_info(vault_base_url, issuer_name, provider:nil, credentials:nil, organization_details:nil, attributes:nil, custom_headers:nil)
  update_certificate_issuer_async(vault_base_url, issuer_name, provider:provider, credentials:credentials, organization_details:organization_details, attributes:attributes, custom_headers:custom_headers).value!
end

#update_certificate_operation(vault_base_url, certificate_name, cancellation_requested, custom_headers: nil) ⇒ CertificateOperation

Updates a certificate operation.

Updates a certificate creation operation that is already in progress. This operation requires the certificates/update permission.

myvault.vault.azure.net. requested on the certificate operation. will be added to the HTTP request.



2215
2216
2217
2218
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 2215

def update_certificate_operation(vault_base_url, certificate_name, cancellation_requested, custom_headers:nil)
  response = update_certificate_operation_async(vault_base_url, certificate_name, cancellation_requested, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_certificate_operation_async(vault_base_url, certificate_name, cancellation_requested, custom_headers: nil) ⇒ Concurrent::Promise

Updates a certificate operation.

Updates a certificate creation operation that is already in progress. This operation requires the certificates/update permission.

myvault.vault.azure.net. requested on the certificate operation. to the HTTP request.



2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 2256

def update_certificate_operation_async(vault_base_url, certificate_name, cancellation_requested, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'certificate_name is nil' if certificate_name.nil?
  fail ArgumentError, 'api_version is nil' if api_version.nil?
  fail ArgumentError, 'cancellation_requested is nil' if cancellation_requested.nil?

  certificate_operation = CertificateOperationUpdateParameter.new
  unless cancellation_requested.nil?
    certificate_operation.cancellation_requested = cancellation_requested
  end

  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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::CertificateOperationUpdateParameter.mapper()
  request_content = self.serialize(request_mapper,  certificate_operation)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'certificates/{certificate-name}/pending'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'certificate-name' => certificate_name},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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::V7_2_preview::Models::CertificateOperation.mapper()
        result.body = self.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_certificate_operation_with_http_info(vault_base_url, certificate_name, cancellation_requested, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Updates a certificate operation.

Updates a certificate creation operation that is already in progress. This operation requires the certificates/update permission.

myvault.vault.azure.net. requested on the certificate operation. will be added to the HTTP request.



2236
2237
2238
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 2236

def update_certificate_operation_with_http_info(vault_base_url, certificate_name, cancellation_requested, custom_headers:nil)
  update_certificate_operation_async(vault_base_url, certificate_name, cancellation_requested, custom_headers:custom_headers).value!
end

#update_certificate_policy(vault_base_url, certificate_name, certificate_policy, custom_headers: nil) ⇒ CertificatePolicy

Updates the policy for a certificate.

Set specified members in the certificate policy. Leave others as null. This operation requires the certificates/update permission.

myvault.vault.azure.net. vault. will be added to the HTTP request.



1829
1830
1831
1832
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 1829

def update_certificate_policy(vault_base_url, certificate_name, certificate_policy, custom_headers:nil)
  response = update_certificate_policy_async(vault_base_url, certificate_name, certificate_policy, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_certificate_policy_async(vault_base_url, certificate_name, certificate_policy, custom_headers: nil) ⇒ Concurrent::Promise

Updates the policy for a certificate.

Set specified members in the certificate policy. Leave others as null. This operation requires the certificates/update permission.

myvault.vault.azure.net. vault. to the HTTP request.



1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 1870

def update_certificate_policy_async(vault_base_url, certificate_name, certificate_policy, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'certificate_name is nil' if certificate_name.nil?
  fail ArgumentError, 'certificate_policy is nil' if certificate_policy.nil?
  fail ArgumentError, 'api_version is nil' if api_version.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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::CertificatePolicy.mapper()
  request_content = self.serialize(request_mapper,  certificate_policy)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'certificates/{certificate-name}/policy'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'certificate-name' => certificate_name},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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::V7_2_preview::Models::CertificatePolicy.mapper()
        result.body = self.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_certificate_policy_with_http_info(vault_base_url, certificate_name, certificate_policy, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Updates the policy for a certificate.

Set specified members in the certificate policy. Leave others as null. This operation requires the certificates/update permission.

myvault.vault.azure.net. vault. will be added to the HTTP request.



1850
1851
1852
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 1850

def update_certificate_policy_with_http_info(vault_base_url, certificate_name, certificate_policy, custom_headers:nil)
  update_certificate_policy_async(vault_base_url, certificate_name, certificate_policy, custom_headers:custom_headers).value!
end

#update_certificate_with_http_info(vault_base_url, certificate_name, certificate_version, certificate_policy: nil, certificate_attributes: nil, tags: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Updates the specified attributes associated with the given certificate.

The UpdateCertificate operation applies the specified update on the given certificate; the only elements updated are the certificate’s attributes. This operation requires the certificates/update permission.

myvault.vault.azure.net. vault. certificate. certificate (optional). form of key-value pairs. will be added to the HTTP request.



1984
1985
1986
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 1984

def update_certificate_with_http_info(vault_base_url, certificate_name, certificate_version, certificate_policy:nil, certificate_attributes:nil, tags:nil, custom_headers:nil)
  update_certificate_async(vault_base_url, certificate_name, certificate_version, certificate_policy:certificate_policy, certificate_attributes:certificate_attributes, tags:tags, custom_headers:custom_headers).value!
end

#update_key(vault_base_url, key_name, key_version, key_ops: nil, key_attributes: nil, tags: nil, custom_headers: nil) ⇒ KeyBundle

The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault.

In order to perform this operation, the key must already exist in the Key Vault. Note: The cryptographic material of a key itself cannot be changed. This operation requires the keys/update permission.

myvault.vault.azure.net. information on possible key operations, see JsonWebKeyOperation. form of key-value pairs. will be added to the HTTP request.



3825
3826
3827
3828
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 3825

def update_key(vault_base_url, key_name, key_version, key_ops:nil, key_attributes:nil, tags:nil, custom_headers:nil)
  response = update_key_async(vault_base_url, key_name, key_version, key_ops:key_ops, key_attributes:key_attributes, tags:tags, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_key_async(vault_base_url, key_name, key_version, key_ops: nil, key_attributes: nil, tags: nil, custom_headers: nil) ⇒ Concurrent::Promise

The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault.

In order to perform this operation, the key must already exist in the Key Vault. Note: The cryptographic material of a key itself cannot be changed. This operation requires the keys/update permission.

myvault.vault.azure.net. information on possible key operations, see JsonWebKeyOperation. form of key-value pairs. to the HTTP request.



3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 3878

def update_key_async(vault_base_url, key_name, key_version, key_ops:nil, key_attributes:nil, tags:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'key_name is nil' if key_name.nil?
  fail ArgumentError, 'key_version is nil' if key_version.nil?
  fail ArgumentError, 'api_version is nil' if api_version.nil?

  parameters = Azure::KeyVault::V7_2_preview::Models::KeyUpdateParameters.new
  unless key_ops.nil? && key_attributes.nil? && tags.nil?
    parameters.key_ops = key_ops
    parameters.key_attributes = key_attributes
    parameters.tags = tags
  end

  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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::KeyUpdateParameters.mapper()
  request_content = self.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'keys/{key-name}/{key-version}'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'key-name' => key_name,'key-version' => key_version},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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::V7_2_preview::Models::KeyBundle.mapper()
        result.body = self.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_key_with_http_info(vault_base_url, key_name, key_version, key_ops: nil, key_attributes: nil, tags: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault.

In order to perform this operation, the key must already exist in the Key Vault. Note: The cryptographic material of a key itself cannot be changed. This operation requires the keys/update permission.

myvault.vault.azure.net. information on possible key operations, see JsonWebKeyOperation. form of key-value pairs. will be added to the HTTP request.



3852
3853
3854
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 3852

def update_key_with_http_info(vault_base_url, key_name, key_version, key_ops:nil, key_attributes:nil, tags:nil, custom_headers:nil)
  update_key_async(vault_base_url, key_name, key_version, key_ops:key_ops, key_attributes:key_attributes, tags:tags, custom_headers:custom_headers).value!
end

#update_sas_definition(vault_base_url, storage_account_name, sas_definition_name, template_uri: nil, sas_type: nil, validity_period: nil, sas_definition_attributes: nil, tags: nil, custom_headers: nil) ⇒ SasDefinitionBundle

Updates the specified attributes associated with the given SAS definition. This operation requires the storage/setsas permission.

myvault.vault.azure.net. arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. create. Possible values include: ‘account’, ‘service’ according to the SAS definition. the SAS definition. form of key-value pairs. will be added to the HTTP request.



9656
9657
9658
9659
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 9656

def update_sas_definition(vault_base_url, , sas_definition_name, template_uri:nil, sas_type:nil, validity_period:nil, sas_definition_attributes:nil, tags:nil, custom_headers:nil)
  response = update_sas_definition_async(vault_base_url, , sas_definition_name, template_uri:template_uri, sas_type:sas_type, validity_period:validity_period, sas_definition_attributes:sas_definition_attributes, tags:tags, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_sas_definition_async(vault_base_url, storage_account_name, sas_definition_name, template_uri: nil, sas_type: nil, validity_period: nil, sas_definition_attributes: nil, tags: nil, custom_headers: nil) ⇒ Concurrent::Promise

Updates the specified attributes associated with the given SAS definition. This operation requires the storage/setsas permission.

myvault.vault.azure.net. arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. create. Possible values include: ‘account’, ‘service’ according to the SAS definition. the SAS definition. form of key-value pairs. to the HTTP request.



9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 9713

def update_sas_definition_async(vault_base_url, , sas_definition_name, template_uri:nil, sas_type:nil, validity_period:nil, sas_definition_attributes:nil, tags:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'storage_account_name is nil' if .nil?
  fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !.nil? && .match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil?
  fail ArgumentError, 'sas_definition_name is nil' if sas_definition_name.nil?
  fail ArgumentError, "'sas_definition_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !sas_definition_name.nil? && sas_definition_name.match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil?
  fail ArgumentError, 'api_version is nil' if api_version.nil?

  parameters = Azure::KeyVault::V7_2_preview::Models::SasDefinitionUpdateParameters.new
  unless template_uri.nil? && sas_type.nil? && validity_period.nil? && sas_definition_attributes.nil? && tags.nil?
    parameters.template_uri = template_uri
    parameters.sas_type = sas_type
    parameters.validity_period = validity_period
    parameters.sas_definition_attributes = sas_definition_attributes
    parameters.tags = tags
  end

  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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::SasDefinitionUpdateParameters.mapper()
  request_content = self.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'storage/{storage-account-name}/sas/{sas-definition-name}'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'storage-account-name' => ,'sas-definition-name' => sas_definition_name},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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::V7_2_preview::Models::SasDefinitionBundle.mapper()
        result.body = self.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_sas_definition_with_http_info(vault_base_url, storage_account_name, sas_definition_name, template_uri: nil, sas_type: nil, validity_period: nil, sas_definition_attributes: nil, tags: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Updates the specified attributes associated with the given SAS definition. This operation requires the storage/setsas permission.

myvault.vault.azure.net. arbitrary key. Tokens created according to the SAS definition will have the same properties as the template. create. Possible values include: ‘account’, ‘service’ according to the SAS definition. the SAS definition. form of key-value pairs. will be added to the HTTP request.



9685
9686
9687
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 9685

def update_sas_definition_with_http_info(vault_base_url, , sas_definition_name, template_uri:nil, sas_type:nil, validity_period:nil, sas_definition_attributes:nil, tags:nil, custom_headers:nil)
  update_sas_definition_async(vault_base_url, , sas_definition_name, template_uri:template_uri, sas_type:sas_type, validity_period:validity_period, sas_definition_attributes:sas_definition_attributes, tags:tags, custom_headers:custom_headers).value!
end

#update_secret(vault_base_url, secret_name, secret_version, content_type: nil, secret_attributes: nil, tags: nil, custom_headers: nil) ⇒ SecretBundle

Updates the attributes associated with a specified secret in a given key vault.

The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in the request are left unchanged. The value of a secret itself cannot be changed. This operation requires the secrets/set permission.

myvault.vault.azure.net. form of key-value pairs. will be added to the HTTP request.



6313
6314
6315
6316
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 6313

def update_secret(vault_base_url, secret_name, secret_version, content_type:nil, secret_attributes:nil, tags:nil, custom_headers:nil)
  response = update_secret_async(vault_base_url, secret_name, secret_version, content_type:content_type, secret_attributes:secret_attributes, tags:tags, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_secret_async(vault_base_url, secret_name, secret_version, content_type: nil, secret_attributes: nil, tags: nil, custom_headers: nil) ⇒ Concurrent::Promise

Updates the attributes associated with a specified secret in a given key vault.

The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in the request are left unchanged. The value of a secret itself cannot be changed. This operation requires the secrets/set permission.

myvault.vault.azure.net. form of key-value pairs. to the HTTP request.



6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 6366

def update_secret_async(vault_base_url, secret_name, secret_version, content_type:nil, secret_attributes:nil, tags:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'secret_name is nil' if secret_name.nil?
  fail ArgumentError, 'secret_version is nil' if secret_version.nil?
  fail ArgumentError, 'api_version is nil' if api_version.nil?

  parameters = Azure::KeyVault::V7_2_preview::Models::SecretUpdateParameters.new
  unless content_type.nil? && secret_attributes.nil? && tags.nil?
    parameters.content_type = content_type
    parameters.secret_attributes = secret_attributes
    parameters.tags = tags
  end

  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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::SecretUpdateParameters.mapper()
  request_content = self.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'secrets/{secret-name}/{secret-version}'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'secret-name' => secret_name,'secret-version' => secret_version},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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::V7_2_preview::Models::SecretBundle.mapper()
        result.body = self.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_secret_with_http_info(vault_base_url, secret_name, secret_version, content_type: nil, secret_attributes: nil, tags: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Updates the attributes associated with a specified secret in a given key vault.

The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in the request are left unchanged. The value of a secret itself cannot be changed. This operation requires the secrets/set permission.

myvault.vault.azure.net. form of key-value pairs. will be added to the HTTP request.



6340
6341
6342
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 6340

def update_secret_with_http_info(vault_base_url, secret_name, secret_version, content_type:nil, secret_attributes:nil, tags:nil, custom_headers:nil)
  update_secret_async(vault_base_url, secret_name, secret_version, content_type:content_type, secret_attributes:secret_attributes, tags:tags, custom_headers:custom_headers).value!
end

#update_storage_account(vault_base_url, storage_account_name, active_key_name: nil, auto_regenerate_key: nil, regeneration_period: nil, storage_account_attributes: nil, tags: nil, custom_headers: nil) ⇒ StorageBundle

Updates the specified attributes associated with the given storage account. This operation requires the storage/set/update permission.

myvault.vault.azure.net. storage account for the user. specified in ISO-8601 format. of the storage account. form of key-value pairs. will be added to the HTTP request.



8568
8569
8570
8571
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 8568

def (vault_base_url, , active_key_name:nil, auto_regenerate_key:nil, regeneration_period:nil, storage_account_attributes:nil, tags:nil, custom_headers:nil)
  response = (vault_base_url, , active_key_name:active_key_name, auto_regenerate_key:auto_regenerate_key, regeneration_period:regeneration_period, storage_account_attributes:, tags:tags, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_storage_account_async(vault_base_url, storage_account_name, active_key_name: nil, auto_regenerate_key: nil, regeneration_period: nil, storage_account_attributes: nil, tags: nil, custom_headers: nil) ⇒ Concurrent::Promise

Updates the specified attributes associated with the given storage account. This operation requires the storage/set/update permission.

myvault.vault.azure.net. storage account for the user. specified in ISO-8601 format. of the storage account. form of key-value pairs. to the HTTP request.



8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 8619

def (vault_base_url, , active_key_name:nil, auto_regenerate_key:nil, regeneration_period:nil, storage_account_attributes:nil, tags:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'storage_account_name is nil' if .nil?
  fail ArgumentError, "'storage_account_name' should satisfy the constraint - 'Pattern': '^[0-9a-zA-Z]+$'" if !.nil? && .match(Regexp.new('^^[0-9a-zA-Z]+$$')).nil?
  fail ArgumentError, 'api_version is nil' if api_version.nil?

  parameters = Azure::KeyVault::V7_2_preview::Models::StorageAccountUpdateParameters.new
  unless active_key_name.nil? && auto_regenerate_key.nil? && regeneration_period.nil? && .nil? && tags.nil?
    parameters.active_key_name = active_key_name
    parameters.auto_regenerate_key = auto_regenerate_key
    parameters.regeneration_period = regeneration_period
    parameters. = 
    parameters.tags = tags
  end

  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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::StorageAccountUpdateParameters.mapper()
  request_content = self.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'storage/{storage-account-name}'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'storage-account-name' => },
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.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::V7_2_preview::Models::StorageBundle.mapper()
        result.body = self.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_storage_account_with_http_info(vault_base_url, storage_account_name, active_key_name: nil, auto_regenerate_key: nil, regeneration_period: nil, storage_account_attributes: nil, tags: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Updates the specified attributes associated with the given storage account. This operation requires the storage/set/update permission.

myvault.vault.azure.net. storage account for the user. specified in ISO-8601 format. of the storage account. form of key-value pairs. will be added to the HTTP request.



8594
8595
8596
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 8594

def (vault_base_url, , active_key_name:nil, auto_regenerate_key:nil, regeneration_period:nil, storage_account_attributes:nil, tags:nil, custom_headers:nil)
  (vault_base_url, , active_key_name:active_key_name, auto_regenerate_key:auto_regenerate_key, regeneration_period:regeneration_period, storage_account_attributes:, tags:tags, custom_headers:custom_headers).value!
end

#verify(vault_base_url, key_name, key_version, algorithm, digest, signature, custom_headers: nil) ⇒ KeyVerifyResult

Verifies a signature using a specified key.

The VERIFY operation is applicable to symmetric keys stored in Azure Key Vault. VERIFY is not strictly necessary for asymmetric keys stored in Azure Key Vault since signature verification can be performed using the public portion of the key but this operation is supported as a convenience for callers that only have a key-reference and not the public portion of the key. This operation requires the keys/verify permission.

myvault.vault.azure.net. algorithm. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: ‘PS256’, ‘PS384’, ‘PS512’, ‘RS256’, ‘RS384’, ‘RS512’, ‘RSNULL’, ‘ES256’, ‘ES384’, ‘ES512’, ‘ES256K’ will be added to the HTTP request.



5116
5117
5118
5119
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 5116

def verify(vault_base_url, key_name, key_version, algorithm, digest, signature, custom_headers:nil)
  response = verify_async(vault_base_url, key_name, key_version, algorithm, digest, signature, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#verify_async(vault_base_url, key_name, key_version, algorithm, digest, signature, custom_headers: nil) ⇒ Concurrent::Promise

Verifies a signature using a specified key.

The VERIFY operation is applicable to symmetric keys stored in Azure Key Vault. VERIFY is not strictly necessary for asymmetric keys stored in Azure Key Vault since signature verification can be performed using the public portion of the key but this operation is supported as a convenience for callers that only have a key-reference and not the public portion of the key. This operation requires the keys/verify permission.

myvault.vault.azure.net. algorithm. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: ‘PS256’, ‘PS384’, ‘PS512’, ‘RS256’, ‘RS384’, ‘RS512’, ‘RSNULL’, ‘ES256’, ‘ES384’, ‘ES512’, ‘ES256K’ to the HTTP request.



5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 5177

def verify_async(vault_base_url, key_name, key_version, algorithm, digest, signature, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'key_name is nil' if key_name.nil?
  fail ArgumentError, 'key_version is nil' if key_version.nil?
  fail ArgumentError, 'api_version is nil' if api_version.nil?
  fail ArgumentError, 'algorithm is nil' if algorithm.nil?
  fail ArgumentError, "'algorithm' should satisfy the constraint - 'MinLength': '1'" if !algorithm.nil? && algorithm.length < 1
  fail ArgumentError, 'digest is nil' if digest.nil?
  fail ArgumentError, 'signature is nil' if signature.nil?

  parameters = Azure::KeyVault::V7_2_preview::Models::KeyVerifyParameters.new
  unless algorithm.nil? && digest.nil? && signature.nil?
    parameters.algorithm = algorithm
    parameters.digest = digest
    parameters.signature = signature
  end

  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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::KeyVerifyParameters.mapper()
  request_content = self.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'keys/{key-name}/{key-version}/verify'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'key-name' => key_name,'key-version' => key_version},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::KeyVerifyResult.mapper()
        result.body = self.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

#verify_with_http_info(vault_base_url, key_name, key_version, algorithm, digest, signature, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Verifies a signature using a specified key.

The VERIFY operation is applicable to symmetric keys stored in Azure Key Vault. VERIFY is not strictly necessary for asymmetric keys stored in Azure Key Vault since signature verification can be performed using the public portion of the key but this operation is supported as a convenience for callers that only have a key-reference and not the public portion of the key. This operation requires the keys/verify permission.

myvault.vault.azure.net. algorithm. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: ‘PS256’, ‘PS384’, ‘PS512’, ‘RS256’, ‘RS384’, ‘RS512’, ‘RSNULL’, ‘ES256’, ‘ES384’, ‘ES512’, ‘ES256K’ will be added to the HTTP request.



5147
5148
5149
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 5147

def verify_with_http_info(vault_base_url, key_name, key_version, algorithm, digest, signature, custom_headers:nil)
  verify_async(vault_base_url, key_name, key_version, algorithm, digest, signature, custom_headers:custom_headers).value!
end

#wrap_key(vault_base_url, key_name, key_version, algorithm, value, iv: nil, aad: nil, tag: nil, custom_headers: nil) ⇒ KeyOperationResult

Wraps a symmetric key using a specified key.

The WRAP operation supports encryption of a symmetric key using a key encryption key that has previously been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be performed using the public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have access to the public key material. This operation requires the keys/wrapKey permission.

myvault.vault.azure.net. Possible values include: ‘RSA-OAEP’, ‘RSA-OAEP-256’, ‘RSA1_5’, ‘A128GCM’, ‘A192GCM’, ‘A256GCM’, ‘A128KW’, ‘A192KW’, ‘A256KW’, ‘A128CBC’, ‘A192CBC’, ‘A256CBC’, ‘A128CBCPAD’, ‘A192CBCPAD’, ‘A256CBCPAD’ authenticated crypto algorithms. authenticated algorithm. will be added to the HTTP request.



5280
5281
5282
5283
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 5280

def wrap_key(vault_base_url, key_name, key_version, algorithm, value, iv:nil, aad:nil, tag:nil, custom_headers:nil)
  response = wrap_key_async(vault_base_url, key_name, key_version, algorithm, value, iv:iv, aad:aad, tag:tag, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#wrap_key_async(vault_base_url, key_name, key_version, algorithm, value, iv: nil, aad: nil, tag: nil, custom_headers: nil) ⇒ Concurrent::Promise

Wraps a symmetric key using a specified key.

The WRAP operation supports encryption of a symmetric key using a key encryption key that has previously been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be performed using the public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have access to the public key material. This operation requires the keys/wrapKey permission.

myvault.vault.azure.net. Possible values include: ‘RSA-OAEP’, ‘RSA-OAEP-256’, ‘RSA1_5’, ‘A128GCM’, ‘A192GCM’, ‘A256GCM’, ‘A128KW’, ‘A192KW’, ‘A256KW’, ‘A128CBC’, ‘A192CBC’, ‘A256CBC’, ‘A128CBCPAD’, ‘A192CBCPAD’, ‘A256CBCPAD’ authenticated crypto algorithms. authenticated algorithm. to the HTTP request.



5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 5349

def wrap_key_async(vault_base_url, key_name, key_version, algorithm, value, iv:nil, aad:nil, tag:nil, custom_headers:nil)
  fail ArgumentError, 'vault_base_url is nil' if vault_base_url.nil?
  fail ArgumentError, 'key_name is nil' if key_name.nil?
  fail ArgumentError, 'key_version is nil' if key_version.nil?
  fail ArgumentError, 'api_version is nil' if api_version.nil?
  fail ArgumentError, 'algorithm is nil' if algorithm.nil?
  fail ArgumentError, "'algorithm' should satisfy the constraint - 'MinLength': '1'" if !algorithm.nil? && algorithm.length < 1
  fail ArgumentError, 'value is nil' if value.nil?

  parameters = Azure::KeyVault::V7_2_preview::Models::KeyOperationsParameters.new
  unless algorithm.nil? && value.nil? && iv.nil? && aad.nil? && tag.nil?
    parameters.algorithm = algorithm
    parameters.value = value
    parameters.iv = iv
    parameters.aad = aad
    parameters.tag = tag
  end

  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'] = accept_language unless accept_language.nil?

  # Serialize Request
  request_mapper = Azure::KeyVault::V7_2_preview::Models::KeyOperationsParameters.mapper()
  request_content = self.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'keys/{key-name}/{key-version}/wrapkey'

  request_url = @base_url || self.base_url
request_url = request_url.gsub('{vaultBaseUrl}', vault_base_url)

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'key-name' => key_name,'key-version' => key_version},
      query_params: {'api-version' => api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = self.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 MsRest::HttpOperationError.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::V7_2_preview::Models::KeyOperationResult.mapper()
        result.body = self.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

#wrap_key_with_http_info(vault_base_url, key_name, key_version, algorithm, value, iv: nil, aad: nil, tag: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Wraps a symmetric key using a specified key.

The WRAP operation supports encryption of a symmetric key using a key encryption key that has previously been stored in an Azure Key Vault. The WRAP operation is only strictly necessary for symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be performed using the public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that have a key-reference but do not have access to the public key material. This operation requires the keys/wrapKey permission.

myvault.vault.azure.net. Possible values include: ‘RSA-OAEP’, ‘RSA-OAEP-256’, ‘RSA1_5’, ‘A128GCM’, ‘A192GCM’, ‘A256GCM’, ‘A128KW’, ‘A192KW’, ‘A256KW’, ‘A128CBC’, ‘A192CBC’, ‘A256CBC’, ‘A128CBCPAD’, ‘A192CBCPAD’, ‘A256CBCPAD’ authenticated crypto algorithms. authenticated algorithm. will be added to the HTTP request.



5315
5316
5317
# File 'lib/7.2-preview/generated/azure_key_vault/key_vault_client.rb', line 5315

def wrap_key_with_http_info(vault_base_url, key_name, key_version, algorithm, value, iv:nil, aad:nil, tag:nil, custom_headers:nil)
  wrap_key_async(vault_base_url, key_name, key_version, algorithm, value, iv:iv, aad:aad, tag:tag, custom_headers:custom_headers).value!
end