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,325 @@
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 HermosoTagAudienceAction < ApiModelBase
18
+ attr_accessor :action
19
+
20
+ attr_accessor :segment_id
21
+
22
+ attr_accessor :name
23
+
24
+ attr_accessor :visited
25
+
26
+ attr_accessor :events
27
+
28
+ attr_accessor :not_events
29
+
30
+ attr_accessor :within_days
31
+
32
+ attr_accessor :platform
33
+
34
+ attr_accessor :audience_id
35
+
36
+ attr_accessor :audience_name
37
+
38
+ attr_accessor :ad_account_id
39
+
40
+ attr_accessor :customer_id
41
+
42
+ attr_accessor :accept_terms
43
+
44
+ attr_accessor :confirm
45
+
46
+ class EnumAttributeValidator
47
+ attr_reader :datatype
48
+ attr_reader :allowable_values
49
+
50
+ def initialize(datatype, allowable_values)
51
+ @allowable_values = allowable_values.map do |value|
52
+ case datatype.to_s
53
+ when /Integer/i
54
+ value.to_i
55
+ when /Float/i
56
+ value.to_f
57
+ else
58
+ value
59
+ end
60
+ end
61
+ end
62
+
63
+ def valid?(value)
64
+ !value || allowable_values.include?(value)
65
+ end
66
+ end
67
+
68
+ # Attribute mapping from ruby-style variable name to JSON key.
69
+ def self.attribute_map
70
+ {
71
+ :'action' => :'action',
72
+ :'segment_id' => :'segment_id',
73
+ :'name' => :'name',
74
+ :'visited' => :'visited',
75
+ :'events' => :'events',
76
+ :'not_events' => :'not_events',
77
+ :'within_days' => :'within_days',
78
+ :'platform' => :'platform',
79
+ :'audience_id' => :'audience_id',
80
+ :'audience_name' => :'audience_name',
81
+ :'ad_account_id' => :'ad_account_id',
82
+ :'customer_id' => :'customer_id',
83
+ :'accept_terms' => :'accept_terms',
84
+ :'confirm' => :'confirm'
85
+ }
86
+ end
87
+
88
+ # Returns attribute mapping this model knows about
89
+ def self.acceptable_attribute_map
90
+ attribute_map
91
+ end
92
+
93
+ # Returns all the JSON keys this model knows about
94
+ def self.acceptable_attributes
95
+ acceptable_attribute_map.values
96
+ end
97
+
98
+ # Attribute type mapping.
99
+ def self.openapi_types
100
+ {
101
+ :'action' => :'String',
102
+ :'segment_id' => :'String',
103
+ :'name' => :'String',
104
+ :'visited' => :'Array<String>',
105
+ :'events' => :'Array<String>',
106
+ :'not_events' => :'Array<String>',
107
+ :'within_days' => :'Integer',
108
+ :'platform' => :'String',
109
+ :'audience_id' => :'String',
110
+ :'audience_name' => :'String',
111
+ :'ad_account_id' => :'String',
112
+ :'customer_id' => :'String',
113
+ :'accept_terms' => :'Boolean',
114
+ :'confirm' => :'Boolean'
115
+ }
116
+ end
117
+
118
+ # List of attributes with nullable: true
119
+ def self.openapi_nullable
120
+ Set.new([
121
+ ])
122
+ end
123
+
124
+ # Returns attribute type mapping
125
+ def self.acceptable_openapi_types
126
+ openapi_types
127
+ end
128
+
129
+ # Returns the nullable attributes
130
+ def self.acceptable_openapi_nullable
131
+ openapi_nullable
132
+ end
133
+
134
+ # Initializes the object
135
+ # @param [Hash] attributes Model attributes in the form of hash
136
+ def initialize(attributes = {})
137
+ if (!attributes.is_a?(Hash))
138
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Hermoso::HermosoTagAudienceAction` initialize method"
139
+ end
140
+
141
+ # check to see if the attribute exists and convert string to symbol for hash key
142
+ acceptable_attribute_map = self.class.acceptable_attribute_map
143
+ attributes = attributes.each_with_object({}) { |(k, v), h|
144
+ if (!acceptable_attribute_map.key?(k.to_sym))
145
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Hermoso::HermosoTagAudienceAction`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
146
+ end
147
+ h[k.to_sym] = v
148
+ }
149
+
150
+ if attributes.key?(:'action')
151
+ self.action = attributes[:'action']
152
+ end
153
+
154
+ if attributes.key?(:'segment_id')
155
+ self.segment_id = attributes[:'segment_id']
156
+ end
157
+
158
+ if attributes.key?(:'name')
159
+ self.name = attributes[:'name']
160
+ end
161
+
162
+ if attributes.key?(:'visited')
163
+ if (value = attributes[:'visited']).is_a?(Array)
164
+ self.visited = value
165
+ end
166
+ end
167
+
168
+ if attributes.key?(:'events')
169
+ if (value = attributes[:'events']).is_a?(Array)
170
+ self.events = value
171
+ end
172
+ end
173
+
174
+ if attributes.key?(:'not_events')
175
+ if (value = attributes[:'not_events']).is_a?(Array)
176
+ self.not_events = value
177
+ end
178
+ end
179
+
180
+ if attributes.key?(:'within_days')
181
+ self.within_days = attributes[:'within_days']
182
+ end
183
+
184
+ if attributes.key?(:'platform')
185
+ self.platform = attributes[:'platform']
186
+ end
187
+
188
+ if attributes.key?(:'audience_id')
189
+ self.audience_id = attributes[:'audience_id']
190
+ end
191
+
192
+ if attributes.key?(:'audience_name')
193
+ self.audience_name = attributes[:'audience_name']
194
+ end
195
+
196
+ if attributes.key?(:'ad_account_id')
197
+ self.ad_account_id = attributes[:'ad_account_id']
198
+ end
199
+
200
+ if attributes.key?(:'customer_id')
201
+ self.customer_id = attributes[:'customer_id']
202
+ end
203
+
204
+ if attributes.key?(:'accept_terms')
205
+ self.accept_terms = attributes[:'accept_terms']
206
+ end
207
+
208
+ if attributes.key?(:'confirm')
209
+ self.confirm = attributes[:'confirm']
210
+ end
211
+ end
212
+
213
+ # Show invalid properties with the reasons. Usually used together with valid?
214
+ # @return Array for valid properties with the reasons
215
+ def list_invalid_properties
216
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
217
+ invalid_properties = Array.new
218
+ invalid_properties
219
+ end
220
+
221
+ # Check to see if the all the properties in the model are valid
222
+ # @return true if the model is valid
223
+ def valid?
224
+ warn '[DEPRECATED] the `valid?` method is obsolete'
225
+ action_validator = EnumAttributeValidator.new('String', ["preview", "save", "delete", "sync", "unknown_default_open_api"])
226
+ return false unless action_validator.valid?(@action)
227
+ platform_validator = EnumAttributeValidator.new('String', ["meta", "google_ads", "snapchat_ads", "pinterest_ads", "x_ads", "unknown_default_open_api"])
228
+ return false unless platform_validator.valid?(@platform)
229
+ true
230
+ end
231
+
232
+ # Custom attribute writer method checking allowed values (enum).
233
+ # @param [Object] action Object to be assigned
234
+ def action=(action)
235
+ validator = EnumAttributeValidator.new('String', ["preview", "save", "delete", "sync", "unknown_default_open_api"])
236
+ action = 'unknown_default_open_api' unless validator.valid?(action)
237
+ @action = action
238
+ end
239
+
240
+ # Custom attribute writer method checking allowed values (enum).
241
+ # @param [Object] platform Object to be assigned
242
+ def platform=(platform)
243
+ validator = EnumAttributeValidator.new('String', ["meta", "google_ads", "snapchat_ads", "pinterest_ads", "x_ads", "unknown_default_open_api"])
244
+ platform = 'unknown_default_open_api' unless validator.valid?(platform)
245
+ @platform = platform
246
+ end
247
+
248
+ # Checks equality by comparing each attribute.
249
+ # @param [Object] Object to be compared
250
+ def ==(o)
251
+ return true if self.equal?(o)
252
+ self.class == o.class &&
253
+ action == o.action &&
254
+ segment_id == o.segment_id &&
255
+ name == o.name &&
256
+ visited == o.visited &&
257
+ events == o.events &&
258
+ not_events == o.not_events &&
259
+ within_days == o.within_days &&
260
+ platform == o.platform &&
261
+ audience_id == o.audience_id &&
262
+ audience_name == o.audience_name &&
263
+ ad_account_id == o.ad_account_id &&
264
+ customer_id == o.customer_id &&
265
+ accept_terms == o.accept_terms &&
266
+ confirm == o.confirm
267
+ end
268
+
269
+ # @see the `==` method
270
+ # @param [Object] Object to be compared
271
+ def eql?(o)
272
+ self == o
273
+ end
274
+
275
+ # Calculates hash code according to all attributes.
276
+ # @return [Integer] Hash code
277
+ def hash
278
+ [action, segment_id, name, visited, events, not_events, within_days, platform, audience_id, audience_name, ad_account_id, customer_id, accept_terms, confirm].hash
279
+ end
280
+
281
+ # Builds the object from hash
282
+ # @param [Hash] attributes Model attributes in the form of hash
283
+ # @return [Object] Returns the model itself
284
+ def self.build_from_hash(attributes)
285
+ return nil unless attributes.is_a?(Hash)
286
+ attributes = attributes.transform_keys(&:to_sym)
287
+ # include attributes inherited from allOf parents (the nearest declaration wins)
288
+ map = acceptable_attribute_map
289
+ transformed_hash = {}
290
+ acceptable_openapi_types.each_pair do |key, type|
291
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
292
+ transformed_hash["#{key}"] = nil
293
+ elsif type =~ /\AArray<(.*)>/i
294
+ # check to ensure the input is an array given that the attribute
295
+ # is documented as an array but the input is not
296
+ if attributes[map[key]].is_a?(Array)
297
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
298
+ end
299
+ elsif !attributes[map[key]].nil?
300
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
301
+ end
302
+ end
303
+ new(transformed_hash)
304
+ end
305
+
306
+ # Returns the object in the form of hash
307
+ # @return [Hash] Returns the object in the form of hash
308
+ def to_hash
309
+ hash = {}
310
+ # include attributes inherited from allOf parents (the nearest declaration wins)
311
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
312
+ value = self.send(attr)
313
+ if value.nil?
314
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
315
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
316
+ end
317
+
318
+ hash[param] = _to_hash(value)
319
+ end
320
+ hash
321
+ end
322
+
323
+ end
324
+
325
+ end
@@ -0,0 +1,241 @@
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 HermosoTagAudiences < ApiModelBase
18
+ attr_accessor :object
19
+
20
+ attr_accessor :segments
21
+
22
+ attr_accessor :segment
23
+
24
+ attr_accessor :sent
25
+
26
+ attr_accessor :needs_confirm
27
+
28
+ attr_accessor :note
29
+
30
+ class EnumAttributeValidator
31
+ attr_reader :datatype
32
+ attr_reader :allowable_values
33
+
34
+ def initialize(datatype, allowable_values)
35
+ @allowable_values = allowable_values.map do |value|
36
+ case datatype.to_s
37
+ when /Integer/i
38
+ value.to_i
39
+ when /Float/i
40
+ value.to_f
41
+ else
42
+ value
43
+ end
44
+ end
45
+ end
46
+
47
+ def valid?(value)
48
+ !value || allowable_values.include?(value)
49
+ end
50
+ end
51
+
52
+ # Attribute mapping from ruby-style variable name to JSON key.
53
+ def self.attribute_map
54
+ {
55
+ :'object' => :'object',
56
+ :'segments' => :'segments',
57
+ :'segment' => :'segment',
58
+ :'sent' => :'sent',
59
+ :'needs_confirm' => :'needs_confirm',
60
+ :'note' => :'note'
61
+ }
62
+ end
63
+
64
+ # Returns attribute mapping this model knows about
65
+ def self.acceptable_attribute_map
66
+ attribute_map
67
+ end
68
+
69
+ # Returns all the JSON keys this model knows about
70
+ def self.acceptable_attributes
71
+ acceptable_attribute_map.values
72
+ end
73
+
74
+ # Attribute type mapping.
75
+ def self.openapi_types
76
+ {
77
+ :'object' => :'String',
78
+ :'segments' => :'Array<Hash<String, Object>>',
79
+ :'segment' => :'Hash<String, Object>',
80
+ :'sent' => :'Integer',
81
+ :'needs_confirm' => :'Boolean',
82
+ :'note' => :'String'
83
+ }
84
+ end
85
+
86
+ # List of attributes with nullable: true
87
+ def self.openapi_nullable
88
+ Set.new([
89
+ ])
90
+ end
91
+
92
+ # Returns attribute type mapping
93
+ def self.acceptable_openapi_types
94
+ openapi_types
95
+ end
96
+
97
+ # Returns the nullable attributes
98
+ def self.acceptable_openapi_nullable
99
+ openapi_nullable
100
+ end
101
+
102
+ # Initializes the object
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ def initialize(attributes = {})
105
+ if (!attributes.is_a?(Hash))
106
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Hermoso::HermosoTagAudiences` initialize method"
107
+ end
108
+
109
+ # check to see if the attribute exists and convert string to symbol for hash key
110
+ acceptable_attribute_map = self.class.acceptable_attribute_map
111
+ attributes = attributes.each_with_object({}) { |(k, v), h|
112
+ if (!acceptable_attribute_map.key?(k.to_sym))
113
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Hermoso::HermosoTagAudiences`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
114
+ end
115
+ h[k.to_sym] = v
116
+ }
117
+
118
+ if attributes.key?(:'object')
119
+ self.object = attributes[:'object']
120
+ end
121
+
122
+ if attributes.key?(:'segments')
123
+ if (value = attributes[:'segments']).is_a?(Array)
124
+ self.segments = value
125
+ end
126
+ end
127
+
128
+ if attributes.key?(:'segment')
129
+ if (value = attributes[:'segment']).is_a?(Hash)
130
+ self.segment = value
131
+ end
132
+ end
133
+
134
+ if attributes.key?(:'sent')
135
+ self.sent = attributes[:'sent']
136
+ end
137
+
138
+ if attributes.key?(:'needs_confirm')
139
+ self.needs_confirm = attributes[:'needs_confirm']
140
+ end
141
+
142
+ if attributes.key?(:'note')
143
+ self.note = attributes[:'note']
144
+ end
145
+ end
146
+
147
+ # Show invalid properties with the reasons. Usually used together with valid?
148
+ # @return Array for valid properties with the reasons
149
+ def list_invalid_properties
150
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
151
+ invalid_properties = Array.new
152
+ invalid_properties
153
+ end
154
+
155
+ # Check to see if the all the properties in the model are valid
156
+ # @return true if the model is valid
157
+ def valid?
158
+ warn '[DEPRECATED] the `valid?` method is obsolete'
159
+ object_validator = EnumAttributeValidator.new('String', ["hermoso_tag_audiences", "unknown_default_open_api"])
160
+ return false unless object_validator.valid?(@object)
161
+ true
162
+ end
163
+
164
+ # Custom attribute writer method checking allowed values (enum).
165
+ # @param [Object] object Object to be assigned
166
+ def object=(object)
167
+ validator = EnumAttributeValidator.new('String', ["hermoso_tag_audiences", "unknown_default_open_api"])
168
+ object = 'unknown_default_open_api' unless validator.valid?(object)
169
+ @object = object
170
+ end
171
+
172
+ # Checks equality by comparing each attribute.
173
+ # @param [Object] Object to be compared
174
+ def ==(o)
175
+ return true if self.equal?(o)
176
+ self.class == o.class &&
177
+ object == o.object &&
178
+ segments == o.segments &&
179
+ segment == o.segment &&
180
+ sent == o.sent &&
181
+ needs_confirm == o.needs_confirm &&
182
+ note == o.note
183
+ end
184
+
185
+ # @see the `==` method
186
+ # @param [Object] Object to be compared
187
+ def eql?(o)
188
+ self == o
189
+ end
190
+
191
+ # Calculates hash code according to all attributes.
192
+ # @return [Integer] Hash code
193
+ def hash
194
+ [object, segments, segment, sent, needs_confirm, note].hash
195
+ end
196
+
197
+ # Builds the object from hash
198
+ # @param [Hash] attributes Model attributes in the form of hash
199
+ # @return [Object] Returns the model itself
200
+ def self.build_from_hash(attributes)
201
+ return nil unless attributes.is_a?(Hash)
202
+ attributes = attributes.transform_keys(&:to_sym)
203
+ # include attributes inherited from allOf parents (the nearest declaration wins)
204
+ map = acceptable_attribute_map
205
+ transformed_hash = {}
206
+ acceptable_openapi_types.each_pair do |key, type|
207
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
208
+ transformed_hash["#{key}"] = nil
209
+ elsif type =~ /\AArray<(.*)>/i
210
+ # check to ensure the input is an array given that the attribute
211
+ # is documented as an array but the input is not
212
+ if attributes[map[key]].is_a?(Array)
213
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
214
+ end
215
+ elsif !attributes[map[key]].nil?
216
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
217
+ end
218
+ end
219
+ new(transformed_hash)
220
+ end
221
+
222
+ # Returns the object in the form of hash
223
+ # @return [Hash] Returns the object in the form of hash
224
+ def to_hash
225
+ hash = {}
226
+ # include attributes inherited from allOf parents (the nearest declaration wins)
227
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
228
+ value = self.send(attr)
229
+ if value.nil?
230
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
231
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
232
+ end
233
+
234
+ hash[param] = _to_hash(value)
235
+ end
236
+ hash
237
+ end
238
+
239
+ end
240
+
241
+ end