akeyless 2.16.3 → 2.16.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (160) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +39 -1
  3. data/docs/AwsS3LogForwardingConfig.md +2 -0
  4. data/docs/CreateAuthMethod.md +1 -1
  5. data/docs/CreateAuthMethodAWSIAM.md +1 -1
  6. data/docs/CreateAuthMethodAzureAD.md +1 -1
  7. data/docs/CreateAuthMethodCert.md +1 -1
  8. data/docs/CreateAuthMethodGCP.md +1 -1
  9. data/docs/CreateAuthMethodHuawei.md +1 -1
  10. data/docs/CreateAuthMethodK8S.md +1 -1
  11. data/docs/CreateAuthMethodLDAP.md +1 -1
  12. data/docs/CreateAuthMethodOAuth2.md +1 -1
  13. data/docs/CreateAuthMethodOIDC.md +1 -1
  14. data/docs/CreateAuthMethodSAML.md +1 -1
  15. data/docs/CreateAuthMethodUniversalIdentity.md +1 -1
  16. data/docs/CreateClassicKey.md +12 -0
  17. data/docs/CreateRotatedSecret.md +28 -0
  18. data/docs/CreateSalesforceTarget.md +42 -0
  19. data/docs/CreateSalesforceTargetOutput.md +18 -0
  20. data/docs/CreateTokenizer.md +42 -0
  21. data/docs/CreateTokenizerOutput.md +18 -0
  22. data/docs/Detokenize.md +26 -0
  23. data/docs/DetokenizeOutput.md +18 -0
  24. data/docs/DynamicSecretProducerInfo.md +2 -0
  25. data/docs/EmailTokenizerInfo.md +22 -0
  26. data/docs/GatewayCreateMigration.md +50 -0
  27. data/docs/GatewayDeleteMigration.md +22 -0
  28. data/docs/GatewayGetMigration.md +22 -0
  29. data/docs/GatewayMigrationCreateOutput.md +18 -0
  30. data/docs/GatewayMigrationDeleteOutput.md +18 -0
  31. data/docs/GatewayMigrationGetOutput.md +18 -0
  32. data/docs/GatewayMigrationUpdateOutput.md +18 -0
  33. data/docs/GatewayUpdateMigration.md +52 -0
  34. data/docs/GetSecretValue.md +2 -0
  35. data/docs/HashiPayload.md +2 -0
  36. data/docs/Item.md +2 -0
  37. data/docs/ItemGeneralInfo.md +5 -1
  38. data/docs/ListTargets.md +2 -0
  39. data/docs/LogForwardingConfigPart.md +0 -2
  40. data/docs/Producer.md +2 -0
  41. data/docs/RegexpTokenizerInfo.md +24 -0
  42. data/docs/RotateSecret.md +22 -0
  43. data/docs/RotatedSecretOutput.md +18 -0
  44. data/docs/SystemAccessCredentialsReplyObj.md +2 -0
  45. data/docs/TargetTypeDetailsInput.md +12 -0
  46. data/docs/Tokenize.md +26 -0
  47. data/docs/TokenizeOutput.md +20 -0
  48. data/docs/TokenizerInfo.md +18 -0
  49. data/docs/UpdateAuthMethod.md +1 -1
  50. data/docs/UpdateAuthMethodAWSIAM.md +1 -1
  51. data/docs/UpdateAuthMethodAzureAD.md +1 -1
  52. data/docs/UpdateAuthMethodCert.md +1 -1
  53. data/docs/UpdateAuthMethodGCP.md +1 -1
  54. data/docs/UpdateAuthMethodK8S.md +1 -1
  55. data/docs/UpdateAuthMethodLDAP.md +1 -1
  56. data/docs/UpdateAuthMethodOAuth2.md +1 -1
  57. data/docs/UpdateAuthMethodOIDC.md +1 -1
  58. data/docs/UpdateAuthMethodSAML.md +1 -1
  59. data/docs/UpdateAuthMethodUniversalIdentity.md +1 -1
  60. data/docs/UpdateRotatedSecret.md +28 -0
  61. data/docs/UpdateSalesforceTarget.md +48 -0
  62. data/docs/UpdateSalesforceTargetOutput.md +18 -0
  63. data/docs/UpdateTokenizer.md +46 -0
  64. data/docs/UpdateTokenizerOutput.md +18 -0
  65. data/docs/V2Api.md +762 -6
  66. data/docs/VaultlessTokenizerInfo.md +28 -0
  67. data/lib/akeyless/api/v2_api.rb +769 -1
  68. data/lib/akeyless/models/aws_s3_log_forwarding_config.rb +10 -1
  69. data/lib/akeyless/models/create_auth_method.rb +0 -2
  70. data/lib/akeyless/models/create_auth_method_awsiam.rb +0 -2
  71. data/lib/akeyless/models/create_auth_method_azure_ad.rb +0 -2
  72. data/lib/akeyless/models/create_auth_method_cert.rb +0 -2
  73. data/lib/akeyless/models/create_auth_method_gcp.rb +0 -2
  74. data/lib/akeyless/models/create_auth_method_huawei.rb +0 -2
  75. data/lib/akeyless/models/create_auth_method_k8_s.rb +0 -2
  76. data/lib/akeyless/models/create_auth_method_ldap.rb +0 -2
  77. data/lib/akeyless/models/create_auth_method_o_auth2.rb +0 -2
  78. data/lib/akeyless/models/create_auth_method_oidc.rb +0 -2
  79. data/lib/akeyless/models/create_auth_method_saml.rb +0 -2
  80. data/lib/akeyless/models/create_auth_method_universal_identity.rb +0 -2
  81. data/lib/akeyless/models/create_classic_key.rb +61 -1
  82. data/lib/akeyless/models/create_rotated_secret.rb +153 -1
  83. data/lib/akeyless/models/create_salesforce_target.rb +375 -0
  84. data/lib/akeyless/models/create_salesforce_target_output.rb +219 -0
  85. data/lib/akeyless/models/create_tokenizer.rb +358 -0
  86. data/lib/akeyless/models/create_tokenizer_output.rb +219 -0
  87. data/lib/akeyless/models/detokenize.rb +271 -0
  88. data/lib/akeyless/models/detokenize_output.rb +219 -0
  89. data/lib/akeyless/models/dynamic_secret_producer_info.rb +10 -1
  90. data/lib/akeyless/models/email_tokenizer_info.rb +241 -0
  91. data/lib/akeyless/models/gateway_create_migration.rb +374 -0
  92. data/lib/akeyless/models/gateway_delete_migration.rb +246 -0
  93. data/lib/akeyless/models/gateway_get_migration.rb +240 -0
  94. data/lib/akeyless/models/gateway_migration_create_output.rb +219 -0
  95. data/lib/akeyless/models/gateway_migration_delete_output.rb +219 -0
  96. data/lib/akeyless/models/gateway_migration_get_output.rb +219 -0
  97. data/lib/akeyless/models/gateway_migration_update_output.rb +219 -0
  98. data/lib/akeyless/models/gateway_update_migration.rb +383 -0
  99. data/lib/akeyless/models/gateway_update_producer_hana_db.rb +1 -1
  100. data/lib/akeyless/models/get_secret_value.rb +10 -1
  101. data/lib/akeyless/models/hashi_payload.rb +10 -1
  102. data/lib/akeyless/models/item.rb +10 -1
  103. data/lib/akeyless/models/item_general_info.rb +22 -4
  104. data/lib/akeyless/models/list_targets.rb +13 -1
  105. data/lib/akeyless/models/log_forwarding_config_part.rb +1 -10
  106. data/lib/akeyless/models/producer.rb +10 -1
  107. data/lib/akeyless/models/regexp_tokenizer_info.rb +251 -0
  108. data/lib/akeyless/models/rotate_secret.rb +245 -0
  109. data/lib/akeyless/models/rotated_secret_output.rb +219 -0
  110. data/lib/akeyless/models/system_access_credentials_reply_obj.rb +11 -1
  111. data/lib/akeyless/models/target_type_details_input.rb +59 -1
  112. data/lib/akeyless/models/tokenize.rb +271 -0
  113. data/lib/akeyless/models/tokenize_output.rb +228 -0
  114. data/lib/akeyless/models/tokenizer_info.rb +219 -0
  115. data/lib/akeyless/models/update_auth_method.rb +0 -2
  116. data/lib/akeyless/models/update_auth_method_awsiam.rb +0 -2
  117. data/lib/akeyless/models/update_auth_method_azure_ad.rb +0 -2
  118. data/lib/akeyless/models/update_auth_method_cert.rb +0 -2
  119. data/lib/akeyless/models/update_auth_method_gcp.rb +0 -2
  120. data/lib/akeyless/models/update_auth_method_k8_s.rb +0 -2
  121. data/lib/akeyless/models/update_auth_method_ldap.rb +0 -2
  122. data/lib/akeyless/models/update_auth_method_o_auth2.rb +0 -2
  123. data/lib/akeyless/models/update_auth_method_oidc.rb +0 -2
  124. data/lib/akeyless/models/update_auth_method_saml.rb +0 -2
  125. data/lib/akeyless/models/update_auth_method_universal_identity.rb +0 -2
  126. data/lib/akeyless/models/update_rotated_secret.rb +153 -1
  127. data/lib/akeyless/models/update_salesforce_target.rb +404 -0
  128. data/lib/akeyless/models/update_salesforce_target_output.rb +219 -0
  129. data/lib/akeyless/models/update_tokenizer.rb +382 -0
  130. data/lib/akeyless/models/update_tokenizer_output.rb +219 -0
  131. data/lib/akeyless/models/vaultless_tokenizer_info.rb +267 -0
  132. data/lib/akeyless/version.rb +1 -1
  133. data/lib/akeyless.rb +26 -0
  134. data/spec/models/create_salesforce_target_output_spec.rb +34 -0
  135. data/spec/models/create_salesforce_target_spec.rb +106 -0
  136. data/spec/models/create_tokenizer_output_spec.rb +34 -0
  137. data/spec/models/create_tokenizer_spec.rb +106 -0
  138. data/spec/models/detokenize_output_spec.rb +34 -0
  139. data/spec/models/detokenize_spec.rb +58 -0
  140. data/spec/models/email_tokenizer_info_spec.rb +46 -0
  141. data/spec/models/gateway_create_migration_spec.rb +130 -0
  142. data/spec/models/gateway_delete_migration_spec.rb +46 -0
  143. data/spec/models/gateway_get_migration_spec.rb +46 -0
  144. data/spec/models/gateway_migration_create_output_spec.rb +34 -0
  145. data/spec/models/gateway_migration_delete_output_spec.rb +34 -0
  146. data/spec/models/gateway_migration_get_output_spec.rb +34 -0
  147. data/spec/models/gateway_migration_update_output_spec.rb +34 -0
  148. data/spec/models/gateway_update_migration_spec.rb +136 -0
  149. data/spec/models/regexp_tokenizer_info_spec.rb +52 -0
  150. data/spec/models/rotate_secret_spec.rb +46 -0
  151. data/spec/models/rotated_secret_output_spec.rb +34 -0
  152. data/spec/models/tokenize_output_spec.rb +40 -0
  153. data/spec/models/tokenize_spec.rb +58 -0
  154. data/spec/models/tokenizer_info_spec.rb +34 -0
  155. data/spec/models/update_salesforce_target_output_spec.rb +34 -0
  156. data/spec/models/update_salesforce_target_spec.rb +124 -0
  157. data/spec/models/update_tokenizer_output_spec.rb +34 -0
  158. data/spec/models/update_tokenizer_spec.rb +118 -0
  159. data/spec/models/vaultless_tokenizer_info_spec.rb +64 -0
  160. metadata +563 -459
