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.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +53 -0
- data/lib/hermoso/api/account_api.rb +156 -0
- data/lib/hermoso/api/analytics_api.rb +400 -0
- data/lib/hermoso/api/brands_api.rb +82 -0
- data/lib/hermoso/api/campaign_profit_api.rb +103 -0
- data/lib/hermoso/api/campaign_results_api.rb +289 -0
- data/lib/hermoso/api/channels_api.rb +82 -0
- data/lib/hermoso/api/clones_api.rb +93 -0
- data/lib/hermoso/api/connect_links_api.rb +228 -0
- data/lib/hermoso/api/connect_redirects_api.rb +153 -0
- data/lib/hermoso/api/connections_api.rb +151 -0
- data/lib/hermoso/api/credits_api.rb +85 -0
- data/lib/hermoso/api/edits_api.rb +102 -0
- data/lib/hermoso/api/events_api.rb +932 -0
- data/lib/hermoso/api/generations_api.rb +173 -0
- data/lib/hermoso/api/jobs_api.rb +226 -0
- data/lib/hermoso/api/library_api.rb +88 -0
- data/lib/hermoso/api/media_api.rb +158 -0
- data/lib/hermoso/api/models_api.rb +88 -0
- data/lib/hermoso/api/posts_api.rb +377 -0
- data/lib/hermoso/api/recasts_api.rb +102 -0
- data/lib/hermoso/api/signup_api.rb +164 -0
- data/lib/hermoso/api/tag_api.rb +570 -0
- data/lib/hermoso/api/tools_api.rb +252 -0
- data/lib/hermoso/api_client.rb +441 -0
- data/lib/hermoso/api_error.rb +58 -0
- data/lib/hermoso/api_model_base.rb +92 -0
- data/lib/hermoso/configuration.rb +400 -0
- data/lib/hermoso/helpers.rb +116 -0
- data/lib/hermoso/models/asset.rb +241 -0
- data/lib/hermoso/models/asset_list.rb +203 -0
- data/lib/hermoso/models/best_time.rb +250 -0
- data/lib/hermoso/models/best_time_slots_inner.rb +205 -0
- data/lib/hermoso/models/brand.rb +273 -0
- data/lib/hermoso/models/brand_list.rb +203 -0
- data/lib/hermoso/models/campaign_profit.rb +261 -0
- data/lib/hermoso/models/campaign_results.rb +250 -0
- data/lib/hermoso/models/campaign_results_upload.rb +171 -0
- data/lib/hermoso/models/campaign_results_upload_rows_inner.rb +259 -0
- data/lib/hermoso/models/channel.rb +326 -0
- data/lib/hermoso/models/channel_carousel.rb +188 -0
- data/lib/hermoso/models/channel_list.rb +203 -0
- data/lib/hermoso/models/clone_quote.rb +243 -0
- data/lib/hermoso/models/clone_quote_request.rb +227 -0
- data/lib/hermoso/models/clone_quote_step.rb +201 -0
- data/lib/hermoso/models/connect_link.rb +321 -0
- data/lib/hermoso/models/connect_link_account.rb +178 -0
- data/lib/hermoso/models/connect_link_create.rb +236 -0
- data/lib/hermoso/models/connect_link_error.rb +169 -0
- data/lib/hermoso/models/connect_redirects.rb +203 -0
- data/lib/hermoso/models/connect_redirects_set.rb +180 -0
- data/lib/hermoso/models/connection.rb +250 -0
- data/lib/hermoso/models/connection_accounts_inner.rb +178 -0
- data/lib/hermoso/models/connection_deleted.rb +228 -0
- data/lib/hermoso/models/connection_list.rb +203 -0
- data/lib/hermoso/models/contact_email.rb +189 -0
- data/lib/hermoso/models/contact_email_resend.rb +161 -0
- data/lib/hermoso/models/content_decay.rb +223 -0
- data/lib/hermoso/models/content_decay_buckets_inner.rb +187 -0
- data/lib/hermoso/models/conversion_destination_create.rb +317 -0
- data/lib/hermoso/models/conversion_destination_list.rb +223 -0
- data/lib/hermoso/models/conversion_destination_result.rb +221 -0
- data/lib/hermoso/models/conversion_event_list.rb +230 -0
- data/lib/hermoso/models/conversion_event_update.rb +195 -0
- data/lib/hermoso/models/conversion_events_send.rb +236 -0
- data/lib/hermoso/models/conversion_events_send_events_inner.rb +314 -0
- data/lib/hermoso/models/conversion_insights.rb +265 -0
- data/lib/hermoso/models/conversion_send_result.rb +257 -0
- data/lib/hermoso/models/conversion_send_result_destinations_inner.rb +286 -0
- data/lib/hermoso/models/credits.rb +240 -0
- data/lib/hermoso/models/credits_limits.rb +234 -0
- data/lib/hermoso/models/credits_limits_brands_inner.rb +218 -0
- data/lib/hermoso/models/credits_limits_brands_inner_members_inner.rb +196 -0
- data/lib/hermoso/models/deleted.rb +210 -0
- data/lib/hermoso/models/edit.rb +278 -0
- data/lib/hermoso/models/edit_create.rb +317 -0
- data/lib/hermoso/models/edit_preview.rb +199 -0
- data/lib/hermoso/models/edit_quote.rb +231 -0
- data/lib/hermoso/models/error.rb +198 -0
- data/lib/hermoso/models/error_error.rb +335 -0
- data/lib/hermoso/models/error_error_unknown_arguments_inner.rb +171 -0
- data/lib/hermoso/models/follower_history.rb +239 -0
- data/lib/hermoso/models/follower_history_accounts_inner.rb +207 -0
- data/lib/hermoso/models/follower_history_accounts_inner_points_inner.rb +178 -0
- data/lib/hermoso/models/follower_history_date_range.rb +169 -0
- data/lib/hermoso/models/generation_create.rb +435 -0
- data/lib/hermoso/models/generation_quote.rb +263 -0
- data/lib/hermoso/models/hermoso_tag.rb +230 -0
- data/lib/hermoso/models/hermoso_tag_audience_action.rb +325 -0
- data/lib/hermoso/models/hermoso_tag_audiences.rb +241 -0
- data/lib/hermoso/models/hermoso_tag_events.rb +223 -0
- data/lib/hermoso/models/hermoso_tag_events_send.rb +179 -0
- data/lib/hermoso/models/hermoso_tag_events_sent.rb +221 -0
- data/lib/hermoso/models/hermoso_tag_install.rb +246 -0
- data/lib/hermoso/models/hermoso_tag_install_result.rb +255 -0
- data/lib/hermoso/models/hermoso_tag_report.rb +261 -0
- data/lib/hermoso/models/hermoso_tag_tag.rb +211 -0
- data/lib/hermoso/models/hermoso_tag_update.rb +356 -0
- data/lib/hermoso/models/inbox_stats.rb +315 -0
- data/lib/hermoso/models/job.rb +359 -0
- data/lib/hermoso/models/job_cancel.rb +221 -0
- data/lib/hermoso/models/job_list.rb +232 -0
- data/lib/hermoso/models/media.rb +230 -0
- data/lib/hermoso/models/model.rb +327 -0
- data/lib/hermoso/models/model_list.rb +203 -0
- data/lib/hermoso/models/post.rb +382 -0
- data/lib/hermoso/models/post_create.rb +318 -0
- data/lib/hermoso/models/post_create_media_inner.rb +104 -0
- data/lib/hermoso/models/post_create_media_inner_one_of.rb +201 -0
- data/lib/hermoso/models/post_list.rb +221 -0
- data/lib/hermoso/models/post_media_inner.rb +169 -0
- data/lib/hermoso/models/post_results_inner.rb +205 -0
- data/lib/hermoso/models/post_results_inner_first_comment.rb +188 -0
- data/lib/hermoso/models/posting_frequency.rb +241 -0
- data/lib/hermoso/models/posting_frequency_frequency_inner.rb +205 -0
- data/lib/hermoso/models/profit_settings.rb +230 -0
- data/lib/hermoso/models/recast.rb +308 -0
- data/lib/hermoso/models/recast_create.rb +274 -0
- data/lib/hermoso/models/recast_person.rb +182 -0
- data/lib/hermoso/models/recast_quote.rb +232 -0
- data/lib/hermoso/models/recast_step.rb +201 -0
- data/lib/hermoso/models/recast_subject.rb +170 -0
- data/lib/hermoso/models/recast_voice.rb +178 -0
- data/lib/hermoso/models/recast_window.rb +179 -0
- data/lib/hermoso/models/signup.rb +329 -0
- data/lib/hermoso/models/signup_claim.rb +178 -0
- data/lib/hermoso/models/signup_create.rb +247 -0
- data/lib/hermoso/models/tool.rb +360 -0
- data/lib/hermoso/models/tool_invoke.rb +169 -0
- data/lib/hermoso/models/tool_job.rb +262 -0
- data/lib/hermoso/models/tool_list.rb +273 -0
- data/lib/hermoso/models/tool_list_areas_inner.rb +219 -0
- data/lib/hermoso/models/tool_list_search.rb +181 -0
- data/lib/hermoso/models/tool_result.rb +245 -0
- data/lib/hermoso/models/tool_result_images_inner.rb +170 -0
- data/lib/hermoso/models/warning.rb +244 -0
- data/lib/hermoso/spec.rb +8 -0
- data/lib/hermoso/version.rb +15 -0
- data/lib/hermoso.rb +174 -0
- metadata +237 -0
|
@@ -0,0 +1,382 @@
|
|
|
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 Post < ApiModelBase
|
|
18
|
+
attr_accessor :object
|
|
19
|
+
|
|
20
|
+
attr_accessor :id
|
|
21
|
+
|
|
22
|
+
# scheduled | processing | published | partially_published | failed | indeterminate. THIS SET MAY GROW — tolerate an unknown value. `indeterminate` means a restart interrupted the send and we cannot say whether it published: check the channel rather than assuming either way. `failed` is only ever used when we know nothing published.
|
|
23
|
+
attr_accessor :status
|
|
24
|
+
|
|
25
|
+
attr_accessor :scheduled_at
|
|
26
|
+
|
|
27
|
+
attr_accessor :created_at
|
|
28
|
+
|
|
29
|
+
attr_accessor :channels
|
|
30
|
+
|
|
31
|
+
attr_accessor :caption
|
|
32
|
+
|
|
33
|
+
attr_accessor :title
|
|
34
|
+
|
|
35
|
+
# The headline actually going out — derived from the caption when you named none.
|
|
36
|
+
attr_accessor :title_effective
|
|
37
|
+
|
|
38
|
+
attr_accessor :link
|
|
39
|
+
|
|
40
|
+
attr_accessor :media
|
|
41
|
+
|
|
42
|
+
attr_accessor :captions_by_channel
|
|
43
|
+
|
|
44
|
+
attr_accessor :visibility
|
|
45
|
+
|
|
46
|
+
attr_accessor :visibility_by_channel
|
|
47
|
+
|
|
48
|
+
# Which account this goes to, per channel (Page, board, LinkedIn Page, Business listing). Unset means the connection’s default.
|
|
49
|
+
attr_accessor :targets
|
|
50
|
+
|
|
51
|
+
attr_accessor :options
|
|
52
|
+
|
|
53
|
+
# Per-channel outcome once fired. A partial failure is normal and is reported here — the top-level status then says `partially_published`, never a flat `failed`.
|
|
54
|
+
attr_accessor :results
|
|
55
|
+
|
|
56
|
+
attr_accessor :retry_of
|
|
57
|
+
|
|
58
|
+
# Present when the status alone would mislead. Set for `indeterminate`.
|
|
59
|
+
attr_accessor :status_detail
|
|
60
|
+
|
|
61
|
+
attr_accessor :content_lost
|
|
62
|
+
|
|
63
|
+
class EnumAttributeValidator
|
|
64
|
+
attr_reader :datatype
|
|
65
|
+
attr_reader :allowable_values
|
|
66
|
+
|
|
67
|
+
def initialize(datatype, allowable_values)
|
|
68
|
+
@allowable_values = allowable_values.map do |value|
|
|
69
|
+
case datatype.to_s
|
|
70
|
+
when /Integer/i
|
|
71
|
+
value.to_i
|
|
72
|
+
when /Float/i
|
|
73
|
+
value.to_f
|
|
74
|
+
else
|
|
75
|
+
value
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
def valid?(value)
|
|
81
|
+
!value || allowable_values.include?(value)
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
86
|
+
def self.attribute_map
|
|
87
|
+
{
|
|
88
|
+
:'object' => :'object',
|
|
89
|
+
:'id' => :'id',
|
|
90
|
+
:'status' => :'status',
|
|
91
|
+
:'scheduled_at' => :'scheduled_at',
|
|
92
|
+
:'created_at' => :'created_at',
|
|
93
|
+
:'channels' => :'channels',
|
|
94
|
+
:'caption' => :'caption',
|
|
95
|
+
:'title' => :'title',
|
|
96
|
+
:'title_effective' => :'title_effective',
|
|
97
|
+
:'link' => :'link',
|
|
98
|
+
:'media' => :'media',
|
|
99
|
+
:'captions_by_channel' => :'captions_by_channel',
|
|
100
|
+
:'visibility' => :'visibility',
|
|
101
|
+
:'visibility_by_channel' => :'visibility_by_channel',
|
|
102
|
+
:'targets' => :'targets',
|
|
103
|
+
:'options' => :'options',
|
|
104
|
+
:'results' => :'results',
|
|
105
|
+
:'retry_of' => :'retry_of',
|
|
106
|
+
:'status_detail' => :'status_detail',
|
|
107
|
+
:'content_lost' => :'content_lost'
|
|
108
|
+
}
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Returns attribute mapping this model knows about
|
|
112
|
+
def self.acceptable_attribute_map
|
|
113
|
+
attribute_map
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Returns all the JSON keys this model knows about
|
|
117
|
+
def self.acceptable_attributes
|
|
118
|
+
acceptable_attribute_map.values
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Attribute type mapping.
|
|
122
|
+
def self.openapi_types
|
|
123
|
+
{
|
|
124
|
+
:'object' => :'String',
|
|
125
|
+
:'id' => :'String',
|
|
126
|
+
:'status' => :'String',
|
|
127
|
+
:'scheduled_at' => :'Time',
|
|
128
|
+
:'created_at' => :'Time',
|
|
129
|
+
:'channels' => :'Array<String>',
|
|
130
|
+
:'caption' => :'String',
|
|
131
|
+
:'title' => :'String',
|
|
132
|
+
:'title_effective' => :'String',
|
|
133
|
+
:'link' => :'String',
|
|
134
|
+
:'media' => :'Array<PostMediaInner>',
|
|
135
|
+
:'captions_by_channel' => :'Hash<String, String>',
|
|
136
|
+
:'visibility' => :'String',
|
|
137
|
+
:'visibility_by_channel' => :'Hash<String, String>',
|
|
138
|
+
:'targets' => :'Hash<String, Object>',
|
|
139
|
+
:'options' => :'Hash<String, Object>',
|
|
140
|
+
:'results' => :'Array<PostResultsInner>',
|
|
141
|
+
:'retry_of' => :'String',
|
|
142
|
+
:'status_detail' => :'String',
|
|
143
|
+
:'content_lost' => :'Boolean'
|
|
144
|
+
}
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# List of attributes with nullable: true
|
|
148
|
+
def self.openapi_nullable
|
|
149
|
+
Set.new([
|
|
150
|
+
])
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Returns attribute type mapping
|
|
154
|
+
def self.acceptable_openapi_types
|
|
155
|
+
openapi_types
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Returns the nullable attributes
|
|
159
|
+
def self.acceptable_openapi_nullable
|
|
160
|
+
openapi_nullable
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Initializes the object
|
|
164
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
165
|
+
def initialize(attributes = {})
|
|
166
|
+
if (!attributes.is_a?(Hash))
|
|
167
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Hermoso::Post` initialize method"
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
171
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
172
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
173
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
174
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Hermoso::Post`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
175
|
+
end
|
|
176
|
+
h[k.to_sym] = v
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if attributes.key?(:'object')
|
|
180
|
+
self.object = attributes[:'object']
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
if attributes.key?(:'id')
|
|
184
|
+
self.id = attributes[:'id']
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
if attributes.key?(:'status')
|
|
188
|
+
self.status = attributes[:'status']
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
if attributes.key?(:'scheduled_at')
|
|
192
|
+
self.scheduled_at = attributes[:'scheduled_at']
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
if attributes.key?(:'created_at')
|
|
196
|
+
self.created_at = attributes[:'created_at']
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
if attributes.key?(:'channels')
|
|
200
|
+
if (value = attributes[:'channels']).is_a?(Array)
|
|
201
|
+
self.channels = value
|
|
202
|
+
end
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
if attributes.key?(:'caption')
|
|
206
|
+
self.caption = attributes[:'caption']
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
if attributes.key?(:'title')
|
|
210
|
+
self.title = attributes[:'title']
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
if attributes.key?(:'title_effective')
|
|
214
|
+
self.title_effective = attributes[:'title_effective']
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
if attributes.key?(:'link')
|
|
218
|
+
self.link = attributes[:'link']
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
if attributes.key?(:'media')
|
|
222
|
+
if (value = attributes[:'media']).is_a?(Array)
|
|
223
|
+
self.media = value
|
|
224
|
+
end
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
if attributes.key?(:'captions_by_channel')
|
|
228
|
+
if (value = attributes[:'captions_by_channel']).is_a?(Hash)
|
|
229
|
+
self.captions_by_channel = value
|
|
230
|
+
end
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
if attributes.key?(:'visibility')
|
|
234
|
+
self.visibility = attributes[:'visibility']
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
if attributes.key?(:'visibility_by_channel')
|
|
238
|
+
if (value = attributes[:'visibility_by_channel']).is_a?(Hash)
|
|
239
|
+
self.visibility_by_channel = value
|
|
240
|
+
end
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
if attributes.key?(:'targets')
|
|
244
|
+
if (value = attributes[:'targets']).is_a?(Hash)
|
|
245
|
+
self.targets = value
|
|
246
|
+
end
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
if attributes.key?(:'options')
|
|
250
|
+
if (value = attributes[:'options']).is_a?(Hash)
|
|
251
|
+
self.options = value
|
|
252
|
+
end
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
if attributes.key?(:'results')
|
|
256
|
+
if (value = attributes[:'results']).is_a?(Array)
|
|
257
|
+
self.results = value
|
|
258
|
+
end
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
if attributes.key?(:'retry_of')
|
|
262
|
+
self.retry_of = attributes[:'retry_of']
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
if attributes.key?(:'status_detail')
|
|
266
|
+
self.status_detail = attributes[:'status_detail']
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
if attributes.key?(:'content_lost')
|
|
270
|
+
self.content_lost = attributes[:'content_lost']
|
|
271
|
+
end
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
275
|
+
# @return Array for valid properties with the reasons
|
|
276
|
+
def list_invalid_properties
|
|
277
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
278
|
+
invalid_properties = Array.new
|
|
279
|
+
invalid_properties
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
# Check to see if the all the properties in the model are valid
|
|
283
|
+
# @return true if the model is valid
|
|
284
|
+
def valid?
|
|
285
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
286
|
+
object_validator = EnumAttributeValidator.new('String', ["post", "unknown_default_open_api"])
|
|
287
|
+
return false unless object_validator.valid?(@object)
|
|
288
|
+
true
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
292
|
+
# @param [Object] object Object to be assigned
|
|
293
|
+
def object=(object)
|
|
294
|
+
validator = EnumAttributeValidator.new('String', ["post", "unknown_default_open_api"])
|
|
295
|
+
object = 'unknown_default_open_api' unless validator.valid?(object)
|
|
296
|
+
@object = object
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
# Checks equality by comparing each attribute.
|
|
300
|
+
# @param [Object] Object to be compared
|
|
301
|
+
def ==(o)
|
|
302
|
+
return true if self.equal?(o)
|
|
303
|
+
self.class == o.class &&
|
|
304
|
+
object == o.object &&
|
|
305
|
+
id == o.id &&
|
|
306
|
+
status == o.status &&
|
|
307
|
+
scheduled_at == o.scheduled_at &&
|
|
308
|
+
created_at == o.created_at &&
|
|
309
|
+
channels == o.channels &&
|
|
310
|
+
caption == o.caption &&
|
|
311
|
+
title == o.title &&
|
|
312
|
+
title_effective == o.title_effective &&
|
|
313
|
+
link == o.link &&
|
|
314
|
+
media == o.media &&
|
|
315
|
+
captions_by_channel == o.captions_by_channel &&
|
|
316
|
+
visibility == o.visibility &&
|
|
317
|
+
visibility_by_channel == o.visibility_by_channel &&
|
|
318
|
+
targets == o.targets &&
|
|
319
|
+
options == o.options &&
|
|
320
|
+
results == o.results &&
|
|
321
|
+
retry_of == o.retry_of &&
|
|
322
|
+
status_detail == o.status_detail &&
|
|
323
|
+
content_lost == o.content_lost
|
|
324
|
+
end
|
|
325
|
+
|
|
326
|
+
# @see the `==` method
|
|
327
|
+
# @param [Object] Object to be compared
|
|
328
|
+
def eql?(o)
|
|
329
|
+
self == o
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
# Calculates hash code according to all attributes.
|
|
333
|
+
# @return [Integer] Hash code
|
|
334
|
+
def hash
|
|
335
|
+
[object, id, status, scheduled_at, created_at, channels, caption, title, title_effective, link, media, captions_by_channel, visibility, visibility_by_channel, targets, options, results, retry_of, status_detail, content_lost].hash
|
|
336
|
+
end
|
|
337
|
+
|
|
338
|
+
# Builds the object from hash
|
|
339
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
340
|
+
# @return [Object] Returns the model itself
|
|
341
|
+
def self.build_from_hash(attributes)
|
|
342
|
+
return nil unless attributes.is_a?(Hash)
|
|
343
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
344
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
345
|
+
map = acceptable_attribute_map
|
|
346
|
+
transformed_hash = {}
|
|
347
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
348
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
349
|
+
transformed_hash["#{key}"] = nil
|
|
350
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
351
|
+
# check to ensure the input is an array given that the attribute
|
|
352
|
+
# is documented as an array but the input is not
|
|
353
|
+
if attributes[map[key]].is_a?(Array)
|
|
354
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
355
|
+
end
|
|
356
|
+
elsif !attributes[map[key]].nil?
|
|
357
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
358
|
+
end
|
|
359
|
+
end
|
|
360
|
+
new(transformed_hash)
|
|
361
|
+
end
|
|
362
|
+
|
|
363
|
+
# Returns the object in the form of hash
|
|
364
|
+
# @return [Hash] Returns the object in the form of hash
|
|
365
|
+
def to_hash
|
|
366
|
+
hash = {}
|
|
367
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
368
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
369
|
+
value = self.send(attr)
|
|
370
|
+
if value.nil?
|
|
371
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
372
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
373
|
+
end
|
|
374
|
+
|
|
375
|
+
hash[param] = _to_hash(value)
|
|
376
|
+
end
|
|
377
|
+
hash
|
|
378
|
+
end
|
|
379
|
+
|
|
380
|
+
end
|
|
381
|
+
|
|
382
|
+
end
|
|
@@ -0,0 +1,318 @@
|
|
|
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 PostCreate < ApiModelBase
|
|
18
|
+
# One or more channel ids from GET /v1/channels. DELIBERATELY NOT AN ENUM — the set is derived from what the product can publish to, and it GROWS as platform approvals land. Read it from GET /v1/channels rather than hard-coding it, and treat an id you have not seen as valid.
|
|
19
|
+
attr_accessor :channels
|
|
20
|
+
|
|
21
|
+
# The post text. Per-channel length limits are enforced at create time, not discovered at publish time.
|
|
22
|
+
attr_accessor :caption
|
|
23
|
+
|
|
24
|
+
# The headline Pinterest and YouTube each require. Derived from the caption when omitted.
|
|
25
|
+
attr_accessor :title
|
|
26
|
+
|
|
27
|
+
attr_accessor :link
|
|
28
|
+
|
|
29
|
+
# Ordered. One item is a single post; two or more are a carousel, in the order given. Each item is a Hermoso-hosted URL from POST /v1/media, as a bare string or as {url, type}.
|
|
30
|
+
attr_accessor :media
|
|
31
|
+
|
|
32
|
+
# Omit to publish immediately. Otherwise ISO-8601, at least 60 seconds out and within the documented horizon.
|
|
33
|
+
attr_accessor :scheduled_at
|
|
34
|
+
|
|
35
|
+
# Take the next free slot in this profile’s posting schedule instead of naming a time. Mutually exclusive with scheduled_at — sending both is an error, never a silent precedence.
|
|
36
|
+
attr_accessor :use_queue
|
|
37
|
+
|
|
38
|
+
# IANA zone for use_queue. Defaults to the profile’s saved zone.
|
|
39
|
+
attr_accessor :timezone
|
|
40
|
+
|
|
41
|
+
# public (default) | unlisted | private | draft. Refused at create time where a channel cannot honour it, never silently downgraded at publish time.
|
|
42
|
+
attr_accessor :visibility
|
|
43
|
+
|
|
44
|
+
attr_accessor :visibility_by_channel
|
|
45
|
+
|
|
46
|
+
# Override the caption for one channel.
|
|
47
|
+
attr_accessor :captions_by_channel
|
|
48
|
+
|
|
49
|
+
# Which account to post to, where the connection holds more than one. Omit for the default. GET /v1/channels names the field each channel uses.
|
|
50
|
+
attr_accessor :targets
|
|
51
|
+
|
|
52
|
+
# Per-channel publish metadata (YouTube description, tags, categoryId, madeForKids, notifySubscribers, paidProductPlacement, brandPartner and a captionTrack {url|text, language, name} uploaded right after the video; X thread parts, Instagram alt text, and so on).
|
|
53
|
+
attr_accessor :options
|
|
54
|
+
|
|
55
|
+
# A comment the account posts on its own post right after it publishes: Facebook Pages, Instagram, and LinkedIn company Pages (LinkedIn needs its comments authorization, provider linkedin_community). Up to 2,000 characters, refused (never cut) when longer. Other channels publish the post without it and say so on their result. A comment that fails never undoes the post; its outcome is reported on the channel’s result.
|
|
56
|
+
attr_accessor :first_comment
|
|
57
|
+
|
|
58
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
59
|
+
def self.attribute_map
|
|
60
|
+
{
|
|
61
|
+
:'channels' => :'channels',
|
|
62
|
+
:'caption' => :'caption',
|
|
63
|
+
:'title' => :'title',
|
|
64
|
+
:'link' => :'link',
|
|
65
|
+
:'media' => :'media',
|
|
66
|
+
:'scheduled_at' => :'scheduled_at',
|
|
67
|
+
:'use_queue' => :'use_queue',
|
|
68
|
+
:'timezone' => :'timezone',
|
|
69
|
+
:'visibility' => :'visibility',
|
|
70
|
+
:'visibility_by_channel' => :'visibility_by_channel',
|
|
71
|
+
:'captions_by_channel' => :'captions_by_channel',
|
|
72
|
+
:'targets' => :'targets',
|
|
73
|
+
:'options' => :'options',
|
|
74
|
+
:'first_comment' => :'first_comment'
|
|
75
|
+
}
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Returns attribute mapping this model knows about
|
|
79
|
+
def self.acceptable_attribute_map
|
|
80
|
+
attribute_map
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Returns all the JSON keys this model knows about
|
|
84
|
+
def self.acceptable_attributes
|
|
85
|
+
acceptable_attribute_map.values
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Attribute type mapping.
|
|
89
|
+
def self.openapi_types
|
|
90
|
+
{
|
|
91
|
+
:'channels' => :'Array<String>',
|
|
92
|
+
:'caption' => :'String',
|
|
93
|
+
:'title' => :'String',
|
|
94
|
+
:'link' => :'String',
|
|
95
|
+
:'media' => :'Array<PostCreateMediaInner>',
|
|
96
|
+
:'scheduled_at' => :'Time',
|
|
97
|
+
:'use_queue' => :'Boolean',
|
|
98
|
+
:'timezone' => :'String',
|
|
99
|
+
:'visibility' => :'String',
|
|
100
|
+
:'visibility_by_channel' => :'Hash<String, String>',
|
|
101
|
+
:'captions_by_channel' => :'Hash<String, String>',
|
|
102
|
+
:'targets' => :'Hash<String, Object>',
|
|
103
|
+
:'options' => :'Hash<String, Object>',
|
|
104
|
+
:'first_comment' => :'String'
|
|
105
|
+
}
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# List of attributes with nullable: true
|
|
109
|
+
def self.openapi_nullable
|
|
110
|
+
Set.new([
|
|
111
|
+
])
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# Returns attribute type mapping
|
|
115
|
+
def self.acceptable_openapi_types
|
|
116
|
+
openapi_types
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Returns the nullable attributes
|
|
120
|
+
def self.acceptable_openapi_nullable
|
|
121
|
+
openapi_nullable
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Initializes the object
|
|
125
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
126
|
+
def initialize(attributes = {})
|
|
127
|
+
if (!attributes.is_a?(Hash))
|
|
128
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Hermoso::PostCreate` initialize method"
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
132
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
133
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
134
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
135
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Hermoso::PostCreate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
136
|
+
end
|
|
137
|
+
h[k.to_sym] = v
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if attributes.key?(:'channels')
|
|
141
|
+
if (value = attributes[:'channels']).is_a?(Array)
|
|
142
|
+
self.channels = value
|
|
143
|
+
end
|
|
144
|
+
else
|
|
145
|
+
self.channels = nil
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
if attributes.key?(:'caption')
|
|
149
|
+
self.caption = attributes[:'caption']
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
if attributes.key?(:'title')
|
|
153
|
+
self.title = attributes[:'title']
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if attributes.key?(:'link')
|
|
157
|
+
self.link = attributes[:'link']
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
if attributes.key?(:'media')
|
|
161
|
+
if (value = attributes[:'media']).is_a?(Array)
|
|
162
|
+
self.media = value
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
if attributes.key?(:'scheduled_at')
|
|
167
|
+
self.scheduled_at = attributes[:'scheduled_at']
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
if attributes.key?(:'use_queue')
|
|
171
|
+
self.use_queue = attributes[:'use_queue']
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
if attributes.key?(:'timezone')
|
|
175
|
+
self.timezone = attributes[:'timezone']
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
if attributes.key?(:'visibility')
|
|
179
|
+
self.visibility = attributes[:'visibility']
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
if attributes.key?(:'visibility_by_channel')
|
|
183
|
+
if (value = attributes[:'visibility_by_channel']).is_a?(Hash)
|
|
184
|
+
self.visibility_by_channel = value
|
|
185
|
+
end
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
if attributes.key?(:'captions_by_channel')
|
|
189
|
+
if (value = attributes[:'captions_by_channel']).is_a?(Hash)
|
|
190
|
+
self.captions_by_channel = value
|
|
191
|
+
end
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
if attributes.key?(:'targets')
|
|
195
|
+
if (value = attributes[:'targets']).is_a?(Hash)
|
|
196
|
+
self.targets = value
|
|
197
|
+
end
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
if attributes.key?(:'options')
|
|
201
|
+
if (value = attributes[:'options']).is_a?(Hash)
|
|
202
|
+
self.options = value
|
|
203
|
+
end
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
if attributes.key?(:'first_comment')
|
|
207
|
+
self.first_comment = attributes[:'first_comment']
|
|
208
|
+
end
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
212
|
+
# @return Array for valid properties with the reasons
|
|
213
|
+
def list_invalid_properties
|
|
214
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
215
|
+
invalid_properties = Array.new
|
|
216
|
+
if @channels.nil?
|
|
217
|
+
invalid_properties.push('invalid value for "channels", channels cannot be nil.')
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
invalid_properties
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
# Check to see if the all the properties in the model are valid
|
|
224
|
+
# @return true if the model is valid
|
|
225
|
+
def valid?
|
|
226
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
227
|
+
return false if @channels.nil?
|
|
228
|
+
true
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
# Custom attribute writer method with validation
|
|
232
|
+
# @param [Object] channels Value to be assigned
|
|
233
|
+
def channels=(channels)
|
|
234
|
+
if channels.nil?
|
|
235
|
+
fail ArgumentError, 'channels cannot be nil'
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
@channels = channels
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
# Checks equality by comparing each attribute.
|
|
242
|
+
# @param [Object] Object to be compared
|
|
243
|
+
def ==(o)
|
|
244
|
+
return true if self.equal?(o)
|
|
245
|
+
self.class == o.class &&
|
|
246
|
+
channels == o.channels &&
|
|
247
|
+
caption == o.caption &&
|
|
248
|
+
title == o.title &&
|
|
249
|
+
link == o.link &&
|
|
250
|
+
media == o.media &&
|
|
251
|
+
scheduled_at == o.scheduled_at &&
|
|
252
|
+
use_queue == o.use_queue &&
|
|
253
|
+
timezone == o.timezone &&
|
|
254
|
+
visibility == o.visibility &&
|
|
255
|
+
visibility_by_channel == o.visibility_by_channel &&
|
|
256
|
+
captions_by_channel == o.captions_by_channel &&
|
|
257
|
+
targets == o.targets &&
|
|
258
|
+
options == o.options &&
|
|
259
|
+
first_comment == o.first_comment
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
# @see the `==` method
|
|
263
|
+
# @param [Object] Object to be compared
|
|
264
|
+
def eql?(o)
|
|
265
|
+
self == o
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
# Calculates hash code according to all attributes.
|
|
269
|
+
# @return [Integer] Hash code
|
|
270
|
+
def hash
|
|
271
|
+
[channels, caption, title, link, media, scheduled_at, use_queue, timezone, visibility, visibility_by_channel, captions_by_channel, targets, options, first_comment].hash
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
# Builds the object from hash
|
|
275
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
276
|
+
# @return [Object] Returns the model itself
|
|
277
|
+
def self.build_from_hash(attributes)
|
|
278
|
+
return nil unless attributes.is_a?(Hash)
|
|
279
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
280
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
281
|
+
map = acceptable_attribute_map
|
|
282
|
+
transformed_hash = {}
|
|
283
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
284
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
285
|
+
transformed_hash["#{key}"] = nil
|
|
286
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
287
|
+
# check to ensure the input is an array given that the attribute
|
|
288
|
+
# is documented as an array but the input is not
|
|
289
|
+
if attributes[map[key]].is_a?(Array)
|
|
290
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
291
|
+
end
|
|
292
|
+
elsif !attributes[map[key]].nil?
|
|
293
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
294
|
+
end
|
|
295
|
+
end
|
|
296
|
+
new(transformed_hash)
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
# Returns the object in the form of hash
|
|
300
|
+
# @return [Hash] Returns the object in the form of hash
|
|
301
|
+
def to_hash
|
|
302
|
+
hash = {}
|
|
303
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
304
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
305
|
+
value = self.send(attr)
|
|
306
|
+
if value.nil?
|
|
307
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
308
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
hash[param] = _to_hash(value)
|
|
312
|
+
end
|
|
313
|
+
hash
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
end
|