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,308 @@
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 Recast < ApiModelBase
18
+ attr_accessor :object
19
+
20
+ attr_accessor :dry_run
21
+
22
+ # `quoted` (a dry run), `refused` (a dry run that would not start), or the job's own status once queued: `queued`, `running`, `done`, `error`. This enum MAY GROW.
23
+ attr_accessor :status
24
+
25
+ attr_accessor :quote
26
+
27
+ # The model that will render it.
28
+ attr_accessor :engine
29
+
30
+ attr_accessor :window
31
+
32
+ # The whole video's length.
33
+ attr_accessor :source_seconds
34
+
35
+ attr_accessor :subject
36
+
37
+ attr_accessor :voice
38
+
39
+ # Plain sentences worth showing: a window that was cut, a recast done in passes and the cut second to watch, a face that is small in a shot.
40
+ attr_accessor :notes
41
+
42
+ # With `person.describe` on a real call: the AI person that was made. It is in your Library; send it as `person.image_url` to reuse them.
43
+ attr_accessor :person_url
44
+
45
+ attr_accessor :job_id
46
+
47
+ # The queued job, as `GET /v1/jobs/{id}` answers it. Poll that until `done`; `url` is the video.
48
+ attr_accessor :job
49
+
50
+ class EnumAttributeValidator
51
+ attr_reader :datatype
52
+ attr_reader :allowable_values
53
+
54
+ def initialize(datatype, allowable_values)
55
+ @allowable_values = allowable_values.map do |value|
56
+ case datatype.to_s
57
+ when /Integer/i
58
+ value.to_i
59
+ when /Float/i
60
+ value.to_f
61
+ else
62
+ value
63
+ end
64
+ end
65
+ end
66
+
67
+ def valid?(value)
68
+ !value || allowable_values.include?(value)
69
+ end
70
+ end
71
+
72
+ # Attribute mapping from ruby-style variable name to JSON key.
73
+ def self.attribute_map
74
+ {
75
+ :'object' => :'object',
76
+ :'dry_run' => :'dry_run',
77
+ :'status' => :'status',
78
+ :'quote' => :'quote',
79
+ :'engine' => :'engine',
80
+ :'window' => :'window',
81
+ :'source_seconds' => :'source_seconds',
82
+ :'subject' => :'subject',
83
+ :'voice' => :'voice',
84
+ :'notes' => :'notes',
85
+ :'person_url' => :'person_url',
86
+ :'job_id' => :'job_id',
87
+ :'job' => :'job'
88
+ }
89
+ end
90
+
91
+ # Returns attribute mapping this model knows about
92
+ def self.acceptable_attribute_map
93
+ attribute_map
94
+ end
95
+
96
+ # Returns all the JSON keys this model knows about
97
+ def self.acceptable_attributes
98
+ acceptable_attribute_map.values
99
+ end
100
+
101
+ # Attribute type mapping.
102
+ def self.openapi_types
103
+ {
104
+ :'object' => :'String',
105
+ :'dry_run' => :'Boolean',
106
+ :'status' => :'String',
107
+ :'quote' => :'RecastQuote',
108
+ :'engine' => :'String',
109
+ :'window' => :'RecastWindow',
110
+ :'source_seconds' => :'Float',
111
+ :'subject' => :'RecastSubject',
112
+ :'voice' => :'RecastVoice',
113
+ :'notes' => :'Array<String>',
114
+ :'person_url' => :'String',
115
+ :'job_id' => :'String',
116
+ :'job' => :'Job'
117
+ }
118
+ end
119
+
120
+ # List of attributes with nullable: true
121
+ def self.openapi_nullable
122
+ Set.new([
123
+ ])
124
+ end
125
+
126
+ # Returns attribute type mapping
127
+ def self.acceptable_openapi_types
128
+ openapi_types
129
+ end
130
+
131
+ # Returns the nullable attributes
132
+ def self.acceptable_openapi_nullable
133
+ openapi_nullable
134
+ end
135
+
136
+ # Initializes the object
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ def initialize(attributes = {})
139
+ if (!attributes.is_a?(Hash))
140
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Hermoso::Recast` initialize method"
141
+ end
142
+
143
+ # check to see if the attribute exists and convert string to symbol for hash key
144
+ acceptable_attribute_map = self.class.acceptable_attribute_map
145
+ attributes = attributes.each_with_object({}) { |(k, v), h|
146
+ if (!acceptable_attribute_map.key?(k.to_sym))
147
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Hermoso::Recast`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
148
+ end
149
+ h[k.to_sym] = v
150
+ }
151
+
152
+ if attributes.key?(:'object')
153
+ self.object = attributes[:'object']
154
+ end
155
+
156
+ if attributes.key?(:'dry_run')
157
+ self.dry_run = attributes[:'dry_run']
158
+ end
159
+
160
+ if attributes.key?(:'status')
161
+ self.status = attributes[:'status']
162
+ end
163
+
164
+ if attributes.key?(:'quote')
165
+ self.quote = attributes[:'quote']
166
+ end
167
+
168
+ if attributes.key?(:'engine')
169
+ self.engine = attributes[:'engine']
170
+ end
171
+
172
+ if attributes.key?(:'window')
173
+ self.window = attributes[:'window']
174
+ end
175
+
176
+ if attributes.key?(:'source_seconds')
177
+ self.source_seconds = attributes[:'source_seconds']
178
+ end
179
+
180
+ if attributes.key?(:'subject')
181
+ self.subject = attributes[:'subject']
182
+ end
183
+
184
+ if attributes.key?(:'voice')
185
+ self.voice = attributes[:'voice']
186
+ end
187
+
188
+ if attributes.key?(:'notes')
189
+ if (value = attributes[:'notes']).is_a?(Array)
190
+ self.notes = value
191
+ end
192
+ end
193
+
194
+ if attributes.key?(:'person_url')
195
+ self.person_url = attributes[:'person_url']
196
+ end
197
+
198
+ if attributes.key?(:'job_id')
199
+ self.job_id = attributes[:'job_id']
200
+ end
201
+
202
+ if attributes.key?(:'job')
203
+ self.job = attributes[:'job']
204
+ end
205
+ end
206
+
207
+ # Show invalid properties with the reasons. Usually used together with valid?
208
+ # @return Array for valid properties with the reasons
209
+ def list_invalid_properties
210
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
211
+ invalid_properties = Array.new
212
+ invalid_properties
213
+ end
214
+
215
+ # Check to see if the all the properties in the model are valid
216
+ # @return true if the model is valid
217
+ def valid?
218
+ warn '[DEPRECATED] the `valid?` method is obsolete'
219
+ object_validator = EnumAttributeValidator.new('String', ["recast", "unknown_default_open_api"])
220
+ return false unless object_validator.valid?(@object)
221
+ true
222
+ end
223
+
224
+ # Custom attribute writer method checking allowed values (enum).
225
+ # @param [Object] object Object to be assigned
226
+ def object=(object)
227
+ validator = EnumAttributeValidator.new('String', ["recast", "unknown_default_open_api"])
228
+ object = 'unknown_default_open_api' unless validator.valid?(object)
229
+ @object = object
230
+ end
231
+
232
+ # Checks equality by comparing each attribute.
233
+ # @param [Object] Object to be compared
234
+ def ==(o)
235
+ return true if self.equal?(o)
236
+ self.class == o.class &&
237
+ object == o.object &&
238
+ dry_run == o.dry_run &&
239
+ status == o.status &&
240
+ quote == o.quote &&
241
+ engine == o.engine &&
242
+ window == o.window &&
243
+ source_seconds == o.source_seconds &&
244
+ subject == o.subject &&
245
+ voice == o.voice &&
246
+ notes == o.notes &&
247
+ person_url == o.person_url &&
248
+ job_id == o.job_id &&
249
+ job == o.job
250
+ end
251
+
252
+ # @see the `==` method
253
+ # @param [Object] Object to be compared
254
+ def eql?(o)
255
+ self == o
256
+ end
257
+
258
+ # Calculates hash code according to all attributes.
259
+ # @return [Integer] Hash code
260
+ def hash
261
+ [object, dry_run, status, quote, engine, window, source_seconds, subject, voice, notes, person_url, job_id, job].hash
262
+ end
263
+
264
+ # Builds the object from hash
265
+ # @param [Hash] attributes Model attributes in the form of hash
266
+ # @return [Object] Returns the model itself
267
+ def self.build_from_hash(attributes)
268
+ return nil unless attributes.is_a?(Hash)
269
+ attributes = attributes.transform_keys(&:to_sym)
270
+ # include attributes inherited from allOf parents (the nearest declaration wins)
271
+ map = acceptable_attribute_map
272
+ transformed_hash = {}
273
+ acceptable_openapi_types.each_pair do |key, type|
274
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
275
+ transformed_hash["#{key}"] = nil
276
+ elsif type =~ /\AArray<(.*)>/i
277
+ # check to ensure the input is an array given that the attribute
278
+ # is documented as an array but the input is not
279
+ if attributes[map[key]].is_a?(Array)
280
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
281
+ end
282
+ elsif !attributes[map[key]].nil?
283
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
284
+ end
285
+ end
286
+ new(transformed_hash)
287
+ end
288
+
289
+ # Returns the object in the form of hash
290
+ # @return [Hash] Returns the object in the form of hash
291
+ def to_hash
292
+ hash = {}
293
+ # include attributes inherited from allOf parents (the nearest declaration wins)
294
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
295
+ value = self.send(attr)
296
+ if value.nil?
297
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
298
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
299
+ end
300
+
301
+ hash[param] = _to_hash(value)
302
+ end
303
+ hash
304
+ end
305
+
306
+ end
307
+
308
+ end
@@ -0,0 +1,274 @@
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 RecastCreate < ApiModelBase
18
+ # The video the person goes into: a public https link to a video file, a TikTok, Reel, Facebook, X or YouTube post link (read once, through one lookup), or a Hermoso file URL (`POST /v1/media`, `GET /v1/library`, a job `url`).
19
+ attr_accessor :video
20
+
21
+ attr_accessor :person
22
+
23
+ # Optional. A NEW voice for the new person, keeping the original words and timing: `match` (a voice that fits them), `female`, `male`, or a stock voice name (Aria, Sarah, Charlotte, George, Brian, Charlie). Omit to keep the video's own sound. Never the original speaker's voice or a cloned one.
24
+ attr_accessor :voice
25
+
26
+ # Optional. The new person speaks this language instead (for example `Spanish`), with the mouth lip-synced to the new words. `voice` defaults to `match`.
27
+ attr_accessor :language
28
+
29
+ # Optional. Where the recast window starts, in seconds. Default 0.
30
+ attr_accessor :start
31
+
32
+ # Optional. Where it ends, in seconds. Default: the end of the video, up to 60 seconds after `start`. At least 3 seconds.
33
+ attr_accessor :_end
34
+
35
+ # Optional, in your own words: who in the video is replaced when there are several people (\"the man on the left\").
36
+ attr_accessor :instruction
37
+
38
+ # true = return the exact price and the plan, and run nothing.
39
+ attr_accessor :dry_run
40
+
41
+ # Optional https URL to POST the finished job to (the same as the `X-Hermoso-Callback-Url` header).
42
+ attr_accessor :callback_url
43
+
44
+ # Attribute mapping from ruby-style variable name to JSON key.
45
+ def self.attribute_map
46
+ {
47
+ :'video' => :'video',
48
+ :'person' => :'person',
49
+ :'voice' => :'voice',
50
+ :'language' => :'language',
51
+ :'start' => :'start',
52
+ :'_end' => :'end',
53
+ :'instruction' => :'instruction',
54
+ :'dry_run' => :'dry_run',
55
+ :'callback_url' => :'callback_url'
56
+ }
57
+ end
58
+
59
+ # Returns attribute mapping this model knows about
60
+ def self.acceptable_attribute_map
61
+ attribute_map
62
+ end
63
+
64
+ # Returns all the JSON keys this model knows about
65
+ def self.acceptable_attributes
66
+ acceptable_attribute_map.values
67
+ end
68
+
69
+ # Attribute type mapping.
70
+ def self.openapi_types
71
+ {
72
+ :'video' => :'String',
73
+ :'person' => :'RecastPerson',
74
+ :'voice' => :'String',
75
+ :'language' => :'String',
76
+ :'start' => :'Float',
77
+ :'_end' => :'Float',
78
+ :'instruction' => :'String',
79
+ :'dry_run' => :'Boolean',
80
+ :'callback_url' => :'String'
81
+ }
82
+ end
83
+
84
+ # List of attributes with nullable: true
85
+ def self.openapi_nullable
86
+ Set.new([
87
+ ])
88
+ end
89
+
90
+ # Returns attribute type mapping
91
+ def self.acceptable_openapi_types
92
+ openapi_types
93
+ end
94
+
95
+ # Returns the nullable attributes
96
+ def self.acceptable_openapi_nullable
97
+ openapi_nullable
98
+ end
99
+
100
+ # Initializes the object
101
+ # @param [Hash] attributes Model attributes in the form of hash
102
+ def initialize(attributes = {})
103
+ if (!attributes.is_a?(Hash))
104
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Hermoso::RecastCreate` initialize method"
105
+ end
106
+
107
+ # check to see if the attribute exists and convert string to symbol for hash key
108
+ acceptable_attribute_map = self.class.acceptable_attribute_map
109
+ attributes = attributes.each_with_object({}) { |(k, v), h|
110
+ if (!acceptable_attribute_map.key?(k.to_sym))
111
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Hermoso::RecastCreate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
112
+ end
113
+ h[k.to_sym] = v
114
+ }
115
+
116
+ if attributes.key?(:'video')
117
+ self.video = attributes[:'video']
118
+ else
119
+ self.video = nil
120
+ end
121
+
122
+ if attributes.key?(:'person')
123
+ self.person = attributes[:'person']
124
+ else
125
+ self.person = nil
126
+ end
127
+
128
+ if attributes.key?(:'voice')
129
+ self.voice = attributes[:'voice']
130
+ end
131
+
132
+ if attributes.key?(:'language')
133
+ self.language = attributes[:'language']
134
+ end
135
+
136
+ if attributes.key?(:'start')
137
+ self.start = attributes[:'start']
138
+ end
139
+
140
+ if attributes.key?(:'_end')
141
+ self._end = attributes[:'_end']
142
+ end
143
+
144
+ if attributes.key?(:'instruction')
145
+ self.instruction = attributes[:'instruction']
146
+ end
147
+
148
+ if attributes.key?(:'dry_run')
149
+ self.dry_run = attributes[:'dry_run']
150
+ end
151
+
152
+ if attributes.key?(:'callback_url')
153
+ self.callback_url = attributes[:'callback_url']
154
+ end
155
+ end
156
+
157
+ # Show invalid properties with the reasons. Usually used together with valid?
158
+ # @return Array for valid properties with the reasons
159
+ def list_invalid_properties
160
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
161
+ invalid_properties = Array.new
162
+ if @video.nil?
163
+ invalid_properties.push('invalid value for "video", video cannot be nil.')
164
+ end
165
+
166
+ if @person.nil?
167
+ invalid_properties.push('invalid value for "person", person cannot be nil.')
168
+ end
169
+
170
+ invalid_properties
171
+ end
172
+
173
+ # Check to see if the all the properties in the model are valid
174
+ # @return true if the model is valid
175
+ def valid?
176
+ warn '[DEPRECATED] the `valid?` method is obsolete'
177
+ return false if @video.nil?
178
+ return false if @person.nil?
179
+ true
180
+ end
181
+
182
+ # Custom attribute writer method with validation
183
+ # @param [Object] video Value to be assigned
184
+ def video=(video)
185
+ if video.nil?
186
+ fail ArgumentError, 'video cannot be nil'
187
+ end
188
+
189
+ @video = video
190
+ end
191
+
192
+ # Custom attribute writer method with validation
193
+ # @param [Object] person Value to be assigned
194
+ def person=(person)
195
+ if person.nil?
196
+ fail ArgumentError, 'person cannot be nil'
197
+ end
198
+
199
+ @person = person
200
+ end
201
+
202
+ # Checks equality by comparing each attribute.
203
+ # @param [Object] Object to be compared
204
+ def ==(o)
205
+ return true if self.equal?(o)
206
+ self.class == o.class &&
207
+ video == o.video &&
208
+ person == o.person &&
209
+ voice == o.voice &&
210
+ language == o.language &&
211
+ start == o.start &&
212
+ _end == o._end &&
213
+ instruction == o.instruction &&
214
+ dry_run == o.dry_run &&
215
+ callback_url == o.callback_url
216
+ end
217
+
218
+ # @see the `==` method
219
+ # @param [Object] Object to be compared
220
+ def eql?(o)
221
+ self == o
222
+ end
223
+
224
+ # Calculates hash code according to all attributes.
225
+ # @return [Integer] Hash code
226
+ def hash
227
+ [video, person, voice, language, start, _end, instruction, dry_run, callback_url].hash
228
+ end
229
+
230
+ # Builds the object from hash
231
+ # @param [Hash] attributes Model attributes in the form of hash
232
+ # @return [Object] Returns the model itself
233
+ def self.build_from_hash(attributes)
234
+ return nil unless attributes.is_a?(Hash)
235
+ attributes = attributes.transform_keys(&:to_sym)
236
+ # include attributes inherited from allOf parents (the nearest declaration wins)
237
+ map = acceptable_attribute_map
238
+ transformed_hash = {}
239
+ acceptable_openapi_types.each_pair do |key, type|
240
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
241
+ transformed_hash["#{key}"] = nil
242
+ elsif type =~ /\AArray<(.*)>/i
243
+ # check to ensure the input is an array given that the attribute
244
+ # is documented as an array but the input is not
245
+ if attributes[map[key]].is_a?(Array)
246
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
247
+ end
248
+ elsif !attributes[map[key]].nil?
249
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
250
+ end
251
+ end
252
+ new(transformed_hash)
253
+ end
254
+
255
+ # Returns the object in the form of hash
256
+ # @return [Hash] Returns the object in the form of hash
257
+ def to_hash
258
+ hash = {}
259
+ # include attributes inherited from allOf parents (the nearest declaration wins)
260
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
261
+ value = self.send(attr)
262
+ if value.nil?
263
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
264
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
265
+ end
266
+
267
+ hash[param] = _to_hash(value)
268
+ end
269
+ hash
270
+ end
271
+
272
+ end
273
+
274
+ end