@@ -35,8 +35,6 @@ module Akeyless
35
35
 
36
36
  attr_accessor :splunk_config
37
37
 
38
- attr_accessor :std_out
39
-
40
38
  attr_accessor :syslog_config
41
39
 
42
40
  attr_accessor :target_log_type
@@ -54,7 +52,6 @@ module Akeyless
54
52
  :'logz_io_config' => :'logz_io_config',
55
53
  :'pull_interval_sec' => :'pull_interval_sec',
56
54
  :'splunk_config' => :'splunk_config',
57
- :'std_out' => :'std_out',
58
55
  :'syslog_config' => :'syslog_config',
59
56
  :'target_log_type' => :'target_log_type'
60
57
  }
@@ -78,7 +75,6 @@ module Akeyless
78
75
  :'logz_io_config' => :'LogzIoLogForwardingConfig',
79
76
  :'pull_interval_sec' => :'String',
80
77
  :'splunk_config' => :'SplunkLogForwardingConfig',
81
- :'std_out' => :'Boolean',
82
78
  :'syslog_config' => :'SyslogLogForwardingConfig',
83
79
  :'target_log_type' => :'String'
84
80
  }
@@ -145,10 +141,6 @@ module Akeyless
145
141
  self.splunk_config = attributes[:'splunk_config']
