akeyless 5.0.21 → 5.0.22

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 (87) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +13 -1
  3. data/docs/AccountGeneralSettings.md +2 -0
  4. data/docs/ActiveDirectoryPayload.md +6 -0
  5. data/docs/Auth.md +2 -0
  6. data/docs/AuthMethodCreateCert.md +2 -0
  7. data/docs/AuthMethodUpdateCert.md +2 -0
  8. data/docs/AzureADAccessRules.md +2 -0
  9. data/docs/AzureTargetDetails.md +2 -0
  10. data/docs/CertAccessRules.md +2 -0
  11. data/docs/CertificateChainInfo.md +2 -0
  12. data/docs/Configure.md +2 -0
  13. data/docs/ConjurMigration.md +20 -0
  14. data/docs/ConjurPayload.md +24 -0
  15. data/docs/CreateAuthMethodCert.md +2 -0
  16. data/docs/CreateAzureTarget.md +2 -0
  17. data/docs/CreateUSC.md +10 -0
  18. data/docs/DSProducerDetails.md +2 -0
  19. data/docs/DefaultAuthMethodSettings.md +20 -0
  20. data/docs/GatewayCreateMigration.md +15 -1
  21. data/docs/GatewayUpdateMigration.md +14 -0
  22. data/docs/GetPKICertificateOutput.md +2 -0
  23. data/docs/GithubMetadata.md +28 -0
  24. data/docs/HTTPChallengeInfo.md +26 -0
  25. data/docs/IssuerOverviewInfo.md +22 -0
  26. data/docs/ItemGeneralInfo.md +2 -0
  27. data/docs/MigrationStatusReplyObj.md +2 -0
  28. data/docs/MigrationsConfigPart.md +2 -0
  29. data/docs/SecretInfo.md +2 -0
  30. data/docs/TargetCreateAzure.md +2 -0
  31. data/docs/TargetUpdateAzure.md +2 -0
  32. data/docs/UpdateAuthMethodCert.md +2 -0
  33. data/docs/UpdateAzureTarget.md +2 -0
  34. data/docs/V2Api.md +126 -0
  35. data/docs/ValidateCertificateChallenge.md +30 -0
  36. data/docs/ValidateCertificateChallengeOutput.md +24 -0
  37. data/docs/VaultAddress.md +20 -0
  38. data/docs/VaultAddressOutput.md +20 -0
  39. data/lib/akeyless/api/v2_api.rb +128 -0
  40. data/lib/akeyless/models/account_general_settings.rb +10 -1
  41. data/lib/akeyless/models/active_directory_payload.rb +30 -1
  42. data/lib/akeyless/models/auth.rb +13 -1
  43. data/lib/akeyless/models/auth_method_create_cert.rb +11 -1
  44. data/lib/akeyless/models/auth_method_update_cert.rb +11 -1
  45. data/lib/akeyless/models/azure_ad_access_rules.rb +11 -1
  46. data/lib/akeyless/models/azure_target_details.rb +10 -1
  47. data/lib/akeyless/models/cert_access_rules.rb +11 -1
  48. data/lib/akeyless/models/certificate_chain_info.rb +11 -1
  49. data/lib/akeyless/models/configure.rb +13 -1
  50. data/lib/akeyless/models/conjur_migration.rb +223 -0
  51. data/lib/akeyless/models/conjur_payload.rb +241 -0
  52. data/lib/akeyless/models/create_auth_method_cert.rb +11 -1
  53. data/lib/akeyless/models/create_azure_target.rb +13 -1
  54. data/lib/akeyless/models/create_usc.rb +54 -1
  55. data/lib/akeyless/models/default_auth_method_settings.rb +223 -0
  56. data/lib/akeyless/models/ds_producer_details.rb +10 -1
  57. data/lib/akeyless/models/gateway_create_migration.rb +74 -2
  58. data/lib/akeyless/models/gateway_update_migration.rb +73 -1
  59. data/lib/akeyless/models/get_pki_certificate_output.rb +10 -1
  60. data/lib/akeyless/models/github_metadata.rb +259 -0
  61. data/lib/akeyless/models/http_challenge_info.rb +251 -0
  62. data/lib/akeyless/models/issuer_overview_info.rb +232 -0
  63. data/lib/akeyless/models/item_general_info.rb +10 -1
  64. data/lib/akeyless/models/migration_status_reply_obj.rb +10 -1
  65. data/lib/akeyless/models/migrations_config_part.rb +12 -1
  66. data/lib/akeyless/models/secret_info.rb +10 -1
  67. data/lib/akeyless/models/target_create_azure.rb +13 -1
  68. data/lib/akeyless/models/target_update_azure.rb +13 -1
  69. data/lib/akeyless/models/update_auth_method_cert.rb +11 -1
  70. data/lib/akeyless/models/update_azure_target.rb +13 -1
  71. data/lib/akeyless/models/validate_certificate_challenge.rb +279 -0
  72. data/lib/akeyless/models/validate_certificate_challenge_output.rb +242 -0
  73. data/lib/akeyless/models/vault_address.rb +227 -0
  74. data/lib/akeyless/models/vault_address_output.rb +223 -0
  75. data/lib/akeyless/version.rb +1 -1
  76. data/lib/akeyless.rb +10 -0
  77. data/spec/models/conjur_migration_spec.rb +42 -0
  78. data/spec/models/conjur_payload_spec.rb +54 -0
  79. data/spec/models/default_auth_method_settings_spec.rb +42 -0
  80. data/spec/models/github_metadata_spec.rb +66 -0
  81. data/spec/models/http_challenge_info_spec.rb +60 -0
  82. data/spec/models/issuer_overview_info_spec.rb +48 -0
  83. data/spec/models/validate_certificate_challenge_output_spec.rb +54 -0
  84. data/spec/models/validate_certificate_challenge_spec.rb +72 -0
  85. data/spec/models/vault_address_output_spec.rb +42 -0
  86. data/spec/models/vault_address_spec.rb +42 -0
  87. metadata +41 -1
