azure_mgmt_key_vault 0.17.6 → 0.17.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-06-01/generated/azure_mgmt_key_vault/key_vault_management_client.rb +1 -1
  3. data/lib/2016-10-01/generated/azure_mgmt_key_vault/key_vault_management_client.rb +1 -1
  4. data/lib/2018-02-14-preview/generated/azure_mgmt_key_vault/key_vault_management_client.rb +1 -1
  5. data/lib/2018-02-14/generated/azure_mgmt_key_vault/key_vault_management_client.rb +1 -1
  6. data/lib/2019-09-01/generated/azure_mgmt_key_vault.rb +86 -0
  7. data/lib/2019-09-01/generated/azure_mgmt_key_vault/key_vault_management_client.rb +149 -0
  8. data/lib/2019-09-01/generated/azure_mgmt_key_vault/keys.rb +806 -0
  9. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/access_policy_entry.rb +86 -0
  10. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/access_policy_update_kind.rb +17 -0
  11. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/attributes.rb +111 -0
  12. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/certificate_permissions.rb +31 -0
  13. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/check_name_availability_result.rb +77 -0
  14. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/create_mode.rb +16 -0
  15. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/deleted_vault.rb +83 -0
  16. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/deleted_vault_list_result.rb +98 -0
  17. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/deleted_vault_properties.rb +103 -0
  18. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/deletion_recovery_level.rb +18 -0
  19. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/iprule.rb +49 -0
  20. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/json_web_key_curve_name.rb +18 -0
  21. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/json_web_key_operation.rb +21 -0
  22. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/json_web_key_type.rb +18 -0
  23. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/key.rb +184 -0
  24. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/key_attributes.rb +86 -0
  25. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/key_create_parameters.rb +67 -0
  26. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/key_list_result.rb +98 -0
  27. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/key_permissions.rb +31 -0
  28. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/key_properties.rb +131 -0
  29. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/log_specification.rb +68 -0
  30. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/network_rule_action.rb +16 -0
  31. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/network_rule_bypass_options.rb +16 -0
  32. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/network_rule_set.rb +103 -0
  33. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/operation.rb +83 -0
  34. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/operation_display.rb +79 -0
  35. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/operation_list_result.rb +100 -0
  36. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/permissions.rb +111 -0
  37. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/private_endpoint.rb +47 -0
  38. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/private_endpoint_connection.rb +127 -0
  39. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/private_endpoint_connection_item.rb +74 -0
  40. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/private_endpoint_connection_provisioning_state.rb +20 -0
  41. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/private_endpoint_service_connection_status.rb +18 -0
  42. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/private_link_resource.rb +140 -0
  43. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/private_link_resource_list_result.rb +55 -0
  44. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/private_link_service_connection_state.rb +73 -0
  45. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/reason.rb +16 -0
  46. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/resource.rb +113 -0
  47. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/resource_list_result.rb +98 -0
  48. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/secret_permissions.rb +23 -0
  49. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/service_specification.rb +55 -0
  50. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/sku.rb +62 -0
  51. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/sku_name.rb +16 -0
  52. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/storage_permissions.rb +29 -0
  53. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/vault.rb +115 -0
  54. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/vault_access_policy_parameters.rb +95 -0
  55. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/vault_access_policy_properties.rb +57 -0
  56. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/vault_check_name_availability_parameters.rb +60 -0
  57. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/vault_create_or_update_parameters.rb +80 -0
  58. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/vault_list_result.rb +98 -0
  59. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/vault_patch_parameters.rb +67 -0
  60. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/vault_patch_properties.rb +205 -0
  61. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/vault_properties.rb +248 -0
  62. data/lib/2019-09-01/generated/azure_mgmt_key_vault/models/virtual_network_rule.rb +48 -0
  63. data/lib/2019-09-01/generated/azure_mgmt_key_vault/module_definition.rb +9 -0
  64. data/lib/2019-09-01/generated/azure_mgmt_key_vault/operations.rb +220 -0
  65. data/lib/2019-09-01/generated/azure_mgmt_key_vault/private_endpoint_connections.rb +410 -0
  66. data/lib/2019-09-01/generated/azure_mgmt_key_vault/private_link_resources.rb +124 -0
  67. data/lib/2019-09-01/generated/azure_mgmt_key_vault/vaults.rb +1771 -0
  68. data/lib/azure_mgmt_key_vault.rb +4 -3
  69. data/lib/version.rb +1 -1
  70. metadata +65 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 31617948f447c80f75b9962217e8920e215d132d283eb0aaf83c920ede38e176
4
- data.tar.gz: d049e23c15ae3cd05240f4203239e76c0691d405cc2a5cd8b51662f2d2e18c3e
3
+ metadata.gz: 593637e170fe4a61bc7da75097c48a11bd519cfede35c46528ac7aad9650c467
4
+ data.tar.gz: c1bff019692bef64e9761ca88848eb887115236a962a809683240f6e774e5766
5
5
  SHA512:
6
- metadata.gz: 6335381594be54aaf047c40030711cbff2d2aa5a07f4ddb29cdae56530c86a244ac94d707405c3877b85faf5af88e34f1357d37e867e314334cf0f2012693d1b
7
- data.tar.gz: 90dcd21291fa7915bc9625104987fa24b0f0fa65ee79184a2cb572aa8513f07c5475279d4b137ac801944f93d73af306b655ef8dc312f5766ef19cfb102917da
6
+ metadata.gz: 04ef256065fbbf123681608e969db33cd6184ee7d0b6c6f95277a24a36e5df64dd876cbff0a205f5908137b3b6c61692a93efcd0cd9966e9b1ed1c2b28814331
7
+ data.tar.gz: 7972e20c41b70bef0c3cc1e3d3eb76d53066daa09229855e4817d2b9fc2c4ef4381ebe5bf61314bf1aa835eca069b81eb24dd22d879d668a679611fceb7696e7
@@ -126,7 +126,7 @@ module Azure::KeyVault::Mgmt::V2015_06_01
126
126
  #
127
127
  def add_telemetry
128
128
  sdk_information = 'azure_mgmt_key_vault'
