akeyless 5.0.28 → 5.0.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +54 -1
  3. data/docs/AccountGeneralSettings.md +4 -0
  4. data/docs/AerospikeTargetDetails.md +82 -0
  5. data/docs/AnthropicTargetDetails.md +20 -0
  6. data/docs/AuthMethod.md +3 -1
  7. data/docs/AuthMethodAccessInfo.md +2 -0
  8. data/docs/AuthMethodCreateSAML.md +3 -1
  9. data/docs/AuthMethodCreateUniversalIdentity.md +2 -0
  10. data/docs/AuthMethodUpdateSAML.md +3 -1
  11. data/docs/AuthMethodUpdateUniversalIdentity.md +2 -0
  12. data/docs/BedrockTargetDetails.md +20 -0
  13. data/docs/CertificateDiscovery.md +2 -0
  14. data/docs/CertificatePayload.md +2 -0
  15. data/docs/CreateAuthMethodSAML.md +3 -1
  16. data/docs/CreateAuthMethodUniversalIdentity.md +2 -0
  17. data/docs/CreateDBTarget.md +2 -0
  18. data/docs/CreateMcpSecretBearerToken.md +46 -0
  19. data/docs/CreateMcpSecretOAuthAuthCode.md +56 -0
  20. data/docs/CreateMcpSecretOAuthClientCreds.md +52 -0
  21. data/docs/CreatePKICertIssuer.md +1 -1
  22. data/docs/CustomDnsTargetDetails.md +20 -0
  23. data/docs/DSProducerDetails.md +2 -0
  24. data/docs/DbTargetDetails.md +2 -0
  25. data/docs/DecryptGPG.md +3 -1
  26. data/docs/EmailCustomization.md +28 -0
  27. data/docs/EmailCustomizationAccountInformation.md +24 -0
  28. data/docs/EmailCustomizationAccountInformationValues.md +24 -0
  29. data/docs/EncryptGPG.md +3 -1
  30. data/docs/EsmGetSecretOutput.md +4 -0
  31. data/docs/FileDownloadInstructions.md +20 -0
  32. data/docs/FileInfo.md +50 -0
  33. data/docs/GatewayCreateMigration.md +4 -0
  34. data/docs/GatewayUpdateMigration.md +4 -0
  35. data/docs/GetKubeExecCreds.md +1 -1
  36. data/docs/GetPKICertificate.md +1 -1
  37. data/docs/GrokTargetDetails.md +22 -0
  38. data/docs/HashiPayload.md +2 -0
  39. data/docs/Item.md +2 -0
  40. data/docs/KeycloakTargetDetails.md +24 -0
  41. data/docs/OktaTargetDetails.md +20 -0
  42. data/docs/RuntimeAuthorityCommand.md +4 -0
  43. data/docs/SAMLAccessRules.md +3 -1
  44. data/docs/StaticSecretDetailsInfo.md +2 -0
  45. data/docs/TargetCreateAerospike.md +64 -0
  46. data/docs/TargetCreateAnthropic.md +36 -0
  47. data/docs/TargetCreateBedrock.md +36 -0
  48. data/docs/TargetCreateCustomDns.md +36 -0
  49. data/docs/TargetCreateDB.md +2 -0
  50. data/docs/TargetCreateGrok.md +38 -0
  51. data/docs/TargetCreateKeycloak.md +40 -0
  52. data/docs/TargetCreateOkta.md +36 -0
  53. data/docs/TargetTypeDetailsInput.md +14 -0
  54. data/docs/TargetUpdateAerospike.md +70 -0
  55. data/docs/TargetUpdateAnthropic.md +42 -0
  56. data/docs/TargetUpdateBedrock.md +42 -0
  57. data/docs/TargetUpdateCustomDns.md +40 -0
  58. data/docs/TargetUpdateDB.md +2 -0
  59. data/docs/TargetUpdateGrok.md +44 -0
  60. data/docs/TargetUpdateKeycloak.md +44 -0
  61. data/docs/TargetUpdateOkta.md +40 -0
  62. data/docs/UidExpirationEvent.md +18 -0
  63. data/docs/UpdateAuthMethodSAML.md +3 -1
  64. data/docs/UpdateAuthMethodUniversalIdentity.md +2 -0
  65. data/docs/UpdateDBTarget.md +2 -0
  66. data/docs/UpdateMcpSecretBearerToken.md +40 -0
  67. data/docs/UpdateMcpSecretOAuthAuthCode.md +50 -0
  68. data/docs/UpdateMcpSecretOAuthClientCreds.md +46 -0
  69. data/docs/UpdatePKICertIssuer.md +1 -1
  70. data/docs/UscGetSecretOutput.md +4 -0
  71. data/docs/V2Api.md +1260 -0
  72. data/lib/akeyless/api/v2_api.rb +1410 -130
  73. data/lib/akeyless/models/account_general_settings.rb +20 -1
  74. data/lib/akeyless/models/aerospike_target_details.rb +512 -0
  75. data/lib/akeyless/models/anthropic_target_details.rb +224 -0
  76. data/lib/akeyless/models/auth_method.rb +15 -4
  77. data/lib/akeyless/models/auth_method_access_info.rb +13 -1
  78. data/lib/akeyless/models/auth_method_create_saml.rb +14 -4
  79. data/lib/akeyless/models/auth_method_create_universal_identity.rb +13 -1
  80. data/lib/akeyless/models/auth_method_update_saml.rb +14 -4
  81. data/lib/akeyless/models/auth_method_update_universal_identity.rb +13 -1
  82. data/lib/akeyless/models/bedrock_target_details.rb +224 -0
  83. data/lib/akeyless/models/certificate_discovery.rb +11 -1
  84. data/lib/akeyless/models/certificate_payload.rb +12 -1
  85. data/lib/akeyless/models/create_auth_method_saml.rb +14 -4
  86. data/lib/akeyless/models/create_auth_method_universal_identity.rb +13 -1
  87. data/lib/akeyless/models/create_db_target.rb +11 -1
  88. data/lib/akeyless/models/create_mcp_secret_bearer_token.rb +371 -0
  89. data/lib/akeyless/models/create_mcp_secret_o_auth_auth_code.rb +423 -0
  90. data/lib/akeyless/models/create_mcp_secret_o_auth_client_creds.rb +403 -0
  91. data/lib/akeyless/models/create_pki_cert_issuer.rb +1 -1
  92. data/lib/akeyless/models/custom_dns_target_details.rb +225 -0
  93. data/lib/akeyless/models/db_target_details.rb +11 -1
  94. data/lib/akeyless/models/decrypt_gpg.rb +14 -4
  95. data/lib/akeyless/models/ds_producer_details.rb +11 -1
  96. data/lib/akeyless/models/email_customization.rb +259 -0
  97. data/lib/akeyless/models/email_customization_account_information.rb +242 -0
  98. data/lib/akeyless/models/email_customization_account_information_values.rb +241 -0
  99. data/lib/akeyless/models/encrypt_gpg.rb +14 -4
  100. data/lib/akeyless/models/esm_get_secret_output.rb +19 -1
  101. data/lib/akeyless/models/file_download_instructions.rb +223 -0
  102. data/lib/akeyless/models/file_info.rb +358 -0
  103. data/lib/akeyless/models/gateway_create_migration.rb +21 -1
  104. data/lib/akeyless/models/gateway_update_migration.rb +21 -1
  105. data/lib/akeyless/models/get_kube_exec_creds.rb +1 -1
  106. data/lib/akeyless/models/get_pki_certificate.rb +1 -1
  107. data/lib/akeyless/models/grok_target_details.rb +234 -0
  108. data/lib/akeyless/models/hashi_payload.rb +10 -1
  109. data/lib/akeyless/models/item.rb +10 -1
  110. data/lib/akeyless/models/keycloak_target_details.rb +242 -0
  111. data/lib/akeyless/models/okta_target_details.rb +224 -0
  112. data/lib/akeyless/models/runtime_authority_command.rb +21 -1
  113. data/lib/akeyless/models/saml_access_rules.rb +14 -4
  114. data/lib/akeyless/models/static_secret_details_info.rb +10 -1
  115. data/lib/akeyless/models/target_create_aerospike.rb +454 -0
  116. data/lib/akeyless/models/target_create_anthropic.rb +317 -0
  117. data/lib/akeyless/models/target_create_bedrock.rb +317 -0
  118. data/lib/akeyless/models/target_create_custom_dns.rb +330 -0
  119. data/lib/akeyless/models/target_create_db.rb +11 -1
  120. data/lib/akeyless/models/target_create_grok.rb +327 -0
  121. data/lib/akeyless/models/target_create_keycloak.rb +334 -0
  122. data/lib/akeyless/models/target_create_okta.rb +314 -0
  123. data/lib/akeyless/models/target_type_details_input.rb +64 -1
  124. data/lib/akeyless/models/target_update_aerospike.rb +488 -0
  125. data/lib/akeyless/models/target_update_anthropic.rb +351 -0
  126. data/lib/akeyless/models/target_update_bedrock.rb +351 -0
  127. data/lib/akeyless/models/target_update_custom_dns.rb +350 -0
  128. data/lib/akeyless/models/target_update_db.rb +11 -1
  129. data/lib/akeyless/models/target_update_grok.rb +361 -0
  130. data/lib/akeyless/models/target_update_keycloak.rb +354 -0
  131. data/lib/akeyless/models/target_update_okta.rb +334 -0
  132. data/lib/akeyless/models/uid_expiration_event.rb +214 -0
  133. data/lib/akeyless/models/update_auth_method_saml.rb +14 -4
  134. data/lib/akeyless/models/update_auth_method_universal_identity.rb +13 -1
  135. data/lib/akeyless/models/update_db_target.rb +11 -1
  136. data/lib/akeyless/models/update_mcp_secret_bearer_token.rb +338 -0
  137. data/lib/akeyless/models/update_mcp_secret_o_auth_auth_code.rb +390 -0
  138. data/lib/akeyless/models/update_mcp_secret_o_auth_client_creds.rb +370 -0
  139. data/lib/akeyless/models/update_pki_cert_issuer.rb +1 -1
  140. data/lib/akeyless/models/usc_get_secret_output.rb +19 -1
  141. data/lib/akeyless/version.rb +1 -1
  142. data/lib/akeyless.rb +33 -0
  143. data/spec/models/aerospike_target_details_spec.rb +228 -0
  144. data/spec/models/anthropic_target_details_spec.rb +42 -0
  145. data/spec/models/bedrock_target_details_spec.rb +42 -0
  146. data/spec/models/create_mcp_secret_bearer_token_spec.rb +120 -0
  147. data/spec/models/create_mcp_secret_o_auth_auth_code_spec.rb +150 -0
  148. data/spec/models/create_mcp_secret_o_auth_client_creds_spec.rb +138 -0
  149. data/spec/models/custom_dns_target_details_spec.rb +42 -0
  150. data/spec/models/email_customization_account_information_spec.rb +54 -0
  151. data/spec/models/email_customization_account_information_values_spec.rb +54 -0
  152. data/spec/models/email_customization_spec.rb +66 -0
  153. data/spec/models/file_download_instructions_spec.rb +42 -0
  154. data/spec/models/file_info_spec.rb +132 -0
  155. data/spec/models/grok_target_details_spec.rb +48 -0
  156. data/spec/models/keycloak_target_details_spec.rb +54 -0
  157. data/spec/models/okta_target_details_spec.rb +42 -0
  158. data/spec/models/target_create_aerospike_spec.rb +174 -0
  159. data/spec/models/target_create_anthropic_spec.rb +90 -0
  160. data/spec/models/target_create_bedrock_spec.rb +90 -0
  161. data/spec/models/target_create_custom_dns_spec.rb +90 -0
  162. data/spec/models/target_create_grok_spec.rb +96 -0
  163. data/spec/models/target_create_keycloak_spec.rb +102 -0
  164. data/spec/models/target_create_okta_spec.rb +90 -0
  165. data/spec/models/target_update_aerospike_spec.rb +192 -0
  166. data/spec/models/target_update_anthropic_spec.rb +108 -0
  167. data/spec/models/target_update_bedrock_spec.rb +108 -0
  168. data/spec/models/target_update_custom_dns_spec.rb +102 -0
  169. data/spec/models/target_update_grok_spec.rb +114 -0
  170. data/spec/models/target_update_keycloak_spec.rb +114 -0
  171. data/spec/models/target_update_okta_spec.rb +102 -0
  172. data/spec/models/uid_expiration_event_spec.rb +36 -0
  173. data/spec/models/update_mcp_secret_bearer_token_spec.rb +102 -0
  174. data/spec/models/update_mcp_secret_o_auth_auth_code_spec.rb +132 -0
  175. data/spec/models/update_mcp_secret_o_auth_client_creds_spec.rb +120 -0
  176. metadata +1314 -1182