@@ -21,6 +21,8 @@ module Akeyless
21
21
 
22
22
  attr_accessor :data
23
23
 
24
+ attr_accessor :http_challenge_info
25
+
24
26
  attr_accessor :parent_cert
25
27
 
26
28
  attr_accessor :path
@@ -33,6 +35,7 @@ module Akeyless
33
35
  :'cert_display_id' => :'cert_display_id',
34
36
  :'cert_item_id' => :'cert_item_id',
35
37
  :'data' => :'data',
38
+ :'http_challenge_info' => :'http_challenge_info',
36
39
  :'parent_cert' => :'parent_cert',
37
40
  :'path' => :'path',
38
41
  :'reading_token' => :'reading_token'
@@ -50,6 +53,7 @@ module Akeyless
50
53
  :'cert_display_id' => :'String',
51
54
  :'cert_item_id' => :'Integer',
52
55
  :'data' => :'String',
56
+ :'http_challenge_info' => :'HTTPChallengeInfo',
53
57
  :'parent_cert' => :'String',
54
58
  :'path' => :'String',
55
59
  :'reading_token' => :'String'
@@ -89,6 +93,10 @@ module Akeyless
89
93
  self.data = attributes[:'data']
90
94
  end
91
95
 
96
+ if attributes.key?(:'http_challenge_info')
97
+ self.http_challenge_info = attributes[:'http_challenge_info']
98
+ end
99
+
92
100
  if attributes.key?(:'parent_cert')
93
101
  self.parent_cert = attributes[:'parent_cert']
94
102
  end
@@ -125,6 +133,7 @@ module Akeyless
125
133
  cert_display_id == o.cert_display_id &&
126
134
  cert_item_id == o.cert_item_id &&
