akeyless 5.0.23 → 5.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +12 -6
  3. data/docs/AccountGeneralSettings.md +2 -0
  4. data/docs/AgenticRule.md +20 -0
  5. data/docs/AgenticRules.md +20 -0
  6. data/docs/CreateDBTarget.md +8 -0
  7. data/docs/CreateRole.md +2 -0
  8. data/docs/CreateUSC.md +5 -1
  9. data/docs/DSProducerDetails.md +10 -0
  10. data/docs/DbTargetDetails.md +8 -0
  11. data/docs/DeleteRoleRule.md +1 -1
  12. data/docs/EsmListSecretsOutput.md +2 -0
  13. data/docs/GatewayMigrationCreateOutput.md +2 -0
  14. data/docs/ItemGeneralInfo.md +2 -0
  15. data/docs/ListItems.md +2 -0
  16. data/docs/RuntimeAuthorityCommand.md +28 -0
  17. data/docs/SetDefaultProfile.md +20 -0
  18. data/docs/SetDefaultProfileOutput.md +18 -0
  19. data/docs/SetRoleRule.md +1 -1
  20. data/docs/SystemAccessCredentialsReplyObj.md +2 -0
  21. data/docs/Target.md +2 -0
  22. data/docs/TargetCreateArtifactory.md +2 -0
  23. data/docs/TargetCreateAws.md +2 -0
  24. data/docs/TargetCreateAzure.md +2 -0
  25. data/docs/TargetCreateDB.md +10 -0
  26. data/docs/TargetCreateDigiCert.md +2 -0
  27. data/docs/TargetCreateDockerhub.md +2 -0
  28. data/docs/TargetCreateEks.md +2 -0
  29. data/docs/TargetCreateGcp.md +2 -0
  30. data/docs/TargetCreateGemini.md +2 -0
  31. data/docs/TargetCreateGithub.md +2 -0
  32. data/docs/TargetCreateGitlab.md +2 -0
  33. data/docs/TargetCreateGke.md +2 -0
  34. data/docs/TargetCreateGlobalSign.md +2 -0
  35. data/docs/TargetCreateGlobalSignAtlas.md +2 -0
  36. data/docs/TargetCreateGodaddy.md +2 -0
  37. data/docs/TargetCreateGoogleTrust.md +2 -0
  38. data/docs/TargetCreateHashiVault.md +2 -0
  39. data/docs/TargetCreateK8s.md +2 -0
  40. data/docs/TargetCreateLdap.md +2 -0
  41. data/docs/TargetCreateLetsEncrypt.md +2 -0
  42. data/docs/TargetCreateLinked.md +2 -0
  43. data/docs/TargetCreateOpenAI.md +2 -0
  44. data/docs/TargetCreatePing.md +2 -0
  45. data/docs/TargetCreateRabbitMq.md +2 -0
  46. data/docs/TargetCreateSalesforce.md +2 -0
  47. data/docs/TargetCreateSectigo.md +2 -0
  48. data/docs/TargetCreateSplunk.md +2 -0
  49. data/docs/TargetCreateSsh.md +2 -0
  50. data/docs/TargetCreateWeb.md +2 -0
  51. data/docs/TargetCreateWindows.md +2 -0
  52. data/docs/TargetCreateZeroSSL.md +2 -0
  53. data/docs/TargetUpdateArtifactory.md +2 -0
  54. data/docs/TargetUpdateAws.md +2 -0
  55. data/docs/TargetUpdateAzure.md +2 -0
  56. data/docs/TargetUpdateDB.md +10 -0
  57. data/docs/TargetUpdateDockerhub.md +2 -0
  58. data/docs/TargetUpdateEks.md +2 -0
  59. data/docs/TargetUpdateGcp.md +2 -0
  60. data/docs/TargetUpdateGemini.md +2 -0
  61. data/docs/TargetUpdateGithub.md +2 -0
  62. data/docs/TargetUpdateGitlab.md +2 -0
  63. data/docs/TargetUpdateGke.md +2 -0
  64. data/docs/TargetUpdateGlobalSign.md +2 -0
  65. data/docs/TargetUpdateGlobalSignAtlas.md +2 -0
  66. data/docs/TargetUpdateGodaddy.md +2 -0
  67. data/docs/TargetUpdateGoogleTrust.md +2 -0
  68. data/docs/TargetUpdateHashiVault.md +2 -0
  69. data/docs/TargetUpdateK8s.md +2 -0
  70. data/docs/TargetUpdateLdap.md +2 -0
  71. data/docs/TargetUpdateLetsEncrypt.md +2 -0
  72. data/docs/TargetUpdateOpenAI.md +2 -0
  73. data/docs/TargetUpdatePing.md +2 -0
  74. data/docs/TargetUpdateRabbitMq.md +2 -0
  75. data/docs/TargetUpdateSalesforce.md +2 -0
  76. data/docs/TargetUpdateSectigo.md +2 -0
  77. data/docs/TargetUpdateSsh.md +2 -0
  78. data/docs/TargetUpdateWeb.md +2 -0
  79. data/docs/TargetUpdateWindows.md +2 -0
  80. data/docs/TargetUpdateZeroSSL.md +2 -0
  81. data/docs/UpdateDBTarget.md +8 -0
  82. data/docs/UpdateItem.md +5 -1
  83. data/docs/UpdateRole.md +2 -0
  84. data/docs/UpdateTarget.md +2 -0
  85. data/docs/UscList.md +4 -0
  86. data/docs/UscListSecretsOutput.md +2 -0
  87. data/docs/V2Api.md +67 -5
  88. data/lib/akeyless/api/v2_api.rb +69 -5
  89. data/lib/akeyless/models/account_general_settings.rb +10 -1
  90. data/lib/akeyless/models/agentic_rule.rb +223 -0
  91. data/lib/akeyless/models/agentic_rules.rb +227 -0
  92. data/lib/akeyless/models/create_db_target.rb +41 -1
  93. data/lib/akeyless/models/create_role.rb +11 -1
  94. data/lib/akeyless/models/create_usc.rb +24 -4
  95. data/lib/akeyless/models/db_target_details.rb +41 -1
  96. data/lib/akeyless/models/delete_role_rule.rb +1 -1
  97. data/lib/akeyless/models/ds_producer_details.rb +50 -1
  98. data/lib/akeyless/models/esm_list_secrets_output.rb +10 -1
  99. data/lib/akeyless/models/gateway_migration_create_output.rb +10 -1
  100. data/lib/akeyless/models/item_general_info.rb +10 -1
  101. data/lib/akeyless/models/list_items.rb +13 -1
  102. data/lib/akeyless/models/runtime_authority_command.rb +288 -0
  103. data/lib/akeyless/models/set_default_profile.rb +234 -0
  104. data/lib/akeyless/models/set_default_profile_output.rb +214 -0
  105. data/lib/akeyless/models/set_role_rule.rb +1 -1
  106. data/lib/akeyless/models/system_access_credentials_reply_obj.rb +11 -1
  107. data/lib/akeyless/models/target.rb +10 -1
  108. data/lib/akeyless/models/target_create_artifactory.rb +11 -1
  109. data/lib/akeyless/models/target_create_aws.rb +11 -1
  110. data/lib/akeyless/models/target_create_azure.rb +11 -1
  111. data/lib/akeyless/models/target_create_db.rb +51 -1
  112. data/lib/akeyless/models/target_create_digi_cert.rb +11 -1
  113. data/lib/akeyless/models/target_create_dockerhub.rb +11 -1
  114. data/lib/akeyless/models/target_create_eks.rb +11 -1
  115. data/lib/akeyless/models/target_create_gcp.rb +11 -1
  116. data/lib/akeyless/models/target_create_gemini.rb +11 -1
  117. data/lib/akeyless/models/target_create_github.rb +11 -1
  118. data/lib/akeyless/models/target_create_gitlab.rb +11 -1
  119. data/lib/akeyless/models/target_create_gke.rb +11 -1
  120. data/lib/akeyless/models/target_create_global_sign.rb +11 -1
  121. data/lib/akeyless/models/target_create_global_sign_atlas.rb +11 -1
  122. data/lib/akeyless/models/target_create_godaddy.rb +11 -1
  123. data/lib/akeyless/models/target_create_google_trust.rb +11 -1
  124. data/lib/akeyless/models/target_create_hashi_vault.rb +11 -1
  125. data/lib/akeyless/models/target_create_k8s.rb +11 -1
  126. data/lib/akeyless/models/target_create_ldap.rb +11 -1
  127. data/lib/akeyless/models/target_create_lets_encrypt.rb +11 -1
  128. data/lib/akeyless/models/target_create_linked.rb +11 -1
  129. data/lib/akeyless/models/target_create_open_ai.rb +11 -1
  130. data/lib/akeyless/models/target_create_ping.rb +11 -1
  131. data/lib/akeyless/models/target_create_rabbit_mq.rb +11 -1
  132. data/lib/akeyless/models/target_create_salesforce.rb +11 -1
  133. data/lib/akeyless/models/target_create_sectigo.rb +11 -1
  134. data/lib/akeyless/models/target_create_splunk.rb +11 -1
  135. data/lib/akeyless/models/target_create_ssh.rb +11 -1
  136. data/lib/akeyless/models/target_create_web.rb +11 -1
  137. data/lib/akeyless/models/target_create_windows.rb +11 -1
  138. data/lib/akeyless/models/target_create_zero_ssl.rb +11 -1
  139. data/lib/akeyless/models/target_update_artifactory.rb +11 -1
  140. data/lib/akeyless/models/target_update_aws.rb +11 -1
  141. data/lib/akeyless/models/target_update_azure.rb +11 -1
  142. data/lib/akeyless/models/target_update_db.rb +51 -1
  143. data/lib/akeyless/models/target_update_dockerhub.rb +11 -1
  144. data/lib/akeyless/models/target_update_eks.rb +11 -1
  145. data/lib/akeyless/models/target_update_gcp.rb +11 -1
  146. data/lib/akeyless/models/target_update_gemini.rb +11 -1
  147. data/lib/akeyless/models/target_update_github.rb +11 -1
  148. data/lib/akeyless/models/target_update_gitlab.rb +11 -1
  149. data/lib/akeyless/models/target_update_gke.rb +11 -1
  150. data/lib/akeyless/models/target_update_global_sign.rb +11 -1
  151. data/lib/akeyless/models/target_update_global_sign_atlas.rb +11 -1
  152. data/lib/akeyless/models/target_update_godaddy.rb +11 -1
  153. data/lib/akeyless/models/target_update_google_trust.rb +11 -1
  154. data/lib/akeyless/models/target_update_hashi_vault.rb +11 -1
  155. data/lib/akeyless/models/target_update_k8s.rb +11 -1
  156. data/lib/akeyless/models/target_update_ldap.rb +11 -1
  157. data/lib/akeyless/models/target_update_lets_encrypt.rb +11 -1
  158. data/lib/akeyless/models/target_update_open_ai.rb +11 -1
  159. data/lib/akeyless/models/target_update_ping.rb +11 -1
  160. data/lib/akeyless/models/target_update_rabbit_mq.rb +11 -1
  161. data/lib/akeyless/models/target_update_salesforce.rb +11 -1
  162. data/lib/akeyless/models/target_update_sectigo.rb +11 -1
  163. data/lib/akeyless/models/target_update_ssh.rb +11 -1
  164. data/lib/akeyless/models/target_update_web.rb +11 -1
  165. data/lib/akeyless/models/target_update_windows.rb +11 -1
  166. data/lib/akeyless/models/target_update_zero_ssl.rb +11 -1
  167. data/lib/akeyless/models/update_db_target.rb +41 -1
  168. data/lib/akeyless/models/update_item.rb +24 -4
  169. data/lib/akeyless/models/update_role.rb +11 -1
  170. data/lib/akeyless/models/update_target.rb +11 -1
  171. data/lib/akeyless/models/usc_list.rb +21 -1
  172. data/lib/akeyless/models/usc_list_secrets_output.rb +10 -1
  173. data/lib/akeyless/version.rb +1 -1
  174. data/lib/akeyless.rb +5 -0
  175. data/spec/models/agentic_rule_spec.rb +42 -0
  176. data/spec/models/agentic_rules_spec.rb +42 -0
  177. data/spec/models/runtime_authority_command_spec.rb +66 -0
  178. data/spec/models/set_default_profile_output_spec.rb +36 -0
  179. data/spec/models/set_default_profile_spec.rb +42 -0
  180. metadata +22 -2
