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
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 4474ddc31fd58139e38338dea756656516dbded951d10a83051ef3a27974385f
4
+ data.tar.gz: 65d6d47ab29c35a3007988c11f0c99b0be54e68681a8ee559aa6001b870434f4
5
+ SHA512:
6
+ metadata.gz: 782dfa083bf45a8d9bca5faf6d50afa833b190f4ca5714767eff1b619c9c19e45767305feafc205bcce1222690634aa4831a8894f42aae9766eab8203ef4a8ed
7
+ data.tar.gz: 93df6475b07ae6a9a761ab2706d6351c55de294a290f9fdcbe2b60e17b8e8415ef91d324ab598531fbf2a36fe991643c0b151c9c9b199f30cd2dc9df4f9036b6
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Hermoso (hermoso.ai)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,53 @@
1
+ # hermoso (Ruby)
2
+
3
+ The typed Ruby client for the [Hermoso API](https://hermoso.ai/docs/api/): generate image and video ads, publish and
4
+ schedule posts to your own channels, read your analytics, and call any of Hermoso's tools from your own backend.
5
+
6
+ Not on RubyGems yet. Install from source:
7
+
8
+ ```ruby
9
+ # Gemfile
10
+ gem 'hermoso', git: 'https://github.com/hermoso-ai/hermoso-sdks', glob: 'ruby/*.gemspec'
11
+ ```
12
+
13
+ Ruby 3.1+. Create an API key at [app.hermoso.ai](https://app.hermoso.ai) on the **API, MCP & CLI** tab, under
14
+ **Terminal & API keys**, and set it as `HERMOSO_API_KEY`. New accounts start free with no card.
15
+
16
+ ## Quickstart: make an image ad, wait for it, schedule it
17
+
18
+ ```ruby
19
+ require 'hermoso'
20
+ require 'securerandom'
21
+
22
+ client = Hermoso.client # reads HERMOSO_API_KEY
23
+ started = Hermoso.run_tool('generate_image', { prompt: 'Summer ad for our cold brew, headline "Cold. Brewed. Yours."',
24
+ job: 'static_ad', aspectRatio: '4:5' }, client: client, wait: 0)
25
+ job = Hermoso.wait_for_job(started.job_id, client: client)
26
+ post = Hermoso::PostsApi.new(client).create_post(
27
+ Hermoso::PostCreate.build_from_hash(channels: %w[instagram facebook], caption: 'Cold. Brewed. Yours.',
28
+ media: [job.url], scheduled_at: '2026-12-01T15:00:00Z'),
29
+ idempotency_key: SecureRandom.uuid
30
+ )
31
+ puts post.id, post.status
32
+ ```
33
+
34
+ `run_tool` reaches every Hermoso tool (`render_ad` for video ads, `plan_ad`, competitor research, the ad platforms);
35
+ `Hermoso::ToolsApi.new(client).get_tool(name)` describes each tool's arguments. Rendering costs credits; polling a job
36
+ and publishing are free. Omit `scheduled_at` to publish now.
37
+
38
+ ## The helpers
39
+
40
+ | Helper | What it does |
41
+ |---|---|
42
+ | `Hermoso.client(api_key:, brand:, base_url:)` | An `ApiClient` with your key; `brand:` acts on one brand of an account that holds several. |
43
+ | `Hermoso.paginate(api, :list_posts, status: 'published')` | An `Enumerator` over every item of a list, following `next_cursor`. |
44
+ | `Hermoso.wait_for_job(id, client:)` | Polls a render until it is `done` or `error`. |
45
+ | `Hermoso.run_tool(name, args, client:, wait:)` | Calls any tool; returns a `ToolResult`, or a `ToolJob` when it queued a render. |
46
+
47
+ Every `/v1` operation is a method on a generated API class (`Hermoso::CreditsApi`, `PostsApi`, `AnalyticsApi`, …),
48
+ with typed models in `Hermoso::`. Generated operations raise `Hermoso::ApiError`; the helpers raise
49
+ `Hermoso::HermosoError` with the API's `error.code` and `message`.
50
+
51
+ Docs: [hermoso.ai/docs/sdks](https://hermoso.ai/docs/sdks/) · OpenAPI:
52
+ [app.hermoso.ai/openapi.json](https://app.hermoso.ai/openapi.json). MIT licensed. Generated with
53
+ [OpenAPI Generator](https://openapi-generator.tech); `lib/` is regenerated, never edited by hand.
@@ -0,0 +1,156 @@
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 AccountApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Retrieve the contact email and whether it is verified
23
+ # The mailbox named at signup and whether its verification link has been clicked. The account works either way; a verified address is where receipts, low-credit alerts and replies to bug reports go. The address is NEVER the account identity and can never be used to sign in to, link, or merge accounts.
24
+ # @param [Hash] opts the optional parameters
25
+ # @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.
26
+ # @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.
27
+ # @return [ContactEmail]
28
+ def get_contact_email(opts = {})
29
+ data, _status_code, _headers = get_contact_email_with_http_info(opts)
30
+ data
31
+ end
32
+
33
+ # Retrieve the contact email and whether it is verified
34
+ # The mailbox named at signup and whether its verification link has been clicked. The account works either way; a verified address is where receipts, low-credit alerts and replies to bug reports go. The address is NEVER the account identity and can never be used to sign in to, link, or merge accounts.
35
+ # @param [Hash] opts the optional parameters
36
+ # @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.
37
+ # @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.
38
+ # @return [Array<(ContactEmail, Integer, Hash)>] ContactEmail data, response status code and response headers
39
+ def get_contact_email_with_http_info(opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: AccountApi.get_contact_email ...'
42
+ end
43
+ # resource path
44
+ local_var_path = '/v1/account/email'
45
+
46
+ # query parameters
47
+ query_params = opts[:query_params] || {}
48
+
49
+ # header parameters
50
+ header_params = opts[:header_params] || {}
51
+ # HTTP header 'Accept' (if needed)
52
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
53
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
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] || 'ContactEmail'
64
+
65
+ # auth_names
66
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
67
+
68
+ new_options = opts.merge(
69
+ :operation => :"AccountApi.get_contact_email",
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: AccountApi#get_contact_email\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
81
+ end
82
+ return data, status_code, headers
83
+ end
84
+
85
+ # Re-send the verification link, or set a different contact email
86
+ # With no body, re-sends the verification link to the current contact address (at most once every 10 minutes — 429 `verification_recently_sent` otherwise). With `email`, replaces the contact address and starts verification over for the new one. An address that is already the sign-in email of another Hermoso account cannot be verified here (409 `email_in_use` when the link is clicked) and this account stays exactly as it is.
87
+ # @param contact_email_resend [ContactEmailResend]
88
+ # @param [Hash] opts the optional parameters
89
+ # @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.
90
+ # @return [ContactEmail]
91
+ def resend_email_verification(contact_email_resend, opts = {})
92
+ data, _status_code, _headers = resend_email_verification_with_http_info(contact_email_resend, opts)
93
+ data
94
+ end
95
+
96
+ # Re-send the verification link, or set a different contact email
97
+ # With no body, re-sends the verification link to the current contact address (at most once every 10 minutes — 429 &#x60;verification_recently_sent&#x60; otherwise). With &#x60;email&#x60;, replaces the contact address and starts verification over for the new one. An address that is already the sign-in email of another Hermoso account cannot be verified here (409 &#x60;email_in_use&#x60; when the link is clicked) and this account stays exactly as it is.
98
+ # @param contact_email_resend [ContactEmailResend]
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 [Array<(ContactEmail, Integer, Hash)>] ContactEmail data, response status code and response headers
102
+ def resend_email_verification_with_http_info(contact_email_resend, opts = {})
103
+ if @api_client.config.debugging
104
+ @api_client.config.logger.debug 'Calling API: AccountApi.resend_email_verification ...'
105
+ end
106
+ # verify the required parameter 'contact_email_resend' is set
107
+ if @api_client.config.client_side_validation && contact_email_resend.nil?
108
+ fail ArgumentError, "Missing the required parameter 'contact_email_resend' when calling AccountApi.resend_email_verification"
109
+ end
110
+ # resource path
111
+ local_var_path = '/v1/account/email/resend'
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
+ # HTTP header 'Content-Type'
121
+ content_type = @api_client.select_header_content_type(['application/json'])
122
+ if !content_type.nil?
123
+ header_params['Content-Type'] = content_type
124
+ end
125
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
126
+
127
+ # form parameters
128
+ form_params = opts[:form_params] || {}
129
+
130
+ # http body (model)
131
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(contact_email_resend)
132
+
133
+ # return_type
134
+ return_type = opts[:debug_return_type] || 'ContactEmail'
135
+
136
+ # auth_names
137
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
138
+
139
+ new_options = opts.merge(
140
+ :operation => :"AccountApi.resend_email_verification",
141
+ :header_params => header_params,
142
+ :query_params => query_params,
143
+ :form_params => form_params,
144
+ :body => post_body,
145
+ :auth_names => auth_names,
146
+ :return_type => return_type
147
+ )
148
+
149
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
150
+ if @api_client.config.debugging
151
+ @api_client.config.logger.debug "API called: AccountApi#resend_email_verification\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
152
+ end
153
+ return data, status_code, headers
154
+ end
155
+ end
156
+ end
@@ -0,0 +1,400 @@
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 AnalyticsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Best time to post
23
+ # From this brand's own measured posts, per channel, on `timezone`: a day × hour grid (`slots`, one row per channel and slot with the post count, the average engagement and the lift against that channel's usual), the best weekday and 3-hour band where one beat the usual by 15% over at least 5 posts, and Instagram's followers-online hours when Instagram is connected. Raw numbers are never pooled across channels; below 15 measured posts nothing is named and `why` says how many there are. `day_of_week` 0 = Monday.
24
+ # @param [Hash] opts the optional parameters
25
+ # @option opts [String] :channel One channel (instagram, tiktok, facebook, linkedin, x, threads, youtube, pinterest, bluesky). Omit for every channel.
26
+ # @option opts [String] :account One account: handle, Page name or id.
27
+ # @option opts [String] :source &#x60;all&#x60; (default), &#x60;hermoso&#x60; (posts made in Hermoso) or &#x60;imported&#x60; (posts imported from the platform).
28
+ # @option opts [Integer] :days Look-back, 30-365 days. Default 90.
29
+ # @option opts [String] :timezone IANA zone for days and hours. Default: the account&#39;s.
30
+ # @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.
31
+ # @return [BestTime]
32
+ def get_best_time(opts = {})
33
+ data, _status_code, _headers = get_best_time_with_http_info(opts)
34
+ data
35
+ end
36
+
37
+ # Best time to post
38
+ # From this brand&#39;s own measured posts, per channel, on &#x60;timezone&#x60;: a day × hour grid (&#x60;slots&#x60;, one row per channel and slot with the post count, the average engagement and the lift against that channel&#39;s usual), the best weekday and 3-hour band where one beat the usual by 15% over at least 5 posts, and Instagram&#39;s followers-online hours when Instagram is connected. Raw numbers are never pooled across channels; below 15 measured posts nothing is named and &#x60;why&#x60; says how many there are. &#x60;day_of_week&#x60; 0 &#x3D; Monday.
39
+ # @param [Hash] opts the optional parameters
40
+ # @option opts [String] :channel One channel (instagram, tiktok, facebook, linkedin, x, threads, youtube, pinterest, bluesky). Omit for every channel.
41
+ # @option opts [String] :account One account: handle, Page name or id.
42
+ # @option opts [String] :source &#x60;all&#x60; (default), &#x60;hermoso&#x60; (posts made in Hermoso) or &#x60;imported&#x60; (posts imported from the platform).
43
+ # @option opts [Integer] :days Look-back, 30-365 days. Default 90.
44
+ # @option opts [String] :timezone IANA zone for days and hours. Default: the account&#39;s.
45
+ # @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.
46
+ # @return [Array<(BestTime, Integer, Hash)>] BestTime data, response status code and response headers
47
+ def get_best_time_with_http_info(opts = {})
48
+ if @api_client.config.debugging
49
+ @api_client.config.logger.debug 'Calling API: AnalyticsApi.get_best_time ...'
50
+ end
51
+ # resource path
52
+ local_var_path = '/v1/analytics/best-time'
53
+
54
+ # query parameters
55
+ query_params = opts[:query_params] || {}
56
+ query_params[:'channel'] = opts[:'channel'] if !opts[:'channel'].nil?
57
+ query_params[:'account'] = opts[:'account'] if !opts[:'account'].nil?
58
+ query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?
59
+ query_params[:'days'] = opts[:'days'] if !opts[:'days'].nil?
60
+ query_params[:'timezone'] = opts[:'timezone'] if !opts[:'timezone'].nil?
61
+
62
+ # header parameters
63
+ header_params = opts[:header_params] || {}
64
+ # HTTP header 'Accept' (if needed)
65
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
66
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
67
+
68
+ # form parameters
69
+ form_params = opts[:form_params] || {}
70
+
71
+ # http body (model)
72
+ post_body = opts[:debug_body]
73
+
74
+ # return_type
75
+ return_type = opts[:debug_return_type] || 'BestTime'
76
+
77
+ # auth_names
78
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
79
+
80
+ new_options = opts.merge(
81
+ :operation => :"AnalyticsApi.get_best_time",
82
+ :header_params => header_params,
83
+ :query_params => query_params,
84
+ :form_params => form_params,
85
+ :body => post_body,
86
+ :auth_names => auth_names,
87
+ :return_type => return_type
88
+ )
89
+
90
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
91
+ if @api_client.config.debugging
92
+ @api_client.config.logger.debug "API called: AnalyticsApi#get_best_time\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
93
+ end
94
+ return data, status_code, headers
95
+ end
96
+
97
+ # Content decay
98
+ # How fast posts stop earning: for each age bucket (0-6h … 30d+), the average share of a post's final engagement (and, separately, of its final reach) reached by then, from posts with two or more readings and a settled reading 6+ days after posting. Per channel, plus `buckets` pooled across channels (a share is unitless, so pooling it is legitimate where pooling raw numbers is not).
99
+ # @param [Hash] opts the optional parameters
100
+ # @option opts [String] :channel One channel. Omit for every channel.
101
+ # @option opts [String] :account One account.
102
+ # @option opts [String] :source &#x60;all&#x60;, &#x60;hermoso&#x60; or &#x60;imported&#x60;.
103
+ # @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.
104
+ # @return [ContentDecay]
105
+ def get_content_decay(opts = {})
106
+ data, _status_code, _headers = get_content_decay_with_http_info(opts)
107
+ data
108
+ end
109
+
110
+ # Content decay
111
+ # How fast posts stop earning: for each age bucket (0-6h … 30d+), the average share of a post&#39;s final engagement (and, separately, of its final reach) reached by then, from posts with two or more readings and a settled reading 6+ days after posting. Per channel, plus &#x60;buckets&#x60; pooled across channels (a share is unitless, so pooling it is legitimate where pooling raw numbers is not).
112
+ # @param [Hash] opts the optional parameters
113
+ # @option opts [String] :channel One channel. Omit for every channel.
114
+ # @option opts [String] :account One account.
115
+ # @option opts [String] :source &#x60;all&#x60;, &#x60;hermoso&#x60; or &#x60;imported&#x60;.
116
+ # @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.
117
+ # @return [Array<(ContentDecay, Integer, Hash)>] ContentDecay data, response status code and response headers
118
+ def get_content_decay_with_http_info(opts = {})
119
+ if @api_client.config.debugging
120
+ @api_client.config.logger.debug 'Calling API: AnalyticsApi.get_content_decay ...'
121
+ end
122
+ # resource path
123
+ local_var_path = '/v1/analytics/content-decay'
124
+
125
+ # query parameters
126
+ query_params = opts[:query_params] || {}
127
+ query_params[:'channel'] = opts[:'channel'] if !opts[:'channel'].nil?
128
+ query_params[:'account'] = opts[:'account'] if !opts[:'account'].nil?
129
+ query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?
130
+
131
+ # header parameters
132
+ header_params = opts[:header_params] || {}
133
+ # HTTP header 'Accept' (if needed)
134
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
135
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
136
+
137
+ # form parameters
138
+ form_params = opts[:form_params] || {}
139
+
140
+ # http body (model)
141
+ post_body = opts[:debug_body]
142
+
143
+ # return_type
144
+ return_type = opts[:debug_return_type] || 'ContentDecay'
145
+
146
+ # auth_names
147
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
148
+
149
+ new_options = opts.merge(
150
+ :operation => :"AnalyticsApi.get_content_decay",
151
+ :header_params => header_params,
152
+ :query_params => query_params,
153
+ :form_params => form_params,
154
+ :body => post_body,
155
+ :auth_names => auth_names,
156
+ :return_type => return_type
157
+ )
158
+
159
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
160
+ if @api_client.config.debugging
161
+ @api_client.config.logger.debug "API called: AnalyticsApi#get_content_decay\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
162
+ end
163
+ return data, status_code, headers
164
+ end
165
+
166
+ # Follower history
167
+ # Follower count over time for every connected account (read once a day): one point per day, week or month with the change since the period before, up to a year (a longer range is cut and `warning` says so). A day whose read failed is a gap with its reason in `gaps`, never a 0. YouTube keeps its counts without a change (its API policy forbids derived numbers).
168
+ # @param [Hash] opts the optional parameters
169
+ # @option opts [String] :from YYYY-MM-DD. Default 30 days before &#x60;to&#x60;.
170
+ # @option opts [String] :to YYYY-MM-DD. Default today.
171
+ # @option opts [String] :granularity &#x60;daily&#x60; (default), &#x60;weekly&#x60; or &#x60;monthly&#x60;.
172
+ # @option opts [String] :channel One channel.
173
+ # @option opts [String] :account One account.
174
+ # @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.
175
+ # @return [FollowerHistory]
176
+ def get_follower_history(opts = {})
177
+ data, _status_code, _headers = get_follower_history_with_http_info(opts)
178
+ data
179
+ end
180
+
181
+ # Follower history
182
+ # Follower count over time for every connected account (read once a day): one point per day, week or month with the change since the period before, up to a year (a longer range is cut and &#x60;warning&#x60; says so). A day whose read failed is a gap with its reason in &#x60;gaps&#x60;, never a 0. YouTube keeps its counts without a change (its API policy forbids derived numbers).
183
+ # @param [Hash] opts the optional parameters
184
+ # @option opts [String] :from YYYY-MM-DD. Default 30 days before &#x60;to&#x60;.
185
+ # @option opts [String] :to YYYY-MM-DD. Default today.
186
+ # @option opts [String] :granularity &#x60;daily&#x60; (default), &#x60;weekly&#x60; or &#x60;monthly&#x60;.
187
+ # @option opts [String] :channel One channel.
188
+ # @option opts [String] :account One account.
189
+ # @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.
190
+ # @return [Array<(FollowerHistory, Integer, Hash)>] FollowerHistory data, response status code and response headers
191
+ def get_follower_history_with_http_info(opts = {})
192
+ if @api_client.config.debugging
193
+ @api_client.config.logger.debug 'Calling API: AnalyticsApi.get_follower_history ...'
194
+ end
195
+ # resource path
196
+ local_var_path = '/v1/analytics/follower-history'
197
+
198
+ # query parameters
199
+ query_params = opts[:query_params] || {}
200
+ query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
201
+ query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?
202
+ query_params[:'granularity'] = opts[:'granularity'] if !opts[:'granularity'].nil?
203
+ query_params[:'channel'] = opts[:'channel'] if !opts[:'channel'].nil?
204
+ query_params[:'account'] = opts[:'account'] if !opts[:'account'].nil?
205
+
206
+ # header parameters
207
+ header_params = opts[:header_params] || {}
208
+ # HTTP header 'Accept' (if needed)
209
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
210
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
211
+
212
+ # form parameters
213
+ form_params = opts[:form_params] || {}
214
+
215
+ # http body (model)
216
+ post_body = opts[:debug_body]
217
+
218
+ # return_type
219
+ return_type = opts[:debug_return_type] || 'FollowerHistory'
220
+
221
+ # auth_names
222
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
223
+
224
+ new_options = opts.merge(
225
+ :operation => :"AnalyticsApi.get_follower_history",
226
+ :header_params => header_params,
227
+ :query_params => query_params,
228
+ :form_params => form_params,
229
+ :body => post_body,
230
+ :auth_names => auth_names,
231
+ :return_type => return_type
232
+ )
233
+
234
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
235
+ if @api_client.config.debugging
236
+ @api_client.config.logger.debug "API called: AnalyticsApi#get_follower_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
237
+ end
238
+ return data, status_code, headers
239
+ end
240
+
241
+ # Inbox stats
242
+ # Across every connected messaging channel (WhatsApp, Messenger, Instagram, Telegram, SMS, LINE, Slack, Discord, email; X only with `include_x=true`, which X bills per message read): messages received and sent per day (`timeseries`) and per channel (`byPlatform`), a day × hour `heatmap` on `timezone` with the busiest hours (`dow` 1 = Monday), `responseTime` (median, p90, p99, mean, fastest, slowest and a histogram, measured from the other person's message to the brand's next reply in the same conversation), reply rate, the receiving accounts by load (`topAccounts`), per-conversation rows (`conversations`) and who is `waiting` now. Hermoso keeps each message's time and direction, never its text, from when the inbox was first read; `coverage` says since when and which channels could not be read.
243
+ # @param [Hash] opts the optional parameters
244
+ # @option opts [Integer] :days Last N days, 1-365. Default 30.
245
+ # @option opts [String] :from YYYY-MM-DD.
246
+ # @option opts [String] :to YYYY-MM-DD.
247
+ # @option opts [String] :channel One channel: whatsapp, messenger, instagram, telegram, sms, line, slack, discord, email, x.
248
+ # @option opts [String] :account One receiving account.
249
+ # @option opts [Boolean] :include_x Also count X DMs (X bills per message read).
250
+ # @option opts [String] :timezone IANA zone for days and hours. Default: the account&#39;s.
251
+ # @option opts [Integer] :limit Rows in &#x60;topAccounts&#x60; and per page of &#x60;conversations&#x60;.
252
+ # @option opts [Integer] :page Page of &#x60;conversations&#x60;, from 1.
253
+ # @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.
254
+ # @return [InboxStats]
255
+ def get_inbox_stats(opts = {})
256
+ data, _status_code, _headers = get_inbox_stats_with_http_info(opts)
257
+ data
258
+ end
259
+
260
+ # Inbox stats
261
+ # Across every connected messaging channel (WhatsApp, Messenger, Instagram, Telegram, SMS, LINE, Slack, Discord, email; X only with &#x60;include_x&#x3D;true&#x60;, which X bills per message read): messages received and sent per day (&#x60;timeseries&#x60;) and per channel (&#x60;byPlatform&#x60;), a day × hour &#x60;heatmap&#x60; on &#x60;timezone&#x60; with the busiest hours (&#x60;dow&#x60; 1 &#x3D; Monday), &#x60;responseTime&#x60; (median, p90, p99, mean, fastest, slowest and a histogram, measured from the other person&#39;s message to the brand&#39;s next reply in the same conversation), reply rate, the receiving accounts by load (&#x60;topAccounts&#x60;), per-conversation rows (&#x60;conversations&#x60;) and who is &#x60;waiting&#x60; now. Hermoso keeps each message&#39;s time and direction, never its text, from when the inbox was first read; &#x60;coverage&#x60; says since when and which channels could not be read.
262
+ # @param [Hash] opts the optional parameters
263
+ # @option opts [Integer] :days Last N days, 1-365. Default 30.
264
+ # @option opts [String] :from YYYY-MM-DD.
265
+ # @option opts [String] :to YYYY-MM-DD.
266
+ # @option opts [String] :channel One channel: whatsapp, messenger, instagram, telegram, sms, line, slack, discord, email, x.
267
+ # @option opts [String] :account One receiving account.
268
+ # @option opts [Boolean] :include_x Also count X DMs (X bills per message read).
269
+ # @option opts [String] :timezone IANA zone for days and hours. Default: the account&#39;s.
270
+ # @option opts [Integer] :limit Rows in &#x60;topAccounts&#x60; and per page of &#x60;conversations&#x60;.
271
+ # @option opts [Integer] :page Page of &#x60;conversations&#x60;, from 1.
272
+ # @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.
273
+ # @return [Array<(InboxStats, Integer, Hash)>] InboxStats data, response status code and response headers
274
+ def get_inbox_stats_with_http_info(opts = {})
275
+ if @api_client.config.debugging
276
+ @api_client.config.logger.debug 'Calling API: AnalyticsApi.get_inbox_stats ...'
277
+ end
278
+ # resource path
279
+ local_var_path = '/v1/analytics/inbox'
280
+
281
+ # query parameters
282
+ query_params = opts[:query_params] || {}
283
+ query_params[:'days'] = opts[:'days'] if !opts[:'days'].nil?
284
+ query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
285
+ query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?
286
+ query_params[:'channel'] = opts[:'channel'] if !opts[:'channel'].nil?
287
+ query_params[:'account'] = opts[:'account'] if !opts[:'account'].nil?
288
+ query_params[:'include_x'] = opts[:'include_x'] if !opts[:'include_x'].nil?
289
+ query_params[:'timezone'] = opts[:'timezone'] if !opts[:'timezone'].nil?
290
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
291
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
292
+
293
+ # header parameters
294
+ header_params = opts[:header_params] || {}
295
+ # HTTP header 'Accept' (if needed)
296
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
297
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
298
+
299
+ # form parameters
300
+ form_params = opts[:form_params] || {}
301
+
302
+ # http body (model)
303
+ post_body = opts[:debug_body]
304
+
305
+ # return_type
306
+ return_type = opts[:debug_return_type] || 'InboxStats'
307
+
308
+ # auth_names
309
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
310
+
311
+ new_options = opts.merge(
312
+ :operation => :"AnalyticsApi.get_inbox_stats",
313
+ :header_params => header_params,
314
+ :query_params => query_params,
315
+ :form_params => form_params,
316
+ :body => post_body,
317
+ :auth_names => auth_names,
318
+ :return_type => return_type
319
+ )
320
+
321
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
322
+ if @api_client.config.debugging
323
+ @api_client.config.logger.debug "API called: AnalyticsApi#get_inbox_stats\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
324
+ end
325
+ return data, status_code, headers
326
+ end
327
+
328
+ # Posting frequency vs engagement
329
+ # Per channel, completed weeks only (the last 180 days): for each posts-per-week, the weeks observed, the average engagement per post, the average engagement rate and the average follower change in those weeks. `frequency` has one row per (platform, posts_per_week); each channel names `best`, the highest cadence before engagement per post drops by 15%, once two cadences have 3+ measured weeks each.
330
+ # @param [Hash] opts the optional parameters
331
+ # @option opts [String] :channel One channel. Omit for every channel.
332
+ # @option opts [String] :account One account.
333
+ # @option opts [String] :source &#x60;all&#x60;, &#x60;hermoso&#x60; or &#x60;imported&#x60;.
334
+ # @option opts [String] :timezone IANA zone that decides where a week starts (Monday). Default: the account&#39;s.
335
+ # @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.
336
+ # @return [PostingFrequency]
337
+ def get_posting_frequency(opts = {})
338
+ data, _status_code, _headers = get_posting_frequency_with_http_info(opts)
339
+ data
340
+ end
341
+
342
+ # Posting frequency vs engagement
343
+ # Per channel, completed weeks only (the last 180 days): for each posts-per-week, the weeks observed, the average engagement per post, the average engagement rate and the average follower change in those weeks. &#x60;frequency&#x60; has one row per (platform, posts_per_week); each channel names &#x60;best&#x60;, the highest cadence before engagement per post drops by 15%, once two cadences have 3+ measured weeks each.
344
+ # @param [Hash] opts the optional parameters
345
+ # @option opts [String] :channel One channel. Omit for every channel.
346
+ # @option opts [String] :account One account.
347
+ # @option opts [String] :source &#x60;all&#x60;, &#x60;hermoso&#x60; or &#x60;imported&#x60;.
348
+ # @option opts [String] :timezone IANA zone that decides where a week starts (Monday). Default: the account&#39;s.
349
+ # @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.
350
+ # @return [Array<(PostingFrequency, Integer, Hash)>] PostingFrequency data, response status code and response headers
351
+ def get_posting_frequency_with_http_info(opts = {})
352
+ if @api_client.config.debugging
353
+ @api_client.config.logger.debug 'Calling API: AnalyticsApi.get_posting_frequency ...'
354
+ end
355
+ # resource path
356
+ local_var_path = '/v1/analytics/posting-frequency'
357
+
358
+ # query parameters
359
+ query_params = opts[:query_params] || {}
360
+ query_params[:'channel'] = opts[:'channel'] if !opts[:'channel'].nil?
361
+ query_params[:'account'] = opts[:'account'] if !opts[:'account'].nil?
362
+ query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?
363
+ query_params[:'timezone'] = opts[:'timezone'] if !opts[:'timezone'].nil?
364
+
365
+ # header parameters
366
+ header_params = opts[:header_params] || {}
367
+ # HTTP header 'Accept' (if needed)
368
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
369
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
370
+
371
+ # form parameters
372
+ form_params = opts[:form_params] || {}
373
+
374
+ # http body (model)
375
+ post_body = opts[:debug_body]
376
+
377
+ # return_type
378
+ return_type = opts[:debug_return_type] || 'PostingFrequency'
379
+
380
+ # auth_names
381
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
382
+
383
+ new_options = opts.merge(
384
+ :operation => :"AnalyticsApi.get_posting_frequency",
385
+ :header_params => header_params,
386
+ :query_params => query_params,
387
+ :form_params => form_params,
388
+ :body => post_body,
389
+ :auth_names => auth_names,
390
+ :return_type => return_type
391
+ )
392
+
393
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
394
+ if @api_client.config.debugging
395
+ @api_client.config.logger.debug "API called: AnalyticsApi#get_posting_frequency\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
396
+ end
397
+ return data, status_code, headers
398
+ end
399
+ end
400
+ end