hermoso 0.1.4

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 (142) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +53 -0
  4. data/lib/hermoso/api/account_api.rb +156 -0
  5. data/lib/hermoso/api/analytics_api.rb +400 -0
  6. data/lib/hermoso/api/brands_api.rb +82 -0
  7. data/lib/hermoso/api/campaign_profit_api.rb +103 -0
  8. data/lib/hermoso/api/campaign_results_api.rb +289 -0
  9. data/lib/hermoso/api/channels_api.rb +82 -0
  10. data/lib/hermoso/api/clones_api.rb +93 -0
  11. data/lib/hermoso/api/connect_links_api.rb +228 -0
  12. data/lib/hermoso/api/connect_redirects_api.rb +153 -0
  13. data/lib/hermoso/api/connections_api.rb +151 -0
  14. data/lib/hermoso/api/credits_api.rb +85 -0
  15. data/lib/hermoso/api/edits_api.rb +102 -0
  16. data/lib/hermoso/api/events_api.rb +932 -0
  17. data/lib/hermoso/api/generations_api.rb +173 -0
  18. data/lib/hermoso/api/jobs_api.rb +226 -0
  19. data/lib/hermoso/api/library_api.rb +88 -0
  20. data/lib/hermoso/api/media_api.rb +158 -0
  21. data/lib/hermoso/api/models_api.rb +88 -0
  22. data/lib/hermoso/api/posts_api.rb +377 -0
  23. data/lib/hermoso/api/recasts_api.rb +102 -0
  24. data/lib/hermoso/api/signup_api.rb +164 -0
  25. data/lib/hermoso/api/tag_api.rb +570 -0
  26. data/lib/hermoso/api/tools_api.rb +252 -0
  27. data/lib/hermoso/api_client.rb +441 -0
  28. data/lib/hermoso/api_error.rb +58 -0
  29. data/lib/hermoso/api_model_base.rb +92 -0
  30. data/lib/hermoso/configuration.rb +400 -0
  31. data/lib/hermoso/helpers.rb +116 -0
  32. data/lib/hermoso/models/asset.rb +241 -0
  33. data/lib/hermoso/models/asset_list.rb +203 -0
  34. data/lib/hermoso/models/best_time.rb +250 -0
  35. data/lib/hermoso/models/best_time_slots_inner.rb +205 -0
  36. data/lib/hermoso/models/brand.rb +273 -0
  37. data/lib/hermoso/models/brand_list.rb +203 -0
  38. data/lib/hermoso/models/campaign_profit.rb +261 -0
  39. data/lib/hermoso/models/campaign_results.rb +250 -0
  40. data/lib/hermoso/models/campaign_results_upload.rb +171 -0
  41. data/lib/hermoso/models/campaign_results_upload_rows_inner.rb +259 -0
  42. data/lib/hermoso/models/channel.rb +326 -0
  43. data/lib/hermoso/models/channel_carousel.rb +188 -0
  44. data/lib/hermoso/models/channel_list.rb +203 -0
  45. data/lib/hermoso/models/clone_quote.rb +243 -0
  46. data/lib/hermoso/models/clone_quote_request.rb +227 -0
  47. data/lib/hermoso/models/clone_quote_step.rb +201 -0
  48. data/lib/hermoso/models/connect_link.rb +321 -0
  49. data/lib/hermoso/models/connect_link_account.rb +178 -0
  50. data/lib/hermoso/models/connect_link_create.rb +236 -0
  51. data/lib/hermoso/models/connect_link_error.rb +169 -0
  52. data/lib/hermoso/models/connect_redirects.rb +203 -0
  53. data/lib/hermoso/models/connect_redirects_set.rb +180 -0
  54. data/lib/hermoso/models/connection.rb +250 -0
  55. data/lib/hermoso/models/connection_accounts_inner.rb +178 -0
  56. data/lib/hermoso/models/connection_deleted.rb +228 -0
  57. data/lib/hermoso/models/connection_list.rb +203 -0
  58. data/lib/hermoso/models/contact_email.rb +189 -0
  59. data/lib/hermoso/models/contact_email_resend.rb +161 -0
  60. data/lib/hermoso/models/content_decay.rb +223 -0
  61. data/lib/hermoso/models/content_decay_buckets_inner.rb +187 -0
  62. data/lib/hermoso/models/conversion_destination_create.rb +317 -0
  63. data/lib/hermoso/models/conversion_destination_list.rb +223 -0
  64. data/lib/hermoso/models/conversion_destination_result.rb +221 -0
  65. data/lib/hermoso/models/conversion_event_list.rb +230 -0
  66. data/lib/hermoso/models/conversion_event_update.rb +195 -0
  67. data/lib/hermoso/models/conversion_events_send.rb +236 -0
  68. data/lib/hermoso/models/conversion_events_send_events_inner.rb +314 -0
  69. data/lib/hermoso/models/conversion_insights.rb +265 -0
  70. data/lib/hermoso/models/conversion_send_result.rb +257 -0
  71. data/lib/hermoso/models/conversion_send_result_destinations_inner.rb +286 -0
  72. data/lib/hermoso/models/credits.rb +240 -0
  73. data/lib/hermoso/models/credits_limits.rb +234 -0
  74. data/lib/hermoso/models/credits_limits_brands_inner.rb +218 -0
  75. data/lib/hermoso/models/credits_limits_brands_inner_members_inner.rb +196 -0
  76. data/lib/hermoso/models/deleted.rb +210 -0
  77. data/lib/hermoso/models/edit.rb +278 -0
  78. data/lib/hermoso/models/edit_create.rb +317 -0
  79. data/lib/hermoso/models/edit_preview.rb +199 -0
  80. data/lib/hermoso/models/edit_quote.rb +231 -0
  81. data/lib/hermoso/models/error.rb +198 -0
  82. data/lib/hermoso/models/error_error.rb +335 -0
  83. data/lib/hermoso/models/error_error_unknown_arguments_inner.rb +171 -0
  84. data/lib/hermoso/models/follower_history.rb +239 -0
  85. data/lib/hermoso/models/follower_history_accounts_inner.rb +207 -0
  86. data/lib/hermoso/models/follower_history_accounts_inner_points_inner.rb +178 -0
  87. data/lib/hermoso/models/follower_history_date_range.rb +169 -0
  88. data/lib/hermoso/models/generation_create.rb +435 -0
  89. data/lib/hermoso/models/generation_quote.rb +263 -0
  90. data/lib/hermoso/models/hermoso_tag.rb +230 -0
  91. data/lib/hermoso/models/hermoso_tag_audience_action.rb +325 -0
  92. data/lib/hermoso/models/hermoso_tag_audiences.rb +241 -0
  93. data/lib/hermoso/models/hermoso_tag_events.rb +223 -0
  94. data/lib/hermoso/models/hermoso_tag_events_send.rb +179 -0
  95. data/lib/hermoso/models/hermoso_tag_events_sent.rb +221 -0
  96. data/lib/hermoso/models/hermoso_tag_install.rb +246 -0
  97. data/lib/hermoso/models/hermoso_tag_install_result.rb +255 -0
  98. data/lib/hermoso/models/hermoso_tag_report.rb +261 -0
  99. data/lib/hermoso/models/hermoso_tag_tag.rb +211 -0
  100. data/lib/hermoso/models/hermoso_tag_update.rb +356 -0
  101. data/lib/hermoso/models/inbox_stats.rb +315 -0
  102. data/lib/hermoso/models/job.rb +359 -0
  103. data/lib/hermoso/models/job_cancel.rb +221 -0
  104. data/lib/hermoso/models/job_list.rb +232 -0
  105. data/lib/hermoso/models/media.rb +230 -0
  106. data/lib/hermoso/models/model.rb +327 -0
  107. data/lib/hermoso/models/model_list.rb +203 -0
  108. data/lib/hermoso/models/post.rb +382 -0
  109. data/lib/hermoso/models/post_create.rb +318 -0
  110. data/lib/hermoso/models/post_create_media_inner.rb +104 -0
  111. data/lib/hermoso/models/post_create_media_inner_one_of.rb +201 -0
  112. data/lib/hermoso/models/post_list.rb +221 -0
  113. data/lib/hermoso/models/post_media_inner.rb +169 -0
  114. data/lib/hermoso/models/post_results_inner.rb +205 -0
  115. data/lib/hermoso/models/post_results_inner_first_comment.rb +188 -0
  116. data/lib/hermoso/models/posting_frequency.rb +241 -0
  117. data/lib/hermoso/models/posting_frequency_frequency_inner.rb +205 -0
  118. data/lib/hermoso/models/profit_settings.rb +230 -0
  119. data/lib/hermoso/models/recast.rb +308 -0
  120. data/lib/hermoso/models/recast_create.rb +274 -0
  121. data/lib/hermoso/models/recast_person.rb +182 -0
  122. data/lib/hermoso/models/recast_quote.rb +232 -0
  123. data/lib/hermoso/models/recast_step.rb +201 -0
  124. data/lib/hermoso/models/recast_subject.rb +170 -0
  125. data/lib/hermoso/models/recast_voice.rb +178 -0
  126. data/lib/hermoso/models/recast_window.rb +179 -0
  127. data/lib/hermoso/models/signup.rb +329 -0
  128. data/lib/hermoso/models/signup_claim.rb +178 -0
  129. data/lib/hermoso/models/signup_create.rb +247 -0
  130. data/lib/hermoso/models/tool.rb +360 -0
  131. data/lib/hermoso/models/tool_invoke.rb +169 -0
  132. data/lib/hermoso/models/tool_job.rb +262 -0
  133. data/lib/hermoso/models/tool_list.rb +273 -0
  134. data/lib/hermoso/models/tool_list_areas_inner.rb +219 -0
  135. data/lib/hermoso/models/tool_list_search.rb +181 -0
  136. data/lib/hermoso/models/tool_result.rb +245 -0
  137. data/lib/hermoso/models/tool_result_images_inner.rb +170 -0
  138. data/lib/hermoso/models/warning.rb +244 -0
  139. data/lib/hermoso/spec.rb +8 -0
  140. data/lib/hermoso/version.rb +15 -0
  141. data/lib/hermoso.rb +174 -0
  142. metadata +237 -0
