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,317 @@
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 EditCreate < ApiModelBase
18
+ # The clip to edit: a public https link to a video file or a social post, or a Hermoso file URL. 3 to 15 seconds.
19
+ attr_accessor :video
20
+
21
+ # The ONE change, in plain words: \"change only the mug to red\", \"swap the bottle for our product\", \"make it nighttime\".
22
+ attr_accessor :instruction
23
+
24
+ # Optional image (https or a Hermoso file URL) that anchors the material of what changes: a fabric, a finish, a colour swatch, the real product. Only its surface is used, never its framing or light.
25
+ attr_accessor :reference
26
+
27
+ # Default true: keep the clip's sound. false = silent.
28
+ attr_accessor :keep_audio
29
+
30
+ # Default auto: keep the light unless the change needs new light (night, a lamp). preserve or relight forces it.
31
+ attr_accessor :lighting
32
+
33
+ # true = edit ONE still of the clip first and return it with the clip's price. Nothing else runs.
34
+ attr_accessor :preview_first_frame
35
+
36
+ # The `preview.still_url` a preview returned: the clip is then rendered so the change looks the way it does in that still.
37
+ attr_accessor :preview_still
38
+
39
+ # Which second to preview (default the first frame). Send the same value with `preview_still`.
40
+ attr_accessor :preview_at
41
+
42
+ # true = return the exact price, and run nothing.
43
+ attr_accessor :dry_run
44
+
45
+ # Optional https URL to POST the finished job to (the same as the `X-Hermoso-Callback-Url` header).
46
+ attr_accessor :callback_url
47
+
48
+ class EnumAttributeValidator
49
+ attr_reader :datatype
50
+ attr_reader :allowable_values
51
+
52
+ def initialize(datatype, allowable_values)
53
+ @allowable_values = allowable_values.map do |value|
54
+ case datatype.to_s
55
+ when /Integer/i
56
+ value.to_i
57
+ when /Float/i
58
+ value.to_f
59
+ else
60
+ value
61
+ end
62
+ end
63
+ end
64
+
65
+ def valid?(value)
66
+ !value || allowable_values.include?(value)
67
+ end
68
+ end
69
+
70
+ # Attribute mapping from ruby-style variable name to JSON key.
71
+ def self.attribute_map
72
+ {
73
+ :'video' => :'video',
74
+ :'instruction' => :'instruction',
75
+ :'reference' => :'reference',
76
+ :'keep_audio' => :'keep_audio',
77
+ :'lighting' => :'lighting',
78
+ :'preview_first_frame' => :'preview_first_frame',
79
+ :'preview_still' => :'preview_still',
80
+ :'preview_at' => :'preview_at',
81
+ :'dry_run' => :'dry_run',
82
+ :'callback_url' => :'callback_url'
83
+ }
84
+ end
85
+
86
+ # Returns attribute mapping this model knows about
87
+ def self.acceptable_attribute_map
88
+ attribute_map
89
+ end
90
+
91
+ # Returns all the JSON keys this model knows about
92
+ def self.acceptable_attributes
93
+ acceptable_attribute_map.values
94
+ end
95
+
96
+ # Attribute type mapping.
97
+ def self.openapi_types
98
+ {
99
+ :'video' => :'String',
100
+ :'instruction' => :'String',
101
+ :'reference' => :'String',
102
+ :'keep_audio' => :'Boolean',
103
+ :'lighting' => :'String',
104
+ :'preview_first_frame' => :'Boolean',
105
+ :'preview_still' => :'String',
106
+ :'preview_at' => :'Float',
107
+ :'dry_run' => :'Boolean',
108
+ :'callback_url' => :'String'
109
+ }
110
+ end
111
+
112
+ # List of attributes with nullable: true
113
+ def self.openapi_nullable
114
+ Set.new([
115
+ ])
116
+ end
117
+
118
+ # Returns attribute type mapping
119
+ def self.acceptable_openapi_types
120
+ openapi_types
121
+ end
122
+
123
+ # Returns the nullable attributes
124
+ def self.acceptable_openapi_nullable
125
+ openapi_nullable
126
+ end
127
+
128
+ # Initializes the object
129
+ # @param [Hash] attributes Model attributes in the form of hash
130
+ def initialize(attributes = {})
131
+ if (!attributes.is_a?(Hash))
132
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Hermoso::EditCreate` initialize method"
133
+ end
134
+
135
+ # check to see if the attribute exists and convert string to symbol for hash key
136
+ acceptable_attribute_map = self.class.acceptable_attribute_map
137
+ attributes = attributes.each_with_object({}) { |(k, v), h|
138
+ if (!acceptable_attribute_map.key?(k.to_sym))
139
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Hermoso::EditCreate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
140
+ end
141
+ h[k.to_sym] = v
142
+ }
143
+
144
+ if attributes.key?(:'video')
145
+ self.video = attributes[:'video']
146
+ else
147
+ self.video = nil
148
+ end
149
+
150
+ if attributes.key?(:'instruction')
151
+ self.instruction = attributes[:'instruction']
152
+ else
153
+ self.instruction = nil
154
+ end
155
+
156
+ if attributes.key?(:'reference')
157
+ self.reference = attributes[:'reference']
158
+ end
159
+
160
+ if attributes.key?(:'keep_audio')
161
+ self.keep_audio = attributes[:'keep_audio']
162
+ end
163
+
164
+ if attributes.key?(:'lighting')
165
+ self.lighting = attributes[:'lighting']
166
+ end
167
+
168
+ if attributes.key?(:'preview_first_frame')
169
+ self.preview_first_frame = attributes[:'preview_first_frame']
170
+ end
171
+
172
+ if attributes.key?(:'preview_still')
173
+ self.preview_still = attributes[:'preview_still']
174
+ end
175
+
176
+ if attributes.key?(:'preview_at')
177
+ self.preview_at = attributes[:'preview_at']
178
+ end
179
+
180
+ if attributes.key?(:'dry_run')
181
+ self.dry_run = attributes[:'dry_run']
182
+ end
183
+
184
+ if attributes.key?(:'callback_url')
185
+ self.callback_url = attributes[:'callback_url']
186
+ end
187
+ end
188
+
189
+ # Show invalid properties with the reasons. Usually used together with valid?
190
+ # @return Array for valid properties with the reasons
191
+ def list_invalid_properties
192
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
193
+ invalid_properties = Array.new
194
+ if @video.nil?
195
+ invalid_properties.push('invalid value for "video", video cannot be nil.')
196
+ end
197
+
198
+ if @instruction.nil?
199
+ invalid_properties.push('invalid value for "instruction", instruction cannot be nil.')
200
+ end
201
+
202
+ invalid_properties
203
+ end
204
+
205
+ # Check to see if the all the properties in the model are valid
206
+ # @return true if the model is valid
207
+ def valid?
208
+ warn '[DEPRECATED] the `valid?` method is obsolete'
209
+ return false if @video.nil?
210
+ return false if @instruction.nil?
211
+ lighting_validator = EnumAttributeValidator.new('String', ["auto", "preserve", "relight", "unknown_default_open_api"])
212
+ return false unless lighting_validator.valid?(@lighting)
213
+ true
214
+ end
215
+
216
+ # Custom attribute writer method with validation
217
+ # @param [Object] video Value to be assigned
218
+ def video=(video)
219
+ if video.nil?
220
+ fail ArgumentError, 'video cannot be nil'
221
+ end
222
+
223
+ @video = video
224
+ end
225
+
226
+ # Custom attribute writer method with validation
227
+ # @param [Object] instruction Value to be assigned
228
+ def instruction=(instruction)
229
+ if instruction.nil?
230
+ fail ArgumentError, 'instruction cannot be nil'
231
+ end
232
+
233
+ @instruction = instruction
234
+ end
235
+
236
+ # Custom attribute writer method checking allowed values (enum).
237
+ # @param [Object] lighting Object to be assigned
238
+ def lighting=(lighting)
239
+ validator = EnumAttributeValidator.new('String', ["auto", "preserve", "relight", "unknown_default_open_api"])
240
+ lighting = 'unknown_default_open_api' unless validator.valid?(lighting)
241
+ @lighting = lighting
242
+ end
243
+
244
+ # Checks equality by comparing each attribute.
245
+ # @param [Object] Object to be compared
246
+ def ==(o)
247
+ return true if self.equal?(o)
248
+ self.class == o.class &&
249
+ video == o.video &&
250
+ instruction == o.instruction &&
251
+ reference == o.reference &&
252
+ keep_audio == o.keep_audio &&
253
+ lighting == o.lighting &&
254
+ preview_first_frame == o.preview_first_frame &&
255
+ preview_still == o.preview_still &&
256
+ preview_at == o.preview_at &&
257
+ dry_run == o.dry_run &&
258
+ callback_url == o.callback_url
259
+ end
260
+
261
+ # @see the `==` method
262
+ # @param [Object] Object to be compared
263
+ def eql?(o)
264
+ self == o
265
+ end
266
+
267
+ # Calculates hash code according to all attributes.
268
+ # @return [Integer] Hash code
269
+ def hash
270
+ [video, instruction, reference, keep_audio, lighting, preview_first_frame, preview_still, preview_at, dry_run, callback_url].hash
271
+ end
272
+
273
+ # Builds the object from hash
274
+ # @param [Hash] attributes Model attributes in the form of hash
275
+ # @return [Object] Returns the model itself
276
+ def self.build_from_hash(attributes)
277
+ return nil unless attributes.is_a?(Hash)
278
+ attributes = attributes.transform_keys(&:to_sym)
279
+ # include attributes inherited from allOf parents (the nearest declaration wins)
280
+ map = acceptable_attribute_map
281
+ transformed_hash = {}
282
+ acceptable_openapi_types.each_pair do |key, type|
283
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
284
+ transformed_hash["#{key}"] = nil
285
+ elsif type =~ /\AArray<(.*)>/i
286
+ # check to ensure the input is an array given that the attribute
287
+ # is documented as an array but the input is not
288
+ if attributes[map[key]].is_a?(Array)
289
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
290
+ end
291
+ elsif !attributes[map[key]].nil?
292
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
293
+ end
294
+ end
295
+ new(transformed_hash)
296
+ end
297
+
298
+ # Returns the object in the form of hash
299
+ # @return [Hash] Returns the object in the form of hash
300
+ def to_hash
301
+ hash = {}
302
+ # include attributes inherited from allOf parents (the nearest declaration wins)
303
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
304
+ value = self.send(attr)
305
+ if value.nil?
306
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
307
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
308
+ end
309
+
310
+ hash[param] = _to_hash(value)
311
+ end
312
+ hash
313
+ end
314
+
315
+ end
316
+
317
+ end
@@ -0,0 +1,199 @@
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 EditPreview < ApiModelBase
18
+ # The edited still (null on a dry run). Send it back as `preview_still`.
19
+ attr_accessor :still_url
20
+
21
+ # What the still cost, or on a dry run what it reserves.
22
+ attr_accessor :still_credits
23
+
24
+ attr_accessor :still_refused
25
+
26
+ # The second of the clip the still was taken from.
27
+ attr_accessor :frame_at
28
+
29
+ attr_accessor :note
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'still_url' => :'still_url',
35
+ :'still_credits' => :'still_credits',
36
+ :'still_refused' => :'still_refused',
37
+ :'frame_at' => :'frame_at',
38
+ :'note' => :'note'
39
+ }
40
+ end
41
+
42
+ # Returns attribute mapping this model knows about
43
+ def self.acceptable_attribute_map
44
+ attribute_map
45
+ end
46
+
47
+ # Returns all the JSON keys this model knows about
48
+ def self.acceptable_attributes
49
+ acceptable_attribute_map.values
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.openapi_types
54
+ {
55
+ :'still_url' => :'String',
56
+ :'still_credits' => :'Float',
57
+ :'still_refused' => :'String',
58
+ :'frame_at' => :'Float',
59
+ :'note' => :'String'
60
+ }
61
+ end
62
+
63
+ # List of attributes with nullable: true
64
+ def self.openapi_nullable
65
+ Set.new([
66
+ ])
67
+ end
68
+
69
+ # Returns attribute type mapping
70
+ def self.acceptable_openapi_types
71
+ openapi_types
72
+ end
73
+
74
+ # Returns the nullable attributes
75
+ def self.acceptable_openapi_nullable
76
+ openapi_nullable
77
+ end
78
+
79
+ # Initializes the object
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ def initialize(attributes = {})
82
+ if (!attributes.is_a?(Hash))
83
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Hermoso::EditPreview` initialize method"
84
+ end
85
+
86
+ # check to see if the attribute exists and convert string to symbol for hash key
87
+ acceptable_attribute_map = self.class.acceptable_attribute_map
88
+ attributes = attributes.each_with_object({}) { |(k, v), h|
89
+ if (!acceptable_attribute_map.key?(k.to_sym))
90
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Hermoso::EditPreview`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
91
+ end
92
+ h[k.to_sym] = v
93
+ }
94
+
95
+ if attributes.key?(:'still_url')
96
+ self.still_url = attributes[:'still_url']
97
+ end
98
+
99
+ if attributes.key?(:'still_credits')
100
+ self.still_credits = attributes[:'still_credits']
101
+ end
102
+
103
+ if attributes.key?(:'still_refused')
104
+ self.still_refused = attributes[:'still_refused']
105
+ end
106
+
107
+ if attributes.key?(:'frame_at')
108
+ self.frame_at = attributes[:'frame_at']
109
+ end
110
+
111
+ if attributes.key?(:'note')
112
+ self.note = attributes[:'note']
113
+ end
114
+ end
115
+
116
+ # Show invalid properties with the reasons. Usually used together with valid?
117
+ # @return Array for valid properties with the reasons
118
+ def list_invalid_properties
119
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
120
+ invalid_properties = Array.new
121
+ invalid_properties
122
+ end
123
+
124
+ # Check to see if the all the properties in the model are valid
125
+ # @return true if the model is valid
126
+ def valid?
127
+ warn '[DEPRECATED] the `valid?` method is obsolete'
128
+ true
129
+ end
130
+
131
+ # Checks equality by comparing each attribute.
132
+ # @param [Object] Object to be compared
133
+ def ==(o)
134
+ return true if self.equal?(o)
135
+ self.class == o.class &&
136
+ still_url == o.still_url &&
137
+ still_credits == o.still_credits &&
138
+ still_refused == o.still_refused &&
139
+ frame_at == o.frame_at &&
140
+ note == o.note
141
+ end
142
+
143
+ # @see the `==` method
144
+ # @param [Object] Object to be compared
145
+ def eql?(o)
146
+ self == o
147
+ end
148
+
149
+ # Calculates hash code according to all attributes.
150
+ # @return [Integer] Hash code
151
+ def hash
152
+ [still_url, still_credits, still_refused, frame_at, note].hash
153
+ end
154
+
155
+ # Builds the object from hash
156
+ # @param [Hash] attributes Model attributes in the form of hash
157
+ # @return [Object] Returns the model itself
158
+ def self.build_from_hash(attributes)
159
+ return nil unless attributes.is_a?(Hash)
160
+ attributes = attributes.transform_keys(&:to_sym)
161
+ # include attributes inherited from allOf parents (the nearest declaration wins)
162
+ map = acceptable_attribute_map
163
+ transformed_hash = {}
164
+ acceptable_openapi_types.each_pair do |key, type|
165
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
166
+ transformed_hash["#{key}"] = nil
167
+ elsif type =~ /\AArray<(.*)>/i
168
+ # check to ensure the input is an array given that the attribute
169
+ # is documented as an array but the input is not
170
+ if attributes[map[key]].is_a?(Array)
171
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
172
+ end
173
+ elsif !attributes[map[key]].nil?
174
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
175
+ end
176
+ end
177
+ new(transformed_hash)
178
+ end
179
+
180
+ # Returns the object in the form of hash
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_hash
183
+ hash = {}
184
+ # include attributes inherited from allOf parents (the nearest declaration wins)
185
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
186
+ value = self.send(attr)
187
+ if value.nil?
188
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
189
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
190
+ end
191
+
192
+ hash[param] = _to_hash(value)
193
+ end
194
+ hash
195
+ end
196
+
197
+ end
198
+
199
+ end