129
- sdk_information = "#{sdk_information}/0.17.6"
129
+ sdk_information = "#{sdk_information}/0.17.7"
130
130
  add_user_agent_information(sdk_information)
131
131
  end
132
132
  end
@@ -130,7 +130,7 @@ module Azure::KeyVault::Mgmt::V2016_10_01
130
130
  #
131
131
  def add_telemetry
132
132
  sdk_information = 'azure_mgmt_key_vault'
133
- sdk_information = "#{sdk_information}/0.17.6"
133
+ sdk_information = "#{sdk_information}/0.17.7"
134
134
  add_user_agent_information(sdk_information)
135
135
  end
136
136
  end
@@ -134,7 +134,7 @@ module Azure::KeyVault::Mgmt::V2018_02_14_preview
134
134
  #
135
135
  def add_telemetry
136
136
  sdk_information = 'azure_mgmt_key_vault'
137
- sdk_information = "#{sdk_information}/0.17.6"
137
+ sdk_information = "#{sdk_information}/0.17.7"
138
138
  add_user_agent_information(sdk_information)
139
139
  end
140
140
  end
@@ -130,7 +130,7 @@ module Azure::KeyVault::Mgmt::V2018_02_14
130
130
  #
131
131
  def add_telemetry
132
132
  sdk_information = 'azure_mgmt_key_vault'
133
- sdk_information = "#{sdk_information}/0.17.6"
133
+ sdk_information = "#{sdk_information}/0.17.7"
134
134
  add_user_agent_information(sdk_information)
135
135
  end
136
136
  end
