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,169 @@
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 FollowerHistoryDateRange < ApiModelBase
18
+ attr_accessor :from
19
+
20
+ attr_accessor :to
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'from' => :'from',
26
+ :'to' => :'to'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'from' => :'String',
44
+ :'to' => :'String'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Returns attribute type mapping
55
+ def self.acceptable_openapi_types
56
+ openapi_types
57
+ end
58
+
59
+ # Returns the nullable attributes
60
+ def self.acceptable_openapi_nullable
61
+ openapi_nullable
62
+ end
63
+
64
+ # Initializes the object
65
+ # @param [Hash] attributes Model attributes in the form of hash
66
+ def initialize(attributes = {})
67
+ if (!attributes.is_a?(Hash))
68
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Hermoso::FollowerHistoryDateRange` initialize method"
69
+ end
70
+
71
+ # check to see if the attribute exists and convert string to symbol for hash key
72
+ acceptable_attribute_map = self.class.acceptable_attribute_map
73
+ attributes = attributes.each_with_object({}) { |(k, v), h|
74
+ if (!acceptable_attribute_map.key?(k.to_sym))
75
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Hermoso::FollowerHistoryDateRange`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
76
+ end
77
+ h[k.to_sym] = v
78
+ }
79
+
80
+ if attributes.key?(:'from')
81
+ self.from = attributes[:'from']
82
+ end
83
+
84
+ if attributes.key?(:'to')
85
+ self.to = attributes[:'to']
86
+ end
87
+ end
88
+
89
+ # Show invalid properties with the reasons. Usually used together with valid?
90
+ # @return Array for valid properties with the reasons
91
+ def list_invalid_properties
92
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
93
+ invalid_properties = Array.new
94
+ invalid_properties
95
+ end
96
+
97
+ # Check to see if the all the properties in the model are valid
98
+ # @return true if the model is valid
99
+ def valid?
100
+ warn '[DEPRECATED] the `valid?` method is obsolete'
101
+ true
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ from == o.from &&
110
+ to == o.to
111
+ end
112
+
113
+ # @see the `==` method
114
+ # @param [Object] Object to be compared
115
+ def eql?(o)
116
+ self == o
117
+ end
118
+
119
+ # Calculates hash code according to all attributes.
120
+ # @return [Integer] Hash code
121
+ def hash
122
+ [from, to].hash
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def self.build_from_hash(attributes)
129
+ return nil unless attributes.is_a?(Hash)
130
+ attributes = attributes.transform_keys(&:to_sym)
131
+ # include attributes inherited from allOf parents (the nearest declaration wins)
132
+ map = acceptable_attribute_map
133
+ transformed_hash = {}
134
+ acceptable_openapi_types.each_pair do |key, type|
135
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
136
+ transformed_hash["#{key}"] = nil
137
+ elsif type =~ /\AArray<(.*)>/i
138
+ # check to ensure the input is an array given that the attribute
139
+ # is documented as an array but the input is not
140
+ if attributes[map[key]].is_a?(Array)
141
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
142
+ end
143
+ elsif !attributes[map[key]].nil?
144
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
145
+ end
146
+ end
147
+ new(transformed_hash)
148
+ end
149
+
150
+ # Returns the object in the form of hash
151
+ # @return [Hash] Returns the object in the form of hash
152
+ def to_hash
153
+ hash = {}
154
+ # include attributes inherited from allOf parents (the nearest declaration wins)
155
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
156
+ value = self.send(attr)
157
+ if value.nil?
158
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
159
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
160
+ end
161
+
162
+ hash[param] = _to_hash(value)
163
+ end
164
+ hash
165
+ end
166
+
167
+ end
168
+
169
+ end
@@ -0,0 +1,435 @@
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 GenerationCreate < ApiModelBase
18
+ # What to make. This enum MAY GROW.
19
+ attr_accessor :type
20
+
21
+ # What the ad should show, in plain words.
22
+ attr_accessor :prompt
23
+
24
+ # A model id from the live catalog (the `hermoso_capabilities` tool lists them with prices). Omit to let Hermoso pick; the quote then prices the model the server would pick.
25
+ attr_accessor :model
26
+
27
+ # e.g. 1:1, 4:5, 9:16, 16:9. Each model lists the ratios it renders.
28
+ attr_accessor :aspect_ratio
29
+
30
+ # Image only: a size tier the model lists (for example 1K, 2K).
31
+ attr_accessor :image_size
32
+
33
+ # Video only: one of the chosen model’s listed lengths.
34
+ attr_accessor :duration_seconds
35
+
36
+ # Video only: a Hermoso-hosted image to animate (image-to-video).
37
+ attr_accessor :ref_image
38
+
39
+ # Image only: up to 3 Hermoso-hosted images (a `POST /v1/media` or Library `url`) the render uses as its reference. When present the brand’s product photos are not attached for you; the quote prices exactly this.
40
+ attr_accessor :ref_images
41
+
42
+ # Image only, default true: attach the profile’s own product photos (and its logo when the prompt asks for one) so the render shows the real product. The quote prices exactly what this attaches.
43
+ attr_accessor :use_brand
44
+
45
+ # Image only, default png. gif = a short looping animated GIF, svg = an editable vector. Both render on gpt-image-2.6 (default) or gpt-image-2.6-flare from the prompt alone: no ref_images, and the profile’s photos are not attached.
46
+ attr_accessor :format
47
+
48
+ # format gif only: frames in the loop (default 9).
49
+ attr_accessor :frames
50
+
51
+ # format gif only: milliseconds per frame, rounded to 10 (default 200).
52
+ attr_accessor :frame_ms
53
+
54
+ # gpt-image-2.6 models only: how much the model plans before drawing (default high). No separate charge.
55
+ attr_accessor :complexity
56
+
57
+ # Image only: transparent = a PNG with no background (an alpha channel), for a cut-out product, icon or sticker. Renders on gpt-image-2.6 (default) or gpt-image-2.6-flare from the prompt alone: no ref_images, and the profile’s photos are not attached. Priced like a plain image of that size (the quote shows it).
58
+ attr_accessor :background
59
+
60
+ class EnumAttributeValidator
61
+ attr_reader :datatype
62
+ attr_reader :allowable_values
63
+
64
+ def initialize(datatype, allowable_values)
65
+ @allowable_values = allowable_values.map do |value|
66
+ case datatype.to_s
67
+ when /Integer/i
68
+ value.to_i
69
+ when /Float/i
70
+ value.to_f
71
+ else
72
+ value
73
+ end
74
+ end
75
+ end
76
+
77
+ def valid?(value)
78
+ !value || allowable_values.include?(value)
79
+ end
80
+ end
81
+
82
+ # Attribute mapping from ruby-style variable name to JSON key.
83
+ def self.attribute_map
84
+ {
85
+ :'type' => :'type',
86
+ :'prompt' => :'prompt',
87
+ :'model' => :'model',
88
+ :'aspect_ratio' => :'aspect_ratio',
89
+ :'image_size' => :'image_size',
90
+ :'duration_seconds' => :'duration_seconds',
91
+ :'ref_image' => :'ref_image',
92
+ :'ref_images' => :'ref_images',
93
+ :'use_brand' => :'use_brand',
94
+ :'format' => :'format',
95
+ :'frames' => :'frames',
96
+ :'frame_ms' => :'frame_ms',
97
+ :'complexity' => :'complexity',
98
+ :'background' => :'background'
99
+ }
100
+ end
101
+
102
+ # Returns attribute mapping this model knows about
103
+ def self.acceptable_attribute_map
104
+ attribute_map
105
+ end
106
+
107
+ # Returns all the JSON keys this model knows about
108
+ def self.acceptable_attributes
109
+ acceptable_attribute_map.values
110
+ end
111
+
112
+ # Attribute type mapping.
113
+ def self.openapi_types
114
+ {
115
+ :'type' => :'String',
116
+ :'prompt' => :'String',
117
+ :'model' => :'String',
118
+ :'aspect_ratio' => :'String',
119
+ :'image_size' => :'String',
120
+ :'duration_seconds' => :'Integer',
121
+ :'ref_image' => :'String',
122
+ :'ref_images' => :'Array<String>',
123
+ :'use_brand' => :'Boolean',
124
+ :'format' => :'String',
125
+ :'frames' => :'Integer',
126
+ :'frame_ms' => :'Integer',
127
+ :'complexity' => :'String',
128
+ :'background' => :'String'
129
+ }
130
+ end
131
+
132
+ # List of attributes with nullable: true
133
+ def self.openapi_nullable
134
+ Set.new([
135
+ ])
136
+ end
137
+
138
+ # Returns attribute type mapping
139
+ def self.acceptable_openapi_types
140
+ openapi_types
141
+ end
142
+
143
+ # Returns the nullable attributes
144
+ def self.acceptable_openapi_nullable
145
+ openapi_nullable
146
+ end
147
+
148
+ # Initializes the object
149
+ # @param [Hash] attributes Model attributes in the form of hash
150
+ def initialize(attributes = {})
151
+ if (!attributes.is_a?(Hash))
152
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Hermoso::GenerationCreate` initialize method"
153
+ end
154
+
155
+ # check to see if the attribute exists and convert string to symbol for hash key
156
+ acceptable_attribute_map = self.class.acceptable_attribute_map
157
+ attributes = attributes.each_with_object({}) { |(k, v), h|
158
+ if (!acceptable_attribute_map.key?(k.to_sym))
159
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Hermoso::GenerationCreate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
160
+ end
161
+ h[k.to_sym] = v
162
+ }
163
+
164
+ if attributes.key?(:'type')
165
+ self.type = attributes[:'type']
166
+ else
167
+ self.type = nil
168
+ end
169
+
170
+ if attributes.key?(:'prompt')
171
+ self.prompt = attributes[:'prompt']
172
+ else
173
+ self.prompt = nil
174
+ end
175
+
176
+ if attributes.key?(:'model')
177
+ self.model = attributes[:'model']
178
+ end
179
+
180
+ if attributes.key?(:'aspect_ratio')
181
+ self.aspect_ratio = attributes[:'aspect_ratio']
182
+ end
183
+
184
+ if attributes.key?(:'image_size')
185
+ self.image_size = attributes[:'image_size']
186
+ end
187
+
188
+ if attributes.key?(:'duration_seconds')
189
+ self.duration_seconds = attributes[:'duration_seconds']
190
+ end
191
+
192
+ if attributes.key?(:'ref_image')
193
+ self.ref_image = attributes[:'ref_image']
194
+ end
195
+
196
+ if attributes.key?(:'ref_images')
197
+ if (value = attributes[:'ref_images']).is_a?(Array)
198
+ self.ref_images = value
199
+ end
200
+ end
201
+
202
+ if attributes.key?(:'use_brand')
203
+ self.use_brand = attributes[:'use_brand']
204
+ end
205
+
206
+ if attributes.key?(:'format')
207
+ self.format = attributes[:'format']
208
+ end
209
+
210
+ if attributes.key?(:'frames')
211
+ self.frames = attributes[:'frames']
212
+ end
213
+
214
+ if attributes.key?(:'frame_ms')
215
+ self.frame_ms = attributes[:'frame_ms']
216
+ end
217
+
218
+ if attributes.key?(:'complexity')
219
+ self.complexity = attributes[:'complexity']
220
+ end
221
+
222
+ if attributes.key?(:'background')
223
+ self.background = attributes[:'background']
224
+ end
225
+ end
226
+
227
+ # Show invalid properties with the reasons. Usually used together with valid?
228
+ # @return Array for valid properties with the reasons
229
+ def list_invalid_properties
230
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
231
+ invalid_properties = Array.new
232
+ if @type.nil?
233
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
234
+ end
235
+
236
+ if @prompt.nil?
237
+ invalid_properties.push('invalid value for "prompt", prompt cannot be nil.')
238
+ end
239
+
240
+ if !@frames.nil? && @frames > 16
241
+ invalid_properties.push('invalid value for "frames", must be smaller than or equal to 16.')
242
+ end
243
+
244
+ if !@frames.nil? && @frames < 2
245
+ invalid_properties.push('invalid value for "frames", must be greater than or equal to 2.')
246
+ end
247
+
248
+ if !@frame_ms.nil? && @frame_ms > 2000
249
+ invalid_properties.push('invalid value for "frame_ms", must be smaller than or equal to 2000.')
250
+ end
251
+
252
+ if !@frame_ms.nil? && @frame_ms < 20
253
+ invalid_properties.push('invalid value for "frame_ms", must be greater than or equal to 20.')
254
+ end
255
+
256
+ invalid_properties
257
+ end
258
+
259
+ # Check to see if the all the properties in the model are valid
260
+ # @return true if the model is valid
261
+ def valid?
262
+ warn '[DEPRECATED] the `valid?` method is obsolete'
263
+ return false if @type.nil?
264
+ type_validator = EnumAttributeValidator.new('String', ["image", "video", "unknown_default_open_api"])
265
+ return false unless type_validator.valid?(@type)
266
+ return false if @prompt.nil?
267
+ format_validator = EnumAttributeValidator.new('String', ["png", "gif", "svg", "unknown_default_open_api"])
268
+ return false unless format_validator.valid?(@format)
269
+ return false if !@frames.nil? && @frames > 16
270
+ return false if !@frames.nil? && @frames < 2
271
+ return false if !@frame_ms.nil? && @frame_ms > 2000
272
+ return false if !@frame_ms.nil? && @frame_ms < 20
273
+ complexity_validator = EnumAttributeValidator.new('String', ["low", "medium", "high", "unknown_default_open_api"])
274
+ return false unless complexity_validator.valid?(@complexity)
275
+ background_validator = EnumAttributeValidator.new('String', ["transparent", "unknown_default_open_api"])
276
+ return false unless background_validator.valid?(@background)
277
+ true
278
+ end
279
+
280
+ # Custom attribute writer method checking allowed values (enum).
281
+ # @param [Object] type Object to be assigned
282
+ def type=(type)
283
+ validator = EnumAttributeValidator.new('String', ["image", "video", "unknown_default_open_api"])
284
+ type = 'unknown_default_open_api' unless validator.valid?(type)
285
+ @type = type
286
+ end
287
+
288
+ # Custom attribute writer method with validation
289
+ # @param [Object] prompt Value to be assigned
290
+ def prompt=(prompt)
291
+ if prompt.nil?
292
+ fail ArgumentError, 'prompt cannot be nil'
293
+ end
294
+
295
+ @prompt = prompt
296
+ end
297
+
298
+ # Custom attribute writer method checking allowed values (enum).
299
+ # @param [Object] format Object to be assigned
300
+ def format=(format)
301
+ validator = EnumAttributeValidator.new('String', ["png", "gif", "svg", "unknown_default_open_api"])
302
+ format = 'unknown_default_open_api' unless validator.valid?(format)
303
+ @format = format
304
+ end
305
+
306
+ # Custom attribute writer method with validation
307
+ # @param [Object] frames Value to be assigned
308
+ def frames=(frames)
309
+ if frames.nil?
310
+ fail ArgumentError, 'frames cannot be nil'
311
+ end
312
+
313
+ if frames > 16
314
+ fail ArgumentError, 'invalid value for "frames", must be smaller than or equal to 16.'
315
+ end
316
+
317
+ if frames < 2
318
+ fail ArgumentError, 'invalid value for "frames", must be greater than or equal to 2.'
319
+ end
320
+
321
+ @frames = frames
322
+ end
323
+
324
+ # Custom attribute writer method with validation
325
+ # @param [Object] frame_ms Value to be assigned
326
+ def frame_ms=(frame_ms)
327
+ if frame_ms.nil?
328
+ fail ArgumentError, 'frame_ms cannot be nil'
329
+ end
330
+
331
+ if frame_ms > 2000
332
+ fail ArgumentError, 'invalid value for "frame_ms", must be smaller than or equal to 2000.'
333
+ end
334
+
335
+ if frame_ms < 20
336
+ fail ArgumentError, 'invalid value for "frame_ms", must be greater than or equal to 20.'
337
+ end
338
+
339
+ @frame_ms = frame_ms
340
+ end
341
+
342
+ # Custom attribute writer method checking allowed values (enum).
343
+ # @param [Object] complexity Object to be assigned
344
+ def complexity=(complexity)
345
+ validator = EnumAttributeValidator.new('String', ["low", "medium", "high", "unknown_default_open_api"])
346
+ complexity = 'unknown_default_open_api' unless validator.valid?(complexity)
347
+ @complexity = complexity
348
+ end
349
+
350
+ # Custom attribute writer method checking allowed values (enum).
351
+ # @param [Object] background Object to be assigned
352
+ def background=(background)
353
+ validator = EnumAttributeValidator.new('String', ["transparent", "unknown_default_open_api"])
354
+ background = 'unknown_default_open_api' unless validator.valid?(background)
355
+ @background = background
356
+ end
357
+
358
+ # Checks equality by comparing each attribute.
359
+ # @param [Object] Object to be compared
360
+ def ==(o)
361
+ return true if self.equal?(o)
362
+ self.class == o.class &&
363
+ type == o.type &&
364
+ prompt == o.prompt &&
365
+ model == o.model &&
366
+ aspect_ratio == o.aspect_ratio &&
367
+ image_size == o.image_size &&
368
+ duration_seconds == o.duration_seconds &&
369
+ ref_image == o.ref_image &&
370
+ ref_images == o.ref_images &&
371
+ use_brand == o.use_brand &&
372
+ format == o.format &&
373
+ frames == o.frames &&
374
+ frame_ms == o.frame_ms &&
375
+ complexity == o.complexity &&
376
+ background == o.background
377
+ end
378
+
379
+ # @see the `==` method
380
+ # @param [Object] Object to be compared
381
+ def eql?(o)
382
+ self == o
383
+ end
384
+
385
+ # Calculates hash code according to all attributes.
386
+ # @return [Integer] Hash code
387
+ def hash
388
+ [type, prompt, model, aspect_ratio, image_size, duration_seconds, ref_image, ref_images, use_brand, format, frames, frame_ms, complexity, background].hash
389
+ end
390
+
391
+ # Builds the object from hash
392
+ # @param [Hash] attributes Model attributes in the form of hash
393
+ # @return [Object] Returns the model itself
394
+ def self.build_from_hash(attributes)
395
+ return nil unless attributes.is_a?(Hash)
396
+ attributes = attributes.transform_keys(&:to_sym)
397
+ # include attributes inherited from allOf parents (the nearest declaration wins)
398
+ map = acceptable_attribute_map
399
+ transformed_hash = {}
400
+ acceptable_openapi_types.each_pair do |key, type|
401
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
402
+ transformed_hash["#{key}"] = nil
403
+ elsif type =~ /\AArray<(.*)>/i
404
+ # check to ensure the input is an array given that the attribute
405
+ # is documented as an array but the input is not
406
+ if attributes[map[key]].is_a?(Array)
407
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
408
+ end
409
+ elsif !attributes[map[key]].nil?
410
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
411
+ end
412
+ end
413
+ new(transformed_hash)
414
+ end
415
+
416
+ # Returns the object in the form of hash
417
+ # @return [Hash] Returns the object in the form of hash
418
+ def to_hash
419
+ hash = {}
420
+ # include attributes inherited from allOf parents (the nearest declaration wins)
421
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
422
+ value = self.send(attr)
423
+ if value.nil?
424
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
425
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
426
+ end
427
+
428
+ hash[param] = _to_hash(value)
429
+ end
430
+ hash
431
+ end
432
+
433
+ end
434
+
435
+ end