@@ -0,0 +1,288 @@
1
+ =begin
2
+ #Akeyless API
3
+
4
+ #The purpose of this application is to provide access to Akeyless API.
5
+
6
+ The version of the OpenAPI document: 3.0
7
+ Contact: support@akeyless.io
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.10.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Akeyless
17
+ class RuntimeAuthorityCommand
18
+ # Agent identifier for auditing
19
+ attr_accessor :agent_id
20
+
21
+ # Set output format to JSON
22
+ attr_accessor :json
23
+
24
+ # Secret name (dynamic secret or rotated secret)
25
+ attr_accessor :name
26
+
27
+ # Query or action payload (SQL, natural language, or CLI-style)
28
+ attr_accessor :payload
29
+
30
+ # Authentication token (see `/auth` and `/configure`)
31
+ attr_accessor :token
32
+
33
+ # The universal identity token, Required only for universal_identity authentication
34
+ attr_accessor :uid_token
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'agent_id' => :'agent-id',
40
+ :'json' => :'json',
41
+ :'name' => :'name',
42
+ :'payload' => :'payload',
43
+ :'token' => :'token',
44
+ :'uid_token' => :'uid-token'
45
+ }
46
+ end
47
+
48
+ # Returns all the JSON keys this model knows about
49
+ def self.acceptable_attributes
50
+ attribute_map.values
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.openapi_types
55
+ {
56
+ :'agent_id' => :'String',
57
+ :'json' => :'Boolean',
58
+ :'name' => :'String',
59
+ :'payload' => :'String',
60
+ :'token' => :'String',
61
+ :'uid_token' => :'String'
62
+ }
63
+ end
64
+
65
+ # List of attributes with nullable: true
66
+ def self.openapi_nullable
67
+ Set.new([
68
+ ])
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::RuntimeAuthorityCommand` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ attributes = attributes.each_with_object({}) { |(k, v), h|
80
+ if (!self.class.attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::RuntimeAuthorityCommand`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
82
+ end
83
+ h[k.to_sym] = v
84
+ }
85
+
86
+ if attributes.key?(:'agent_id')
87
+ self.agent_id = attributes[:'agent_id']
88
+ else
89
+ self.agent_id = nil
90
+ end
91
+
92
+ if attributes.key?(:'json')
93
+ self.json = attributes[:'json']
94
+ else
95
+ self.json = false
96
+ end
97
+
98
+ if attributes.key?(:'name')
99
+ self.name = attributes[:'name']
100
+ else
101
+ self.name = nil
102
+ end
103
+
104
+ if attributes.key?(:'payload')
105
+ self.payload = attributes[:'payload']
106
+ else
107
+ self.payload = nil
108
+ end
109
+
110
+ if attributes.key?(:'token')
111
+ self.token = attributes[:'token']
112
+ end
113
+
114
+ if attributes.key?(:'uid_token')
115
+ self.uid_token = attributes[:'uid_token']
116
+ end
117
+ end
118
+
119
+ # Show invalid properties with the reasons. Usually used together with valid?
120
+ # @return Array for valid properties with the reasons
121
+ def list_invalid_properties
122
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
123
+ invalid_properties = Array.new
124
+ if @agent_id.nil?
125
+ invalid_properties.push('invalid value for "agent_id", agent_id cannot be nil.')
126
+ end
127
+
128
+ if @name.nil?
129
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
130
+ end
131
+
132
+ if @payload.nil?
133
+ invalid_properties.push('invalid value for "payload", payload cannot be nil.')
134
+ end
135
+
136
+ invalid_properties
137
+ end
138
+
139
+ # Check to see if the all the properties in the model are valid
140
+ # @return true if the model is valid
141
+ def valid?
142
+ warn '[DEPRECATED] the `valid?` method is obsolete'
143
+ return false if @agent_id.nil?
144
+ return false if @name.nil?
145
+ return false if @payload.nil?
146
+ true
147
+ end
148
+
149
+ # Checks equality by comparing each attribute.
150
+ # @param [Object] Object to be compared
151
+ def ==(o)
152
+ return true if self.equal?(o)
153
+ self.class == o.class &&
154
+ agent_id == o.agent_id &&
155
+ json == o.json &&
156
+ name == o.name &&
157
+ payload == o.payload &&
158
+ token == o.token &&
159
+ uid_token == o.uid_token
160
+ end
161
+
162
+ # @see the `==` method
163
+ # @param [Object] Object to be compared
164
+ def eql?(o)
165
+ self == o
166
+ end
167
+
168
+ # Calculates hash code according to all attributes.
169
+ # @return [Integer] Hash code
170
+ def hash
171
+ [agent_id, json, name, payload, token, uid_token].hash
172
+ end
173
+
174
+ # Builds the object from hash
175
+ # @param [Hash] attributes Model attributes in the form of hash
176
+ # @return [Object] Returns the model itself
177
+ def self.build_from_hash(attributes)
178
+ return nil unless attributes.is_a?(Hash)
179
+ attributes = attributes.transform_keys(&:to_sym)
180
+ transformed_hash = {}
181
+ openapi_types.each_pair do |key, type|
182
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
183
+ transformed_hash["#{key}"] = nil
184
+ elsif type =~ /\AArray<(.*)>/i
185
+ # check to ensure the input is an array given that the attribute
186
+ # is documented as an array but the input is not
187
+ if attributes[attribute_map[key]].is_a?(Array)
188
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
189
+ end
190
+ elsif !attributes[attribute_map[key]].nil?
191
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
192
+ end
193
+ end
194
+ new(transformed_hash)
195
+ end
196
+
197
+ # Deserializes the data based on type
198
+ # @param string type Data type
199
+ # @param string value Value to be deserialized
200
+ # @return [Object] Deserialized data
201
+ def self._deserialize(type, value)
202
+ case type.to_sym
203
+ when :Time
204
+ Time.parse(value)
205
+ when :Date
206
+ Date.parse(value)
207
+ when :String
208
+ value.to_s
209
+ when :Integer
210
+ value.to_i
211
+ when :Float
212
+ value.to_f
213
+ when :Boolean
214
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
215
+ true
216
+ else
217
+ false
218
+ end
219
+ when :Object
220
+ # generic object (usually a Hash), return directly
221
+ value
222
+ when /\AArray<(?<inner_type>.+)>\z/
223
+ inner_type = Regexp.last_match[:inner_type]
224
+ value.map { |v| _deserialize(inner_type, v) }
225
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
226
+ k_type = Regexp.last_match[:k_type]
227
+ v_type = Regexp.last_match[:v_type]
228
+ {}.tap do |hash|
229
+ value.each do |k, v|
230
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
231
+ end
232
+ end
233
+ else # model
234
+ # models (e.g. Pet) or oneOf
235
+ klass = Akeyless.const_get(type)
236
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
237
+ end
238
+ end
239
+
240
+ # Returns the string representation of the object
241
+ # @return [String] String presentation of the object
242
+ def to_s
243
+ to_hash.to_s
244
+ end
245
+
246
+ # to_body is an alias to to_hash (backward compatibility)
247
+ # @return [Hash] Returns the object in the form of hash
248
+ def to_body
249
+ to_hash
250
+ end
251
+
252
+ # Returns the object in the form of hash
253
+ # @return [Hash] Returns the object in the form of hash
254
+ def to_hash
255
+ hash = {}
256
+ self.class.attribute_map.each_pair do |attr, param|
257
+ value = self.send(attr)
258
+ if value.nil?
259
+ is_nullable = self.class.openapi_nullable.include?(attr)
260
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
261
+ end
262
+
263
+ hash[param] = _to_hash(value)
264
+ end
265
+ hash
266
+ end
267
+
268
+ # Outputs non-array value in the form of hash
269
+ # For object, use to_hash. Otherwise, just return the value
270
+ # @param [Object] value Any valid value
271
+ # @return [Hash] Returns the value in the form of hash
272
+ def _to_hash(value)
273
+ if value.is_a?(Array)
274
+ value.compact.map { |v| _to_hash(v) }
275
+ elsif value.is_a?(Hash)
276
+ {}.tap do |hash|
277
+ value.each { |k, v| hash[k] = _to_hash(v) }
278
+ end
279
+ elsif value.respond_to? :to_hash
280
+ value.to_hash
281
+ else
282
+ value
283
+ end
284
+ end
285
+
286
+ end
287
+
288
+ end
@@ -0,0 +1,234 @@
1
+ =begin
2
+ #Akeyless API
3
+
4
+ #The purpose of this application is to provide access to Akeyless API.
5
+
6
+ The version of the OpenAPI document: 3.0
7
+ Contact: support@akeyless.io
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.10.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Akeyless
17
+ class SetDefaultProfile
18
+ # Set output format to JSON
19
+ attr_accessor :json
20
+
21
+ # Profile name to use as the default
22
+ attr_accessor :profile
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'json' => :'json',
28
+ :'profile' => :'profile'
29
+ }
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'json' => :'Boolean',
41
+ :'profile' => :'String'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::SetDefaultProfile` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::SetDefaultProfile`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'json')
67
+ self.json = attributes[:'json']
68
+ else
69
+ self.json = false
70
+ end
71
+
72
+ if attributes.key?(:'profile')
73
+ self.profile = attributes[:'profile']
74
+ else
75
+ self.profile = nil
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
83
+ invalid_properties = Array.new
84
+ if @profile.nil?
85
+ invalid_properties.push('invalid value for "profile", profile cannot be nil.')
86
+ end
87
+
88
+ invalid_properties
89
+ end
90
+
91
+ # Check to see if the all the properties in the model are valid
92
+ # @return true if the model is valid
93
+ def valid?
94
+ warn '[DEPRECATED] the `valid?` method is obsolete'
95
+ return false if @profile.nil?
96
+ true
97
+ end
98
+
99
+ # Checks equality by comparing each attribute.
100
+ # @param [Object] Object to be compared
101
+ def ==(o)
102
+ return true if self.equal?(o)
103
+ self.class == o.class &&
104
+ json == o.json &&
105
+ profile == o.profile
106
+ end
107
+
108
+ # @see the `==` method
109
+ # @param [Object] Object to be compared
110
+ def eql?(o)
111
+ self == o
112
+ end
113
+
114
+ # Calculates hash code according to all attributes.
115
+ # @return [Integer] Hash code
116
+ def hash
117
+ [json, profile].hash
118
+ end
119
+
120
+ # Builds the object from hash
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ # @return [Object] Returns the model itself
123
+ def self.build_from_hash(attributes)
124
+ return nil unless attributes.is_a?(Hash)
125
+ attributes = attributes.transform_keys(&:to_sym)
126
+ transformed_hash = {}
127
+ openapi_types.each_pair do |key, type|
128
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
129
+ transformed_hash["#{key}"] = nil
130
+ elsif type =~ /\AArray<(.*)>/i
131
+ # check to ensure the input is an array given that the attribute
132
+ # is documented as an array but the input is not
133
+ if attributes[attribute_map[key]].is_a?(Array)
134
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
135
+ end
136
+ elsif !attributes[attribute_map[key]].nil?
137
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
138
+ end
139
+ end
140
+ new(transformed_hash)
141
+ end
142
+
143
+ # Deserializes the data based on type
144
+ # @param string type Data type
145
+ # @param string value Value to be deserialized
146
+ # @return [Object] Deserialized data
147
+ def self._deserialize(type, value)
148
+ case type.to_sym
149
+ when :Time
150
+ Time.parse(value)
151
+ when :Date
152
+ Date.parse(value)
153
+ when :String
154
+ value.to_s
155
+ when :Integer
156
+ value.to_i
157
+ when :Float
158
+ value.to_f
159
+ when :Boolean
160
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
161
+ true
162
+ else
163
+ false
164
+ end
165
+ when :Object
166
+ # generic object (usually a Hash), return directly
167
+ value
168
+ when /\AArray<(?<inner_type>.+)>\z/
169
+ inner_type = Regexp.last_match[:inner_type]
170
+ value.map { |v| _deserialize(inner_type, v) }
171
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
172
+ k_type = Regexp.last_match[:k_type]
173
+ v_type = Regexp.last_match[:v_type]
174
+ {}.tap do |hash|
175
+ value.each do |k, v|
176
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
177
+ end
178
+ end
179
+ else # model
180
+ # models (e.g. Pet) or oneOf
181
+ klass = Akeyless.const_get(type)
182
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
183
+ end
184
+ end
185
+
186
+ # Returns the string representation of the object
187
+ # @return [String] String presentation of the object
188
+ def to_s
189
+ to_hash.to_s
190
+ end
191
+
192
+ # to_body is an alias to to_hash (backward compatibility)
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_body
195
+ to_hash
196
+ end
197
+
198
+ # Returns the object in the form of hash
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_hash
201
+ hash = {}
202
+ self.class.attribute_map.each_pair do |attr, param|
203
+ value = self.send(attr)
204
+ if value.nil?
205
+ is_nullable = self.class.openapi_nullable.include?(attr)
206
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
207
+ end
208
+
209
+ hash[param] = _to_hash(value)
210
+ end
211
+ hash
212
+ end
213
+
214
+ # Outputs non-array value in the form of hash
215
+ # For object, use to_hash. Otherwise, just return the value
216
+ # @param [Object] value Any valid value
217
+ # @return [Hash] Returns the value in the form of hash
218
+ def _to_hash(value)
219
+ if value.is_a?(Array)
220
+ value.compact.map { |v| _to_hash(v) }
221
+ elsif value.is_a?(Hash)
222
+ {}.tap do |hash|
223
+ value.each { |k, v| hash[k] = _to_hash(v) }
224
+ end
225
+ elsif value.respond_to? :to_hash
226
+ value.to_hash
227
+ else
228
+ value
229
+ end
230
+ end
231
+
232
+ end
233
+
234
+ end