@@ -0,0 +1,351 @@
1
+ =begin
2
+ #Akeyless API
3
+
4
+ #The purpose of this application is to provide access to Akeyless API.
5
+
6
+ The version of the OpenAPI document: 3.0
7
+ Contact: support@akeyless.io
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.10.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Akeyless
17
+ # targetUpdateAnthropic is a command that updates an existing anthropic target
18
+ class TargetUpdateAnthropic
19
+ # Base URL of the Anthropic API
20
+ attr_accessor :anthropic_url
21
+
22
+ # API key for Anthropic
23
+ attr_accessor :api_key
24
+
25
+ # Protection from accidental deletion of this object [true/false]
26
+ attr_accessor :delete_protection
27
+
28
+ # Description of the object
29
+ attr_accessor :description
30
+
31
+ # Set output format to JSON
32
+ attr_accessor :json
33
+
34
+ # Whether to keep previous version [true/false]. If not set, use default according to account settings
35
+ attr_accessor :keep_prev_version
36
+
37
+ # The name of a key that used to encrypt the target secret value (if empty, the account default protectionKey key will be used)
38
+ attr_accessor :key
39
+
40
+ # Set the maximum number of versions, limited by the account settings defaults.
41
+ attr_accessor :max_versions
42
+
43
+ # Target name
44
+ attr_accessor :name
45
+
46
+ # Deprecated - use description
47
+ attr_accessor :new_comment
48
+
49
+ # New target name
50
+ attr_accessor :new_name
51
+
52
+ # Authentication token (see `/auth` and `/configure`)
53
+ attr_accessor :token
54
+
55
+ # The universal identity token, Required only for universal_identity authentication
56
+ attr_accessor :uid_token
57
+
58
+ # Attribute mapping from ruby-style variable name to JSON key.
59
+ def self.attribute_map
60
+ {
61
+ :'anthropic_url' => :'anthropic-url',
62
+ :'api_key' => :'api-key',
63
+ :'delete_protection' => :'delete_protection',
64
+ :'description' => :'description',
65
+ :'json' => :'json',
66
+ :'keep_prev_version' => :'keep-prev-version',
67
+ :'key' => :'key',
68
+ :'max_versions' => :'max-versions',
69
+ :'name' => :'name',
70
+ :'new_comment' => :'new-comment',
71
+ :'new_name' => :'new-name',
72
+ :'token' => :'token',
73
+ :'uid_token' => :'uid-token'
74
+ }
75
+ end
76
+
77
+ # Returns all the JSON keys this model knows about
78
+ def self.acceptable_attributes
79
+ attribute_map.values
80
+ end
81
+
82
+ # Attribute type mapping.
83
+ def self.openapi_types
84
+ {
85
+ :'anthropic_url' => :'String',
86
+ :'api_key' => :'String',
87
+ :'delete_protection' => :'String',
88
+ :'description' => :'String',
89
+ :'json' => :'Boolean',
90
+ :'keep_prev_version' => :'String',
91
+ :'key' => :'String',
92
+ :'max_versions' => :'String',
93
+ :'name' => :'String',
94
+ :'new_comment' => :'String',
95
+ :'new_name' => :'String',
96
+ :'token' => :'String',
97
+ :'uid_token' => :'String'
98
+ }
99
+ end
100
+
101
+ # List of attributes with nullable: true
102
+ def self.openapi_nullable
103
+ Set.new([
104
+ ])
105
+ end
106
+
107
+ # Initializes the object
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ def initialize(attributes = {})
110
+ if (!attributes.is_a?(Hash))
111
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::TargetUpdateAnthropic` initialize method"
112
+ end
113
+
114
+ # check to see if the attribute exists and convert string to symbol for hash key
115
+ attributes = attributes.each_with_object({}) { |(k, v), h|
116
+ if (!self.class.attribute_map.key?(k.to_sym))
117
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::TargetUpdateAnthropic`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
118
+ end
119
+ h[k.to_sym] = v
120
+ }
121
+
122
+ if attributes.key?(:'anthropic_url')
123
+ self.anthropic_url = attributes[:'anthropic_url']
124
+ else
125
+ self.anthropic_url = 'https://api.anthropic.com'
126
+ end
127
+
128
+ if attributes.key?(:'api_key')
129
+ self.api_key = attributes[:'api_key']
130
+ end
131
+
132
+ if attributes.key?(:'delete_protection')
133
+ self.delete_protection = attributes[:'delete_protection']
134
+ end
135
+
136
+ if attributes.key?(:'description')
137
+ self.description = attributes[:'description']
138
+ else
139
+ self.description = 'default_comment'
140
+ end
141
+
142
+ if attributes.key?(:'json')
143
+ self.json = attributes[:'json']
144
+ else
145
+ self.json = false
146
+ end
147
+
148
+ if attributes.key?(:'keep_prev_version')
149
+ self.keep_prev_version = attributes[:'keep_prev_version']
150
+ end
151
+
152
+ if attributes.key?(:'key')
153
+ self.key = attributes[:'key']
154
+ end
155
+
156
+ if attributes.key?(:'max_versions')
157
+ self.max_versions = attributes[:'max_versions']
158
+ end
159
+
160
+ if attributes.key?(:'name')
161
+ self.name = attributes[:'name']
162
+ else
163
+ self.name = nil
164
+ end
165
+
166
+ if attributes.key?(:'new_comment')
167
+ self.new_comment = attributes[:'new_comment']
168
+ else
169
+ self.new_comment = 'default_comment'
170
+ end
171
+
172
+ if attributes.key?(:'new_name')
173
+ self.new_name = attributes[:'new_name']
174
+ end
175
+
176
+ if attributes.key?(:'token')
177
+ self.token = attributes[:'token']
178
+ end
179
+
180
+ if attributes.key?(:'uid_token')
181
+ self.uid_token = attributes[:'uid_token']
182
+ end
183
+ end
184
+
185
+ # Show invalid properties with the reasons. Usually used together with valid?
186
+ # @return Array for valid properties with the reasons
187
+ def list_invalid_properties
188
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
189
+ invalid_properties = Array.new
190
+ if @name.nil?
191
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
192
+ end
193
+
194
+ invalid_properties
195
+ end
196
+
197
+ # Check to see if the all the properties in the model are valid
198
+ # @return true if the model is valid
199
+ def valid?
200
+ warn '[DEPRECATED] the `valid?` method is obsolete'
201
+ return false if @name.nil?
202
+ true
203
+ end
204
+
205
+ # Checks equality by comparing each attribute.
206
+ # @param [Object] Object to be compared
207
+ def ==(o)
208
+ return true if self.equal?(o)
209
+ self.class == o.class &&
210
+ anthropic_url == o.anthropic_url &&
211
+ api_key == o.api_key &&
212
+ delete_protection == o.delete_protection &&
213
+ description == o.description &&
214
+ json == o.json &&
215
+ keep_prev_version == o.keep_prev_version &&
216
+ key == o.key &&
217
+ max_versions == o.max_versions &&
218
+ name == o.name &&
219
+ new_comment == o.new_comment &&
220
+ new_name == o.new_name &&
221
+ token == o.token &&
222
+ uid_token == o.uid_token
223
+ end
224
+
225
+ # @see the `==` method
226
+ # @param [Object] Object to be compared
227
+ def eql?(o)
228
+ self == o
229
+ end
230
+
231
+ # Calculates hash code according to all attributes.
232
+ # @return [Integer] Hash code
233
+ def hash
234
+ [anthropic_url, api_key, delete_protection, description, json, keep_prev_version, key, max_versions, name, new_comment, new_name, token, uid_token].hash
235
+ end
236
+
237
+ # Builds the object from hash
238
+ # @param [Hash] attributes Model attributes in the form of hash
239
+ # @return [Object] Returns the model itself
240
+ def self.build_from_hash(attributes)
241
+ return nil unless attributes.is_a?(Hash)
242
+ attributes = attributes.transform_keys(&:to_sym)
243
+ transformed_hash = {}
244
+ openapi_types.each_pair do |key, type|
245
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
246
+ transformed_hash["#{key}"] = nil
247
+ elsif type =~ /\AArray<(.*)>/i
248
+ # check to ensure the input is an array given that the attribute
249
+ # is documented as an array but the input is not
250
+ if attributes[attribute_map[key]].is_a?(Array)
251
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
252
+ end
253
+ elsif !attributes[attribute_map[key]].nil?
254
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
255
+ end
256
+ end
257
+ new(transformed_hash)
258
+ end
259
+
260
+ # Deserializes the data based on type
261
+ # @param string type Data type
262
+ # @param string value Value to be deserialized
263
+ # @return [Object] Deserialized data
264
+ def self._deserialize(type, value)
265
+ case type.to_sym
266
+ when :Time
267
+ Time.parse(value)
268
+ when :Date
269
+ Date.parse(value)
270
+ when :String
271
+ value.to_s
272
+ when :Integer
273
+ value.to_i
274
+ when :Float
275
+ value.to_f
276
+ when :Boolean
277
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
278
+ true
279
+ else
280
+ false
281
+ end
282
+ when :Object
283
+ # generic object (usually a Hash), return directly
284
+ value
285
+ when /\AArray<(?<inner_type>.+)>\z/
286
+ inner_type = Regexp.last_match[:inner_type]
287
+ value.map { |v| _deserialize(inner_type, v) }
288
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
289
+ k_type = Regexp.last_match[:k_type]
290
+ v_type = Regexp.last_match[:v_type]
291
+ {}.tap do |hash|
292
+ value.each do |k, v|
293
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
294
+ end
295
+ end
296
+ else # model
297
+ # models (e.g. Pet) or oneOf
298
+ klass = Akeyless.const_get(type)
299
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
300
+ end
301
+ end
302
+
303
+ # Returns the string representation of the object
304
+ # @return [String] String presentation of the object
305
+ def to_s
306
+ to_hash.to_s
307
+ end
308
+
309
+ # to_body is an alias to to_hash (backward compatibility)
310
+ # @return [Hash] Returns the object in the form of hash
311
+ def to_body
312
+ to_hash
313
+ end
314
+
315
+ # Returns the object in the form of hash
316
+ # @return [Hash] Returns the object in the form of hash
317
+ def to_hash
318
+ hash = {}
319
+ self.class.attribute_map.each_pair do |attr, param|
320
+ value = self.send(attr)
321
+ if value.nil?
322
+ is_nullable = self.class.openapi_nullable.include?(attr)
323
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
324
+ end
325
+
326
+ hash[param] = _to_hash(value)
327
+ end
328
+ hash
329
+ end
330
+
331
+ # Outputs non-array value in the form of hash
332
+ # For object, use to_hash. Otherwise, just return the value
333
+ # @param [Object] value Any valid value
334
+ # @return [Hash] Returns the value in the form of hash
335
+ def _to_hash(value)
336
+ if value.is_a?(Array)
337
+ value.compact.map { |v| _to_hash(v) }
338
+ elsif value.is_a?(Hash)
339
+ {}.tap do |hash|
340
+ value.each { |k, v| hash[k] = _to_hash(v) }
341
+ end
342
+ elsif value.respond_to? :to_hash
343
+ value.to_hash
344
+ else
345
+ value
346
+ end
347
+ end
348
+
349
+ end
350
+
351
+ end
@@ -0,0 +1,351 @@
1
+ =begin
2
+ #Akeyless API
3
+
4
+ #The purpose of this application is to provide access to Akeyless API.
5
+
6
+ The version of the OpenAPI document: 3.0
7
+ Contact: support@akeyless.io
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.10.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Akeyless
17
+ # targetUpdateBedrock is a command that updates an existing bedrock (Amazon Bedrock) target
18
+ class TargetUpdateBedrock
19
+ # API key for Bedrock
20
+ attr_accessor :api_key
21
+
22
+ # Base URL of the Bedrock API
23
+ attr_accessor :bedrock_url
24
+
25
+ # Protection from accidental deletion of this object [true/false]
26
+ attr_accessor :delete_protection
27
+
28
+ # Description of the object
29
+ attr_accessor :description
30
+
31
+ # Set output format to JSON
32
+ attr_accessor :json
33
+
34
+ # Whether to keep previous version [true/false]. If not set, use default according to account settings
35
+ attr_accessor :keep_prev_version
36
+
37
+ # The name of a key that used to encrypt the target secret value (if empty, the account default protectionKey key will be used)
38
+ attr_accessor :key
39
+
40
+ # Set the maximum number of versions, limited by the account settings defaults.
41
+ attr_accessor :max_versions
42
+
43
+ # Target name
44
+ attr_accessor :name
45
+
46
+ # Deprecated - use description
47
+ attr_accessor :new_comment
48
+
49
+ # New target name
50
+ attr_accessor :new_name
51
+
52
+ # Authentication token (see `/auth` and `/configure`)
53
+ attr_accessor :token
54
+
55
+ # The universal identity token, Required only for universal_identity authentication
56
+ attr_accessor :uid_token
57
+
58
+ # Attribute mapping from ruby-style variable name to JSON key.
59
+ def self.attribute_map
60
+ {
61
+ :'api_key' => :'api-key',
62
+ :'bedrock_url' => :'bedrock-url',
63
+ :'delete_protection' => :'delete_protection',
64
+ :'description' => :'description',
65
+ :'json' => :'json',
66
+ :'keep_prev_version' => :'keep-prev-version',
67
+ :'key' => :'key',
68
+ :'max_versions' => :'max-versions',
69
+ :'name' => :'name',
70
+ :'new_comment' => :'new-comment',
71
+ :'new_name' => :'new-name',
72
+ :'token' => :'token',
73
+ :'uid_token' => :'uid-token'
74
+ }
75
+ end
76
+
77
+ # Returns all the JSON keys this model knows about
78
+ def self.acceptable_attributes
79
+ attribute_map.values
80
+ end
81
+
82
+ # Attribute type mapping.
83
+ def self.openapi_types
84
+ {
85
+ :'api_key' => :'String',
86
+ :'bedrock_url' => :'String',
87
+ :'delete_protection' => :'String',
88
+ :'description' => :'String',
89
+ :'json' => :'Boolean',
90
+ :'keep_prev_version' => :'String',
91
+ :'key' => :'String',
92
+ :'max_versions' => :'String',
93
+ :'name' => :'String',
94
+ :'new_comment' => :'String',
95
+ :'new_name' => :'String',
96
+ :'token' => :'String',
97
+ :'uid_token' => :'String'
98
+ }
99
+ end
100
+
101
+ # List of attributes with nullable: true
102
+ def self.openapi_nullable
103
+ Set.new([
104
+ ])
105
+ end
106
+
107
+ # Initializes the object
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ def initialize(attributes = {})
110
+ if (!attributes.is_a?(Hash))
111
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::TargetUpdateBedrock` initialize method"
112
+ end
113
+
114
+ # check to see if the attribute exists and convert string to symbol for hash key
115
+ attributes = attributes.each_with_object({}) { |(k, v), h|
116
+ if (!self.class.attribute_map.key?(k.to_sym))
117
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::TargetUpdateBedrock`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
118
+ end
119
+ h[k.to_sym] = v
120
+ }
121
+
122
+ if attributes.key?(:'api_key')
123
+ self.api_key = attributes[:'api_key']
124
+ end
125
+
126
+ if attributes.key?(:'bedrock_url')
127
+ self.bedrock_url = attributes[:'bedrock_url']
128
+ else
129
+ self.bedrock_url = 'https://bedrock-runtime.us-east-1.amazonaws.com'
130
+ end
131
+
132
+ if attributes.key?(:'delete_protection')
133
+ self.delete_protection = attributes[:'delete_protection']
134
+ end
135
+
136
+ if attributes.key?(:'description')
137
+ self.description = attributes[:'description']
138
+ else
139
+ self.description = 'default_comment'
140
+ end
141
+
142
+ if attributes.key?(:'json')
143
+ self.json = attributes[:'json']
144
+ else
145
+ self.json = false
146
+ end
147
+
148
+ if attributes.key?(:'keep_prev_version')
149
+ self.keep_prev_version = attributes[:'keep_prev_version']
150
+ end
151
+
152
+ if attributes.key?(:'key')
153
+ self.key = attributes[:'key']
154
+ end
155
+
156
+ if attributes.key?(:'max_versions')
157
+ self.max_versions = attributes[:'max_versions']
158
+ end
159
+
160
+ if attributes.key?(:'name')
161
+ self.name = attributes[:'name']
162
+ else
163
+ self.name = nil
164
+ end
165
+
166
+ if attributes.key?(:'new_comment')
167
+ self.new_comment = attributes[:'new_comment']
168
+ else
169
+ self.new_comment = 'default_comment'
170
+ end
171
+
172
+ if attributes.key?(:'new_name')
173
+ self.new_name = attributes[:'new_name']
174
+ end
175
+
176
+ if attributes.key?(:'token')
177
+ self.token = attributes[:'token']
178
+ end
179
+
180
+ if attributes.key?(:'uid_token')
181
+ self.uid_token = attributes[:'uid_token']
182
+ end
183
+ end
184
+
185
+ # Show invalid properties with the reasons. Usually used together with valid?
186
+ # @return Array for valid properties with the reasons
187
+ def list_invalid_properties
188
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
189
+ invalid_properties = Array.new
190
+ if @name.nil?
191
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
192
+ end
193
+
194
+ invalid_properties
195
+ end
196
+
197
+ # Check to see if the all the properties in the model are valid
198
+ # @return true if the model is valid
199
+ def valid?
200
+ warn '[DEPRECATED] the `valid?` method is obsolete'
201
+ return false if @name.nil?
202
+ true
203
+ end
204
+
205
+ # Checks equality by comparing each attribute.
206
+ # @param [Object] Object to be compared
207
+ def ==(o)
208
+ return true if self.equal?(o)
209
+ self.class == o.class &&
210
+ api_key == o.api_key &&
211
+ bedrock_url == o.bedrock_url &&
212
+ delete_protection == o.delete_protection &&
213
+ description == o.description &&
214
+ json == o.json &&
215
+ keep_prev_version == o.keep_prev_version &&
216
+ key == o.key &&
217
+ max_versions == o.max_versions &&
218
+ name == o.name &&
219
+ new_comment == o.new_comment &&
220
+ new_name == o.new_name &&
221
+ token == o.token &&
222
+ uid_token == o.uid_token
223
+ end
224
+
225
+ # @see the `==` method
226
+ # @param [Object] Object to be compared
227
+ def eql?(o)
228
+ self == o
229
+ end
230
+
231
+ # Calculates hash code according to all attributes.
232
+ # @return [Integer] Hash code
233
+ def hash
234
+ [api_key, bedrock_url, delete_protection, description, json, keep_prev_version, key, max_versions, name, new_comment, new_name, token, uid_token].hash
235
+ end
236
+
237
+ # Builds the object from hash
238
+ # @param [Hash] attributes Model attributes in the form of hash
239
+ # @return [Object] Returns the model itself
240
+ def self.build_from_hash(attributes)
241
+ return nil unless attributes.is_a?(Hash)
242
+ attributes = attributes.transform_keys(&:to_sym)
243
+ transformed_hash = {}
244
+ openapi_types.each_pair do |key, type|
245
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
246
+ transformed_hash["#{key}"] = nil
247
+ elsif type =~ /\AArray<(.*)>/i
248
+ # check to ensure the input is an array given that the attribute
249
+ # is documented as an array but the input is not
250
+ if attributes[attribute_map[key]].is_a?(Array)
251
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
252
+ end
253
+ elsif !attributes[attribute_map[key]].nil?
254
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
255
+ end
256
+ end
257
+ new(transformed_hash)
258
+ end
259
+
260
+ # Deserializes the data based on type
261
+ # @param string type Data type
262
+ # @param string value Value to be deserialized
263
+ # @return [Object] Deserialized data
264
+ def self._deserialize(type, value)
265
+ case type.to_sym
266
+ when :Time
267
+ Time.parse(value)
268
+ when :Date
269
+ Date.parse(value)
270
+ when :String
271
+ value.to_s
272
+ when :Integer
273
+ value.to_i
274
+ when :Float
275
+ value.to_f
276
+ when :Boolean
277
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
278
+ true
279
+ else
280
+ false
281
+ end
282
+ when :Object
283
+ # generic object (usually a Hash), return directly
284
+ value
285
+ when /\AArray<(?<inner_type>.+)>\z/
286
+ inner_type = Regexp.last_match[:inner_type]
287
+ value.map { |v| _deserialize(inner_type, v) }
288
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
289
+ k_type = Regexp.last_match[:k_type]
290
+ v_type = Regexp.last_match[:v_type]
291
+ {}.tap do |hash|
292
+ value.each do |k, v|
293
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
294
+ end
295
+ end
296
+ else # model
297
+ # models (e.g. Pet) or oneOf
298
+ klass = Akeyless.const_get(type)
299
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
300
+ end
301
+ end
302
+
303
+ # Returns the string representation of the object
304
+ # @return [String] String presentation of the object
305
+ def to_s
306
+ to_hash.to_s
307
+ end
308
+
309
+ # to_body is an alias to to_hash (backward compatibility)
310
+ # @return [Hash] Returns the object in the form of hash
311
+ def to_body
312
+ to_hash
313
+ end
314
+
315
+ # Returns the object in the form of hash
316
+ # @return [Hash] Returns the object in the form of hash
317
+ def to_hash
318
+ hash = {}
319
+ self.class.attribute_map.each_pair do |attr, param|
320
+ value = self.send(attr)
321
+ if value.nil?
322
+ is_nullable = self.class.openapi_nullable.include?(attr)
323
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
324
+ end
325
+
326
+ hash[param] = _to_hash(value)
327
+ end
328
+ hash
329
+ end
330
+
331
+ # Outputs non-array value in the form of hash
332
+ # For object, use to_hash. Otherwise, just return the value
333
+ # @param [Object] value Any valid value
334
+ # @return [Hash] Returns the value in the form of hash
335
+ def _to_hash(value)
336
+ if value.is_a?(Array)
337
+ value.compact.map { |v| _to_hash(v) }
338
+ elsif value.is_a?(Hash)
339
+ {}.tap do |hash|
340
+ value.each { |k, v| hash[k] = _to_hash(v) }
341
+ end
342
+ elsif value.respond_to? :to_hash
343
+ value.to_hash
344
+ else
345
+ value
346
+ end
347
+ end
348
+
349
+ end
350
+
351
+ end