127
135
  data == o.data &&
136
+ http_challenge_info == o.http_challenge_info &&
128
137
  parent_cert == o.parent_cert &&
129
138
  path == o.path &&
130
139
  reading_token == o.reading_token
@@ -139,7 +148,7 @@ module Akeyless
139
148
  # Calculates hash code according to all attributes.
140
149
  # @return [Integer] Hash code
141
150
  def hash
142
- [cert_display_id, cert_item_id, data, parent_cert, path, reading_token].hash
151
+ [cert_display_id, cert_item_id, data, http_challenge_info, parent_cert, path, reading_token].hash
143
152
  end
144
153
 
145
154
  # Builds the object from hash
@@ -0,0 +1,259 @@
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 GithubMetadata
18
+ attr_accessor :environment_name
19
+
20
+ attr_accessor :organization_name
21
+
22
+ attr_accessor :repository
23
+
24
+ attr_accessor :repository_access
25
+
26
+ attr_accessor :scope
27
+
28
+ attr_accessor :selected_repositories
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'environment_name' => :'environment_name',
34
+ :'organization_name' => :'organization_name',
35
+ :'repository' => :'repository',
36
+ :'repository_access' => :'repository_access',
37
+ :'scope' => :'scope',
38
+ :'selected_repositories' => :'selected_repositories'
39
+ }
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'environment_name' => :'String',
51
+ :'organization_name' => :'String',
52
+ :'repository' => :'String',
53
+ :'repository_access' => :'String',
54
+ :'scope' => :'String',
55
+ :'selected_repositories' => :'String'
56
+ }
57
+ end
58
+
59
+ # List of attributes with nullable: true
60
+ def self.openapi_nullable
61
+ Set.new([
62
+ ])
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ if (!attributes.is_a?(Hash))
69
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::GithubMetadata` initialize method"
70
+ end
71
+
72
+ # check to see if the attribute exists and convert string to symbol for hash key
73
+ attributes = attributes.each_with_object({}) { |(k, v), h|
74
+ if (!self.class.attribute_map.key?(k.to_sym))
75
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::GithubMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
76
+ end
77
+ h[k.to_sym] = v
78
+ }
79
+
80
+ if attributes.key?(:'environment_name')
81
+ self.environment_name = attributes[:'environment_name']
82
+ end
83
+
84
+ if attributes.key?(:'organization_name')
85
+ self.organization_name = attributes[:'organization_name']
86
+ end
87
+
88
+ if attributes.key?(:'repository')
89
+ self.repository = attributes[:'repository']
90
+ end
91
+
92
+ if attributes.key?(:'repository_access')
93
+ self.repository_access = attributes[:'repository_access']
94
+ end
95
+
96
+ if attributes.key?(:'scope')
97
+ self.scope = attributes[:'scope']
98
+ end
99
+
100
+ if attributes.key?(:'selected_repositories')
101
+ self.selected_repositories = attributes[:'selected_repositories']
102
+ end
103
+ end
104
+
105
+ # Show invalid properties with the reasons. Usually used together with valid?
106
+ # @return Array for valid properties with the reasons
107
+ def list_invalid_properties
108
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
109
+ invalid_properties = Array.new
110
+ invalid_properties
111
+ end
112
+
113
+ # Check to see if the all the properties in the model are valid
114
+ # @return true if the model is valid
115
+ def valid?
116
+ warn '[DEPRECATED] the `valid?` method is obsolete'
117
+ true
118
+ end
119
+
120
+ # Checks equality by comparing each attribute.
121
+ # @param [Object] Object to be compared
122
+ def ==(o)
123
+ return true if self.equal?(o)
124
+ self.class == o.class &&
125
+ environment_name == o.environment_name &&
126
+ organization_name == o.organization_name &&
127
+ repository == o.repository &&
128
+ repository_access == o.repository_access &&
129
+ scope == o.scope &&
130
+ selected_repositories == o.selected_repositories
131
+ end
132
+
133
+ # @see the `==` method
134
+ # @param [Object] Object to be compared
135
+ def eql?(o)
136
+ self == o
137
+ end
138
+
139
+ # Calculates hash code according to all attributes.
140
+ # @return [Integer] Hash code
141
+ def hash
142
+ [environment_name, organization_name, repository, repository_access, scope, selected_repositories].hash
143
+ end
144
+
145
+ # Builds the object from hash
146
+ # @param [Hash] attributes Model attributes in the form of hash
147
+ # @return [Object] Returns the model itself
148
+ def self.build_from_hash(attributes)
149
+ return nil unless attributes.is_a?(Hash)
150
+ attributes = attributes.transform_keys(&:to_sym)
151
+ transformed_hash = {}
152
+ openapi_types.each_pair do |key, type|
153
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
154
+ transformed_hash["#{key}"] = nil
155
+ elsif type =~ /\AArray<(.*)>/i
156
+ # check to ensure the input is an array given that the attribute
157
+ # is documented as an array but the input is not
158
+ if attributes[attribute_map[key]].is_a?(Array)
159
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
160
+ end
161
+ elsif !attributes[attribute_map[key]].nil?
162
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
163
+ end
164
+ end
165
+ new(transformed_hash)
166
+ end
167
+
168
+ # Deserializes the data based on type
169
+ # @param string type Data type
170
+ # @param string value Value to be deserialized
171
+ # @return [Object] Deserialized data
172
+ def self._deserialize(type, value)
173
+ case type.to_sym
174
+ when :Time
175
+ Time.parse(value)
176
+ when :Date
177
+ Date.parse(value)
178
+ when :String
179
+ value.to_s
180
+ when :Integer
181
+ value.to_i
182
+ when :Float
183
+ value.to_f
184
+ when :Boolean
185
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
186
+ true
187
+ else
188
+ false
189
+ end
190
+ when :Object
191
+ # generic object (usually a Hash), return directly
192
+ value
193
+ when /\AArray<(?<inner_type>.+)>\z/
194
+ inner_type = Regexp.last_match[:inner_type]
195
+ value.map { |v| _deserialize(inner_type, v) }
196
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
197
+ k_type = Regexp.last_match[:k_type]
198
+ v_type = Regexp.last_match[:v_type]
199
+ {}.tap do |hash|
200
+ value.each do |k, v|
201
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
202
+ end
203
+ end
204
+ else # model
205
+ # models (e.g. Pet) or oneOf
206
+ klass = Akeyless.const_get(type)
207
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
208
+ end
209
+ end
210
+
211
+ # Returns the string representation of the object
212
+ # @return [String] String presentation of the object
213
+ def to_s
214
+ to_hash.to_s
215
+ end
216
+
217
+ # to_body is an alias to to_hash (backward compatibility)
218
+ # @return [Hash] Returns the object in the form of hash
219
+ def to_body
220
+ to_hash
221
+ end
222
+
223
+ # Returns the object in the form of hash
224
+ # @return [Hash] Returns the object in the form of hash
225
+ def to_hash
226
+ hash = {}
227
+ self.class.attribute_map.each_pair do |attr, param|
228
+ value = self.send(attr)
229
+ if value.nil?
230
+ is_nullable = self.class.openapi_nullable.include?(attr)
231
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
232
+ end
233
+
234
+ hash[param] = _to_hash(value)
235
+ end
236
+ hash
237
+ end
238
+
239
+ # Outputs non-array value in the form of hash
240
+ # For object, use to_hash. Otherwise, just return the value
241
+ # @param [Object] value Any valid value
242
+ # @return [Hash] Returns the value in the form of hash
243
+ def _to_hash(value)
244
+ if value.is_a?(Array)
245
+ value.compact.map { |v| _to_hash(v) }
246
+ elsif value.is_a?(Hash)
247
+ {}.tap do |hash|
248
+ value.each { |k, v| hash[k] = _to_hash(v) }
249
+ end
250
+ elsif value.respond_to? :to_hash
251
+ value.to_hash
252
+ else
253
+ value
254
+ end
255
+ end
256
+
257
+ end
258
+
259
+ end
@@ -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: 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
+ # HTTPChallengeInfo contains HTTP-01 challenge details for user display
18
+ class HTTPChallengeInfo
19
+ attr_accessor :file_content
20
+
21
+ attr_accessor :file_path
22
+
23
+ attr_accessor :instructions
24
+
25
+ attr_accessor :key_auth
26
+
27
+ attr_accessor :token
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'file_content' => :'file_content',
33
+ :'file_path' => :'file_path',
34
+ :'instructions' => :'instructions',
35
+ :'key_auth' => :'key_auth',
36
+ :'token' => :'token'
37
+ }
38
+ end
39
+
40
+ # Returns all the JSON keys this model knows about
41
+ def self.acceptable_attributes
42
+ attribute_map.values
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'file_content' => :'String',
49
+ :'file_path' => :'String',
50
+ :'instructions' => :'String',
51
+ :'key_auth' => :'String',
52
+ :'token' => :'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::HTTPChallengeInfo` 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::HTTPChallengeInfo`. 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?(:'file_content')
78
+ self.file_content = attributes[:'file_content']
79
+ end
80
+
81
+ if attributes.key?(:'file_path')
82
+ self.file_path = attributes[:'file_path']
83
+ end
84
+
85
+ if attributes.key?(:'instructions')
86
+ self.instructions = attributes[:'instructions']
87
+ end
88
+
89
+ if attributes.key?(:'key_auth')
90
+ self.key_auth = attributes[:'key_auth']
91
+ end
92
+
93
+ if attributes.key?(:'token')
94
+ self.token = attributes[:'token']
95
+ end
96
+ end
97
+
98
+ # Show invalid properties with the reasons. Usually used together with valid?
99
+ # @return Array for valid properties with the reasons
100
+ def list_invalid_properties
101
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
102
+ invalid_properties = Array.new
103
+ invalid_properties
104
+ end
105
+
106
+ # Check to see if the all the properties in the model are valid
107
+ # @return true if the model is valid
108
+ def valid?
109
+ warn '[DEPRECATED] the `valid?` method is obsolete'
110
+ true
111
+ end
112
+
113
+ # Checks equality by comparing each attribute.
114
+ # @param [Object] Object to be compared
115
+ def ==(o)
116
+ return true if self.equal?(o)
117
+ self.class == o.class &&
118
+ file_content == o.file_content &&
119
+ file_path == o.file_path &&
120
+ instructions == o.instructions &&
121
+ key_auth == o.key_auth &&
122
+ token == o.token
123
+ end
124
+
125
+ # @see the `==` method
126
+ # @param [Object] Object to be compared
127
+ def eql?(o)
128
+ self == o
129
+ end
130
+
131
+ # Calculates hash code according to all attributes.
132
+ # @return [Integer] Hash code
133
+ def hash
134
+ [file_content, file_path, instructions, key_auth, token].hash
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 self.build_from_hash(attributes)
141
+ return nil unless attributes.is_a?(Hash)
142
+ attributes = attributes.transform_keys(&:to_sym)
143
+ transformed_hash = {}
144
+ openapi_types.each_pair do |key, type|
145
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
146
+ transformed_hash["#{key}"] = nil
147
+ elsif type =~ /\AArray<(.*)>/i
148
+ # check to ensure the input is an array given that the attribute
149
+ # is documented as an array but the input is not
150
+ if attributes[attribute_map[key]].is_a?(Array)
151
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
152
+ end
153
+ elsif !attributes[attribute_map[key]].nil?
154
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
155
+ end
156
+ end
157
+ new(transformed_hash)
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 self._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_any_of) || 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