akeyless 2.16.4 → 2.16.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (195) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +44 -1
  3. data/docs/AwsS3LogForwardingConfig.md +2 -0
  4. data/docs/CertAccessRules.md +1 -1
  5. data/docs/CreateAuthMethod.md +1 -1
  6. data/docs/CreateAuthMethodAWSIAM.md +1 -1
  7. data/docs/CreateAuthMethodAzureAD.md +1 -1
  8. data/docs/CreateAuthMethodCert.md +1 -1
  9. data/docs/CreateAuthMethodGCP.md +1 -1
  10. data/docs/CreateAuthMethodHuawei.md +1 -1
  11. data/docs/CreateAuthMethodK8S.md +1 -1
  12. data/docs/CreateAuthMethodLDAP.md +1 -1
  13. data/docs/CreateAuthMethodOAuth2.md +1 -1
  14. data/docs/CreateAuthMethodOIDC.md +1 -1
  15. data/docs/CreateAuthMethodSAML.md +1 -1
  16. data/docs/CreateAuthMethodUniversalIdentity.md +1 -1
  17. data/docs/CreateAzureTarget.md +6 -0
  18. data/docs/CreateClassicKey.md +12 -0
  19. data/docs/CreateRotatedSecret.md +30 -0
  20. data/docs/CreateSalesforceTarget.md +42 -0
  21. data/docs/CreateSalesforceTargetOutput.md +18 -0
  22. data/docs/CreateTokenizer.md +42 -0
  23. data/docs/CreateTokenizerOutput.md +18 -0
  24. data/docs/DSProducerDetails.md +6 -0
  25. data/docs/DeleteRoleRule.md +1 -1
  26. data/docs/Detokenize.md +26 -0
  27. data/docs/DetokenizeOutput.md +18 -0
  28. data/docs/DynamicSecretProducerInfo.md +2 -0
  29. data/docs/EmailTokenizerInfo.md +22 -0
  30. data/docs/GatewayCreateMigration.md +50 -0
  31. data/docs/GatewayCreateProducerRabbitMQ.md +2 -0
  32. data/docs/GatewayCreateProducerRedshift.md +2 -0
  33. data/docs/GatewayDeleteMigration.md +22 -0
  34. data/docs/GatewayGetMigration.md +22 -0
  35. data/docs/GatewayMigrationCreateOutput.md +18 -0
  36. data/docs/GatewayMigrationDeleteOutput.md +18 -0
  37. data/docs/GatewayMigrationGetOutput.md +18 -0
  38. data/docs/GatewayMigrationUpdateOutput.md +18 -0
  39. data/docs/GatewayUpdateMigration.md +52 -0
  40. data/docs/GatewayUpdateProducerRabbitMQ.md +2 -0
  41. data/docs/GatewayUpdateProducerRedshift.md +2 -0
  42. data/docs/GetRSAPublicOutput.md +1 -1
  43. data/docs/GetSecretValue.md +2 -0
  44. data/docs/HashiPayload.md +2 -0
  45. data/docs/Item.md +2 -0
  46. data/docs/ItemGeneralInfo.md +5 -1
  47. data/docs/ListItems.md +2 -0
  48. data/docs/ListTargets.md +2 -0
  49. data/docs/LogForwardingConfigPart.md +0 -2
  50. data/docs/Producer.md +2 -0
  51. data/docs/RegexpTokenizerInfo.md +24 -0
  52. data/docs/RotateSecret.md +22 -0
  53. data/docs/RotatedSecretOutput.md +18 -0
  54. data/docs/SetRoleRule.md +1 -1
  55. data/docs/SystemAccessCredentialsReplyObj.md +2 -0
  56. data/docs/Target.md +2 -0
  57. data/docs/TargetTypeDetailsInput.md +18 -0
  58. data/docs/Tokenize.md +26 -0
  59. data/docs/TokenizeOutput.md +20 -0
  60. data/docs/TokenizerInfo.md +18 -0
  61. data/docs/UpdateAuthMethod.md +1 -1
  62. data/docs/UpdateAuthMethodAWSIAM.md +1 -1
  63. data/docs/UpdateAuthMethodAzureAD.md +1 -1
  64. data/docs/UpdateAuthMethodCert.md +1 -1
  65. data/docs/UpdateAuthMethodGCP.md +1 -1
  66. data/docs/UpdateAuthMethodK8S.md +1 -1
  67. data/docs/UpdateAuthMethodLDAP.md +1 -1
  68. data/docs/UpdateAuthMethodOAuth2.md +1 -1
  69. data/docs/UpdateAuthMethodOIDC.md +1 -1
  70. data/docs/UpdateAuthMethodSAML.md +1 -1
  71. data/docs/UpdateAuthMethodUniversalIdentity.md +1 -1
  72. data/docs/UpdateAzureTarget.md +6 -0
  73. data/docs/UpdateLdapTarget.md +42 -0
  74. data/docs/UpdateLdapTargetDetails.md +40 -0
  75. data/docs/UpdateLdapTargetOutput.md +18 -0
  76. data/docs/UpdateRotatedSecret.md +30 -0
  77. data/docs/UpdateSalesforceTarget.md +48 -0
  78. data/docs/UpdateSalesforceTargetOutput.md +18 -0
  79. data/docs/UpdateTokenizer.md +46 -0
  80. data/docs/UpdateTokenizerOutput.md +18 -0
  81. data/docs/V2Api.md +888 -6
  82. data/docs/VaultlessTokenizerInfo.md +28 -0
  83. data/lib/akeyless/api/v2_api.rb +897 -1
  84. data/lib/akeyless/models/aws_s3_log_forwarding_config.rb +10 -1
  85. data/lib/akeyless/models/cert_access_rules.rb +2 -4
  86. data/lib/akeyless/models/create_auth_method.rb +0 -2
  87. data/lib/akeyless/models/create_auth_method_awsiam.rb +0 -2
  88. data/lib/akeyless/models/create_auth_method_azure_ad.rb +0 -2
  89. data/lib/akeyless/models/create_auth_method_cert.rb +0 -2
  90. data/lib/akeyless/models/create_auth_method_gcp.rb +0 -2
  91. data/lib/akeyless/models/create_auth_method_huawei.rb +0 -2
  92. data/lib/akeyless/models/create_auth_method_k8_s.rb +0 -2
  93. data/lib/akeyless/models/create_auth_method_ldap.rb +0 -2
  94. data/lib/akeyless/models/create_auth_method_o_auth2.rb +0 -2
  95. data/lib/akeyless/models/create_auth_method_oidc.rb +0 -2
  96. data/lib/akeyless/models/create_auth_method_saml.rb +0 -2
  97. data/lib/akeyless/models/create_auth_method_universal_identity.rb +0 -2
  98. data/lib/akeyless/models/create_azure_target.rb +31 -1
  99. data/lib/akeyless/models/create_classic_key.rb +61 -1
  100. data/lib/akeyless/models/create_rotated_secret.rb +163 -1
  101. data/lib/akeyless/models/create_salesforce_target.rb +375 -0
  102. data/lib/akeyless/models/create_salesforce_target_output.rb +219 -0
  103. data/lib/akeyless/models/create_tokenizer.rb +358 -0
  104. data/lib/akeyless/models/create_tokenizer_output.rb +219 -0
  105. data/lib/akeyless/models/delete_role_rule.rb +1 -1
  106. data/lib/akeyless/models/detokenize.rb +271 -0
  107. data/lib/akeyless/models/detokenize_output.rb +219 -0
  108. data/lib/akeyless/models/ds_producer_details.rb +28 -1
  109. data/lib/akeyless/models/dynamic_secret_producer_info.rb +10 -1
  110. data/lib/akeyless/models/email_tokenizer_info.rb +241 -0
  111. data/lib/akeyless/models/gateway_create_migration.rb +374 -0
  112. data/lib/akeyless/models/gateway_create_producer_rabbit_mq.rb +13 -1
  113. data/lib/akeyless/models/gateway_create_producer_redshift.rb +11 -1
  114. data/lib/akeyless/models/gateway_delete_migration.rb +246 -0
  115. data/lib/akeyless/models/gateway_get_migration.rb +240 -0
  116. data/lib/akeyless/models/gateway_migration_create_output.rb +219 -0
  117. data/lib/akeyless/models/gateway_migration_delete_output.rb +219 -0
  118. data/lib/akeyless/models/gateway_migration_get_output.rb +219 -0
  119. data/lib/akeyless/models/gateway_migration_update_output.rb +219 -0
  120. data/lib/akeyless/models/gateway_update_migration.rb +383 -0
  121. data/lib/akeyless/models/gateway_update_producer_hana_db.rb +1 -1
  122. data/lib/akeyless/models/gateway_update_producer_rabbit_mq.rb +13 -1
  123. data/lib/akeyless/models/gateway_update_producer_redshift.rb +11 -1
  124. data/lib/akeyless/models/get_rsa_public_output.rb +2 -4
  125. data/lib/akeyless/models/get_secret_value.rb +10 -1
  126. data/lib/akeyless/models/hashi_payload.rb +10 -1
  127. data/lib/akeyless/models/item.rb +10 -1
  128. data/lib/akeyless/models/item_general_info.rb +22 -4
  129. data/lib/akeyless/models/list_items.rb +10 -1
  130. data/lib/akeyless/models/list_targets.rb +13 -1
  131. data/lib/akeyless/models/log_forwarding_config_part.rb +1 -10
  132. data/lib/akeyless/models/producer.rb +10 -1
  133. data/lib/akeyless/models/regexp_tokenizer_info.rb +251 -0
  134. data/lib/akeyless/models/rotate_secret.rb +245 -0
  135. data/lib/akeyless/models/rotated_secret_output.rb +219 -0
  136. data/lib/akeyless/models/set_role_rule.rb +1 -1
  137. data/lib/akeyless/models/system_access_credentials_reply_obj.rb +11 -1
  138. data/lib/akeyless/models/target.rb +13 -1
  139. data/lib/akeyless/models/target_type_details_input.rb +86 -1
  140. data/lib/akeyless/models/tokenize.rb +271 -0
  141. data/lib/akeyless/models/tokenize_output.rb +228 -0
  142. data/lib/akeyless/models/tokenizer_info.rb +219 -0
  143. data/lib/akeyless/models/update_auth_method.rb +0 -2
  144. data/lib/akeyless/models/update_auth_method_awsiam.rb +0 -2
  145. data/lib/akeyless/models/update_auth_method_azure_ad.rb +0 -2
  146. data/lib/akeyless/models/update_auth_method_cert.rb +0 -2
  147. data/lib/akeyless/models/update_auth_method_gcp.rb +0 -2
  148. data/lib/akeyless/models/update_auth_method_k8_s.rb +0 -2
  149. data/lib/akeyless/models/update_auth_method_ldap.rb +0 -2
  150. data/lib/akeyless/models/update_auth_method_o_auth2.rb +0 -2
  151. data/lib/akeyless/models/update_auth_method_oidc.rb +0 -2
  152. data/lib/akeyless/models/update_auth_method_saml.rb +0 -2
  153. data/lib/akeyless/models/update_auth_method_universal_identity.rb +0 -2
  154. data/lib/akeyless/models/update_azure_target.rb +31 -1
  155. data/lib/akeyless/models/update_ldap_target.rb +339 -0
  156. data/lib/akeyless/models/update_ldap_target_details.rb +328 -0
  157. data/lib/akeyless/models/update_ldap_target_output.rb +219 -0
  158. data/lib/akeyless/models/update_rotated_secret.rb +163 -1
  159. data/lib/akeyless/models/update_salesforce_target.rb +404 -0
  160. data/lib/akeyless/models/update_salesforce_target_output.rb +219 -0
  161. data/lib/akeyless/models/update_tokenizer.rb +382 -0
  162. data/lib/akeyless/models/update_tokenizer_output.rb +219 -0
  163. data/lib/akeyless/models/vaultless_tokenizer_info.rb +267 -0
  164. data/lib/akeyless/version.rb +1 -1
  165. data/lib/akeyless.rb +29 -0
  166. data/spec/models/create_salesforce_target_output_spec.rb +34 -0
  167. data/spec/models/create_salesforce_target_spec.rb +106 -0
  168. data/spec/models/create_tokenizer_output_spec.rb +34 -0
  169. data/spec/models/create_tokenizer_spec.rb +106 -0
  170. data/spec/models/detokenize_output_spec.rb +34 -0
  171. data/spec/models/detokenize_spec.rb +58 -0
  172. data/spec/models/email_tokenizer_info_spec.rb +46 -0
  173. data/spec/models/gateway_create_migration_spec.rb +130 -0
  174. data/spec/models/gateway_delete_migration_spec.rb +46 -0
  175. data/spec/models/gateway_get_migration_spec.rb +46 -0
  176. data/spec/models/gateway_migration_create_output_spec.rb +34 -0
  177. data/spec/models/gateway_migration_delete_output_spec.rb +34 -0
  178. data/spec/models/gateway_migration_get_output_spec.rb +34 -0
  179. data/spec/models/gateway_migration_update_output_spec.rb +34 -0
  180. data/spec/models/gateway_update_migration_spec.rb +136 -0
  181. data/spec/models/regexp_tokenizer_info_spec.rb +52 -0
  182. data/spec/models/rotate_secret_spec.rb +46 -0
  183. data/spec/models/rotated_secret_output_spec.rb +34 -0
  184. data/spec/models/tokenize_output_spec.rb +40 -0
  185. data/spec/models/tokenize_spec.rb +58 -0
  186. data/spec/models/tokenizer_info_spec.rb +34 -0
  187. data/spec/models/update_ldap_target_details_spec.rb +100 -0
  188. data/spec/models/update_ldap_target_output_spec.rb +34 -0
  189. data/spec/models/update_ldap_target_spec.rb +106 -0
  190. data/spec/models/update_salesforce_target_output_spec.rb +34 -0
  191. data/spec/models/update_salesforce_target_spec.rb +124 -0
  192. data/spec/models/update_tokenizer_output_spec.rb +34 -0
  193. data/spec/models/update_tokenizer_spec.rb +118 -0
  194. data/spec/models/vaultless_tokenizer_info_spec.rb +64 -0
  195. metadata +575 -459
