seatschart 0.3.0 → 0.4.0

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 (36) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +39 -6
  3. data/lib/seatschart/api/auth_api.rb +81 -4
  4. data/lib/seatschart/api/billing_api.rb +4 -0
  5. data/lib/seatschart/api/charts_api.rb +11 -11
  6. data/lib/seatschart/api/events_api.rb +20 -20
  7. data/lib/seatschart/api/public_api.rb +6 -6
  8. data/lib/seatschart/api/workspace_api.rb +1213 -47
  9. data/lib/seatschart/models/api_error.rb +4 -4
  10. data/lib/seatschart/models/delete_api_workspaces_by_workspace_id_keys_by_key_id200_response.rb +237 -0
  11. data/lib/seatschart/models/get_api_workspaces200_response_items_inner.rb +50 -4
  12. data/lib/seatschart/models/get_api_workspaces_by_workspace_id_keys200_response.rb +239 -0
  13. data/lib/seatschart/models/get_api_workspaces_by_workspace_id_keys200_response_api_keys_inner.rb +321 -0
  14. data/lib/seatschart/models/get_api_workspaces_created_by_api_parameter.rb +103 -0
  15. data/lib/seatschart/models/get_api_workspaces_overview_created_by_api_parameter.rb +103 -0
  16. data/lib/seatschart/models/patch_api_events_by_event_id_request.rb +15 -15
  17. data/lib/seatschart/models/patch_api_workspaces_by_workspace_id_keys_by_key_id200_response.rb +221 -0
  18. data/lib/seatschart/models/patch_api_workspaces_by_workspace_id_keys_by_key_id_request.rb +292 -0
  19. data/lib/seatschart/models/patch_api_workspaces_by_workspace_id_request.rb +288 -0
  20. data/lib/seatschart/models/post_api_auth_new_workspace_request.rb +294 -0
  21. data/lib/seatschart/models/post_api_workspaces200_response.rb +468 -0
  22. data/lib/seatschart/models/post_api_workspaces200_response_api_key.rb +332 -0
  23. data/lib/seatschart/models/post_api_workspaces200_response_template.rb +260 -0
  24. data/lib/seatschart/models/post_api_workspaces200_response_template_webhooks_inner.rb +284 -0
  25. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_actions_delete200_response.rb +319 -0
  26. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_actions_delete_request.rb +281 -0
  27. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_invitations_request.rb +300 -0
  28. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_keys201_response.rb +237 -0
  29. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_keys201_response_api_key.rb +338 -0
  30. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_keys_request.rb +299 -0
  31. data/lib/seatschart/models/post_api_workspaces_request.rb +100 -4
  32. data/lib/seatschart/models/post_api_workspaces_request_issue_key.rb +294 -0
  33. data/lib/seatschart/version.rb +1 -1
  34. data/lib/seatschart.rb +20 -1
  35. metadata +22 -3
  36. data/lib/seatschart/models/put_api_charts_by_chart_id_map_draft_request.rb +0 -349
