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
@@ -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 GatewayMigrationDeleteOutput
18
+ attr_accessor :migration_id
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'migration_id' => :'migration_id'
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
+ :'migration_id' => :'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::GatewayMigrationDeleteOutput` 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::GatewayMigrationDeleteOutput`. 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?(:'migration_id')
61
+ self.migration_id = attributes[:'migration_id']
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
+ migration_id == o.migration_id
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
+ [migration_id].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
@@ -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 GatewayMigrationGetOutput
18
+ attr_accessor :body
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'body' => :'body'
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
+ :'body' => :'MigrationsConfigPart'
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::GatewayMigrationGetOutput` 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::GatewayMigrationGetOutput`. 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?(:'body')
61
+ self.body = attributes[:'body']
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
+ body == o.body
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
+ [body].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
@@ -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 GatewayMigrationUpdateOutput
18
+ attr_accessor :migration_name
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'migration_name' => :'migration_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
+ :'migration_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::GatewayMigrationUpdateOutput` 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::GatewayMigrationUpdateOutput`. 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?(:'migration_name')
61
+ self.migration_name = attributes[:'migration_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
+ migration_name == o.migration_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
+ [migration_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