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,228 @@
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 'cgi'
14
+
15
+ module Hermoso
16
+ class ConnectLinksApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create a connect link for your customer
23
+ # A short-lived hosted link that lets someone with NO Hermoso login connect their own account (Facebook and Instagram, Instagram, TikTok, YouTube, LinkedIn, X, Pinterest, Threads, Google Business Profile and the ad platforms) to the brand named by `X-Hermoso-User`. Hand `url` to your customer. They see a short page from Hermoso, accept Hermoso’s Terms and Privacy Policy, sign in on the platform’s own consent screen, and land on your `redirect_url` with `connect_status` (success | cancelled | error), `provider`, `brand`, `link_id`, `account`, `error_code` and your `state` added to its query string (a same-named parameter of yours is overwritten). THE PLATFORM’S CONSENT SCREEN SHOWS HERMOSO’S NAME, because the connection is made with Hermoso’s app on that platform. A link connects ONE provider to ONE brand. It can be retried after a cancel until it expires, and is spent once an account connects. Know when it connects from the `account.connected` webhook event (connect a webhook on the brand and include the `connections` group) or by polling GET /v1/connect-links/{id}. Facebook and LinkedIn then need the Pages chosen: call list_connector_accounts and set_connector_accounts through /v1/tools (the link’s creator owns that choice). Accounts that connect with a pasted key (Bluesky, Telegram) are connected with POST /v1/tools/connect_connector instead.
24
+ # @param connect_link_create [ConnectLinkCreate]
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [String] :idempotency_key Send a unique value to make this call safe to retry. A replay returns the original response with `Idempotency-Replayed: true`, for 24 hours — except a call that queued a job, whose replay is that job as it is now (what `GET /v1/jobs/{id}` answers), so a finished render replays as done with its file.
27
+ # @option opts [String] :x_hermoso_user Which profile to act on, when the account holds more than one: an `id` from `GET /v1/brands`. Defaults to the workspace the key is pinned to. Membership is re-authorised on every request, and an id this key cannot act on is a 404 `brand_not_found`, never an empty result.
28
+ # @return [ConnectLink]
29
+ def create_connect_link(connect_link_create, opts = {})
30
+ data, _status_code, _headers = create_connect_link_with_http_info(connect_link_create, opts)
31
+ data
32
+ end
33
+
34
+ # Create a connect link for your customer
35
+ # A short-lived hosted link that lets someone with NO Hermoso login connect their own account (Facebook and Instagram, Instagram, TikTok, YouTube, LinkedIn, X, Pinterest, Threads, Google Business Profile and the ad platforms) to the brand named by `X-Hermoso-User`. Hand `url` to your customer. They see a short page from Hermoso, accept Hermoso’s Terms and Privacy Policy, sign in on the platform’s own consent screen, and land on your `redirect_url` with `connect_status` (success | cancelled | error), `provider`, `brand`, `link_id`, `account`, `error_code` and your `state` added to its query string (a same-named parameter of yours is overwritten). THE PLATFORM’S CONSENT SCREEN SHOWS HERMOSO’S NAME, because the connection is made with Hermoso’s app on that platform. A link connects ONE provider to ONE brand. It can be retried after a cancel until it expires, and is spent once an account connects. Know when it connects from the `account.connected` webhook event (connect a webhook on the brand and include the `connections` group) or by polling GET /v1/connect-links/{id}. Facebook and LinkedIn then need the Pages chosen: call list_connector_accounts and set_connector_accounts through /v1/tools (the link’s creator owns that choice). Accounts that connect with a pasted key (Bluesky, Telegram) are connected with POST /v1/tools/connect_connector instead.
36
+ # @param connect_link_create [ConnectLinkCreate]
37
+ # @param [Hash] opts the optional parameters
38
+ # @option opts [String] :idempotency_key Send a unique value to make this call safe to retry. A replay returns the original response with `Idempotency-Replayed: true`, for 24 hours — except a call that queued a job, whose replay is that job as it is now (what `GET /v1/jobs/{id}` answers), so a finished render replays as done with its file.
39
+ # @option opts [String] :x_hermoso_user Which profile to act on, when the account holds more than one: an `id` from `GET /v1/brands`. Defaults to the workspace the key is pinned to. Membership is re-authorised on every request, and an id this key cannot act on is a 404 `brand_not_found`, never an empty result.
40
+ # @return [Array<(ConnectLink, Integer, Hash)>] ConnectLink data, response status code and response headers
41
+ def create_connect_link_with_http_info(connect_link_create, opts = {})
42
+ if @api_client.config.debugging
43
+ @api_client.config.logger.debug 'Calling API: ConnectLinksApi.create_connect_link ...'
44
+ end
45
+ # verify the required parameter 'connect_link_create' is set
46
+ if @api_client.config.client_side_validation && connect_link_create.nil?
47
+ fail ArgumentError, "Missing the required parameter 'connect_link_create' when calling ConnectLinksApi.create_connect_link"
48
+ end
49
+ # resource path
50
+ local_var_path = '/v1/connect-links'
51
+
52
+ # query parameters
53
+ query_params = opts[:query_params] || {}
54
+
55
+ # header parameters
56
+ header_params = opts[:header_params] || {}
57
+ # HTTP header 'Accept' (if needed)
58
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
59
+ # HTTP header 'Content-Type'
60
+ content_type = @api_client.select_header_content_type(['application/json'])
61
+ if !content_type.nil?
62
+ header_params['Content-Type'] = content_type
63
+ end
64
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
65
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
66
+
67
+ # form parameters
68
+ form_params = opts[:form_params] || {}
69
+
70
+ # http body (model)
71
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(connect_link_create)
72
+
73
+ # return_type
74
+ return_type = opts[:debug_return_type] || 'ConnectLink'
75
+
76
+ # auth_names
77
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
78
+
79
+ new_options = opts.merge(
80
+ :operation => :"ConnectLinksApi.create_connect_link",
81
+ :header_params => header_params,
82
+ :query_params => query_params,
83
+ :form_params => form_params,
84
+ :body => post_body,
85
+ :auth_names => auth_names,
86
+ :return_type => return_type
87
+ )
88
+
89
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
90
+ if @api_client.config.debugging
91
+ @api_client.config.logger.debug "API called: ConnectLinksApi#create_connect_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
92
+ end
93
+ return data, status_code, headers
94
+ end
95
+
96
+ # Retrieve a connect link
97
+ # `status` is pending, opened, connected, cancelled, failed, expired or revoked. Once connected, `account` names what was connected. Kept for 7 days after the link expires.
98
+ # @param id [String]
99
+ # @param [Hash] opts the optional parameters
100
+ # @option opts [String] :x_hermoso_user Which profile to act on, when the account holds more than one: an &#x60;id&#x60; from &#x60;GET /v1/brands&#x60;. Defaults to the workspace the key is pinned to. Membership is re-authorised on every request, and an id this key cannot act on is a 404 &#x60;brand_not_found&#x60;, never an empty result.
101
+ # @return [ConnectLink]
102
+ def get_connect_link(id, opts = {})
103
+ data, _status_code, _headers = get_connect_link_with_http_info(id, opts)
104
+ data
105
+ end
106
+
107
+ # Retrieve a connect link
108
+ # &#x60;status&#x60; is pending, opened, connected, cancelled, failed, expired or revoked. Once connected, &#x60;account&#x60; names what was connected. Kept for 7 days after the link expires.
109
+ # @param id [String]
110
+ # @param [Hash] opts the optional parameters
111
+ # @option opts [String] :x_hermoso_user Which profile to act on, when the account holds more than one: an &#x60;id&#x60; from &#x60;GET /v1/brands&#x60;. Defaults to the workspace the key is pinned to. Membership is re-authorised on every request, and an id this key cannot act on is a 404 &#x60;brand_not_found&#x60;, never an empty result.
112
+ # @return [Array<(ConnectLink, Integer, Hash)>] ConnectLink data, response status code and response headers
113
+ def get_connect_link_with_http_info(id, opts = {})
114
+ if @api_client.config.debugging
115
+ @api_client.config.logger.debug 'Calling API: ConnectLinksApi.get_connect_link ...'
116
+ end
117
+ # verify the required parameter 'id' is set
118
+ if @api_client.config.client_side_validation && id.nil?
119
+ fail ArgumentError, "Missing the required parameter 'id' when calling ConnectLinksApi.get_connect_link"
120
+ end
121
+ # resource path
122
+ local_var_path = '/v1/connect-links/{id}'.sub('{id}', CGI.escape(id.to_s))
123
+
124
+ # query parameters
125
+ query_params = opts[:query_params] || {}
126
+
127
+ # header parameters
128
+ header_params = opts[:header_params] || {}
129
+ # HTTP header 'Accept' (if needed)
130
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
131
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
132
+
133
+ # form parameters
134
+ form_params = opts[:form_params] || {}
135
+
136
+ # http body (model)
137
+ post_body = opts[:debug_body]
138
+
139
+ # return_type
140
+ return_type = opts[:debug_return_type] || 'ConnectLink'
141
+
142
+ # auth_names
143
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
144
+
145
+ new_options = opts.merge(
146
+ :operation => :"ConnectLinksApi.get_connect_link",
147
+ :header_params => header_params,
148
+ :query_params => query_params,
149
+ :form_params => form_params,
150
+ :body => post_body,
151
+ :auth_names => auth_names,
152
+ :return_type => return_type
153
+ )
154
+
155
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
156
+ if @api_client.config.debugging
157
+ @api_client.config.logger.debug "API called: ConnectLinksApi#get_connect_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
158
+ end
159
+ return data, status_code, headers
160
+ end
161
+
162
+ # Cancel a connect link
163
+ # The link stops working at once. A link that already connected an account cannot be revoked; remove that connection with DELETE /v1/connections/{provider}.
164
+ # @param id [String]
165
+ # @param [Hash] opts the optional parameters
166
+ # @option opts [String] :x_hermoso_user Which profile to act on, when the account holds more than one: an &#x60;id&#x60; from &#x60;GET /v1/brands&#x60;. Defaults to the workspace the key is pinned to. Membership is re-authorised on every request, and an id this key cannot act on is a 404 &#x60;brand_not_found&#x60;, never an empty result.
167
+ # @return [ConnectLink]
168
+ def revoke_connect_link(id, opts = {})
169
+ data, _status_code, _headers = revoke_connect_link_with_http_info(id, opts)
170
+ data
171
+ end
172
+
173
+ # Cancel a connect link
174
+ # The link stops working at once. A link that already connected an account cannot be revoked; remove that connection with DELETE /v1/connections/{provider}.
175
+ # @param id [String]
176
+ # @param [Hash] opts the optional parameters
177
+ # @option opts [String] :x_hermoso_user Which profile to act on, when the account holds more than one: an &#x60;id&#x60; from &#x60;GET /v1/brands&#x60;. Defaults to the workspace the key is pinned to. Membership is re-authorised on every request, and an id this key cannot act on is a 404 &#x60;brand_not_found&#x60;, never an empty result.
178
+ # @return [Array<(ConnectLink, Integer, Hash)>] ConnectLink data, response status code and response headers
179
+ def revoke_connect_link_with_http_info(id, opts = {})
180
+ if @api_client.config.debugging
181
+ @api_client.config.logger.debug 'Calling API: ConnectLinksApi.revoke_connect_link ...'
182
+ end
183
+ # verify the required parameter 'id' is set
184
+ if @api_client.config.client_side_validation && id.nil?
185
+ fail ArgumentError, "Missing the required parameter 'id' when calling ConnectLinksApi.revoke_connect_link"
186
+ end
187
+ # resource path
188
+ local_var_path = '/v1/connect-links/{id}'.sub('{id}', CGI.escape(id.to_s))
189
+
190
+ # query parameters
191
+ query_params = opts[:query_params] || {}
192
+
193
+ # header parameters
194
+ header_params = opts[:header_params] || {}
195
+ # HTTP header 'Accept' (if needed)
196
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
197
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
198
+
199
+ # form parameters
200
+ form_params = opts[:form_params] || {}
201
+
202
+ # http body (model)
203
+ post_body = opts[:debug_body]
204
+
205
+ # return_type
206
+ return_type = opts[:debug_return_type] || 'ConnectLink'
207
+
208
+ # auth_names
209
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
210
+
211
+ new_options = opts.merge(
212
+ :operation => :"ConnectLinksApi.revoke_connect_link",
213
+ :header_params => header_params,
214
+ :query_params => query_params,
215
+ :form_params => form_params,
216
+ :body => post_body,
217
+ :auth_names => auth_names,
218
+ :return_type => return_type
219
+ )
220
+
221
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
222
+ if @api_client.config.debugging
223
+ @api_client.config.logger.debug "API called: ConnectLinksApi#revoke_connect_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
224
+ end
225
+ return data, status_code, headers
226
+ end
227
+ end
228
+ end
@@ -0,0 +1,153 @@
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 'cgi'
14
+
15
+ module Hermoso
16
+ class ConnectRedirectsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # List the registered redirect addresses
23
+ # The https addresses connect links may send your customers back to. A link’s `redirect_url` must sit under one of them: same scheme, host and port, and a path that starts with the registered path at a `/` boundary. Account-wide.
24
+ # @param [Hash] opts the optional parameters
25
+ # @option opts [String] :x_hermoso_user Which profile to act on, when the account holds more than one: an &#x60;id&#x60; from &#x60;GET /v1/brands&#x60;. Defaults to the workspace the key is pinned to. Membership is re-authorised on every request, and an id this key cannot act on is a 404 &#x60;brand_not_found&#x60;, never an empty result.
26
+ # @return [ConnectRedirects]
27
+ def get_connect_redirects(opts = {})
28
+ data, _status_code, _headers = get_connect_redirects_with_http_info(opts)
29
+ data
30
+ end
31
+
32
+ # List the registered redirect addresses
33
+ # The https addresses connect links may send your customers back to. A link’s &#x60;redirect_url&#x60; must sit under one of them: same scheme, host and port, and a path that starts with the registered path at a &#x60;/&#x60; boundary. Account-wide.
34
+ # @param [Hash] opts the optional parameters
35
+ # @option opts [String] :x_hermoso_user Which profile to act on, when the account holds more than one: an &#x60;id&#x60; from &#x60;GET /v1/brands&#x60;. Defaults to the workspace the key is pinned to. Membership is re-authorised on every request, and an id this key cannot act on is a 404 &#x60;brand_not_found&#x60;, never an empty result.
36
+ # @return [Array<(ConnectRedirects, Integer, Hash)>] ConnectRedirects data, response status code and response headers
37
+ def get_connect_redirects_with_http_info(opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: ConnectRedirectsApi.get_connect_redirects ...'
40
+ end
41
+ # resource path
42
+ local_var_path = '/v1/connect-redirects'
43
+
44
+ # query parameters
45
+ query_params = opts[:query_params] || {}
46
+
47
+ # header parameters
48
+ header_params = opts[:header_params] || {}
49
+ # HTTP header 'Accept' (if needed)
50
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
51
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
52
+
53
+ # form parameters
54
+ form_params = opts[:form_params] || {}
55
+
56
+ # http body (model)
57
+ post_body = opts[:debug_body]
58
+
59
+ # return_type
60
+ return_type = opts[:debug_return_type] || 'ConnectRedirects'
61
+
62
+ # auth_names
63
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
64
+
65
+ new_options = opts.merge(
66
+ :operation => :"ConnectRedirectsApi.get_connect_redirects",
67
+ :header_params => header_params,
68
+ :query_params => query_params,
69
+ :form_params => form_params,
70
+ :body => post_body,
71
+ :auth_names => auth_names,
72
+ :return_type => return_type
73
+ )
74
+
75
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
76
+ if @api_client.config.debugging
77
+ @api_client.config.logger.debug "API called: ConnectRedirectsApi#get_connect_redirects\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
78
+ end
79
+ return data, status_code, headers
80
+ end
81
+
82
+ # Replace the registered redirect addresses
83
+ # Replaces the whole list (an empty list removes them all). https only; `http://localhost` is accepted for local testing. No query string, fragment, credentials or wildcard — register an exact origin, optionally with a path prefix. Up to 20.
84
+ # @param connect_redirects_set [ConnectRedirectsSet]
85
+ # @param [Hash] opts the optional parameters
86
+ # @option opts [String] :x_hermoso_user Which profile to act on, when the account holds more than one: an &#x60;id&#x60; from &#x60;GET /v1/brands&#x60;. Defaults to the workspace the key is pinned to. Membership is re-authorised on every request, and an id this key cannot act on is a 404 &#x60;brand_not_found&#x60;, never an empty result.
87
+ # @return [ConnectRedirects]
88
+ def set_connect_redirects(connect_redirects_set, opts = {})
89
+ data, _status_code, _headers = set_connect_redirects_with_http_info(connect_redirects_set, opts)
90
+ data
91
+ end
92
+
93
+ # Replace the registered redirect addresses
94
+ # Replaces the whole list (an empty list removes them all). https only; &#x60;http://localhost&#x60; is accepted for local testing. No query string, fragment, credentials or wildcard — register an exact origin, optionally with a path prefix. Up to 20.
95
+ # @param connect_redirects_set [ConnectRedirectsSet]
96
+ # @param [Hash] opts the optional parameters
97
+ # @option opts [String] :x_hermoso_user Which profile to act on, when the account holds more than one: an &#x60;id&#x60; from &#x60;GET /v1/brands&#x60;. Defaults to the workspace the key is pinned to. Membership is re-authorised on every request, and an id this key cannot act on is a 404 &#x60;brand_not_found&#x60;, never an empty result.
98
+ # @return [Array<(ConnectRedirects, Integer, Hash)>] ConnectRedirects data, response status code and response headers
99
+ def set_connect_redirects_with_http_info(connect_redirects_set, opts = {})
100
+ if @api_client.config.debugging
101
+ @api_client.config.logger.debug 'Calling API: ConnectRedirectsApi.set_connect_redirects ...'
102
+ end
103
+ # verify the required parameter 'connect_redirects_set' is set
104
+ if @api_client.config.client_side_validation && connect_redirects_set.nil?
105
+ fail ArgumentError, "Missing the required parameter 'connect_redirects_set' when calling ConnectRedirectsApi.set_connect_redirects"
106
+ end
107
+ # resource path
108
+ local_var_path = '/v1/connect-redirects'
109
+
110
+ # query parameters
111
+ query_params = opts[:query_params] || {}
112
+
113
+ # header parameters
114
+ header_params = opts[:header_params] || {}
115
+ # HTTP header 'Accept' (if needed)
116
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
117
+ # HTTP header 'Content-Type'
118
+ content_type = @api_client.select_header_content_type(['application/json'])
119
+ if !content_type.nil?
120
+ header_params['Content-Type'] = content_type
121
+ end
122
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
123
+
124
+ # form parameters
125
+ form_params = opts[:form_params] || {}
126
+
127
+ # http body (model)
128
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(connect_redirects_set)
129
+
130
+ # return_type
131
+ return_type = opts[:debug_return_type] || 'ConnectRedirects'
132
+
133
+ # auth_names
134
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
135
+
136
+ new_options = opts.merge(
137
+ :operation => :"ConnectRedirectsApi.set_connect_redirects",
138
+ :header_params => header_params,
139
+ :query_params => query_params,
140
+ :form_params => form_params,
141
+ :body => post_body,
142
+ :auth_names => auth_names,
143
+ :return_type => return_type
144
+ )
145
+
146
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
147
+ if @api_client.config.debugging
148
+ @api_client.config.logger.debug "API called: ConnectRedirectsApi#set_connect_redirects\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
149
+ end
150
+ return data, status_code, headers
151
+ end
152
+ end
153
+ end
@@ -0,0 +1,151 @@
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 'cgi'
14
+
15
+ module Hermoso
16
+ class ConnectionsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Disconnect an account from the brand
23
+ # Removes the connection from THIS brand only. It never revokes Hermoso’s access at the platform, so the same account keeps working on any other brand it is connected to; the account holder removes that access in the platform’s own settings. Pass `account` to remove one account from a channel that holds several. Posts already published are not affected.
24
+ # @param provider [String]
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [String] :account On a channel with several connected accounts: the @handle or id of the one to remove.
27
+ # @option opts [String] :x_hermoso_user Which profile to act on, when the account holds more than one: an &#x60;id&#x60; from &#x60;GET /v1/brands&#x60;. Defaults to the workspace the key is pinned to. Membership is re-authorised on every request, and an id this key cannot act on is a 404 &#x60;brand_not_found&#x60;, never an empty result.
28
+ # @return [ConnectionDeleted]
29
+ def delete_connection(provider, opts = {})
30
+ data, _status_code, _headers = delete_connection_with_http_info(provider, opts)
31
+ data
32
+ end
33
+
34
+ # Disconnect an account from the brand
35
+ # Removes the connection from THIS brand only. It never revokes Hermoso’s access at the platform, so the same account keeps working on any other brand it is connected to; the account holder removes that access in the platform’s own settings. Pass &#x60;account&#x60; to remove one account from a channel that holds several. Posts already published are not affected.
36
+ # @param provider [String]
37
+ # @param [Hash] opts the optional parameters
38
+ # @option opts [String] :account On a channel with several connected accounts: the @handle or id of the one to remove.
39
+ # @option opts [String] :x_hermoso_user Which profile to act on, when the account holds more than one: an &#x60;id&#x60; from &#x60;GET /v1/brands&#x60;. Defaults to the workspace the key is pinned to. Membership is re-authorised on every request, and an id this key cannot act on is a 404 &#x60;brand_not_found&#x60;, never an empty result.
40
+ # @return [Array<(ConnectionDeleted, Integer, Hash)>] ConnectionDeleted data, response status code and response headers
41
+ def delete_connection_with_http_info(provider, opts = {})
42
+ if @api_client.config.debugging
43
+ @api_client.config.logger.debug 'Calling API: ConnectionsApi.delete_connection ...'
44
+ end
45
+ # verify the required parameter 'provider' is set
46
+ if @api_client.config.client_side_validation && provider.nil?
47
+ fail ArgumentError, "Missing the required parameter 'provider' when calling ConnectionsApi.delete_connection"
48
+ end
49
+ # resource path
50
+ local_var_path = '/v1/connections/{provider}'.sub('{provider}', CGI.escape(provider.to_s))
51
+
52
+ # query parameters
53
+ query_params = opts[:query_params] || {}
54
+ query_params[:'account'] = opts[:'account'] if !opts[:'account'].nil?
55
+
56
+ # header parameters
57
+ header_params = opts[:header_params] || {}
58
+ # HTTP header 'Accept' (if needed)
59
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
60
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
61
+
62
+ # form parameters
63
+ form_params = opts[:form_params] || {}
64
+
65
+ # http body (model)
66
+ post_body = opts[:debug_body]
67
+
68
+ # return_type
69
+ return_type = opts[:debug_return_type] || 'ConnectionDeleted'
70
+
71
+ # auth_names
72
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
73
+
74
+ new_options = opts.merge(
75
+ :operation => :"ConnectionsApi.delete_connection",
76
+ :header_params => header_params,
77
+ :query_params => query_params,
78
+ :form_params => form_params,
79
+ :body => post_body,
80
+ :auth_names => auth_names,
81
+ :return_type => return_type
82
+ )
83
+
84
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
85
+ if @api_client.config.debugging
86
+ @api_client.config.logger.debug "API called: ConnectionsApi#delete_connection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
87
+ end
88
+ return data, status_code, headers
89
+ end
90
+
91
+ # List the brand’s connected accounts
92
+ # Every account connected to the brand named by `X-Hermoso-User`: the provider, the account name, every account on a channel that holds several, and whether it needs reconnecting. A read that fails is a 503, never an empty list.
93
+ # @param [Hash] opts the optional parameters
94
+ # @option opts [String] :x_hermoso_user Which profile to act on, when the account holds more than one: an &#x60;id&#x60; from &#x60;GET /v1/brands&#x60;. Defaults to the workspace the key is pinned to. Membership is re-authorised on every request, and an id this key cannot act on is a 404 &#x60;brand_not_found&#x60;, never an empty result.
95
+ # @return [ConnectionList]
96
+ def list_connections(opts = {})
97
+ data, _status_code, _headers = list_connections_with_http_info(opts)
98
+ data
99
+ end
100
+
101
+ # List the brand’s connected accounts
102
+ # Every account connected to the brand named by &#x60;X-Hermoso-User&#x60;: the provider, the account name, every account on a channel that holds several, and whether it needs reconnecting. A read that fails is a 503, never an empty list.
103
+ # @param [Hash] opts the optional parameters
104
+ # @option opts [String] :x_hermoso_user Which profile to act on, when the account holds more than one: an &#x60;id&#x60; from &#x60;GET /v1/brands&#x60;. Defaults to the workspace the key is pinned to. Membership is re-authorised on every request, and an id this key cannot act on is a 404 &#x60;brand_not_found&#x60;, never an empty result.
105
+ # @return [Array<(ConnectionList, Integer, Hash)>] ConnectionList data, response status code and response headers
106
+ def list_connections_with_http_info(opts = {})
107
+ if @api_client.config.debugging
108
+ @api_client.config.logger.debug 'Calling API: ConnectionsApi.list_connections ...'
109
+ end
110
+ # resource path
111
+ local_var_path = '/v1/connections'
112
+
113
+ # query parameters
114
+ query_params = opts[:query_params] || {}
115
+
116
+ # header parameters
117
+ header_params = opts[:header_params] || {}
118
+ # HTTP header 'Accept' (if needed)
119
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
120
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
121
+
122
+ # form parameters
123
+ form_params = opts[:form_params] || {}
124
+
125
+ # http body (model)
126
+ post_body = opts[:debug_body]
127
+
128
+ # return_type
129
+ return_type = opts[:debug_return_type] || 'ConnectionList'
130
+
131
+ # auth_names
132
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
133
+
134
+ new_options = opts.merge(
135
+ :operation => :"ConnectionsApi.list_connections",
136
+ :header_params => header_params,
137
+ :query_params => query_params,
138
+ :form_params => form_params,
139
+ :body => post_body,
140
+ :auth_names => auth_names,
141
+ :return_type => return_type
142
+ )
143
+
144
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
145
+ if @api_client.config.debugging
146
+ @api_client.config.logger.debug "API called: ConnectionsApi#list_connections\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
147
+ end
148
+ return data, status_code, headers
149
+ end
150
+ end
151
+ end
@@ -0,0 +1,85 @@
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 'cgi'
14
+
15
+ module Hermoso
16
+ class CreditsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Retrieve the credit balance
23
+ # This workspace’s Hermoso credit balance and plan. Publishing and scheduling cost no credits; generation does. The Free plan publishes up to 10 posts on 3 channels (a post counts once, however many channels it goes to); every paid plan posts without a limit.
24
+ # @param [Hash] opts the optional parameters
25
+ # @option opts [String] :brand A brand id (&#x60;GET /v1/brands&#x60;) whose monthly credit limit to report in &#x60;limits&#x60;. Omit for the brand this key acts on.
26
+ # @option opts [String] :x_hermoso_user Which profile to act on, when the account holds more than one: an &#x60;id&#x60; from &#x60;GET /v1/brands&#x60;. Defaults to the workspace the key is pinned to. Membership is re-authorised on every request, and an id this key cannot act on is a 404 &#x60;brand_not_found&#x60;, never an empty result.
27
+ # @return [Credits]
28
+ def get_credits(opts = {})
29
+ data, _status_code, _headers = get_credits_with_http_info(opts)
30
+ data
31
+ end
32
+
33
+ # Retrieve the credit balance
34
+ # This workspace’s Hermoso credit balance and plan. Publishing and scheduling cost no credits; generation does. The Free plan publishes up to 10 posts on 3 channels (a post counts once, however many channels it goes to); every paid plan posts without a limit.
35
+ # @param [Hash] opts the optional parameters
36
+ # @option opts [String] :brand A brand id (&#x60;GET /v1/brands&#x60;) whose monthly credit limit to report in &#x60;limits&#x60;. Omit for the brand this key acts on.
37
+ # @option opts [String] :x_hermoso_user Which profile to act on, when the account holds more than one: an &#x60;id&#x60; from &#x60;GET /v1/brands&#x60;. Defaults to the workspace the key is pinned to. Membership is re-authorised on every request, and an id this key cannot act on is a 404 &#x60;brand_not_found&#x60;, never an empty result.
38
+ # @return [Array<(Credits, Integer, Hash)>] Credits data, response status code and response headers
39
+ def get_credits_with_http_info(opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: CreditsApi.get_credits ...'
42
+ end
43
+ # resource path
44
+ local_var_path = '/v1/credits'
45
+
46
+ # query parameters
47
+ query_params = opts[:query_params] || {}
48
+ query_params[:'brand'] = opts[:'brand'] if !opts[:'brand'].nil?
49
+
50
+ # header parameters
51
+ header_params = opts[:header_params] || {}
52
+ # HTTP header 'Accept' (if needed)
53
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
54
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
55
+
56
+ # form parameters
57
+ form_params = opts[:form_params] || {}
58
+
59
+ # http body (model)
60
+ post_body = opts[:debug_body]
61
+
62
+ # return_type
63
+ return_type = opts[:debug_return_type] || 'Credits'
64
+
65
+ # auth_names
66
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
67
+
68
+ new_options = opts.merge(
69
+ :operation => :"CreditsApi.get_credits",
70
+ :header_params => header_params,
71
+ :query_params => query_params,
72
+ :form_params => form_params,
73
+ :body => post_body,
74
+ :auth_names => auth_names,
75
+ :return_type => return_type
76
+ )
77
+
78
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
79
+ if @api_client.config.debugging
80
+ @api_client.config.logger.debug "API called: CreditsApi#get_credits\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
81
+ end
82
+ return data, status_code, headers
83
+ end
84
+ end
85
+ end