@@ -0,0 +1,86 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ require 'uri'
7
+ require 'cgi'
8
+ require 'date'
9
+ require 'json'
10
+ require 'base64'
11
+ require 'erb'
12
+ require 'securerandom'
13
+ require 'time'
14
+ require 'timeliness'
15
+ require 'faraday'
16
+ require 'faraday-cookie_jar'
17
+ require 'concurrent'
18
+ require 'ms_rest'
19
+ require '2019-09-01/generated/azure_mgmt_key_vault/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::KeyVault::Mgmt::V2019_09_01
23
+ autoload :Vaults, '2019-09-01/generated/azure_mgmt_key_vault/vaults.rb'
24
+ autoload :PrivateEndpointConnections, '2019-09-01/generated/azure_mgmt_key_vault/private_endpoint_connections.rb'
25
+ autoload :PrivateLinkResources, '2019-09-01/generated/azure_mgmt_key_vault/private_link_resources.rb'
26
+ autoload :Operations, '2019-09-01/generated/azure_mgmt_key_vault/operations.rb'
27
+ autoload :Keys, '2019-09-01/generated/azure_mgmt_key_vault/keys.rb'
28
+ autoload :KeyVaultManagementClient, '2019-09-01/generated/azure_mgmt_key_vault/key_vault_management_client.rb'
29
+
30
+ module Models
31
+ autoload :DeletedVault, '2019-09-01/generated/azure_mgmt_key_vault/models/deleted_vault.rb'
32
+ autoload :VaultListResult, '2019-09-01/generated/azure_mgmt_key_vault/models/vault_list_result.rb'
33
+ autoload :DeletedVaultListResult, '2019-09-01/generated/azure_mgmt_key_vault/models/deleted_vault_list_result.rb'
34
+ autoload :Permissions, '2019-09-01/generated/azure_mgmt_key_vault/models/permissions.rb'
35
+ autoload :Resource, '2019-09-01/generated/azure_mgmt_key_vault/models/resource.rb'
36
+ autoload :IPRule, '2019-09-01/generated/azure_mgmt_key_vault/models/iprule.rb'
37
+ autoload :ResourceListResult, '2019-09-01/generated/azure_mgmt_key_vault/models/resource_list_result.rb'
38
+ autoload :NetworkRuleSet, '2019-09-01/generated/azure_mgmt_key_vault/models/network_rule_set.rb'
39
+ autoload :VaultCheckNameAvailabilityParameters, '2019-09-01/generated/azure_mgmt_key_vault/models/vault_check_name_availability_parameters.rb'
40
+ autoload :PrivateLinkServiceConnectionState, '2019-09-01/generated/azure_mgmt_key_vault/models/private_link_service_connection_state.rb'
41
+ autoload :CheckNameAvailabilityResult, '2019-09-01/generated/azure_mgmt_key_vault/models/check_name_availability_result.rb'
42
+ autoload :VaultProperties, '2019-09-01/generated/azure_mgmt_key_vault/models/vault_properties.rb'
43
+ autoload :PrivateEndpointConnectionItem, '2019-09-01/generated/azure_mgmt_key_vault/models/private_endpoint_connection_item.rb'
44
+ autoload :VaultAccessPolicyProperties, '2019-09-01/generated/azure_mgmt_key_vault/models/vault_access_policy_properties.rb'
45
+ autoload :VaultPatchProperties, '2019-09-01/generated/azure_mgmt_key_vault/models/vault_patch_properties.rb'
46
+ autoload :VaultCreateOrUpdateParameters, '2019-09-01/generated/azure_mgmt_key_vault/models/vault_create_or_update_parameters.rb'
47
+ autoload :KeyListResult, '2019-09-01/generated/azure_mgmt_key_vault/models/key_list_result.rb'
48
+ autoload :VaultAccessPolicyParameters, '2019-09-01/generated/azure_mgmt_key_vault/models/vault_access_policy_parameters.rb'
49
+ autoload :KeyCreateParameters, '2019-09-01/generated/azure_mgmt_key_vault/models/key_create_parameters.rb'
50
+ autoload :PrivateLinkResourceListResult, '2019-09-01/generated/azure_mgmt_key_vault/models/private_link_resource_list_result.rb'
51
+ autoload :AccessPolicyEntry, '2019-09-01/generated/azure_mgmt_key_vault/models/access_policy_entry.rb'
52
+ autoload :OperationDisplay, '2019-09-01/generated/azure_mgmt_key_vault/models/operation_display.rb'
53
+ autoload :PrivateEndpoint, '2019-09-01/generated/azure_mgmt_key_vault/models/private_endpoint.rb'
54
+ autoload :LogSpecification, '2019-09-01/generated/azure_mgmt_key_vault/models/log_specification.rb'
55
+ autoload :VaultPatchParameters, '2019-09-01/generated/azure_mgmt_key_vault/models/vault_patch_parameters.rb'
56
+ autoload :ServiceSpecification, '2019-09-01/generated/azure_mgmt_key_vault/models/service_specification.rb'
57
+ autoload :Sku, '2019-09-01/generated/azure_mgmt_key_vault/models/sku.rb'
58
+ autoload :Operation, '2019-09-01/generated/azure_mgmt_key_vault/models/operation.rb'
59
+ autoload :DeletedVaultProperties, '2019-09-01/generated/azure_mgmt_key_vault/models/deleted_vault_properties.rb'
60
+ autoload :OperationListResult, '2019-09-01/generated/azure_mgmt_key_vault/models/operation_list_result.rb'
61
+ autoload :VirtualNetworkRule, '2019-09-01/generated/azure_mgmt_key_vault/models/virtual_network_rule.rb'
62
+ autoload :Attributes, '2019-09-01/generated/azure_mgmt_key_vault/models/attributes.rb'
63
+ autoload :Vault, '2019-09-01/generated/azure_mgmt_key_vault/models/vault.rb'
64
+ autoload :KeyProperties, '2019-09-01/generated/azure_mgmt_key_vault/models/key_properties.rb'
65
+ autoload :PrivateEndpointConnection, '2019-09-01/generated/azure_mgmt_key_vault/models/private_endpoint_connection.rb'
66
+ autoload :PrivateLinkResource, '2019-09-01/generated/azure_mgmt_key_vault/models/private_link_resource.rb'
67
+ autoload :KeyAttributes, '2019-09-01/generated/azure_mgmt_key_vault/models/key_attributes.rb'
68
+ autoload :Key, '2019-09-01/generated/azure_mgmt_key_vault/models/key.rb'
69
+ autoload :SkuName, '2019-09-01/generated/azure_mgmt_key_vault/models/sku_name.rb'
70
+ autoload :KeyPermissions, '2019-09-01/generated/azure_mgmt_key_vault/models/key_permissions.rb'
71
+ autoload :SecretPermissions, '2019-09-01/generated/azure_mgmt_key_vault/models/secret_permissions.rb'
72
+ autoload :CertificatePermissions, '2019-09-01/generated/azure_mgmt_key_vault/models/certificate_permissions.rb'
73
+ autoload :StoragePermissions, '2019-09-01/generated/azure_mgmt_key_vault/models/storage_permissions.rb'
74
+ autoload :CreateMode, '2019-09-01/generated/azure_mgmt_key_vault/models/create_mode.rb'
75
+ autoload :NetworkRuleBypassOptions, '2019-09-01/generated/azure_mgmt_key_vault/models/network_rule_bypass_options.rb'
76
+ autoload :NetworkRuleAction, '2019-09-01/generated/azure_mgmt_key_vault/models/network_rule_action.rb'
77
+ autoload :PrivateEndpointServiceConnectionStatus, '2019-09-01/generated/azure_mgmt_key_vault/models/private_endpoint_service_connection_status.rb'
78
+ autoload :PrivateEndpointConnectionProvisioningState, '2019-09-01/generated/azure_mgmt_key_vault/models/private_endpoint_connection_provisioning_state.rb'
79
+ autoload :Reason, '2019-09-01/generated/azure_mgmt_key_vault/models/reason.rb'
80
+ autoload :DeletionRecoveryLevel, '2019-09-01/generated/azure_mgmt_key_vault/models/deletion_recovery_level.rb'
81
+ autoload :JsonWebKeyType, '2019-09-01/generated/azure_mgmt_key_vault/models/json_web_key_type.rb'
82
+ autoload :JsonWebKeyOperation, '2019-09-01/generated/azure_mgmt_key_vault/models/json_web_key_operation.rb'
83
+ autoload :JsonWebKeyCurveName, '2019-09-01/generated/azure_mgmt_key_vault/models/json_web_key_curve_name.rb'
84
+ autoload :AccessPolicyUpdateKind, '2019-09-01/generated/azure_mgmt_key_vault/models/access_policy_update_kind.rb'
85
+ end
86
+ end
@@ -0,0 +1,149 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::KeyVault::Mgmt::V2019_09_01
7
+ #
8
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class KeyVaultManagementClient < MsRestAzure::AzureServiceClient
11
+ include MsRestAzure
12
+ include MsRestAzure::Serialization
13
+
14
+ # @return [String] the base URI of the service.
15
+ attr_accessor :base_url
16
+
17
+ # @return Credentials needed for the client to connect to Azure.
18
+ attr_reader :credentials
19
+
20
+ # @return [String] Subscription credentials which uniquely identify
21
+ # Microsoft Azure subscription. The subscription ID forms part of the URI
22
+ # for every service call.
23
+ attr_accessor :subscription_id
24
+
25
+ # @return [String] Client Api Version.
26
+ attr_reader :api_version
27
+
28
+ # @return [String] The preferred language for the response.
29
+ attr_accessor :accept_language
30
+
31
+ # @return [Integer] The retry timeout in seconds for Long Running
32
+ # Operations. Default value is 30.
33
+ attr_accessor :long_running_operation_retry_timeout
34
+
35
+ # @return [Boolean] Whether a unique x-ms-client-request-id should be
36
+ # generated. When set to true a unique x-ms-client-request-id value is
37
+ # generated and included in each request. Default is true.
38
+ attr_accessor :generate_client_request_id
39
+
40
+ # @return [Vaults] vaults
41
+ attr_reader :vaults
42
+
43
+ # @return [PrivateEndpointConnections] private_endpoint_connections
44
+ attr_reader :private_endpoint_connections
45
+
46
+ # @return [PrivateLinkResources] private_link_resources
47
+ attr_reader :private_link_resources
48
+
49
+ # @return [Operations] operations
50
+ attr_reader :operations
51
+
52
+ # @return [Keys] keys
53
+ attr_reader :keys
54
+
55
+ #
56
+ # Creates initializes a new instance of the KeyVaultManagementClient class.
57
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
58
+ # @param base_url [String] the base URI of the service.
59
+ # @param options [Array] filters to be applied to the HTTP requests.
60
+ #
61
+ def initialize(credentials = nil, base_url = nil, options = nil)
62
+ super(credentials, options)
63
+ @base_url = base_url || 'https://management.azure.com'
64
+
65
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
66
+ @credentials = credentials
67
+
68
+ @vaults = Vaults.new(self)
69
+ @private_endpoint_connections = PrivateEndpointConnections.new(self)
70
+ @private_link_resources = PrivateLinkResources.new(self)
71
+ @operations = Operations.new(self)
72
+ @keys = Keys.new(self)
73
+ @api_version = '2019-09-01'
74
+ @accept_language = 'en-US'
75
+ @long_running_operation_retry_timeout = 30
76
+ @generate_client_request_id = true
77
+ add_telemetry
78
+ end
79
+
80
+ #
81
+ # Makes a request and returns the body of the response.
82
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
83
+ # @param path [String] the path, relative to {base_url}.
84
+ # @param options [Hash{String=>String}] specifying any request options like :body.
85
+ # @return [Hash{String=>String}] containing the body of the response.
86
+ # Example:
87
+ #
88
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
89
+ # path = "/path"
90
+ # options = {
91
+ # body: request_content,
92
+ # query_params: {'api-version' => '2016-02-01'}
93
+ # }
94
+ # result = @client.make_request(:put, path, options)
95
+ #
96
+ def make_request(method, path, options = {})
97
+ result = make_request_with_http_info(method, path, options)
98
+ result.body unless result.nil?
99
+ end
100
+
101
+ #
102
+ # Makes a request and returns the operation response.
103
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
104
+ # @param path [String] the path, relative to {base_url}.
105
+ # @param options [Hash{String=>String}] specifying any request options like :body.
106
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
107
+ #
108
+ def make_request_with_http_info(method, path, options = {})
109
+ result = make_request_async(method, path, options).value!
110
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
111
+ result
112
+ end
113
+
114
+ #
115
+ # Makes a request asynchronously.
116
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
117
+ # @param path [String] the path, relative to {base_url}.
118
+ # @param options [Hash{String=>String}] specifying any request options like :body.
119
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
120
+ #
121
+ def make_request_async(method, path, options = {})
122
+ fail ArgumentError, 'method is nil' if method.nil?
123
+ fail ArgumentError, 'path is nil' if path.nil?
124
+
125
+ request_url = options[:base_url] || @base_url
126
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
127
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
128
+ end
129
+
130
+ request_headers = @request_headers
131
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
132
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
133
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
134
+
135
+ super(request_url, method, path, options)
136
+ end
137
+
138
+
139
+ private
140
+ #
141
+ # Adds telemetry information.
142
+ #
143
+ def add_telemetry
144
+ sdk_information = 'azure_mgmt_key_vault'
145
+ sdk_information = "#{sdk_information}/0.17.7"
146
+ add_user_agent_information(sdk_information)
147
+ end
148
+ end
149
+ end
@@ -0,0 +1,806 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::KeyVault::Mgmt::V2019_09_01
7
+ #
8
+ # The Azure management API provides a RESTful set of web services that
9
+ # interact with Azure Key Vault.
10
+ #
11
+ class Keys
12
+ include MsRestAzure
13
+
14
+ #
15
+ # Creates and initializes a new instance of the Keys class.
16
+ # @param client service class for accessing basic functionality.
17
+ #
18
+ def initialize(client)
19
+ @client = client
20
+ end
21
+
22
+ # @return [KeyVaultManagementClient] reference to the KeyVaultManagementClient
23
+ attr_reader :client
24
+
25
+ #
26
+ # Creates the first version of a new key if it does not exist. If it already
27
+ # exists, then the existing key is returned without any write operations being
28
+ # performed. This API does not create subsequent versions, and does not update
29
+ # existing keys.
30
+ #
31
+ # @param resource_group_name [String] The name of the resource group which
32
+ # contains the specified key vault.
33
+ # @param vault_name [String] The name of the key vault which contains the key
34
+ # to be created.
35
+ # @param key_name [String] The name of the key to be created.
36
+ # @param parameters [KeyCreateParameters] The parameters used to create the
37
+ # specified key.
38
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
39
+ # will be added to the HTTP request.
40
+ #
41
+ # @return [Key] operation results.
42
+ #
43
+ def create_if_not_exist(resource_group_name, vault_name, key_name, parameters, custom_headers:nil)
44
+ response = create_if_not_exist_async(resource_group_name, vault_name, key_name, parameters, custom_headers:custom_headers).value!
45
+ response.body unless response.nil?
46
+ end
47
+
48
+ #
49
+ # Creates the first version of a new key if it does not exist. If it already
50
+ # exists, then the existing key is returned without any write operations being
51
+ # performed. This API does not create subsequent versions, and does not update
52
+ # existing keys.
53
+ #
54
+ # @param resource_group_name [String] The name of the resource group which
55
+ # contains the specified key vault.
56
+ # @param vault_name [String] The name of the key vault which contains the key
57
+ # to be created.
58
+ # @param key_name [String] The name of the key to be created.
59
+ # @param parameters [KeyCreateParameters] The parameters used to create the
60
+ # specified key.
61
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
62
+ # will be added to the HTTP request.
63
+ #
64
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
65
+ #
66
+ def create_if_not_exist_with_http_info(resource_group_name, vault_name, key_name, parameters, custom_headers:nil)
67
+ create_if_not_exist_async(resource_group_name, vault_name, key_name, parameters, custom_headers:custom_headers).value!
68
+ end
69
+
70
+ #
71
+ # Creates the first version of a new key if it does not exist. If it already
72
+ # exists, then the existing key is returned without any write operations being
73
+ # performed. This API does not create subsequent versions, and does not update
74
+ # existing keys.
75
+ #
76
+ # @param resource_group_name [String] The name of the resource group which
77
+ # contains the specified key vault.
78
+ # @param vault_name [String] The name of the key vault which contains the key
79
+ # to be created.
80
+ # @param key_name [String] The name of the key to be created.
81
+ # @param parameters [KeyCreateParameters] The parameters used to create the
82
+ # specified key.
83
+ # @param [Hash{String => String}] A hash of custom headers that will be added
84
+ # to the HTTP request.
85
+ #
86
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
87
+ #
88
+ def create_if_not_exist_async(resource_group_name, vault_name, key_name, parameters, custom_headers:nil)
89
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
90
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
91
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
92
+ fail ArgumentError, "'vault_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]{3,24}$'" if !vault_name.nil? && vault_name.match(Regexp.new('^^[a-zA-Z0-9-]{3,24}$$')).nil?
93
+ fail ArgumentError, 'key_name is nil' if key_name.nil?
94
+ fail ArgumentError, "'key_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]{1,127}$'" if !key_name.nil? && key_name.match(Regexp.new('^^[a-zA-Z0-9-]{1,127}$$')).nil?
95
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
96
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
97
+
98
+
99
+ request_headers = {}
100
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
101
+
102
+ # Set Headers
103
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
104
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
105
+
106
+ # Serialize Request
107
+ request_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::KeyCreateParameters.mapper()
108
+ request_content = @client.serialize(request_mapper, parameters)
109
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
110
+
111
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/keys/{keyName}'
112
+
113
+ request_url = @base_url || @client.base_url
114
+
115
+ options = {
116
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
117
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'vaultName' => vault_name,'keyName' => key_name},
118
+ query_params: {'api-version' => @client.api_version},
119
+ body: request_content,
120
+ headers: request_headers.merge(custom_headers || {}),
121
+ base_url: request_url
122
+ }
123
+ promise = @client.make_request_async(:put, path_template, options)
124
+
125
+ promise = promise.then do |result|
126
+ http_response = result.response
127
+ status_code = http_response.status
128
+ response_content = http_response.body
129
+ unless status_code == 200
130
+ error_model = JSON.load(response_content)
131
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
132
+ end
133
+
134
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
135
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
136
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
137
+ # Deserialize Response
138
+ if status_code == 200
139
+ begin
140
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
141
+ result_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::Key.mapper()
142
+ result.body = @client.deserialize(result_mapper, parsed_response)
143
+ rescue Exception => e
144
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
145
+ end
146
+ end
147
+
148
+ result
149
+ end
150
+
151
+ promise.execute
152
+ end
153
+
154
+ #
155
+ # Gets the current version of the specified key from the specified key vault.
156
+ #
157
+ # @param resource_group_name [String] The name of the resource group which
158
+ # contains the specified key vault.
159
+ # @param vault_name [String] The name of the vault which contains the key to be
160
+ # retrieved.
161
+ # @param key_name [String] The name of the key to be retrieved.
162
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
163
+ # will be added to the HTTP request.
164
+ #
165
+ # @return [Key] operation results.
166
+ #
167
+ def get(resource_group_name, vault_name, key_name, custom_headers:nil)
168
+ response = get_async(resource_group_name, vault_name, key_name, custom_headers:custom_headers).value!
169
+ response.body unless response.nil?
170
+ end
171
+
172
+ #
173
+ # Gets the current version of the specified key from the specified key vault.
174
+ #
175
+ # @param resource_group_name [String] The name of the resource group which
176
+ # contains the specified key vault.
177
+ # @param vault_name [String] The name of the vault which contains the key to be
178
+ # retrieved.
179
+ # @param key_name [String] The name of the key to be retrieved.
180
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
181
+ # will be added to the HTTP request.
182
+ #
183
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
184
+ #
185
+ def get_with_http_info(resource_group_name, vault_name, key_name, custom_headers:nil)
186
+ get_async(resource_group_name, vault_name, key_name, custom_headers:custom_headers).value!
187
+ end
188
+
189
+ #
190
+ # Gets the current version of the specified key from the specified key vault.
191
+ #
192
+ # @param resource_group_name [String] The name of the resource group which
193
+ # contains the specified key vault.
194
+ # @param vault_name [String] The name of the vault which contains the key to be
195
+ # retrieved.
196
+ # @param key_name [String] The name of the key to be retrieved.
197
+ # @param [Hash{String => String}] A hash of custom headers that will be added
198
+ # to the HTTP request.
199
+ #
200
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
201
+ #
202
+ def get_async(resource_group_name, vault_name, key_name, custom_headers:nil)
203
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
204
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
205
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
206
+ fail ArgumentError, "'vault_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]{3,24}$'" if !vault_name.nil? && vault_name.match(Regexp.new('^^[a-zA-Z0-9-]{3,24}$$')).nil?
207
+ fail ArgumentError, 'key_name is nil' if key_name.nil?
208
+ fail ArgumentError, "'key_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]{1,127}$'" if !key_name.nil? && key_name.match(Regexp.new('^^[a-zA-Z0-9-]{1,127}$$')).nil?
209
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
210
+
211
+
212
+ request_headers = {}
213
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
214
+
215
+ # Set Headers
216
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
217
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
218
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/keys/{keyName}'
219
+
220
+ request_url = @base_url || @client.base_url
221
+
222
+ options = {
223
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
224
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'vaultName' => vault_name,'keyName' => key_name},
225
+ query_params: {'api-version' => @client.api_version},
226
+ headers: request_headers.merge(custom_headers || {}),
227
+ base_url: request_url
228
+ }
229
+ promise = @client.make_request_async(:get, path_template, options)
230
+
231
+ promise = promise.then do |result|
232
+ http_response = result.response
233
+ status_code = http_response.status
234
+ response_content = http_response.body
235
+ unless status_code == 200
236
+ error_model = JSON.load(response_content)
237
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
238
+ end
239
+
240
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
241
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
242
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
243
+ # Deserialize Response
244
+ if status_code == 200
245
+ begin
246
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
247
+ result_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::Key.mapper()
248
+ result.body = @client.deserialize(result_mapper, parsed_response)
249
+ rescue Exception => e
250
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
251
+ end
252
+ end
253
+
254
+ result
255
+ end
256
+
257
+ promise.execute
258
+ end
259
+
260
+ #
261
+ # Lists the keys in the specified key vault.
262
+ #
263
+ # @param resource_group_name [String] The name of the resource group which
264
+ # contains the specified key vault.
265
+ # @param vault_name [String] The name of the vault which contains the keys to
266
+ # be retrieved.
267
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
268
+ # will be added to the HTTP request.
269
+ #
270
+ # @return [Array<Key>] operation results.
271
+ #
272
+ def list(resource_group_name, vault_name, custom_headers:nil)
273
+ first_page = list_as_lazy(resource_group_name, vault_name, custom_headers:custom_headers)
274
+ first_page.get_all_items
275
+ end
276
+
277
+ #
278
+ # Lists the keys in the specified key vault.
279
+ #
280
+ # @param resource_group_name [String] The name of the resource group which
281
+ # contains the specified key vault.
282
+ # @param vault_name [String] The name of the vault which contains the keys to
283
+ # be retrieved.
284
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
285
+ # will be added to the HTTP request.
286
+ #
287
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
288
+ #
289
+ def list_with_http_info(resource_group_name, vault_name, custom_headers:nil)
290
+ list_async(resource_group_name, vault_name, custom_headers:custom_headers).value!
291
+ end
292
+
293
+ #
294
+ # Lists the keys in the specified key vault.
295
+ #
296
+ # @param resource_group_name [String] The name of the resource group which
297
+ # contains the specified key vault.
298
+ # @param vault_name [String] The name of the vault which contains the keys to
299
+ # be retrieved.
300
+ # @param [Hash{String => String}] A hash of custom headers that will be added
301
+ # to the HTTP request.
302
+ #
303
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
304
+ #
305
+ def list_async(resource_group_name, vault_name, custom_headers:nil)
306
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
307
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
308
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
309
+ fail ArgumentError, "'vault_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]{3,24}$'" if !vault_name.nil? && vault_name.match(Regexp.new('^^[a-zA-Z0-9-]{3,24}$$')).nil?
310
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
311
+
312
+
313
+ request_headers = {}
314
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
315
+
316
+ # Set Headers
317
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
318
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
319
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/keys'
320
+
321
+ request_url = @base_url || @client.base_url
322
+
323
+ options = {
324
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
325
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'vaultName' => vault_name},
326
+ query_params: {'api-version' => @client.api_version},
327
+ headers: request_headers.merge(custom_headers || {}),
328
+ base_url: request_url
329
+ }
330
+ promise = @client.make_request_async(:get, path_template, options)
331
+
332
+ promise = promise.then do |result|
333
+ http_response = result.response
334
+ status_code = http_response.status
335
+ response_content = http_response.body
336
+ unless status_code == 200
337
+ error_model = JSON.load(response_content)
338
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
339
+ end
340
+
341
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
342
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
343
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
344
+ # Deserialize Response
345
+ if status_code == 200
346
+ begin
347
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
348
+ result_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::KeyListResult.mapper()
349
+ result.body = @client.deserialize(result_mapper, parsed_response)
350
+ rescue Exception => e
351
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
352
+ end
353
+ end
354
+
355
+ result
356
+ end
357
+
358
+ promise.execute
359
+ end
360
+
361
+ #
362
+ # Gets the specified version of the specified key in the specified key vault.
363
+ #
364
+ # @param resource_group_name [String] The name of the resource group which
365
+ # contains the specified key vault.
366
+ # @param vault_name [String] The name of the vault which contains the key
367
+ # version to be retrieved.
368
+ # @param key_name [String] The name of the key version to be retrieved.
369
+ # @param key_version [String] The version of the key to be retrieved.
370
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
371
+ # will be added to the HTTP request.
372
+ #
373
+ # @return [Key] operation results.
374
+ #
375
+ def get_version(resource_group_name, vault_name, key_name, key_version, custom_headers:nil)
376
+ response = get_version_async(resource_group_name, vault_name, key_name, key_version, custom_headers:custom_headers).value!
377
+ response.body unless response.nil?
378
+ end
379
+
380
+ #
381
+ # Gets the specified version of the specified key in the specified key vault.
382
+ #
383
+ # @param resource_group_name [String] The name of the resource group which
384
+ # contains the specified key vault.
385
+ # @param vault_name [String] The name of the vault which contains the key
386
+ # version to be retrieved.
387
+ # @param key_name [String] The name of the key version to be retrieved.
388
+ # @param key_version [String] The version of the key to be retrieved.
389
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
390
+ # will be added to the HTTP request.
391
+ #
392
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
393
+ #
394
+ def get_version_with_http_info(resource_group_name, vault_name, key_name, key_version, custom_headers:nil)
395
+ get_version_async(resource_group_name, vault_name, key_name, key_version, custom_headers:custom_headers).value!
396
+ end
397
+
398
+ #
399
+ # Gets the specified version of the specified key in the specified key vault.
400
+ #
401
+ # @param resource_group_name [String] The name of the resource group which
402
+ # contains the specified key vault.
403
+ # @param vault_name [String] The name of the vault which contains the key
404
+ # version to be retrieved.
405
+ # @param key_name [String] The name of the key version to be retrieved.
406
+ # @param key_version [String] The version of the key to be retrieved.
407
+ # @param [Hash{String => String}] A hash of custom headers that will be added
408
+ # to the HTTP request.
409
+ #
410
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
411
+ #
412
+ def get_version_async(resource_group_name, vault_name, key_name, key_version, custom_headers:nil)
413
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
414
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
415
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
416
+ fail ArgumentError, "'vault_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]{3,24}$'" if !vault_name.nil? && vault_name.match(Regexp.new('^^[a-zA-Z0-9-]{3,24}$$')).nil?
417
+ fail ArgumentError, 'key_name is nil' if key_name.nil?
418
+ fail ArgumentError, "'key_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]{1,127}$'" if !key_name.nil? && key_name.match(Regexp.new('^^[a-zA-Z0-9-]{1,127}$$')).nil?
419
+ fail ArgumentError, 'key_version is nil' if key_version.nil?
420
+ fail ArgumentError, "'key_version' should satisfy the constraint - 'Pattern': '^[a-fA-F0-9]{32}$'" if !key_version.nil? && key_version.match(Regexp.new('^^[a-fA-F0-9]{32}$$')).nil?
421
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
422
+
423
+
424
+ request_headers = {}
425
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
426
+
427
+ # Set Headers
428
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
429
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
430
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/keys/{keyName}/versions/{keyVersion}'
431
+
432
+ request_url = @base_url || @client.base_url
433
+
434
+ options = {
435
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
436
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'vaultName' => vault_name,'keyName' => key_name,'keyVersion' => key_version},
437
+ query_params: {'api-version' => @client.api_version},
438
+ headers: request_headers.merge(custom_headers || {}),
439
+ base_url: request_url
440
+ }
441
+ promise = @client.make_request_async(:get, path_template, options)
442
+
443
+ promise = promise.then do |result|
444
+ http_response = result.response
445
+ status_code = http_response.status
446
+ response_content = http_response.body
447
+ unless status_code == 200
448
+ error_model = JSON.load(response_content)
449
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
450
+ end
451
+
452
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
453
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
454
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
455
+ # Deserialize Response
456
+ if status_code == 200
457
+ begin
458
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
459
+ result_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::Key.mapper()
460
+ result.body = @client.deserialize(result_mapper, parsed_response)
461
+ rescue Exception => e
462
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
463
+ end
464
+ end
465
+
466
+ result
467
+ end
468
+
469
+ promise.execute
470
+ end
471
+
472
+ #
473
+ # Lists the versions of the specified key in the specified key vault.
474
+ #
475
+ # @param resource_group_name [String] The name of the resource group which
476
+ # contains the specified key vault.
477
+ # @param vault_name [String] The name of the vault which contains the key
478
+ # versions to be retrieved.
479
+ # @param key_name [String] The name of the key versions to be retrieved.
480
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
481
+ # will be added to the HTTP request.
482
+ #
483
+ # @return [Array<Key>] operation results.
484
+ #
485
+ def list_versions(resource_group_name, vault_name, key_name, custom_headers:nil)
486
+ first_page = list_versions_as_lazy(resource_group_name, vault_name, key_name, custom_headers:custom_headers)
487
+ first_page.get_all_items
488
+ end
489
+
490
+ #
491
+ # Lists the versions of the specified key in the specified key vault.
492
+ #
493
+ # @param resource_group_name [String] The name of the resource group which
494
+ # contains the specified key vault.
495
+ # @param vault_name [String] The name of the vault which contains the key
496
+ # versions to be retrieved.
497
+ # @param key_name [String] The name of the key versions to be retrieved.
498
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
499
+ # will be added to the HTTP request.
500
+ #
501
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
502
+ #
503
+ def list_versions_with_http_info(resource_group_name, vault_name, key_name, custom_headers:nil)
504
+ list_versions_async(resource_group_name, vault_name, key_name, custom_headers:custom_headers).value!
505
+ end
506
+
507
+ #
508
+ # Lists the versions of the specified key in the specified key vault.
509
+ #
510
+ # @param resource_group_name [String] The name of the resource group which
511
+ # contains the specified key vault.
512
+ # @param vault_name [String] The name of the vault which contains the key
513
+ # versions to be retrieved.
514
+ # @param key_name [String] The name of the key versions to be retrieved.
515
+ # @param [Hash{String => String}] A hash of custom headers that will be added
516
+ # to the HTTP request.
517
+ #
518
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
519
+ #
520
+ def list_versions_async(resource_group_name, vault_name, key_name, custom_headers:nil)
521
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
522
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
523
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
524
+ fail ArgumentError, "'vault_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]{3,24}$'" if !vault_name.nil? && vault_name.match(Regexp.new('^^[a-zA-Z0-9-]{3,24}$$')).nil?
525
+ fail ArgumentError, 'key_name is nil' if key_name.nil?
526
+ fail ArgumentError, "'key_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9-]{1,127}$'" if !key_name.nil? && key_name.match(Regexp.new('^^[a-zA-Z0-9-]{1,127}$$')).nil?
527
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
528
+
529
+
530
+ request_headers = {}
531
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
532
+
533
+ # Set Headers
534
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
535
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
536
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/keys/{keyName}/versions'
537
+
538
+ request_url = @base_url || @client.base_url
539
+
540
+ options = {
541
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
542
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'vaultName' => vault_name,'keyName' => key_name},
543
+ query_params: {'api-version' => @client.api_version},
544
+ headers: request_headers.merge(custom_headers || {}),
545
+ base_url: request_url
546
+ }
547
+ promise = @client.make_request_async(:get, path_template, options)
548
+
549
+ promise = promise.then do |result|
550
+ http_response = result.response
551
+ status_code = http_response.status
552
+ response_content = http_response.body
553
+ unless status_code == 200
554
+ error_model = JSON.load(response_content)
555
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
556
+ end
557
+
558
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
559
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
560
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
561
+ # Deserialize Response
562
+ if status_code == 200
563
+ begin
564
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
565
+ result_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::KeyListResult.mapper()
566
+ result.body = @client.deserialize(result_mapper, parsed_response)
567
+ rescue Exception => e
568
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
569
+ end
570
+ end
571
+
572
+ result
573
+ end
574
+
575
+ promise.execute
576
+ end
577
+
578
+ #
579
+ # Lists the keys in the specified key vault.
580
+ #
581
+ # @param next_page_link [String] The NextLink from the previous successful call
582
+ # to List operation.
583
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
584
+ # will be added to the HTTP request.
585
+ #
586
+ # @return [KeyListResult] operation results.
587
+ #
588
+ def list_next(next_page_link, custom_headers:nil)
589
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
590
+ response.body unless response.nil?
591
+ end
592
+
593
+ #
594
+ # Lists the keys in the specified key vault.
595
+ #
596
+ # @param next_page_link [String] The NextLink from the previous successful call
597
+ # to List operation.
598
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
599
+ # will be added to the HTTP request.
600
+ #
601
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
602
+ #
603
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
604
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
605
+ end
606
+
607
+ #
608
+ # Lists the keys in the specified key vault.
609
+ #
610
+ # @param next_page_link [String] The NextLink from the previous successful call
611
+ # to List operation.
612
+ # @param [Hash{String => String}] A hash of custom headers that will be added
613
+ # to the HTTP request.
614
+ #
615
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
616
+ #
617
+ def list_next_async(next_page_link, custom_headers:nil)
618
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
619
+
620
+
621
+ request_headers = {}
622
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
623
+
624
+ # Set Headers
625
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
626
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
627
+ path_template = '{nextLink}'
628
+
629
+ request_url = @base_url || @client.base_url
630
+
631
+ options = {
632
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
633
+ skip_encoding_path_params: {'nextLink' => next_page_link},
634
+ headers: request_headers.merge(custom_headers || {}),
635
+ base_url: request_url
636
+ }
637
+ promise = @client.make_request_async(:get, path_template, options)
638
+
639
+ promise = promise.then do |result|
640
+ http_response = result.response
641
+ status_code = http_response.status
642
+ response_content = http_response.body
643
+ unless status_code == 200
644
+ error_model = JSON.load(response_content)
645
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
646
+ end
647
+
648
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
649
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
650
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
651
+ # Deserialize Response
652
+ if status_code == 200
653
+ begin
654
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
655
+ result_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::KeyListResult.mapper()
656
+ result.body = @client.deserialize(result_mapper, parsed_response)
657
+ rescue Exception => e
658
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
659
+ end
660
+ end
661
+
662
+ result
663
+ end
664
+
665
+ promise.execute
666
+ end
667
+
668
+ #
669
+ # Lists the versions of the specified key in the specified key vault.
670
+ #
671
+ # @param next_page_link [String] The NextLink from the previous successful call
672
+ # to List operation.
673
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
674
+ # will be added to the HTTP request.
675
+ #
676
+ # @return [KeyListResult] operation results.
677
+ #
678
+ def list_versions_next(next_page_link, custom_headers:nil)
679
+ response = list_versions_next_async(next_page_link, custom_headers:custom_headers).value!
680
+ response.body unless response.nil?
681
+ end
682
+
683
+ #
684
+ # Lists the versions of the specified key in the specified key vault.
685
+ #
686
+ # @param next_page_link [String] The NextLink from the previous successful call
687
+ # to List operation.
688
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
689
+ # will be added to the HTTP request.
690
+ #
691
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
692
+ #
693
+ def list_versions_next_with_http_info(next_page_link, custom_headers:nil)
694
+ list_versions_next_async(next_page_link, custom_headers:custom_headers).value!
695
+ end
696
+
697
+ #
698
+ # Lists the versions of the specified key in the specified key vault.
699
+ #
700
+ # @param next_page_link [String] The NextLink from the previous successful call
701
+ # to List operation.
702
+ # @param [Hash{String => String}] A hash of custom headers that will be added
703
+ # to the HTTP request.
704
+ #
705
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
706
+ #
707
+ def list_versions_next_async(next_page_link, custom_headers:nil)
708
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
709
+
710
+
711
+ request_headers = {}
712
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
713
+
714
+ # Set Headers
715
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
716
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
717
+ path_template = '{nextLink}'
718
+
719
+ request_url = @base_url || @client.base_url
720
+
721
+ options = {
722
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
723
+ skip_encoding_path_params: {'nextLink' => next_page_link},
724
+ headers: request_headers.merge(custom_headers || {}),
725
+ base_url: request_url
726
+ }
727
+ promise = @client.make_request_async(:get, path_template, options)
728
+
729
+ promise = promise.then do |result|
730
+ http_response = result.response
731
+ status_code = http_response.status
732
+ response_content = http_response.body
733
+ unless status_code == 200
734
+ error_model = JSON.load(response_content)
735
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
736
+ end
737
+
738
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
739
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
740
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
741
+ # Deserialize Response
742
+ if status_code == 200
743
+ begin
744
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
745
+ result_mapper = Azure::KeyVault::Mgmt::V2019_09_01::Models::KeyListResult.mapper()
746
+ result.body = @client.deserialize(result_mapper, parsed_response)
747
+ rescue Exception => e
748
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
749
+ end
750
+ end
751
+
752
+ result
753
+ end
754
+
755
+ promise.execute
756
+ end
757
+
758
+ #
759
+ # Lists the keys in the specified key vault.
760
+ #
761
+ # @param resource_group_name [String] The name of the resource group which
762
+ # contains the specified key vault.
763
+ # @param vault_name [String] The name of the vault which contains the keys to
764
+ # be retrieved.
765
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
766
+ # will be added to the HTTP request.
767
+ #
768
+ # @return [KeyListResult] which provide lazy access to pages of the response.
769
+ #
770
+ def list_as_lazy(resource_group_name, vault_name, custom_headers:nil)
771
+ response = list_async(resource_group_name, vault_name, custom_headers:custom_headers).value!
772
+ unless response.nil?
773
+ page = response.body
774
+ page.next_method = Proc.new do |next_page_link|
775
+ list_next_async(next_page_link, custom_headers:custom_headers)
776
+ end
777
+ page
778
+ end
779
+ end
780
+
781
+ #
782
+ # Lists the versions of the specified key in the specified key vault.
783
+ #
784
+ # @param resource_group_name [String] The name of the resource group which
785
+ # contains the specified key vault.
786
+ # @param vault_name [String] The name of the vault which contains the key
787
+ # versions to be retrieved.
788
+ # @param key_name [String] The name of the key versions to be retrieved.
789
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
790
+ # will be added to the HTTP request.
791
+ #
792
+ # @return [KeyListResult] which provide lazy access to pages of the response.
793
+ #
794
+ def list_versions_as_lazy(resource_group_name, vault_name, key_name, custom_headers:nil)
795
+ response = list_versions_async(resource_group_name, vault_name, key_name, custom_headers:custom_headers).value!
796
+ unless response.nil?
797
+ page = response.body
798
+ page.next_method = Proc.new do |next_page_link|
799
+ list_versions_next_async(next_page_link, custom_headers:custom_headers)
800
+ end
801
+ page
802
+ end
803
+ end
804
+
805
+ end
806
+ end