@@ -0,0 +1,339 @@
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: 2.0
7
+ Contact: support@akeyless.io
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Akeyless
17
+ class UpdateLdapTarget
18
+ attr_accessor :bind_dn
19
+
20
+ attr_accessor :bind_dn_password
21
+
22
+ # Comment about the target
23
+ attr_accessor :comment
24
+
25
+ attr_accessor :keep_prev_version
26
+
27
+ # The name of a key that used to encrypt the target secret value (if empty, the account default protectionKey key will be used)
28
+ attr_accessor :key
29
+
30
+ attr_accessor :ldap_ca_cert
31
+
32
+ attr_accessor :ldap_url
33
+
34
+ # Target name
35
+ attr_accessor :name
36
+
37
+ # New target name
38
+ attr_accessor :new_name
39
+
40
+ # Authentication token (see `/auth` and `/configure`)
41
+ attr_accessor :token
42
+
43
+ attr_accessor :token_expiration
44
+
45
+ # The universal identity token, Required only for universal_identity authentication
46
+ attr_accessor :uid_token
47
+
48
+ # Deprecated
49
+ attr_accessor :update_version
50
+
51
+ # Attribute mapping from ruby-style variable name to JSON key.
52
+ def self.attribute_map
53
+ {
54
+ :'bind_dn' => :'bind-dn',
55
+ :'bind_dn_password' => :'bind-dn-password',
56
+ :'comment' => :'comment',
57
+ :'keep_prev_version' => :'keep-prev-version',
58
+ :'key' => :'key',
59
+ :'ldap_ca_cert' => :'ldap-ca-cert',
60
+ :'ldap_url' => :'ldap-url',
61
+ :'name' => :'name',
62
+ :'new_name' => :'new-name',
63
+ :'token' => :'token',
64
+ :'token_expiration' => :'token-expiration',
65
+ :'uid_token' => :'uid-token',
66
+ :'update_version' => :'update-version'
67
+ }
68
+ end
69
+
70
+ # Returns all the JSON keys this model knows about
71
+ def self.acceptable_attributes
72
+ attribute_map.values
73
+ end
74
+
75
+ # Attribute type mapping.
76
+ def self.openapi_types
77
+ {
78
+ :'bind_dn' => :'String',
79
+ :'bind_dn_password' => :'String',
80
+ :'comment' => :'String',
81
+ :'keep_prev_version' => :'String',
82
+ :'key' => :'String',
83
+ :'ldap_ca_cert' => :'String',
84
+ :'ldap_url' => :'String',
85
+ :'name' => :'String',
86
+ :'new_name' => :'String',
87
+ :'token' => :'String',
88
+ :'token_expiration' => :'String',
89
+ :'uid_token' => :'String',
90
+ :'update_version' => :'Boolean'
91
+ }
92
+ end
93
+
94
+ # List of attributes with nullable: true
95
+ def self.openapi_nullable
96
+ Set.new([
97
+ ])
98
+ end
99
+
100
+ # Initializes the object
101
+ # @param [Hash] attributes Model attributes in the form of hash
102
+ def initialize(attributes = {})
103
+ if (!attributes.is_a?(Hash))
104
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::UpdateLdapTarget` initialize method"
105
+ end
106
+
107
+ # check to see if the attribute exists and convert string to symbol for hash key
108
+ attributes = attributes.each_with_object({}) { |(k, v), h|
109
+ if (!self.class.attribute_map.key?(k.to_sym))
110
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::UpdateLdapTarget`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
111
+ end
112
+ h[k.to_sym] = v
113
+ }
114
+
115
+ if attributes.key?(:'bind_dn')
116
+ self.bind_dn = attributes[:'bind_dn']
117
+ end
118
+
119
+ if attributes.key?(:'bind_dn_password')
120
+ self.bind_dn_password = attributes[:'bind_dn_password']
121
+ end
122
+
123
+ if attributes.key?(:'comment')
124
+ self.comment = attributes[:'comment']
125
+ end
126
+
127
+ if attributes.key?(:'keep_prev_version')
128
+ self.keep_prev_version = attributes[:'keep_prev_version']
129
+ end
130
+
131
+ if attributes.key?(:'key')
132
+ self.key = attributes[:'key']
133
+ end
134
+
135
+ if attributes.key?(:'ldap_ca_cert')
136
+ self.ldap_ca_cert = attributes[:'ldap_ca_cert']
137
+ end
138
+
139
+ if attributes.key?(:'ldap_url')
140
+ self.ldap_url = attributes[:'ldap_url']
141
+ end
142
+
143
+ if attributes.key?(:'name')
144
+ self.name = attributes[:'name']
145
+ end
146
+
147
+ if attributes.key?(:'new_name')
148
+ self.new_name = attributes[:'new_name']
149
+ end
150
+
151
+ if attributes.key?(:'token')
152
+ self.token = attributes[:'token']
153
+ end
154
+
155
+ if attributes.key?(:'token_expiration')
156
+ self.token_expiration = attributes[:'token_expiration']
157
+ end
158
+
159
+ if attributes.key?(:'uid_token')
160
+ self.uid_token = attributes[:'uid_token']
161
+ end
162
+
163
+ if attributes.key?(:'update_version')
164
+ self.update_version = attributes[:'update_version']
165
+ end
166
+ end
167
+
168
+ # Show invalid properties with the reasons. Usually used together with valid?
169
+ # @return Array for valid properties with the reasons
170
+ def list_invalid_properties
171
+ invalid_properties = Array.new
172
+ if @name.nil?
173
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
174
+ end
175
+
176
+ invalid_properties
177
+ end
178
+
179
+ # Check to see if the all the properties in the model are valid
180
+ # @return true if the model is valid
181
+ def valid?
182
+ return false if @name.nil?
183
+ true
184
+ end
185
+
186
+ # Checks equality by comparing each attribute.
187
+ # @param [Object] Object to be compared
188
+ def ==(o)
189
+ return true if self.equal?(o)
190
+ self.class == o.class &&
191
+ bind_dn == o.bind_dn &&
192
+ bind_dn_password == o.bind_dn_password &&
193
+ comment == o.comment &&
194
+ keep_prev_version == o.keep_prev_version &&
195
+ key == o.key &&
196
+ ldap_ca_cert == o.ldap_ca_cert &&
197
+ ldap_url == o.ldap_url &&
198
+ name == o.name &&
199
+ new_name == o.new_name &&
200
+ token == o.token &&
201
+ token_expiration == o.token_expiration &&
202
+ uid_token == o.uid_token &&
203
+ update_version == o.update_version
204
+ end
205
+
206
+ # @see the `==` method
207
+ # @param [Object] Object to be compared
208
+ def eql?(o)
209
+ self == o
210
+ end
211
+
212
+ # Calculates hash code according to all attributes.
213
+ # @return [Integer] Hash code
214
+ def hash
215
+ [bind_dn, bind_dn_password, comment, keep_prev_version, key, ldap_ca_cert, ldap_url, name, new_name, token, token_expiration, uid_token, update_version].hash
216
+ end
217
+
218
+ # Builds the object from hash
219
+ # @param [Hash] attributes Model attributes in the form of hash
220
+ # @return [Object] Returns the model itself
221
+ def self.build_from_hash(attributes)
222
+ new.build_from_hash(attributes)
223
+ end
224
+
225
+ # Builds the object from hash
226
+ # @param [Hash] attributes Model attributes in the form of hash
227
+ # @return [Object] Returns the model itself
228
+ def build_from_hash(attributes)
229
+ return nil unless attributes.is_a?(Hash)
230
+ attributes = attributes.transform_keys(&:to_sym)
231
+ self.class.openapi_types.each_pair do |key, type|
232
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
233
+ self.send("#{key}=", nil)
234
+ elsif type =~ /\AArray<(.*)>/i
235
+ # check to ensure the input is an array given that the attribute
236
+ # is documented as an array but the input is not
237
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
238
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
239
+ end
240
+ elsif !attributes[self.class.attribute_map[key]].nil?
241
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
242
+ end
243
+ end
244
+
245
+ self
246
+ end
247
+
248
+ # Deserializes the data based on type
249
+ # @param string type Data type
250
+ # @param string value Value to be deserialized
251
+ # @return [Object] Deserialized data
252
+ def _deserialize(type, value)
253
+ case type.to_sym
254
+ when :Time
255
+ Time.parse(value)
256
+ when :Date
257
+ Date.parse(value)
258
+ when :String
259
+ value.to_s
260
+ when :Integer
261
+ value.to_i
262
+ when :Float
263
+ value.to_f
264
+ when :Boolean
265
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
266
+ true
267
+ else
268
+ false
269
+ end
270
+ when :Object
271
+ # generic object (usually a Hash), return directly
272
+ value
273
+ when /\AArray<(?<inner_type>.+)>\z/
274
+ inner_type = Regexp.last_match[:inner_type]
275
+ value.map { |v| _deserialize(inner_type, v) }
276
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
277
+ k_type = Regexp.last_match[:k_type]
278
+ v_type = Regexp.last_match[:v_type]
279
+ {}.tap do |hash|
280
+ value.each do |k, v|
281
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
282
+ end
283
+ end
284
+ else # model
285
+ # models (e.g. Pet) or oneOf
286
+ klass = Akeyless.const_get(type)
287
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
288
+ end
289
+ end
290
+
291
+ # Returns the string representation of the object
292
+ # @return [String] String presentation of the object
293
+ def to_s
294
+ to_hash.to_s
295
+ end
296
+
297
+ # to_body is an alias to to_hash (backward compatibility)
298
+ # @return [Hash] Returns the object in the form of hash
299
+ def to_body
300
+ to_hash
301
+ end
302
+
303
+ # Returns the object in the form of hash
304
+ # @return [Hash] Returns the object in the form of hash
305
+ def to_hash
306
+ hash = {}
307
+ self.class.attribute_map.each_pair do |attr, param|
308
+ value = self.send(attr)
309
+ if value.nil?
310
+ is_nullable = self.class.openapi_nullable.include?(attr)
311
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
312
+ end
313
+
314
+ hash[param] = _to_hash(value)
315
+ end
316
+ hash
317
+ end
318
+
319
+ # Outputs non-array value in the form of hash
320
+ # For object, use to_hash. Otherwise, just return the value
321
+ # @param [Object] value Any valid value
322
+ # @return [Hash] Returns the value in the form of hash
323
+ def _to_hash(value)
324
+ if value.is_a?(Array)
325
+ value.compact.map { |v| _to_hash(v) }
326
+ elsif value.is_a?(Hash)
327
+ {}.tap do |hash|
328
+ value.each { |k, v| hash[k] = _to_hash(v) }
329
+ end
330
+ elsif value.respond_to? :to_hash
331
+ value.to_hash
332
+ else
333
+ value
334
+ end
335
+ end
336
+
337
+ end
338
+
339
+ end
@@ -0,0 +1,328 @@
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: 2.0
7
+ Contact: support@akeyless.io
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Akeyless
17
+ class UpdateLdapTargetDetails
18
+ attr_accessor :bind_dn
19
+
20
+ attr_accessor :bind_dn_password
21
+
22
+ attr_accessor :keep_prev_version
23
+
24
+ attr_accessor :key
25
+
26
+ attr_accessor :ldap_ca_cert
27
+
28
+ attr_accessor :ldap_url
29
+
30
+ # Target name
31
+ attr_accessor :name
32
+
33
+ # Deprecated
34
+ attr_accessor :new_version
35
+
36
+ # The name of a key that used to encrypt the target secret value (if empty, the account default protectionKey key will be used)
37
+ attr_accessor :protection_key
38
+
39
+ # Authentication token (see `/auth` and `/configure`)
40
+ attr_accessor :token
41
+
42
+ attr_accessor :token_expiration
43
+
44
+ # The universal identity token, Required only for universal_identity authentication
45
+ attr_accessor :uid_token
46
+
47
+ # Attribute mapping from ruby-style variable name to JSON key.
48
+ def self.attribute_map
49
+ {
50
+ :'bind_dn' => :'bind-dn',
51
+ :'bind_dn_password' => :'bind-dn-password',
52
+ :'keep_prev_version' => :'keep-prev-version',
53
+ :'key' => :'key',
54
+ :'ldap_ca_cert' => :'ldap-ca-cert',
55
+ :'ldap_url' => :'ldap-url',
56
+ :'name' => :'name',
57
+ :'new_version' => :'new-version',
58
+ :'protection_key' => :'protection_key',
59
+ :'token' => :'token',
60
+ :'token_expiration' => :'token-expiration',
61
+ :'uid_token' => :'uid-token'
62
+ }
63
+ end
64
+
65
+ # Returns all the JSON keys this model knows about
66
+ def self.acceptable_attributes
67
+ attribute_map.values
68
+ end
69
+
70
+ # Attribute type mapping.
71
+ def self.openapi_types
72
+ {
73
+ :'bind_dn' => :'String',
74
+ :'bind_dn_password' => :'String',
75
+ :'keep_prev_version' => :'String',
76
+ :'key' => :'String',
77
+ :'ldap_ca_cert' => :'String',
78
+ :'ldap_url' => :'String',
79
+ :'name' => :'String',
80
+ :'new_version' => :'Boolean',
81
+ :'protection_key' => :'String',
82
+ :'token' => :'String',
83
+ :'token_expiration' => :'String',
84
+ :'uid_token' => :'String'
85
+ }
86
+ end
87
+
88
+ # List of attributes with nullable: true
89
+ def self.openapi_nullable
90
+ Set.new([
91
+ ])
92
+ end
93
+
94
+ # Initializes the object
95
+ # @param [Hash] attributes Model attributes in the form of hash
96
+ def initialize(attributes = {})
97
+ if (!attributes.is_a?(Hash))
98
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::UpdateLdapTargetDetails` initialize method"
99
+ end
100
+
101
+ # check to see if the attribute exists and convert string to symbol for hash key
102
+ attributes = attributes.each_with_object({}) { |(k, v), h|
103
+ if (!self.class.attribute_map.key?(k.to_sym))
104
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::UpdateLdapTargetDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
105
+ end
106
+ h[k.to_sym] = v
107
+ }
108
+
109
+ if attributes.key?(:'bind_dn')
110
+ self.bind_dn = attributes[:'bind_dn']
111
+ end
112
+
113
+ if attributes.key?(:'bind_dn_password')
114
+ self.bind_dn_password = attributes[:'bind_dn_password']
115
+ end
116
+
117
+ if attributes.key?(:'keep_prev_version')
118
+ self.keep_prev_version = attributes[:'keep_prev_version']
119
+ end
120
+
121
+ if attributes.key?(:'key')
122
+ self.key = attributes[:'key']
123
+ end
124
+
125
+ if attributes.key?(:'ldap_ca_cert')
126
+ self.ldap_ca_cert = attributes[:'ldap_ca_cert']
127
+ end
128
+
129
+ if attributes.key?(:'ldap_url')
130
+ self.ldap_url = attributes[:'ldap_url']
131
+ end
132
+
133
+ if attributes.key?(:'name')
134
+ self.name = attributes[:'name']
135
+ end
136
+
137
+ if attributes.key?(:'new_version')
138
+ self.new_version = attributes[:'new_version']
139
+ end
140
+
141
+ if attributes.key?(:'protection_key')
142
+ self.protection_key = attributes[:'protection_key']
143
+ end
144
+
145
+ if attributes.key?(:'token')
146
+ self.token = attributes[:'token']
147
+ end
148
+
149
+ if attributes.key?(:'token_expiration')
150
+ self.token_expiration = attributes[:'token_expiration']
151
+ end
152
+
153
+ if attributes.key?(:'uid_token')
154
+ self.uid_token = attributes[:'uid_token']
155
+ end
156
+ end
157
+
158
+ # Show invalid properties with the reasons. Usually used together with valid?
159
+ # @return Array for valid properties with the reasons
160
+ def list_invalid_properties
161
+ invalid_properties = Array.new
162
+ if @name.nil?
163
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
164
+ end
165
+
166
+ invalid_properties
167
+ end
168
+
169
+ # Check to see if the all the properties in the model are valid
170
+ # @return true if the model is valid
171
+ def valid?
172
+ return false if @name.nil?
173
+ true
174
+ end
175
+
176
+ # Checks equality by comparing each attribute.
177
+ # @param [Object] Object to be compared
178
+ def ==(o)
179
+ return true if self.equal?(o)
180
+ self.class == o.class &&
181
+ bind_dn == o.bind_dn &&
182
+ bind_dn_password == o.bind_dn_password &&
183
+ keep_prev_version == o.keep_prev_version &&
184
+ key == o.key &&
185
+ ldap_ca_cert == o.ldap_ca_cert &&
186
+ ldap_url == o.ldap_url &&
187
+ name == o.name &&
188
+ new_version == o.new_version &&
189
+ protection_key == o.protection_key &&
190
+ token == o.token &&
191
+ token_expiration == o.token_expiration &&
192
+ uid_token == o.uid_token
193
+ end
194
+
195
+ # @see the `==` method
196
+ # @param [Object] Object to be compared
197
+ def eql?(o)
198
+ self == o
199
+ end
200
+
201
+ # Calculates hash code according to all attributes.
202
+ # @return [Integer] Hash code
203
+ def hash
204
+ [bind_dn, bind_dn_password, keep_prev_version, key, ldap_ca_cert, ldap_url, name, new_version, protection_key, token, token_expiration, uid_token].hash
205
+ end
206
+
207
+ # Builds the object from hash
208
+ # @param [Hash] attributes Model attributes in the form of hash
209
+ # @return [Object] Returns the model itself
210
+ def self.build_from_hash(attributes)
211
+ new.build_from_hash(attributes)
212
+ end
213
+
214
+ # Builds the object from hash
215
+ # @param [Hash] attributes Model attributes in the form of hash
216
+ # @return [Object] Returns the model itself
217
+ def build_from_hash(attributes)
218
+ return nil unless attributes.is_a?(Hash)
219
+ attributes = attributes.transform_keys(&:to_sym)
220
+ self.class.openapi_types.each_pair do |key, type|
221
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
222
+ self.send("#{key}=", nil)
223
+ elsif type =~ /\AArray<(.*)>/i
224
+ # check to ensure the input is an array given that the attribute
225
+ # is documented as an array but the input is not
226
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
227
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
228
+ end
229
+ elsif !attributes[self.class.attribute_map[key]].nil?
230
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
231
+ end
232
+ end
233
+
234
+ self
235
+ end
236
+
237
+ # Deserializes the data based on type
238
+ # @param string type Data type
239
+ # @param string value Value to be deserialized
240
+ # @return [Object] Deserialized data
241
+ def _deserialize(type, value)
242
+ case type.to_sym
243
+ when :Time
244
+ Time.parse(value)
245
+ when :Date
246
+ Date.parse(value)
247
+ when :String
248
+ value.to_s
249
+ when :Integer
250
+ value.to_i
251
+ when :Float
252
+ value.to_f
253
+ when :Boolean
254
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
255
+ true
256
+ else
257
+ false
258
+ end
259
+ when :Object
260
+ # generic object (usually a Hash), return directly
261
+ value
262
+ when /\AArray<(?<inner_type>.+)>\z/
263
+ inner_type = Regexp.last_match[:inner_type]
264
+ value.map { |v| _deserialize(inner_type, v) }
265
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
266
+ k_type = Regexp.last_match[:k_type]
267
+ v_type = Regexp.last_match[:v_type]
268
+ {}.tap do |hash|
269
+ value.each do |k, v|
270
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
271
+ end
272
+ end
273
+ else # model
274
+ # models (e.g. Pet) or oneOf
275
+ klass = Akeyless.const_get(type)
276
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
277
+ end
278
+ end
279
+
280
+ # Returns the string representation of the object
281
+ # @return [String] String presentation of the object
282
+ def to_s
283
+ to_hash.to_s
284
+ end
285
+
286
+ # to_body is an alias to to_hash (backward compatibility)
287
+ # @return [Hash] Returns the object in the form of hash
288
+ def to_body
289
+ to_hash
290
+ end
291
+
292
+ # Returns the object in the form of hash
293
+ # @return [Hash] Returns the object in the form of hash
294
+ def to_hash
295
+ hash = {}
296
+ self.class.attribute_map.each_pair do |attr, param|
297
+ value = self.send(attr)
298
+ if value.nil?
299
+ is_nullable = self.class.openapi_nullable.include?(attr)
300
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
301
+ end
302
+
303
+ hash[param] = _to_hash(value)
304
+ end
305
+ hash
306
+ end
307
+
308
+ # Outputs non-array value in the form of hash
309
+ # For object, use to_hash. Otherwise, just return the value
310
+ # @param [Object] value Any valid value
311
+ # @return [Hash] Returns the value in the form of hash
312
+ def _to_hash(value)
313
+ if value.is_a?(Array)
314
+ value.compact.map { |v| _to_hash(v) }
315
+ elsif value.is_a?(Hash)
316
+ {}.tap do |hash|
317
+ value.each { |k, v| hash[k] = _to_hash(v) }
318
+ end
319
+ elsif value.respond_to? :to_hash
320
+ value.to_hash
321
+ else
322
+ value
323
+ end
324
+ end
325
+
326
+ end
327
+
328
+ end