146
142
  end
147
143
 
148
- if attributes.key?(:'std_out')
149
- self.std_out = attributes[:'std_out']
150
- end
151
-
152
144
  if attributes.key?(:'syslog_config')
153
145
  self.syslog_config = attributes[:'syslog_config']
154
146
  end
@@ -186,7 +178,6 @@ module Akeyless
186
178
  logz_io_config == o.logz_io_config &&
187
179
  pull_interval_sec == o.pull_interval_sec &&
188
180
  splunk_config == o.splunk_config &&
189
- std_out == o.std_out &&
190
181
  syslog_config == o.syslog_config &&
191
182
  target_log_type == o.target_log_type
192
183
  end
@@ -200,7 +191,7 @@ module Akeyless
200
191
  # Calculates hash code according to all attributes.
201
192
  # @return [Integer] Hash code
202
193
  def hash
203
- [aws_s3_config, azure_analytics_config, datadog_config, elasticsearch_config, logan_enable, logan_url, logstash_config, logz_io_config, pull_interval_sec, splunk_config, std_out, syslog_config, target_log_type].hash
194
+ [aws_s3_config, azure_analytics_config, datadog_config, elasticsearch_config, logan_enable, logan_url, logstash_config, logz_io_config, pull_interval_sec, splunk_config, syslog_config, target_log_type].hash
204
195
  end
