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,251 @@
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
+ # RegexpTokenizerInfo represents a general Regexp tokenization template
18
+ class RegexpTokenizerInfo
19
+ # The Alphabet used for the tokenization
20
+ attr_accessor :alphabet
21
+
22
+ # Transformation to perform on the decrypted data
23
+ attr_accessor :decryption_template
24
+
25
+ # Transformation to perform on the encrypted data, if the required output template doesn't match the input string The output Should still be valid for the Pattern, otherwise the secret would be able to be decrypted.
26
+ attr_accessor :encryption_template
27
+
28
+ # Regexp pattern to extract and deposit the text/encdata
29
+ attr_accessor :pattern
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'alphabet' => :'alphabet',
35
+ :'decryption_template' => :'decryption_template',
36
+ :'encryption_template' => :'encryption_template',
37
+ :'pattern' => :'pattern'
38
+ }
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'alphabet' => :'String',
50
+ :'decryption_template' => :'String',
51
+ :'encryption_template' => :'String',
52
+ :'pattern' => :'String'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::RegexpTokenizerInfo` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!self.class.attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::RegexpTokenizerInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'alphabet')
78
+ self.alphabet = attributes[:'alphabet']
79
+ end
80
+
81
+ if attributes.key?(:'decryption_template')
82
+ self.decryption_template = attributes[:'decryption_template']
83
+ end
84
+
85
+ if attributes.key?(:'encryption_template')
86
+ self.encryption_template = attributes[:'encryption_template']
87
+ end
88
+
89
+ if attributes.key?(:'pattern')
90
+ self.pattern = attributes[:'pattern']
91
+ end
92
+ end
93
+
94
+ # Show invalid properties with the reasons. Usually used together with valid?
95
+ # @return Array for valid properties with the reasons
96
+ def list_invalid_properties
97
+ invalid_properties = Array.new
98
+ invalid_properties
99
+ end
100
+
101
+ # Check to see if the all the properties in the model are valid
102
+ # @return true if the model is valid
103
+ def valid?
104
+ true
105
+ end
106
+
107
+ # Checks equality by comparing each attribute.
108
+ # @param [Object] Object to be compared
109
+ def ==(o)
110
+ return true if self.equal?(o)
111
+ self.class == o.class &&
112
+ alphabet == o.alphabet &&
113
+ decryption_template == o.decryption_template &&
114
+ encryption_template == o.encryption_template &&
115
+ pattern == o.pattern
116
+ end
117
+
118
+ # @see the `==` method
119
+ # @param [Object] Object to be compared
120
+ def eql?(o)
121
+ self == o
122
+ end
123
+
124
+ # Calculates hash code according to all attributes.
125
+ # @return [Integer] Hash code
126
+ def hash
127
+ [alphabet, decryption_template, encryption_template, pattern].hash
128
+ end
129
+
130
+ # Builds the object from hash
131
+ # @param [Hash] attributes Model attributes in the form of hash
132
+ # @return [Object] Returns the model itself
133
+ def self.build_from_hash(attributes)
134
+ new.build_from_hash(attributes)
135
+ end
136
+
137
+ # Builds the object from hash
138
+ # @param [Hash] attributes Model attributes in the form of hash
139
+ # @return [Object] Returns the model itself
140
+ def build_from_hash(attributes)
141
+ return nil unless attributes.is_a?(Hash)
142
+ attributes = attributes.transform_keys(&:to_sym)
143
+ self.class.openapi_types.each_pair do |key, type|
144
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
145
+ self.send("#{key}=", nil)
146
+ elsif type =~ /\AArray<(.*)>/i
147
+ # check to ensure the input is an array given that the attribute
148
+ # is documented as an array but the input is not
149
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
150
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
151
+ end
152
+ elsif !attributes[self.class.attribute_map[key]].nil?
153
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
154
+ end
155
+ end
156
+
157
+ self
158
+ end
159
+
160
+ # Deserializes the data based on type
161
+ # @param string type Data type
162
+ # @param string value Value to be deserialized
163
+ # @return [Object] Deserialized data
164
+ def _deserialize(type, value)
165
+ case type.to_sym
166
+ when :Time
167
+ Time.parse(value)
168
+ when :Date
169
+ Date.parse(value)
170
+ when :String
171
+ value.to_s
172
+ when :Integer
173
+ value.to_i
174
+ when :Float
175
+ value.to_f
176
+ when :Boolean
177
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
178
+ true
179
+ else
180
+ false
181
+ end
182
+ when :Object
183
+ # generic object (usually a Hash), return directly
184
+ value
185
+ when /\AArray<(?<inner_type>.+)>\z/
186
+ inner_type = Regexp.last_match[:inner_type]
187
+ value.map { |v| _deserialize(inner_type, v) }
188
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
189
+ k_type = Regexp.last_match[:k_type]
190
+ v_type = Regexp.last_match[:v_type]
191
+ {}.tap do |hash|
192
+ value.each do |k, v|
193
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
194
+ end
195
+ end
196
+ else # model
197
+ # models (e.g. Pet) or oneOf
198
+ klass = Akeyless.const_get(type)
199
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
200
+ end
201
+ end
202
+
203
+ # Returns the string representation of the object
204
+ # @return [String] String presentation of the object
205
+ def to_s
206
+ to_hash.to_s
207
+ end
208
+
209
+ # to_body is an alias to to_hash (backward compatibility)
210
+ # @return [Hash] Returns the object in the form of hash
211
+ def to_body
212
+ to_hash
213
+ end
214
+
215
+ # Returns the object in the form of hash
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_hash
218
+ hash = {}
219
+ self.class.attribute_map.each_pair do |attr, param|
220
+ value = self.send(attr)
221
+ if value.nil?
222
+ is_nullable = self.class.openapi_nullable.include?(attr)
223
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
224
+ end
225
+
226
+ hash[param] = _to_hash(value)
227
+ end
228
+ hash
229
+ end
230
+
231
+ # Outputs non-array value in the form of hash
232
+ # For object, use to_hash. Otherwise, just return the value
233
+ # @param [Object] value Any valid value
234
+ # @return [Hash] Returns the value in the form of hash
235
+ def _to_hash(value)
236
+ if value.is_a?(Array)
237
+ value.compact.map { |v| _to_hash(v) }
238
+ elsif value.is_a?(Hash)
239
+ {}.tap do |hash|
240
+ value.each { |k, v| hash[k] = _to_hash(v) }
241
+ end
242
+ elsif value.respond_to? :to_hash
243
+ value.to_hash
244
+ else
245
+ value
246
+ end
247
+ end
248
+
249
+ end
250
+
251
+ end
@@ -0,0 +1,245 @@
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 RotateSecret
18
+ # Rotated Secret name
19
+ attr_accessor :name
20
+
21
+ # Authentication token (see `/auth` and `/configure`)
22
+ attr_accessor :token
23
+
24
+ # The universal identity token, Required only for universal_identity authentication
25
+ attr_accessor :uid_token
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'name' => :'name',
31
+ :'token' => :'token',
32
+ :'uid_token' => :'uid-token'
33
+ }
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'name' => :'String',
45
+ :'token' => :'String',
46
+ :'uid_token' => :'String'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::RotateSecret` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!self.class.attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::RotateSecret`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'name')
72
+ self.name = attributes[:'name']
73
+ end
74
+
75
+ if attributes.key?(:'token')
76
+ self.token = attributes[:'token']
77
+ end
78
+
79
+ if attributes.key?(:'uid_token')
80
+ self.uid_token = attributes[:'uid_token']
81
+ end
82
+ end
83
+
84
+ # Show invalid properties with the reasons. Usually used together with valid?
85
+ # @return Array for valid properties with the reasons
86
+ def list_invalid_properties
87
+ invalid_properties = Array.new
88
+ if @name.nil?
89
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
90
+ end
91
+
92
+ invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ return false if @name.nil?
99
+ true
100
+ end
101
+
102
+ # Checks equality by comparing each attribute.
103
+ # @param [Object] Object to be compared
104
+ def ==(o)
105
+ return true if self.equal?(o)
106
+ self.class == o.class &&
107
+ name == o.name &&
108
+ token == o.token &&
109
+ uid_token == o.uid_token
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(o)
115
+ self == o
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Integer] Hash code
120
+ def hash
121
+ [name, token, uid_token].hash
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def self.build_from_hash(attributes)
128
+ new.build_from_hash(attributes)
129
+ end
130
+
131
+ # Builds the object from hash
132
+ # @param [Hash] attributes Model attributes in the form of hash
133
+ # @return [Object] Returns the model itself
134
+ def build_from_hash(attributes)
135
+ return nil unless attributes.is_a?(Hash)
136
+ attributes = attributes.transform_keys(&:to_sym)
137
+ self.class.openapi_types.each_pair do |key, type|
138
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
139
+ self.send("#{key}=", nil)
140
+ elsif type =~ /\AArray<(.*)>/i
141
+ # check to ensure the input is an array given that the attribute
142
+ # is documented as an array but the input is not
143
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
144
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
145
+ end
146
+ elsif !attributes[self.class.attribute_map[key]].nil?
147
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
148
+ end
149
+ end
150
+
151
+ self
152
+ end
153
+
154
+ # Deserializes the data based on type
155
+ # @param string type Data type
156
+ # @param string value Value to be deserialized
157
+ # @return [Object] Deserialized data
158
+ def _deserialize(type, value)
159
+ case type.to_sym
160
+ when :Time
161
+ Time.parse(value)
162
+ when :Date
163
+ Date.parse(value)
164
+ when :String
165
+ value.to_s
166
+ when :Integer
167
+ value.to_i
168
+ when :Float
169
+ value.to_f
170
+ when :Boolean
171
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
172
+ true
173
+ else
174
+ false
175
+ end
176
+ when :Object
177
+ # generic object (usually a Hash), return directly
178
+ value
179
+ when /\AArray<(?<inner_type>.+)>\z/
180
+ inner_type = Regexp.last_match[:inner_type]
181
+ value.map { |v| _deserialize(inner_type, v) }
182
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
183
+ k_type = Regexp.last_match[:k_type]
184
+ v_type = Regexp.last_match[:v_type]
185
+ {}.tap do |hash|
186
+ value.each do |k, v|
187
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
188
+ end
189
+ end
190
+ else # model
191
+ # models (e.g. Pet) or oneOf
192
+ klass = Akeyless.const_get(type)
193
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
194
+ end
195
+ end
196
+
197
+ # Returns the string representation of the object
198
+ # @return [String] String presentation of the object
199
+ def to_s
200
+ to_hash.to_s
201
+ end
202
+
203
+ # to_body is an alias to to_hash (backward compatibility)
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_body
206
+ to_hash
207
+ end
208
+
209
+ # Returns the object in the form of hash
210
+ # @return [Hash] Returns the object in the form of hash
211
+ def to_hash
212
+ hash = {}
213
+ self.class.attribute_map.each_pair do |attr, param|
214
+ value = self.send(attr)
215
+ if value.nil?
216
+ is_nullable = self.class.openapi_nullable.include?(attr)
217
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
218
+ end
219
+
220
+ hash[param] = _to_hash(value)
221
+ end
222
+ hash
223
+ end
224
+
225
+ # Outputs non-array value in the form of hash
226
+ # For object, use to_hash. Otherwise, just return the value
227
+ # @param [Object] value Any valid value
228
+ # @return [Hash] Returns the value in the form of hash
229
+ def _to_hash(value)
230
+ if value.is_a?(Array)
231
+ value.compact.map { |v| _to_hash(v) }
232
+ elsif value.is_a?(Hash)
233
+ {}.tap do |hash|
234
+ value.each { |k, v| hash[k] = _to_hash(v) }
235
+ end
236
+ elsif value.respond_to? :to_hash
237
+ value.to_hash
238
+ else
239
+ value
240
+ end
241
+ end
242
+
243
+ end
244
+
245
+ end
@@ -0,0 +1,219 @@
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 RotatedSecretOutput
18
+ attr_accessor :name
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'name' => :'name'
24
+ }
25
+ end
26
+
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'name' => :'String'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::RotatedSecretOutput` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::RotatedSecretOutput`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'name')
61
+ self.name = attributes[:'name']
62
+ end
63
+ end
64
+
65
+ # Show invalid properties with the reasons. Usually used together with valid?
66
+ # @return Array for valid properties with the reasons
67
+ def list_invalid_properties
68
+ invalid_properties = Array.new
69
+ invalid_properties
70
+ end
71
+
72
+ # Check to see if the all the properties in the model are valid
73
+ # @return true if the model is valid
74
+ def valid?
75
+ true
76
+ end
77
+
78
+ # Checks equality by comparing each attribute.
79
+ # @param [Object] Object to be compared
80
+ def ==(o)
81
+ return true if self.equal?(o)
82
+ self.class == o.class &&
83
+ name == o.name
84
+ end
85
+
86
+ # @see the `==` method
87
+ # @param [Object] Object to be compared
88
+ def eql?(o)
89
+ self == o
90
+ end
91
+
92
+ # Calculates hash code according to all attributes.
93
+ # @return [Integer] Hash code
94
+ def hash
95
+ [name].hash
96
+ end
97
+
98
+ # Builds the object from hash
99
+ # @param [Hash] attributes Model attributes in the form of hash
100
+ # @return [Object] Returns the model itself
101
+ def self.build_from_hash(attributes)
102
+ new.build_from_hash(attributes)
103
+ end
104
+
105
+ # Builds the object from hash
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ # @return [Object] Returns the model itself
108
+ def build_from_hash(attributes)
109
+ return nil unless attributes.is_a?(Hash)
110
+ attributes = attributes.transform_keys(&:to_sym)
111
+ self.class.openapi_types.each_pair do |key, type|
112
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
113
+ self.send("#{key}=", nil)
114
+ elsif type =~ /\AArray<(.*)>/i
115
+ # check to ensure the input is an array given that the attribute
116
+ # is documented as an array but the input is not
117
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
118
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
119
+ end
120
+ elsif !attributes[self.class.attribute_map[key]].nil?
121
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
122
+ end
123
+ end
124
+
125
+ self
126
+ end
127
+
128
+ # Deserializes the data based on type
129
+ # @param string type Data type
130
+ # @param string value Value to be deserialized
131
+ # @return [Object] Deserialized data
132
+ def _deserialize(type, value)
133
+ case type.to_sym
134
+ when :Time
135
+ Time.parse(value)
136
+ when :Date
137
+ Date.parse(value)
138
+ when :String
139
+ value.to_s
140
+ when :Integer
141
+ value.to_i
142
+ when :Float
143
+ value.to_f
144
+ when :Boolean
145
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
146
+ true
147
+ else
148
+ false
149
+ end
150
+ when :Object
151
+ # generic object (usually a Hash), return directly
152
+ value
153
+ when /\AArray<(?<inner_type>.+)>\z/
154
+ inner_type = Regexp.last_match[:inner_type]
155
+ value.map { |v| _deserialize(inner_type, v) }
156
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
157
+ k_type = Regexp.last_match[:k_type]
158
+ v_type = Regexp.last_match[:v_type]
159
+ {}.tap do |hash|
160
+ value.each do |k, v|
161
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
162
+ end
163
+ end
164
+ else # model
165
+ # models (e.g. Pet) or oneOf
166
+ klass = Akeyless.const_get(type)
167
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
168
+ end
169
+ end
170
+
171
+ # Returns the string representation of the object
172
+ # @return [String] String presentation of the object
173
+ def to_s
174
+ to_hash.to_s
175
+ end
176
+
177
+ # to_body is an alias to to_hash (backward compatibility)
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_body
180
+ to_hash
181
+ end
182
+
183
+ # Returns the object in the form of hash
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_hash
186
+ hash = {}
187
+ self.class.attribute_map.each_pair do |attr, param|
188
+ value = self.send(attr)
189
+ if value.nil?
190
+ is_nullable = self.class.openapi_nullable.include?(attr)
191
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
192
+ end
193
+
194
+ hash[param] = _to_hash(value)
195
+ end
196
+ hash
197
+ end
198
+
199
+ # Outputs non-array value in the form of hash
200
+ # For object, use to_hash. Otherwise, just return the value
201
+ # @param [Object] value Any valid value
202
+ # @return [Hash] Returns the value in the form of hash
203
+ def _to_hash(value)
204
+ if value.is_a?(Array)
205
+ value.compact.map { |v| _to_hash(v) }
206
+ elsif value.is_a?(Hash)
207
+ {}.tap do |hash|
208
+ value.each { |k, v| hash[k] = _to_hash(v) }
209
+ end
210
+ elsif value.respond_to? :to_hash
211
+ value.to_hash
212
+ else
213
+ value
214
+ end
215
+ end
216
+
217
+ end
218
+
219
+ end