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