@@ -0,0 +1,359 @@
1
+ =begin
2
+ #Hermoso API
3
+
4
+ #The Hermoso public API. Guide: https://hermoso.ai/docs/api/ · OpenAPI: https://app.hermoso.ai/openapi.json
5
+
6
+ The version of the OpenAPI document: 2026-08-26
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.27.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Hermoso
17
+ class Job < ApiModelBase
18
+ attr_accessor :object
19
+
20
+ attr_accessor :id
21
+
22
+ # What kind of work it is: video, stitch, avatar, templatead, upscale, and so on. This set MAY GROW.
23
+ attr_accessor :type
24
+
25
+ # queued, running, done or error. `done` and `error` are final. This enum MAY GROW: keep polling on a value you have not seen.
26
+ attr_accessor :status
27
+
28
+ # 0 to 1, when the worker reports it.
29
+ attr_accessor :progress
30
+
31
+ attr_accessor :label
32
+
33
+ # The profile that started the job.
34
+ attr_accessor :brand_id
35
+
36
+ # ISO-8601.
37
+ attr_accessor :created_at
38
+
39
+ # ISO-8601. For a finished job, when it finished.
40
+ attr_accessor :updated_at
41
+
42
+ # ISO-8601, for work scheduled to start later; null for work that starts immediately.
43
+ attr_accessor :run_at
44
+
45
+ # The finished file, once `status` is `done` and the job produced one. Always an absolute, publicly reachable URL.
46
+ attr_accessor :url
47
+
48
+ # A still for a finished video, when there is one.
49
+ attr_accessor :poster_url
50
+
51
+ # The model that rendered it.
52
+ attr_accessor :model
53
+
54
+ attr_accessor :credits_used
55
+
56
+ # Why it failed, when `status` is `error`. Named `error_message` so it can never be mistaken for this API’s error envelope.
57
+ attr_accessor :error_message
58
+
59
+ # True when the job was stopped by `POST /v1/jobs/{id}/cancel` before it reached a model. Its `status` is `error` and nothing was charged.
60
+ attr_accessor :cancelled
61
+
62
+ # The worker’s full result. PASSTHROUGH TIER: its shape is the job type’s own and improves with it, like a tool’s `data`. Build on the fields above; read this for detail.
63
+ attr_accessor :result
64
+
65
+ # This job’s own path.
66
+ attr_accessor :poll
67
+
68
+ class EnumAttributeValidator
69
+ attr_reader :datatype
70
+ attr_reader :allowable_values
71
+
72
+ def initialize(datatype, allowable_values)
73
+ @allowable_values = allowable_values.map do |value|
74
+ case datatype.to_s
75
+ when /Integer/i
76
+ value.to_i
77
+ when /Float/i
78
+ value.to_f
79
+ else
80
+ value
81
+ end
82
+ end
83
+ end
84
+
85
+ def valid?(value)
86
+ !value || allowable_values.include?(value)
87
+ end
88
+ end
89
+
90
+ # Attribute mapping from ruby-style variable name to JSON key.
91
+ def self.attribute_map
92
+ {
93
+ :'object' => :'object',
94
+ :'id' => :'id',
95
+ :'type' => :'type',
96
+ :'status' => :'status',
97
+ :'progress' => :'progress',
98
+ :'label' => :'label',
99
+ :'brand_id' => :'brand_id',
100
+ :'created_at' => :'created_at',
101
+ :'updated_at' => :'updated_at',
102
+ :'run_at' => :'run_at',
103
+ :'url' => :'url',
104
+ :'poster_url' => :'poster_url',
105
+ :'model' => :'model',
106
+ :'credits_used' => :'credits_used',
107
+ :'error_message' => :'error_message',
108
+ :'cancelled' => :'cancelled',
109
+ :'result' => :'result',
110
+ :'poll' => :'poll'
111
+ }
112
+ end
113
+
114
+ # Returns attribute mapping this model knows about
115
+ def self.acceptable_attribute_map
116
+ attribute_map
117
+ end
118
+
119
+ # Returns all the JSON keys this model knows about
120
+ def self.acceptable_attributes
121
+ acceptable_attribute_map.values
122
+ end
123
+
124
+ # Attribute type mapping.
125
+ def self.openapi_types
126
+ {
127
+ :'object' => :'String',
128
+ :'id' => :'String',
129
+ :'type' => :'String',
130
+ :'status' => :'String',
131
+ :'progress' => :'Float',
132
+ :'label' => :'String',
133
+ :'brand_id' => :'String',
134
+ :'created_at' => :'String',
135
+ :'updated_at' => :'String',
136
+ :'run_at' => :'String',
137
+ :'url' => :'String',
138
+ :'poster_url' => :'String',
139
+ :'model' => :'String',
140
+ :'credits_used' => :'Float',
141
+ :'error_message' => :'String',
142
+ :'cancelled' => :'Boolean',
143
+ :'result' => :'Object',
144
+ :'poll' => :'String'
145
+ }
146
+ end
147
+
148
+ # List of attributes with nullable: true
149
+ def self.openapi_nullable
150
+ Set.new([
151
+ ])
152
+ end
153
+
154
+ # Returns attribute type mapping
155
+ def self.acceptable_openapi_types
156
+ openapi_types
157
+ end
158
+
159
+ # Returns the nullable attributes
160
+ def self.acceptable_openapi_nullable
161
+ openapi_nullable
162
+ end
163
+
164
+ # Initializes the object
165
+ # @param [Hash] attributes Model attributes in the form of hash
166
+ def initialize(attributes = {})
167
+ if (!attributes.is_a?(Hash))
168
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Hermoso::Job` initialize method"
169
+ end
170
+
171
+ # check to see if the attribute exists and convert string to symbol for hash key
172
+ acceptable_attribute_map = self.class.acceptable_attribute_map
173
+ attributes = attributes.each_with_object({}) { |(k, v), h|
174
+ if (!acceptable_attribute_map.key?(k.to_sym))
175
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Hermoso::Job`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
176
+ end
177
+ h[k.to_sym] = v
178
+ }
179
+
180
+ if attributes.key?(:'object')
181
+ self.object = attributes[:'object']
182
+ end
183
+
184
+ if attributes.key?(:'id')
185
+ self.id = attributes[:'id']
186
+ end
187
+
188
+ if attributes.key?(:'type')
189
+ self.type = attributes[:'type']
190
+ end
191
+
192
+ if attributes.key?(:'status')
193
+ self.status = attributes[:'status']
194
+ end
195
+
196
+ if attributes.key?(:'progress')
197
+ self.progress = attributes[:'progress']
198
+ end
199
+
200
+ if attributes.key?(:'label')
201
+ self.label = attributes[:'label']
202
+ end
203
+
204
+ if attributes.key?(:'brand_id')
205
+ self.brand_id = attributes[:'brand_id']
206
+ end
207
+
208
+ if attributes.key?(:'created_at')
209
+ self.created_at = attributes[:'created_at']
210
+ end
211
+
212
+ if attributes.key?(:'updated_at')
213
+ self.updated_at = attributes[:'updated_at']
214
+ end
215
+
216
+ if attributes.key?(:'run_at')
217
+ self.run_at = attributes[:'run_at']
218
+ end
219
+
220
+ if attributes.key?(:'url')
221
+ self.url = attributes[:'url']
222
+ end
223
+
224
+ if attributes.key?(:'poster_url')
225
+ self.poster_url = attributes[:'poster_url']
226
+ end
227
+
228
+ if attributes.key?(:'model')
229
+ self.model = attributes[:'model']
230
+ end
231
+
232
+ if attributes.key?(:'credits_used')
233
+ self.credits_used = attributes[:'credits_used']
234
+ end
235
+
236
+ if attributes.key?(:'error_message')
237
+ self.error_message = attributes[:'error_message']
238
+ end
239
+
240
+ if attributes.key?(:'cancelled')
241
+ self.cancelled = attributes[:'cancelled']
242
+ end
243
+
244
+ if attributes.key?(:'result')
245
+ self.result = attributes[:'result']
246
+ end
247
+
248
+ if attributes.key?(:'poll')
249
+ self.poll = attributes[:'poll']
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
+ invalid_properties
259
+ end
260
+
261
+ # Check to see if the all the properties in the model are valid
262
+ # @return true if the model is valid
263
+ def valid?
264
+ warn '[DEPRECATED] the `valid?` method is obsolete'
265
+ object_validator = EnumAttributeValidator.new('String', ["job", "unknown_default_open_api"])
266
+ return false unless object_validator.valid?(@object)
267
+ true
268
+ end
269
+
270
+ # Custom attribute writer method checking allowed values (enum).
271
+ # @param [Object] object Object to be assigned
272
+ def object=(object)
273
+ validator = EnumAttributeValidator.new('String', ["job", "unknown_default_open_api"])
274
+ object = 'unknown_default_open_api' unless validator.valid?(object)
275
+ @object = object
276
+ end
277
+
278
+ # Checks equality by comparing each attribute.
279
+ # @param [Object] Object to be compared
280
+ def ==(o)
281
+ return true if self.equal?(o)
282
+ self.class == o.class &&
283
+ object == o.object &&
284
+ id == o.id &&
285
+ type == o.type &&
286
+ status == o.status &&
287
+ progress == o.progress &&
288
+ label == o.label &&
289
+ brand_id == o.brand_id &&
290
+ created_at == o.created_at &&
291
+ updated_at == o.updated_at &&
292
+ run_at == o.run_at &&
293
+ url == o.url &&
294
+ poster_url == o.poster_url &&
295
+ model == o.model &&
296
+ credits_used == o.credits_used &&
297
+ error_message == o.error_message &&
298
+ cancelled == o.cancelled &&
299
+ result == o.result &&
300
+ poll == o.poll
301
+ end
302
+
303
+ # @see the `==` method
304
+ # @param [Object] Object to be compared
305
+ def eql?(o)
306
+ self == o
307
+ end
308
+
309
+ # Calculates hash code according to all attributes.
310
+ # @return [Integer] Hash code
311
+ def hash
312
+ [object, id, type, status, progress, label, brand_id, created_at, updated_at, run_at, url, poster_url, model, credits_used, error_message, cancelled, result, poll].hash
313
+ end
314
+
315
+ # Builds the object from hash
316
+ # @param [Hash] attributes Model attributes in the form of hash
317
+ # @return [Object] Returns the model itself
318
+ def self.build_from_hash(attributes)
319
+ return nil unless attributes.is_a?(Hash)
320
+ attributes = attributes.transform_keys(&:to_sym)
321
+ # include attributes inherited from allOf parents (the nearest declaration wins)
322
+ map = acceptable_attribute_map
323
+ transformed_hash = {}
324
+ acceptable_openapi_types.each_pair do |key, type|
325
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
326
+ transformed_hash["#{key}"] = nil
327
+ elsif type =~ /\AArray<(.*)>/i
328
+ # check to ensure the input is an array given that the attribute
329
+ # is documented as an array but the input is not
330
+ if attributes[map[key]].is_a?(Array)
331
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
332
+ end
333
+ elsif !attributes[map[key]].nil?
334
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
335
+ end
336
+ end
337
+ new(transformed_hash)
338
+ end
339
+
340
+ # Returns the object in the form of hash
341
+ # @return [Hash] Returns the object in the form of hash
342
+ def to_hash
343
+ hash = {}
344
+ # include attributes inherited from allOf parents (the nearest declaration wins)
345
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
346
+ value = self.send(attr)
347
+ if value.nil?
348
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
349
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
350
+ end
351
+
352
+ hash[param] = _to_hash(value)
353
+ end
354
+ hash
355
+ end
356
+
357
+ end
358
+
359
+ end
@@ -0,0 +1,221 @@
1
+ =begin
2
+ #Hermoso API
3
+
4
+ #The Hermoso public API. Guide: https://hermoso.ai/docs/api/ · OpenAPI: https://app.hermoso.ai/openapi.json
5
+
6
+ The version of the OpenAPI document: 2026-08-26
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.27.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Hermoso
17
+ class JobCancel < ApiModelBase
18
+ attr_accessor :object
19
+
20
+ # `cancelled`: it had not started, it is stopped and nothing was charged. `requested`: it is starting; it stops before it reaches a model if it can, and is charged nothing if it does. `too_late`: it has already reached the model, so it finishes, is charged as usual and lands in the Library. `finished`: it had already ended. This enum MAY GROW.
21
+ attr_accessor :outcome
22
+
23
+ # A plain sentence for the person who asked to cancel.
24
+ attr_accessor :message
25
+
26
+ attr_accessor :job
27
+
28
+ class EnumAttributeValidator
29
+ attr_reader :datatype
30
+ attr_reader :allowable_values
31
+
32
+ def initialize(datatype, allowable_values)
33
+ @allowable_values = allowable_values.map do |value|
34
+ case datatype.to_s
35
+ when /Integer/i
36
+ value.to_i
37
+ when /Float/i
38
+ value.to_f
39
+ else
40
+ value
41
+ end
42
+ end
43
+ end
44
+
45
+ def valid?(value)
46
+ !value || allowable_values.include?(value)
47
+ end
48
+ end
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'object' => :'object',
54
+ :'outcome' => :'outcome',
55
+ :'message' => :'message',
56
+ :'job' => :'job'
57
+ }
58
+ end
59
+
60
+ # Returns attribute mapping this model knows about
61
+ def self.acceptable_attribute_map
62
+ attribute_map
63
+ end
64
+
65
+ # Returns all the JSON keys this model knows about
66
+ def self.acceptable_attributes
67
+ acceptable_attribute_map.values
68
+ end
69
+
70
+ # Attribute type mapping.
71
+ def self.openapi_types
72
+ {
73
+ :'object' => :'String',
74
+ :'outcome' => :'String',
75
+ :'message' => :'String',
76
+ :'job' => :'Job'
77
+ }
78
+ end
79
+
80
+ # List of attributes with nullable: true
81
+ def self.openapi_nullable
82
+ Set.new([
83
+ ])
84
+ end
85
+
86
+ # Returns attribute type mapping
87
+ def self.acceptable_openapi_types
88
+ openapi_types
89
+ end
90
+
91
+ # Returns the nullable attributes
92
+ def self.acceptable_openapi_nullable
93
+ openapi_nullable
94
+ end
95
+
96
+ # Initializes the object
97
+ # @param [Hash] attributes Model attributes in the form of hash
98
+ def initialize(attributes = {})
99
+ if (!attributes.is_a?(Hash))
100
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Hermoso::JobCancel` initialize method"
101
+ end
102
+
103
+ # check to see if the attribute exists and convert string to symbol for hash key
104
+ acceptable_attribute_map = self.class.acceptable_attribute_map
105
+ attributes = attributes.each_with_object({}) { |(k, v), h|
106
+ if (!acceptable_attribute_map.key?(k.to_sym))
107
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Hermoso::JobCancel`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
108
+ end
109
+ h[k.to_sym] = v
110
+ }
111
+
112
+ if attributes.key?(:'object')
113
+ self.object = attributes[:'object']
114
+ end
115
+
116
+ if attributes.key?(:'outcome')
117
+ self.outcome = attributes[:'outcome']
118
+ end
119
+
120
+ if attributes.key?(:'message')
121
+ self.message = attributes[:'message']
122
+ end
123
+
124
+ if attributes.key?(:'job')
125
+ self.job = attributes[:'job']
126
+ end
127
+ end
128
+
129
+ # Show invalid properties with the reasons. Usually used together with valid?
130
+ # @return Array for valid properties with the reasons
131
+ def list_invalid_properties
132
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
133
+ invalid_properties = Array.new
134
+ invalid_properties
135
+ end
136
+
137
+ # Check to see if the all the properties in the model are valid
138
+ # @return true if the model is valid
139
+ def valid?
140
+ warn '[DEPRECATED] the `valid?` method is obsolete'
141
+ object_validator = EnumAttributeValidator.new('String', ["job_cancel", "unknown_default_open_api"])
142
+ return false unless object_validator.valid?(@object)
143
+ true
144
+ end
145
+
146
+ # Custom attribute writer method checking allowed values (enum).
147
+ # @param [Object] object Object to be assigned
148
+ def object=(object)
149
+ validator = EnumAttributeValidator.new('String', ["job_cancel", "unknown_default_open_api"])
150
+ object = 'unknown_default_open_api' unless validator.valid?(object)
151
+ @object = object
152
+ end
153
+
154
+ # Checks equality by comparing each attribute.
155
+ # @param [Object] Object to be compared
156
+ def ==(o)
157
+ return true if self.equal?(o)
158
+ self.class == o.class &&
159
+ object == o.object &&
160
+ outcome == o.outcome &&
161
+ message == o.message &&
162
+ job == o.job
163
+ end
164
+
165
+ # @see the `==` method
166
+ # @param [Object] Object to be compared
167
+ def eql?(o)
168
+ self == o
169
+ end
170
+
171
+ # Calculates hash code according to all attributes.
172
+ # @return [Integer] Hash code
173
+ def hash
174
+ [object, outcome, message, job].hash
175
+ end
176
+
177
+ # Builds the object from hash
178
+ # @param [Hash] attributes Model attributes in the form of hash
179
+ # @return [Object] Returns the model itself
180
+ def self.build_from_hash(attributes)
181
+ return nil unless attributes.is_a?(Hash)
182
+ attributes = attributes.transform_keys(&:to_sym)
183
+ # include attributes inherited from allOf parents (the nearest declaration wins)
184
+ map = acceptable_attribute_map
185
+ transformed_hash = {}
186
+ acceptable_openapi_types.each_pair do |key, type|
187
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
188
+ transformed_hash["#{key}"] = nil
189
+ elsif type =~ /\AArray<(.*)>/i
190
+ # check to ensure the input is an array given that the attribute
191
+ # is documented as an array but the input is not
192
+ if attributes[map[key]].is_a?(Array)
193
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
194
+ end
195
+ elsif !attributes[map[key]].nil?
196
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
197
+ end
198
+ end
199
+ new(transformed_hash)
200
+ end
201
+
202
+ # Returns the object in the form of hash
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_hash
205
+ hash = {}
206
+ # include attributes inherited from allOf parents (the nearest declaration wins)
207
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
208
+ value = self.send(attr)
209
+ if value.nil?
210
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
211
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
212
+ end
213
+
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ end
220
+
221
+ end