205
196
 
206
197
  # Builds the object from hash
@@ -17,6 +17,8 @@ module Akeyless
17
17
  class Producer
18
18
  attr_accessor :active
19
19
 
20
+ attr_accessor :failure_message
21
+
20
22
  attr_accessor :id
21
23
 
22
24
  attr_accessor :init
@@ -29,6 +31,7 @@ module Akeyless
29
31
  def self.attribute_map
30
32
  {
31
33
  :'active' => :'active',
34
+ :'failure_message' => :'failure_message',
32
35
  :'id' => :'id',
33
36
  :'init' => :'init',
34
37
  :'name' => :'name',
@@ -45,6 +48,7 @@ module Akeyless
45
48
  def self.openapi_types
46
49
  {
47
50
  :'active' => :'Boolean',
51
+ :'failure_message' => :'String',
48
52
  :'id' => :'Integer',
49
53
  :'init' => :'Boolean',
50
54
  :'name' => :'String',
@@ -77,6 +81,10 @@ module Akeyless
77
81
  self.active = attributes[:'active']
78
82
  end
79
83
 
84
+ if attributes.key?(:'failure_message')
85
+ self.failure_message = attributes[:'failure_message']
86
+ end
87
+
80
88
  if attributes.key?(:'id')
81
89
  self.id = attributes[:'id']
82
90
  end
@@ -113,6 +121,7 @@ module Akeyless
113
121
  return true if self.equal?(o)
114
122
  self.class == o.class &&
115
123
  active == o.active &&
124
+ failure_message == o.failure_message &&
116
125
  id == o.id &&
117
126
  init == o.init &&
118
127
  name == o.name &&
@@ -128,7 +137,7 @@ module Akeyless
128
137
  # Calculates hash code according to all attributes.
129
138
  # @return [Integer] Hash code
130
139
  def hash
131
- [active, id, init, name, type].hash
140
+ [active, failure_message, id, init, name, type].hash
132
141
  end
133
142
 
134
143
  # Builds the object from hash
@@ -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