smplkit 3.0.82 → 3.0.83

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 (55) hide show
  1. checksums.yaml +4 -4
  2. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/jobs_api.rb +420 -0
  3. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/runs_api.rb +281 -0
  4. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api/usage_api.rb +82 -0
  5. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api_client.rb +441 -0
  6. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api_error.rb +58 -0
  7. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/api_model_base.rb +88 -0
  8. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/configuration.rb +392 -0
  9. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/http_header.rb +220 -0
  10. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/job.rb +401 -0
  11. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/job_create_request.rb +165 -0
  12. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/job_create_resource.rb +237 -0
  13. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/job_http_configuration.rb +368 -0
  14. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/job_list_response.rb +193 -0
  15. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/job_request.rb +165 -0
  16. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/job_resource.rb +186 -0
  17. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/job_response.rb +165 -0
  18. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/list_meta.rb +165 -0
  19. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/pagination_meta.rb +215 -0
  20. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/run.rb +405 -0
  21. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/run_list_links.rb +149 -0
  22. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/run_list_meta.rb +166 -0
  23. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/run_list_response.rb +203 -0
  24. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/run_resource.rb +202 -0
  25. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/run_response.rb +165 -0
  26. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/usage.rb +274 -0
  27. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/usage_resource.rb +187 -0
  28. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/models/usage_response.rb +165 -0
  29. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client/version.rb +15 -0
  30. data/lib/smplkit/_generated/jobs/lib/smplkit_jobs_client.rb +63 -0
  31. data/lib/smplkit/_generated/jobs/spec/api/jobs_api_spec.rb +111 -0
  32. data/lib/smplkit/_generated/jobs/spec/api/runs_api_spec.rb +85 -0
  33. data/lib/smplkit/_generated/jobs/spec/api/usage_api_spec.rb +47 -0
  34. data/lib/smplkit/_generated/jobs/spec/models/http_header_spec.rb +42 -0
  35. data/lib/smplkit/_generated/jobs/spec/models/job_create_request_spec.rb +36 -0
  36. data/lib/smplkit/_generated/jobs/spec/models/job_create_resource_spec.rb +52 -0
  37. data/lib/smplkit/_generated/jobs/spec/models/job_http_configuration_spec.rb +82 -0
  38. data/lib/smplkit/_generated/jobs/spec/models/job_list_response_spec.rb +42 -0
  39. data/lib/smplkit/_generated/jobs/spec/models/job_request_spec.rb +36 -0
  40. data/lib/smplkit/_generated/jobs/spec/models/job_resource_spec.rb +48 -0
  41. data/lib/smplkit/_generated/jobs/spec/models/job_response_spec.rb +36 -0
  42. data/lib/smplkit/_generated/jobs/spec/models/job_spec.rb +110 -0
  43. data/lib/smplkit/_generated/jobs/spec/models/list_meta_spec.rb +36 -0
  44. data/lib/smplkit/_generated/jobs/spec/models/pagination_meta_spec.rb +54 -0
  45. data/lib/smplkit/_generated/jobs/spec/models/run_list_links_spec.rb +36 -0
  46. data/lib/smplkit/_generated/jobs/spec/models/run_list_meta_spec.rb +36 -0
  47. data/lib/smplkit/_generated/jobs/spec/models/run_list_response_spec.rb +48 -0
  48. data/lib/smplkit/_generated/jobs/spec/models/run_resource_spec.rb +48 -0
  49. data/lib/smplkit/_generated/jobs/spec/models/run_response_spec.rb +36 -0
  50. data/lib/smplkit/_generated/jobs/spec/models/run_spec.rb +138 -0
  51. data/lib/smplkit/_generated/jobs/spec/models/usage_resource_spec.rb +48 -0
  52. data/lib/smplkit/_generated/jobs/spec/models/usage_response_spec.rb +36 -0
  53. data/lib/smplkit/_generated/jobs/spec/models/usage_spec.rb +60 -0
  54. data/lib/smplkit/_generated/jobs/spec/spec_helper.rb +111 -0
  55. metadata +54 -1