@@ -0,0 +1,288 @@
1
+ =begin
2
+ #SeatsChart API
3
+
4
+ #Seat inventory and locking API for B2B2C integrations. Authenticate using `x-api-key` (partners) or `Authorization: Bearer` with an HS256 JWT.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.11.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module SeatsChart
17
+ class PatchApiWorkspacesByWorkspaceIdRequest
18
+ attr_accessor :display_name
19
+
20
+ # Your organizer id (letters, digits and `_ . ~ -`); `null` removes it. Unique among the workspaces you administer: 409 `external_id_taken` names the workspace that has it.
21
+ attr_accessor :external_id
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'display_name' => :'displayName',
27
+ :'external_id' => :'externalId'
28
+ }
29
+ end
30
+
31
+ # Returns all the JSON keys this model knows about
32
+ def self.acceptable_attributes
33
+ attribute_map.values
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.openapi_types
38
+ {
39
+ :'display_name' => :'String',
40
+ :'external_id' => :'String'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ :'external_id'
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 `SeatsChart::PatchApiWorkspacesByWorkspaceIdRequest` 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 `SeatsChart::PatchApiWorkspacesByWorkspaceIdRequest`. 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?(:'display_name')
67
+ self.display_name = attributes[:'display_name']
68
+ end
69
+
70
+ if attributes.key?(:'external_id')
71
+ self.external_id = attributes[:'external_id']
72
+ end
73
+ end
74
+
75
+ # Show invalid properties with the reasons. Usually used together with valid?
76
+ # @return Array for valid properties with the reasons
77
+ def list_invalid_properties
78
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
79
+ invalid_properties = Array.new
80
+ if !@display_name.nil? && @display_name.to_s.length > 512
81
+ invalid_properties.push('invalid value for "display_name", the character length must be smaller than or equal to 512.')
82
+ end
83
+
84
+ if !@display_name.nil? && @display_name.to_s.length < 1
85
+ invalid_properties.push('invalid value for "display_name", the character length must be great than or equal to 1.')
86
+ end
87
+
88
+ if !@external_id.nil? && @external_id.to_s.length > 128
89
+ invalid_properties.push('invalid value for "external_id", the character length must be smaller than or equal to 128.')
90
+ end
91
+
92
+ if !@external_id.nil? && @external_id.to_s.length < 1
93
+ invalid_properties.push('invalid value for "external_id", the character length must be great than or equal to 1.')
94
+ end
95
+
96
+ pattern = Regexp.new(/^[A-Za-z0-9_.~-]{1,128}$/)
97
+ if !@external_id.nil? && @external_id !~ pattern
98
+ invalid_properties.push("invalid value for \"external_id\", must conform to the pattern #{pattern}.")
99
+ end
100
+
101
+ invalid_properties
102
+ end
103
+
104
+ # Check to see if the all the properties in the model are valid
105
+ # @return true if the model is valid
106
+ def valid?
107
+ warn '[DEPRECATED] the `valid?` method is obsolete'
108
+ return false if !@display_name.nil? && @display_name.to_s.length > 512
109
+ return false if !@display_name.nil? && @display_name.to_s.length < 1
110
+ return false if !@external_id.nil? && @external_id.to_s.length > 128
111
+ return false if !@external_id.nil? && @external_id.to_s.length < 1
112
+ return false if !@external_id.nil? && @external_id !~ Regexp.new(/^[A-Za-z0-9_.~-]{1,128}$/)
113
+ true
114
+ end
115
+
116
+ # Custom attribute writer method with validation
117
+ # @param [Object] display_name Value to be assigned
118
+ def display_name=(display_name)
119
+ if display_name.nil?
120
+ fail ArgumentError, 'display_name cannot be nil'
121
+ end
122
+
123
+ if display_name.to_s.length > 512
124
+ fail ArgumentError, 'invalid value for "display_name", the character length must be smaller than or equal to 512.'
125
+ end
126
+
127
+ if display_name.to_s.length < 1
128
+ fail ArgumentError, 'invalid value for "display_name", the character length must be great than or equal to 1.'
129
+ end
130
+
131
+ @display_name = display_name
132
+ end
133
+
134
+ # Custom attribute writer method with validation
135
+ # @param [Object] external_id Value to be assigned
136
+ def external_id=(external_id)
137
+ if !external_id.nil? && external_id.to_s.length > 128
138
+ fail ArgumentError, 'invalid value for "external_id", the character length must be smaller than or equal to 128.'
139
+ end
140
+
141
+ if !external_id.nil? && external_id.to_s.length < 1
142
+ fail ArgumentError, 'invalid value for "external_id", the character length must be great than or equal to 1.'
143
+ end
144
+
145
+ pattern = Regexp.new(/^[A-Za-z0-9_.~-]{1,128}$/)
146
+ if !external_id.nil? && external_id !~ pattern
147
+ fail ArgumentError, "invalid value for \"external_id\", must conform to the pattern #{pattern}."
148
+ end
149
+
150
+ @external_id = external_id
151
+ end
152
+
153
+ # Checks equality by comparing each attribute.
154
+ # @param [Object] Object to be compared
155
+ def ==(o)
156
+ return true if self.equal?(o)
157
+ self.class == o.class &&
158
+ display_name == o.display_name &&
159
+ external_id == o.external_id
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
+ [display_name, external_id].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 = SeatsChart.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,294 @@
1
+ =begin
2
+ #SeatsChart API
3
+
4
+ #Seat inventory and locking API for B2B2C integrations. Authenticate using `x-api-key` (partners) or `Authorization: Bearer` with an HS256 JWT.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.11.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module SeatsChart
17
+ class PostApiAuthNewWorkspaceRequest
18
+ # Token of the 403 `ERR_NO_WORKSPACE` sign-in answer.
19
+ attr_accessor :new_workspace_token
20
+
21
+ attr_accessor :workspace_name
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'new_workspace_token' => :'newWorkspaceToken',
27
+ :'workspace_name' => :'workspaceName'
28
+ }
29
+ end
30
+
31
+ # Returns all the JSON keys this model knows about
32
+ def self.acceptable_attributes
33
+ attribute_map.values
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.openapi_types
38
+ {
39
+ :'new_workspace_token' => :'String',
40
+ :'workspace_name' => :'String'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SeatsChart::PostApiAuthNewWorkspaceRequest` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ attributes = attributes.each_with_object({}) { |(k, v), h|
59
+ if (!self.class.attribute_map.key?(k.to_sym))
60
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SeatsChart::PostApiAuthNewWorkspaceRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
61
+ end
62
+ h[k.to_sym] = v
63
+ }
64
+
65
+ if attributes.key?(:'new_workspace_token')
66
+ self.new_workspace_token = attributes[:'new_workspace_token']
67
+ else
68
+ self.new_workspace_token = nil
69
+ end
70
+
71
+ if attributes.key?(:'workspace_name')
72
+ self.workspace_name = attributes[:'workspace_name']
73
+ else
74
+ self.workspace_name = nil
75
+ end
76
+ end
77
+
78
+ # Show invalid properties with the reasons. Usually used together with valid?
79
+ # @return Array for valid properties with the reasons
80
+ def list_invalid_properties
81
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
82
+ invalid_properties = Array.new
83
+ if @new_workspace_token.nil?
84
+ invalid_properties.push('invalid value for "new_workspace_token", new_workspace_token cannot be nil.')
85
+ end
86
+
87
+ if @new_workspace_token.to_s.length > 128
88
+ invalid_properties.push('invalid value for "new_workspace_token", the character length must be smaller than or equal to 128.')
89
+ end
90
+
91
+ if @new_workspace_token.to_s.length < 32
92
+ invalid_properties.push('invalid value for "new_workspace_token", the character length must be great than or equal to 32.')
93
+ end
94
+
95
+ if @workspace_name.nil?
96
+ invalid_properties.push('invalid value for "workspace_name", workspace_name cannot be nil.')
97
+ end
98
+
99
+ if @workspace_name.to_s.length > 512
100
+ invalid_properties.push('invalid value for "workspace_name", the character length must be smaller than or equal to 512.')
101
+ end
102
+
103
+ if @workspace_name.to_s.length < 1
104
+ invalid_properties.push('invalid value for "workspace_name", the character length must be great than or equal to 1.')
105
+ end
106
+
107
+ invalid_properties
108
+ end
109
+
110
+ # Check to see if the all the properties in the model are valid
111
+ # @return true if the model is valid
112
+ def valid?
113
+ warn '[DEPRECATED] the `valid?` method is obsolete'
114
+ return false if @new_workspace_token.nil?
115
+ return false if @new_workspace_token.to_s.length > 128
116
+ return false if @new_workspace_token.to_s.length < 32
117
+ return false if @workspace_name.nil?
118
+ return false if @workspace_name.to_s.length > 512
119
+ return false if @workspace_name.to_s.length < 1
120
+ true
121
+ end
122
+
123
+ # Custom attribute writer method with validation
124
+ # @param [Object] new_workspace_token Value to be assigned
125
+ def new_workspace_token=(new_workspace_token)
126
+ if new_workspace_token.nil?
127
+ fail ArgumentError, 'new_workspace_token cannot be nil'
128
+ end
129
+
130
+ if new_workspace_token.to_s.length > 128
131
+ fail ArgumentError, 'invalid value for "new_workspace_token", the character length must be smaller than or equal to 128.'
132
+ end
133
+
134
+ if new_workspace_token.to_s.length < 32
135
+ fail ArgumentError, 'invalid value for "new_workspace_token", the character length must be great than or equal to 32.'
136
+ end
137
+
138
+ @new_workspace_token = new_workspace_token
139
+ end
140
+
141
+ # Custom attribute writer method with validation
142
+ # @param [Object] workspace_name Value to be assigned
143
+ def workspace_name=(workspace_name)
144
+ if workspace_name.nil?
145
+ fail ArgumentError, 'workspace_name cannot be nil'
146
+ end
147
+
148
+ if workspace_name.to_s.length > 512
149
+ fail ArgumentError, 'invalid value for "workspace_name", the character length must be smaller than or equal to 512.'
150
+ end
151
+
152
+ if workspace_name.to_s.length < 1
153
+ fail ArgumentError, 'invalid value for "workspace_name", the character length must be great than or equal to 1.'
154
+ end
155
+
156
+ @workspace_name = workspace_name
157
+ end
158
+
159
+ # Checks equality by comparing each attribute.
160
+ # @param [Object] Object to be compared
161
+ def ==(o)
162
+ return true if self.equal?(o)
163
+ self.class == o.class &&
164
+ new_workspace_token == o.new_workspace_token &&
165
+ workspace_name == o.workspace_name
166
+ end
167
+
168
+ # @see the `==` method
169
+ # @param [Object] Object to be compared
170
+ def eql?(o)
171
+ self == o
172
+ end
173
+
174
+ # Calculates hash code according to all attributes.
175
+ # @return [Integer] Hash code
176
+ def hash
177
+ [new_workspace_token, workspace_name].hash
178
+ end
179
+
180
+ # Builds the object from hash
181
+ # @param [Hash] attributes Model attributes in the form of hash
182
+ # @return [Object] Returns the model itself
183
+ def self.build_from_hash(attributes)
184
+ return nil unless attributes.is_a?(Hash)
185
+ attributes = attributes.transform_keys(&:to_sym)
186
+ transformed_hash = {}
187
+ openapi_types.each_pair do |key, type|
188
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
189
+ transformed_hash["#{key}"] = nil
190
+ elsif type =~ /\AArray<(.*)>/i
191
+ # check to ensure the input is an array given that the attribute
192
+ # is documented as an array but the input is not
193
+ if attributes[attribute_map[key]].is_a?(Array)
194
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
195
+ end
196
+ elsif !attributes[attribute_map[key]].nil?
197
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
198
+ end
199
+ end
200
+ new(transformed_hash)
201
+ end
202
+
203
+ # Deserializes the data based on type
204
+ # @param string type Data type
205
+ # @param string value Value to be deserialized
206
+ # @return [Object] Deserialized data
207
+ def self._deserialize(type, value)
208
+ case type.to_sym
209
+ when :Time
210
+ Time.parse(value)
211
+ when :Date
212
+ Date.parse(value)
213
+ when :String
214
+ value.to_s
215
+ when :Integer
216
+ value.to_i
217
+ when :Float
218
+ value.to_f
219
+ when :Boolean
220
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
221
+ true
222
+ else
223
+ false
224
+ end
225
+ when :Object
226
+ # generic object (usually a Hash), return directly
227
+ value
228
+ when /\AArray<(?<inner_type>.+)>\z/
229
+ inner_type = Regexp.last_match[:inner_type]
230
+ value.map { |v| _deserialize(inner_type, v) }
231
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
232
+ k_type = Regexp.last_match[:k_type]
233
+ v_type = Regexp.last_match[:v_type]
234
+ {}.tap do |hash|
235
+ value.each do |k, v|
236
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
237
+ end
238
+ end
239
+ else # model
240
+ # models (e.g. Pet) or oneOf
241
+ klass = SeatsChart.const_get(type)
242
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
243
+ end
244
+ end
245
+
246
+ # Returns the string representation of the object
247
+ # @return [String] String presentation of the object
248
+ def to_s
249
+ to_hash.to_s
250
+ end
251
+
252
+ # to_body is an alias to to_hash (backward compatibility)
253
+ # @return [Hash] Returns the object in the form of hash
254
+ def to_body
255
+ to_hash
256
+ end
257
+
258
+ # Returns the object in the form of hash
259
+ # @return [Hash] Returns the object in the form of hash
260
+ def to_hash
261
+ hash = {}
262
+ self.class.attribute_map.each_pair do |attr, param|
263
+ value = self.send(attr)
264
+ if value.nil?
265
+ is_nullable = self.class.openapi_nullable.include?(attr)
266
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
267
+ end
268
+
269
+ hash[param] = _to_hash(value)
270
+ end
271
+ hash
272
+ end
273
+
274
+ # Outputs non-array value in the form of hash
275
+ # For object, use to_hash. Otherwise, just return the value
276
+ # @param [Object] value Any valid value
277
+ # @return [Hash] Returns the value in the form of hash
278
+ def _to_hash(value)
279
+ if value.is_a?(Array)
280
+ value.compact.map { |v| _to_hash(v) }
281
+ elsif value.is_a?(Hash)
282
+ {}.tap do |hash|
283
+ value.each { |k, v| hash[k] = _to_hash(v) }
284
+ end
285
+ elsif value.respond_to? :to_hash
286
+ value.to_hash
287
+ else
288
+ value
289
+ end
290
+ end
291
+
292
+ end
293
+
294
+ end