@@ -0,0 +1,405 @@
1
+ =begin
2
+ #smplkit Jobs API
3
+
4
+ #Scheduled HTTP job execution API for smplkit.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module SmplkitGeneratedClient::Jobs
17
+ # One occurrence of a job executing.
18
+ class Run < ApiModelBase
19
+ # The slug of the job this run belongs to.
20
+ attr_accessor :job
21
+
22
+ # The job's version at the time the run executed.
23
+ attr_accessor :job_version
24
+
25
+ # Why the run exists: `SCHEDULE`, `MANUAL` (Run now), or `RERUN`.
26
+ attr_accessor :trigger
27
+
28
+ # The source run's id; set only when `trigger` is `RERUN`.
29
+ attr_accessor :rerun_of
30
+
31
+ # The intended fire time for a scheduled run; `null` for manual / rerun runs.
32
+ attr_accessor :scheduled_for
33
+
34
+ # Lifecycle state of the run.
35
+ attr_accessor :status
36
+
37
+ # When execution started.
38
+ attr_accessor :started_at
39
+
40
+ # When execution finished.
41
+ attr_accessor :finished_at
42
+
43
+ # Milliseconds the run waited as `PENDING` before starting.
44
+ attr_accessor :pending_duration_ms
45
+
46
+ # Milliseconds the run spent executing.
47
+ attr_accessor :run_duration_ms
48
+
49
+ # Milliseconds from enqueue to finish.
50
+ attr_accessor :total_duration_ms
51
+
52
+ # Why a `FAILED` run failed; `null` otherwise.
53
+ attr_accessor :failure_reason
54
+
55
+ # Free-text failure detail, if any.
56
+ attr_accessor :error
57
+
58
+ # Snapshot of the request that was sent (header values redacted). Forensics only.
59
+ attr_accessor :request
60
+
61
+ # Outcome of the call. For `http`: `status`, `headers`, `body` (capped at 64 KiB), `body_truncated`, and the original `body_bytes`.
62
+ attr_accessor :result
63
+
64
+ # When the run was enqueued (became `PENDING`).
65
+ attr_accessor :created_at
66
+
67
+ class EnumAttributeValidator
68
+ attr_reader :datatype
69
+ attr_reader :allowable_values
70
+
71
+ def initialize(datatype, allowable_values)
72
+ @allowable_values = allowable_values.map do |value|
73
+ case datatype.to_s
74
+ when /Integer/i
75
+ value.to_i
76
+ when /Float/i
77
+ value.to_f
78
+ else
79
+ value
80
+ end
81
+ end
82
+ end
83
+
84
+ def valid?(value)
85
+ !value || allowable_values.include?(value)
86
+ end
87
+ end
88
+
89
+ # Attribute mapping from ruby-style variable name to JSON key.
90
+ def self.attribute_map
91
+ {
92
+ :'job' => :'job',
93
+ :'job_version' => :'job_version',
94
+ :'trigger' => :'trigger',
95
+ :'rerun_of' => :'rerun_of',
96
+ :'scheduled_for' => :'scheduled_for',
97
+ :'status' => :'status',
98
+ :'started_at' => :'started_at',
99
+ :'finished_at' => :'finished_at',
100
+ :'pending_duration_ms' => :'pending_duration_ms',
101
+ :'run_duration_ms' => :'run_duration_ms',
102
+ :'total_duration_ms' => :'total_duration_ms',
103
+ :'failure_reason' => :'failure_reason',
104
+ :'error' => :'error',
105
+ :'request' => :'request',
106
+ :'result' => :'result',
107
+ :'created_at' => :'created_at'
108
+ }
109
+ end
110
+
111
+ # Returns attribute mapping this model knows about
112
+ def self.acceptable_attribute_map
113
+ attribute_map
114
+ end
115
+
116
+ # Returns all the JSON keys this model knows about
117
+ def self.acceptable_attributes
118
+ acceptable_attribute_map.values
119
+ end
120
+
121
+ # Attribute type mapping.
122
+ def self.openapi_types
123
+ {
124
+ :'job' => :'String',
125
+ :'job_version' => :'Integer',
126
+ :'trigger' => :'String',
127
+ :'rerun_of' => :'String',
128
+ :'scheduled_for' => :'Time',
129
+ :'status' => :'String',
130
+ :'started_at' => :'Time',
131
+ :'finished_at' => :'Time',
132
+ :'pending_duration_ms' => :'Integer',
133
+ :'run_duration_ms' => :'Integer',
134
+ :'total_duration_ms' => :'Integer',
135
+ :'failure_reason' => :'String',
136
+ :'error' => :'String',
137
+ :'request' => :'Hash<String, Object>',
138
+ :'result' => :'Hash<String, Object>',
139
+ :'created_at' => :'Time'
140
+ }
141
+ end
142
+
143
+ # List of attributes with nullable: true
144
+ def self.openapi_nullable
145
+ Set.new([
146
+ :'job_version',
147
+ :'rerun_of',
148
+ :'scheduled_for',
149
+ :'started_at',
150
+ :'finished_at',
151
+ :'pending_duration_ms',
152
+ :'run_duration_ms',
153
+ :'total_duration_ms',
154
+ :'failure_reason',
155
+ :'error',
156
+ :'request',
157
+ :'result',
158
+ :'created_at'
159
+ ])
160
+ end
161
+
162
+ # Initializes the object
163
+ # @param [Hash] attributes Model attributes in the form of hash
164
+ def initialize(attributes = {})
165
+ if (!attributes.is_a?(Hash))
166
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::Jobs::Run` initialize method"
167
+ end
168
+
169
+ # check to see if the attribute exists and convert string to symbol for hash key
170
+ acceptable_attribute_map = self.class.acceptable_attribute_map
171
+ attributes = attributes.each_with_object({}) { |(k, v), h|
172
+ if (!acceptable_attribute_map.key?(k.to_sym))
173
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::Jobs::Run`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
174
+ end
175
+ h[k.to_sym] = v
176
+ }
177
+
178
+ if attributes.key?(:'job')
179
+ self.job = attributes[:'job']
180
+ else
181
+ self.job = nil
182
+ end
183
+
184
+ if attributes.key?(:'job_version')
185
+ self.job_version = attributes[:'job_version']
186
+ end
187
+
188
+ if attributes.key?(:'trigger')
189
+ self.trigger = attributes[:'trigger']
190
+ else
191
+ self.trigger = nil
192
+ end
193
+
194
+ if attributes.key?(:'rerun_of')
195
+ self.rerun_of = attributes[:'rerun_of']
196
+ end
197
+
198
+ if attributes.key?(:'scheduled_for')
199
+ self.scheduled_for = attributes[:'scheduled_for']
200
+ end
201
+
202
+ if attributes.key?(:'status')
203
+ self.status = attributes[:'status']
204
+ else
205
+ self.status = nil
206
+ end
207
+
208
+ if attributes.key?(:'started_at')
209
+ self.started_at = attributes[:'started_at']
210
+ end
211
+
212
+ if attributes.key?(:'finished_at')
213
+ self.finished_at = attributes[:'finished_at']
214
+ end
215
+
216
+ if attributes.key?(:'pending_duration_ms')
217
+ self.pending_duration_ms = attributes[:'pending_duration_ms']
218
+ end
219
+
220
+ if attributes.key?(:'run_duration_ms')
221
+ self.run_duration_ms = attributes[:'run_duration_ms']
222
+ end
223
+
224
+ if attributes.key?(:'total_duration_ms')
225
+ self.total_duration_ms = attributes[:'total_duration_ms']
226
+ end
227
+
228
+ if attributes.key?(:'failure_reason')
229
+ self.failure_reason = attributes[:'failure_reason']
230
+ end
231
+
232
+ if attributes.key?(:'error')
233
+ self.error = attributes[:'error']
234
+ end
235
+
236
+ if attributes.key?(:'request')
237
+ if (value = attributes[:'request']).is_a?(Hash)
238
+ self.request = value
239
+ end
240
+ end
241
+
242
+ if attributes.key?(:'result')
243
+ if (value = attributes[:'result']).is_a?(Hash)
244
+ self.result = value
245
+ end
246
+ end
247
+
248
+ if attributes.key?(:'created_at')
249
+ self.created_at = attributes[:'created_at']
250
+ end
251
+ end
252
+
253
+ # Show invalid properties with the reasons. Usually used together with valid?
254
+ # @return Array for valid properties with the reasons
255
+ def list_invalid_properties
256
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
257
+ invalid_properties = Array.new
258
+ if @job.nil?
259
+ invalid_properties.push('invalid value for "job", job cannot be nil.')
260
+ end
261
+
262
+ if @trigger.nil?
263
+ invalid_properties.push('invalid value for "trigger", trigger cannot be nil.')
264
+ end
265
+
266
+ if @status.nil?
267
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
268
+ end
269
+
270
+ invalid_properties
271
+ end
272
+
273
+ # Check to see if the all the properties in the model are valid
274
+ # @return true if the model is valid
275
+ def valid?
276
+ warn '[DEPRECATED] the `valid?` method is obsolete'
277
+ return false if @job.nil?
278
+ return false if @trigger.nil?
279
+ trigger_validator = EnumAttributeValidator.new('String', ["SCHEDULE", "MANUAL", "RERUN"])
280
+ return false unless trigger_validator.valid?(@trigger)
281
+ return false if @status.nil?
282
+ status_validator = EnumAttributeValidator.new('String', ["PENDING", "RUNNING", "SUCCEEDED", "FAILED", "CANCELED"])
283
+ return false unless status_validator.valid?(@status)
284
+ failure_reason_validator = EnumAttributeValidator.new('String', ["TIMEOUT", "CONNECTION_ERROR", "NON_SUCCESS_STATUS", "SSRF_BLOCKED", "QUOTA_EXCEEDED", "WORKER_LOST"])
285
+ return false unless failure_reason_validator.valid?(@failure_reason)
286
+ true
287
+ end
288
+
289
+ # Custom attribute writer method with validation
290
+ # @param [Object] job Value to be assigned
291
+ def job=(job)
292
+ if job.nil?
293
+ fail ArgumentError, 'job cannot be nil'
294
+ end
295
+
296
+ @job = job
297
+ end
298
+
299
+ # Custom attribute writer method checking allowed values (enum).
300
+ # @param [Object] trigger Object to be assigned
301
+ def trigger=(trigger)
302
+ validator = EnumAttributeValidator.new('String', ["SCHEDULE", "MANUAL", "RERUN"])
303
+ unless validator.valid?(trigger)
304
+ fail ArgumentError, "invalid value for \"trigger\", must be one of #{validator.allowable_values}."
305
+ end
306
+ @trigger = trigger
307
+ end
308
+
309
+ # Custom attribute writer method checking allowed values (enum).
310
+ # @param [Object] status Object to be assigned
311
+ def status=(status)
312
+ validator = EnumAttributeValidator.new('String', ["PENDING", "RUNNING", "SUCCEEDED", "FAILED", "CANCELED"])
313
+ unless validator.valid?(status)
314
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
315
+ end
316
+ @status = status
317
+ end
318
+
319
+ # Custom attribute writer method checking allowed values (enum).
320
+ # @param [Object] failure_reason Object to be assigned
321
+ def failure_reason=(failure_reason)
322
+ validator = EnumAttributeValidator.new('String', ["TIMEOUT", "CONNECTION_ERROR", "NON_SUCCESS_STATUS", "SSRF_BLOCKED", "QUOTA_EXCEEDED", "WORKER_LOST"])
323
+ unless validator.valid?(failure_reason)
324
+ fail ArgumentError, "invalid value for \"failure_reason\", must be one of #{validator.allowable_values}."
325
+ end
326
+ @failure_reason = failure_reason
327
+ end
328
+
329
+ # Checks equality by comparing each attribute.
330
+ # @param [Object] Object to be compared
331
+ def ==(o)
332
+ return true if self.equal?(o)
333
+ self.class == o.class &&
334
+ job == o.job &&
335
+ job_version == o.job_version &&
336
+ trigger == o.trigger &&
337
+ rerun_of == o.rerun_of &&
338
+ scheduled_for == o.scheduled_for &&
339
+ status == o.status &&
340
+ started_at == o.started_at &&
341
+ finished_at == o.finished_at &&
342
+ pending_duration_ms == o.pending_duration_ms &&
343
+ run_duration_ms == o.run_duration_ms &&
344
+ total_duration_ms == o.total_duration_ms &&
345
+ failure_reason == o.failure_reason &&
346
+ error == o.error &&
347
+ request == o.request &&
348
+ result == o.result &&
349
+ created_at == o.created_at
350
+ end
351
+
352
+ # @see the `==` method
353
+ # @param [Object] Object to be compared
354
+ def eql?(o)
355
+ self == o
356
+ end
357
+
358
+ # Calculates hash code according to all attributes.
359
+ # @return [Integer] Hash code
360
+ def hash
361
+ [job, job_version, trigger, rerun_of, scheduled_for, status, started_at, finished_at, pending_duration_ms, run_duration_ms, total_duration_ms, failure_reason, error, request, result, created_at].hash
362
+ end
363
+
364
+ # Builds the object from hash
365
+ # @param [Hash] attributes Model attributes in the form of hash
366
+ # @return [Object] Returns the model itself
367
+ def self.build_from_hash(attributes)
368
+ return nil unless attributes.is_a?(Hash)
369
+ attributes = attributes.transform_keys(&:to_sym)
370
+ transformed_hash = {}
371
+ openapi_types.each_pair do |key, type|
372
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
373
+ transformed_hash["#{key}"] = nil
374
+ elsif type =~ /\AArray<(.*)>/i
375
+ # check to ensure the input is an array given that the attribute
376
+ # is documented as an array but the input is not
377
+ if attributes[attribute_map[key]].is_a?(Array)
378
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
379
+ end
380
+ elsif !attributes[attribute_map[key]].nil?
381
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
382
+ end
383
+ end
384
+ new(transformed_hash)
385
+ end
386
+
387
+ # Returns the object in the form of hash
388
+ # @return [Hash] Returns the object in the form of hash
389
+ def to_hash
390
+ hash = {}
391
+ self.class.attribute_map.each_pair do |attr, param|
392
+ value = self.send(attr)
393
+ if value.nil?
394
+ is_nullable = self.class.openapi_nullable.include?(attr)
395
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
396
+ end
397
+
398
+ hash[param] = _to_hash(value)
399
+ end
400
+ hash
401
+ end
402
+
403
+ end
404
+
405
+ end
@@ -0,0 +1,149 @@
1
+ =begin
2
+ #smplkit Jobs API
3
+
4
+ #Scheduled HTTP job execution API for smplkit.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module SmplkitGeneratedClient::Jobs
17
+ class RunListLinks < ApiModelBase
18
+ # URL of the next page, or `null`.
19
+ attr_accessor :_next
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'_next' => :'next'
25
+ }
26
+ end
27
+
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ acceptable_attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'_next' => :'String'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ :'_next'
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::Jobs::RunListLinks` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ acceptable_attribute_map = self.class.acceptable_attribute_map
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!acceptable_attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::Jobs::RunListLinks`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'_next')
69
+ self._next = attributes[:'_next']
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
+ invalid_properties = Array.new
78
+ invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ warn '[DEPRECATED] the `valid?` method is obsolete'
85
+ true
86
+ end
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param [Object] Object to be compared
90
+ def ==(o)
91
+ return true if self.equal?(o)
92
+ self.class == o.class &&
93
+ _next == o._next
94
+ end
95
+
96
+ # @see the `==` method
97
+ # @param [Object] Object to be compared
98
+ def eql?(o)
99
+ self == o
100
+ end
101
+
102
+ # Calculates hash code according to all attributes.
103
+ # @return [Integer] Hash code
104
+ def hash
105
+ [_next].hash
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def self.build_from_hash(attributes)
112
+ return nil unless attributes.is_a?(Hash)
113
+ attributes = attributes.transform_keys(&:to_sym)
114
+ transformed_hash = {}
115
+ openapi_types.each_pair do |key, type|
116
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
117
+ transformed_hash["#{key}"] = nil
118
+ elsif type =~ /\AArray<(.*)>/i
119
+ # check to ensure the input is an array given that the attribute
120
+ # is documented as an array but the input is not
121
+ if attributes[attribute_map[key]].is_a?(Array)
122
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
123
+ end
124
+ elsif !attributes[attribute_map[key]].nil?
125
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
126
+ end
127
+ end
128
+ new(transformed_hash)
129
+ end
130
+
131
+ # Returns the object in the form of hash
132
+ # @return [Hash] Returns the object in the form of hash
133
+ def to_hash
134
+ hash = {}
135
+ self.class.attribute_map.each_pair do |attr, param|
136
+ value = self.send(attr)
137
+ if value.nil?
138
+ is_nullable = self.class.openapi_nullable.include?(attr)
139
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
140
+ end
141
+
142
+ hash[param] = _to_hash(value)
143
+ end
144
+ hash
145
+ end
146
+
147
+ end
148
+
149
+ end