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,570 @@
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 TagApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get the brand’s Hermoso tag
23
+ # The brand’s first-party website tag: the snippet to put in every page’s <head>, its settings, and whether it is firing (the last event seen and from which hosts). Made on the first call. It records page views, each visit’s UTM parameters and ad click ids, the referrer and the conversions the site reports, and forwards conversions server-side to every saved event destination (GET /v1/events/destinations) with one dedup `event_id`. The website owner is responsible for the site’s consent banner and privacy notice; the tag follows the consent the site gives it. Free.
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 [HermosoTag]
27
+ def get_tag(opts = {})
28
+ data, _status_code, _headers = get_tag_with_http_info(opts)
29
+ data
30
+ end
31
+
32
+ # Get the brand’s Hermoso tag
33
+ # The brand’s first-party website tag: the snippet to put in every page’s &lt;head&gt;, its settings, and whether it is firing (the last event seen and from which hosts). Made on the first call. It records page views, each visit’s UTM parameters and ad click ids, the referrer and the conversions the site reports, and forwards conversions server-side to every saved event destination (GET /v1/events/destinations) with one dedup &#x60;event_id&#x60;. The website owner is responsible for the site’s consent banner and privacy notice; the tag follows the consent the site gives it. Free.
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<(HermosoTag, Integer, Hash)>] HermosoTag data, response status code and response headers
37
+ def get_tag_with_http_info(opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: TagApi.get_tag ...'
40
+ end
41
+ # resource path
42
+ local_var_path = '/v1/tag'
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] || 'HermosoTag'
61
+
62
+ # auth_names
63
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
64
+
65
+ new_options = opts.merge(
66
+ :operation => :"TagApi.get_tag",
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: TagApi#get_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
78
+ end
79
+ return data, status_code, headers
80
+ end
81
+
82
+ # Visits, leads and revenue by source
83
+ # Visits → leads → purchases → revenue (per currency) from the tag, grouped by `group_by`: channel (default), source, medium, campaign, post, ad or page. UTC days, at most 92; bots are left out and test events reported apart. Free.
84
+ # @param [Hash] opts the optional parameters
85
+ # @option opts [String] :group_by channel, source, medium, campaign, post, ad or page.
86
+ # @option opts [String] :from YYYY-MM-DD
87
+ # @option opts [String] :to YYYY-MM-DD
88
+ # @option opts [Integer] :days The last N days, default 30.
89
+ # @option opts [Integer] :limit
90
+ # @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.
91
+ # @return [HermosoTagReport]
92
+ def get_tag_report(opts = {})
93
+ data, _status_code, _headers = get_tag_report_with_http_info(opts)
94
+ data
95
+ end
96
+
97
+ # Visits, leads and revenue by source
98
+ # Visits → leads → purchases → revenue (per currency) from the tag, grouped by &#x60;group_by&#x60;: channel (default), source, medium, campaign, post, ad or page. UTC days, at most 92; bots are left out and test events reported apart. Free.
99
+ # @param [Hash] opts the optional parameters
100
+ # @option opts [String] :group_by channel, source, medium, campaign, post, ad or page.
101
+ # @option opts [String] :from YYYY-MM-DD
102
+ # @option opts [String] :to YYYY-MM-DD
103
+ # @option opts [Integer] :days The last N days, default 30.
104
+ # @option opts [Integer] :limit
105
+ # @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.
106
+ # @return [Array<(HermosoTagReport, Integer, Hash)>] HermosoTagReport data, response status code and response headers
107
+ def get_tag_report_with_http_info(opts = {})
108
+ if @api_client.config.debugging
109
+ @api_client.config.logger.debug 'Calling API: TagApi.get_tag_report ...'
110
+ end
111
+ # resource path
112
+ local_var_path = '/v1/tag/report'
113
+
114
+ # query parameters
115
+ query_params = opts[:query_params] || {}
116
+ query_params[:'group_by'] = opts[:'group_by'] if !opts[:'group_by'].nil?
117
+ query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
118
+ query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?
119
+ query_params[:'days'] = opts[:'days'] if !opts[:'days'].nil?
120
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
121
+
122
+ # header parameters
123
+ header_params = opts[:header_params] || {}
124
+ # HTTP header 'Accept' (if needed)
125
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
126
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
127
+
128
+ # form parameters
129
+ form_params = opts[:form_params] || {}
130
+
131
+ # http body (model)
132
+ post_body = opts[:debug_body]
133
+
134
+ # return_type
135
+ return_type = opts[:debug_return_type] || 'HermosoTagReport'
136
+
137
+ # auth_names
138
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
139
+
140
+ new_options = opts.merge(
141
+ :operation => :"TagApi.get_tag_report",
142
+ :header_params => header_params,
143
+ :query_params => query_params,
144
+ :form_params => form_params,
145
+ :body => post_body,
146
+ :auth_names => auth_names,
147
+ :return_type => return_type
148
+ )
149
+
150
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
151
+ if @api_client.config.debugging
152
+ @api_client.config.logger.debug "API called: TagApi#get_tag_report\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
153
+ end
154
+ return data, status_code, headers
155
+ end
156
+
157
+ # Put the Hermoso tag on the website
158
+ # Through the site connection the brand has: `google_tag_manager`, `wordpress`, `shopify` (an app pixel in Shopify customer events, which also sees checkout) or `manual` (the snippet and where to paste it). Without `confirm: true` nothing is written and the reply says what would change. `remove: true` uninstalls what Hermoso added. Free.
159
+ # @param hermoso_tag_install [HermosoTagInstall]
160
+ # @param [Hash] opts the optional parameters
161
+ # @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.
162
+ # @return [HermosoTagInstallResult]
163
+ def install_tag(hermoso_tag_install, opts = {})
164
+ data, _status_code, _headers = install_tag_with_http_info(hermoso_tag_install, opts)
165
+ data
166
+ end
167
+
168
+ # Put the Hermoso tag on the website
169
+ # Through the site connection the brand has: &#x60;google_tag_manager&#x60;, &#x60;wordpress&#x60;, &#x60;shopify&#x60; (an app pixel in Shopify customer events, which also sees checkout) or &#x60;manual&#x60; (the snippet and where to paste it). Without &#x60;confirm: true&#x60; nothing is written and the reply says what would change. &#x60;remove: true&#x60; uninstalls what Hermoso added. Free.
170
+ # @param hermoso_tag_install [HermosoTagInstall]
171
+ # @param [Hash] opts the optional parameters
172
+ # @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.
173
+ # @return [Array<(HermosoTagInstallResult, Integer, Hash)>] HermosoTagInstallResult data, response status code and response headers
174
+ def install_tag_with_http_info(hermoso_tag_install, opts = {})
175
+ if @api_client.config.debugging
176
+ @api_client.config.logger.debug 'Calling API: TagApi.install_tag ...'
177
+ end
178
+ # verify the required parameter 'hermoso_tag_install' is set
179
+ if @api_client.config.client_side_validation && hermoso_tag_install.nil?
180
+ fail ArgumentError, "Missing the required parameter 'hermoso_tag_install' when calling TagApi.install_tag"
181
+ end
182
+ # resource path
183
+ local_var_path = '/v1/tag/install'
184
+
185
+ # query parameters
186
+ query_params = opts[:query_params] || {}
187
+
188
+ # header parameters
189
+ header_params = opts[:header_params] || {}
190
+ # HTTP header 'Accept' (if needed)
191
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
192
+ # HTTP header 'Content-Type'
193
+ content_type = @api_client.select_header_content_type(['application/json'])
194
+ if !content_type.nil?
195
+ header_params['Content-Type'] = content_type
196
+ end
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] || @api_client.object_to_http_body(hermoso_tag_install)
204
+
205
+ # return_type
206
+ return_type = opts[:debug_return_type] || 'HermosoTagInstallResult'
207
+
208
+ # auth_names
209
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
210
+
211
+ new_options = opts.merge(
212
+ :operation => :"TagApi.install_tag",
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(:POST, local_var_path, new_options)
222
+ if @api_client.config.debugging
223
+ @api_client.config.logger.debug "API called: TagApi#install_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
224
+ end
225
+ return data, status_code, headers
226
+ end
227
+
228
+ # Visitor segments from the tag
229
+ # The brand’s segments of website visitors seen by the tag, each with how many match now, how many are identified (the site gave an email or phone) and how many allowed ad use, plus its past syncs. Free.
230
+ # @param [Hash] opts the optional parameters
231
+ # @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.
232
+ # @return [HermosoTagAudiences]
233
+ def list_tag_audiences(opts = {})
234
+ data, _status_code, _headers = list_tag_audiences_with_http_info(opts)
235
+ data
236
+ end
237
+
238
+ # Visitor segments from the tag
239
+ # The brand’s segments of website visitors seen by the tag, each with how many match now, how many are identified (the site gave an email or phone) and how many allowed ad use, plus its past syncs. Free.
240
+ # @param [Hash] opts the optional parameters
241
+ # @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.
242
+ # @return [Array<(HermosoTagAudiences, Integer, Hash)>] HermosoTagAudiences data, response status code and response headers
243
+ def list_tag_audiences_with_http_info(opts = {})
244
+ if @api_client.config.debugging
245
+ @api_client.config.logger.debug 'Calling API: TagApi.list_tag_audiences ...'
246
+ end
247
+ # resource path
248
+ local_var_path = '/v1/tag/audiences'
249
+
250
+ # query parameters
251
+ query_params = opts[:query_params] || {}
252
+
253
+ # header parameters
254
+ header_params = opts[:header_params] || {}
255
+ # HTTP header 'Accept' (if needed)
256
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
257
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
258
+
259
+ # form parameters
260
+ form_params = opts[:form_params] || {}
261
+
262
+ # http body (model)
263
+ post_body = opts[:debug_body]
264
+
265
+ # return_type
266
+ return_type = opts[:debug_return_type] || 'HermosoTagAudiences'
267
+
268
+ # auth_names
269
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
270
+
271
+ new_options = opts.merge(
272
+ :operation => :"TagApi.list_tag_audiences",
273
+ :header_params => header_params,
274
+ :query_params => query_params,
275
+ :form_params => form_params,
276
+ :body => post_body,
277
+ :auth_names => auth_names,
278
+ :return_type => return_type
279
+ )
280
+
281
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
282
+ if @api_client.config.debugging
283
+ @api_client.config.logger.debug "API called: TagApi#list_tag_audiences\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
284
+ end
285
+ return data, status_code, headers
286
+ end
287
+
288
+ # Recent events from the tag
289
+ # The newest events the tag received (conversions by default, visits, or all), each with its page, source and medium, value, and what each ad platform answered when it was forwarded. Free.
290
+ # @param [Hash] opts the optional parameters
291
+ # @option opts [String] :kind conversions (default), visits or all.
292
+ # @option opts [String] :event_name
293
+ # @option opts [Integer] :limit 1-150, default 30.
294
+ # @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.
295
+ # @return [HermosoTagEvents]
296
+ def list_tag_events(opts = {})
297
+ data, _status_code, _headers = list_tag_events_with_http_info(opts)
298
+ data
299
+ end
300
+
301
+ # Recent events from the tag
302
+ # The newest events the tag received (conversions by default, visits, or all), each with its page, source and medium, value, and what each ad platform answered when it was forwarded. Free.
303
+ # @param [Hash] opts the optional parameters
304
+ # @option opts [String] :kind conversions (default), visits or all.
305
+ # @option opts [String] :event_name
306
+ # @option opts [Integer] :limit 1-150, default 30.
307
+ # @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.
308
+ # @return [Array<(HermosoTagEvents, Integer, Hash)>] HermosoTagEvents data, response status code and response headers
309
+ def list_tag_events_with_http_info(opts = {})
310
+ if @api_client.config.debugging
311
+ @api_client.config.logger.debug 'Calling API: TagApi.list_tag_events ...'
312
+ end
313
+ # resource path
314
+ local_var_path = '/v1/tag/events'
315
+
316
+ # query parameters
317
+ query_params = opts[:query_params] || {}
318
+ query_params[:'kind'] = opts[:'kind'] if !opts[:'kind'].nil?
319
+ query_params[:'event_name'] = opts[:'event_name'] if !opts[:'event_name'].nil?
320
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
321
+
322
+ # header parameters
323
+ header_params = opts[:header_params] || {}
324
+ # HTTP header 'Accept' (if needed)
325
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
326
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
327
+
328
+ # form parameters
329
+ form_params = opts[:form_params] || {}
330
+
331
+ # http body (model)
332
+ post_body = opts[:debug_body]
333
+
334
+ # return_type
335
+ return_type = opts[:debug_return_type] || 'HermosoTagEvents'
336
+
337
+ # auth_names
338
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
339
+
340
+ new_options = opts.merge(
341
+ :operation => :"TagApi.list_tag_events",
342
+ :header_params => header_params,
343
+ :query_params => query_params,
344
+ :form_params => form_params,
345
+ :body => post_body,
346
+ :auth_names => auth_names,
347
+ :return_type => return_type
348
+ )
349
+
350
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
351
+ if @api_client.config.debugging
352
+ @api_client.config.logger.debug "API called: TagApi#list_tag_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
353
+ end
354
+ return data, status_code, headers
355
+ end
356
+
357
+ # Send server-side events into the tag
358
+ # Conversions the browser never saw (a renewal, a phone order, a payment confirmed after the page closed), in the `POST /v1/events` shape: `events: [{ event_name, event_id, value, currency, user: { email, phone, external_id, visitor_id }, source_url }]`, 1 to 500. Send the SAME `event_id` the browser sent and every platform counts one sale. Forwarded to the brand’s event destinations and counted in the tag’s report like the browser’s. Free.
359
+ # @param hermoso_tag_events_send [HermosoTagEventsSend]
360
+ # @param [Hash] opts the optional parameters
361
+ # @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.
362
+ # @return [HermosoTagEventsSent]
363
+ def send_tag_events(hermoso_tag_events_send, opts = {})
364
+ data, _status_code, _headers = send_tag_events_with_http_info(hermoso_tag_events_send, opts)
365
+ data
366
+ end
367
+
368
+ # Send server-side events into the tag
369
+ # Conversions the browser never saw (a renewal, a phone order, a payment confirmed after the page closed), in the &#x60;POST /v1/events&#x60; shape: &#x60;events: [{ event_name, event_id, value, currency, user: { email, phone, external_id, visitor_id }, source_url }]&#x60;, 1 to 500. Send the SAME &#x60;event_id&#x60; the browser sent and every platform counts one sale. Forwarded to the brand’s event destinations and counted in the tag’s report like the browser’s. Free.
370
+ # @param hermoso_tag_events_send [HermosoTagEventsSend]
371
+ # @param [Hash] opts the optional parameters
372
+ # @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.
373
+ # @return [Array<(HermosoTagEventsSent, Integer, Hash)>] HermosoTagEventsSent data, response status code and response headers
374
+ def send_tag_events_with_http_info(hermoso_tag_events_send, opts = {})
375
+ if @api_client.config.debugging
376
+ @api_client.config.logger.debug 'Calling API: TagApi.send_tag_events ...'
377
+ end
378
+ # verify the required parameter 'hermoso_tag_events_send' is set
379
+ if @api_client.config.client_side_validation && hermoso_tag_events_send.nil?
380
+ fail ArgumentError, "Missing the required parameter 'hermoso_tag_events_send' when calling TagApi.send_tag_events"
381
+ end
382
+ # resource path
383
+ local_var_path = '/v1/tag/events'
384
+
385
+ # query parameters
386
+ query_params = opts[:query_params] || {}
387
+
388
+ # header parameters
389
+ header_params = opts[:header_params] || {}
390
+ # HTTP header 'Accept' (if needed)
391
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
392
+ # HTTP header 'Content-Type'
393
+ content_type = @api_client.select_header_content_type(['application/json'])
394
+ if !content_type.nil?
395
+ header_params['Content-Type'] = content_type
396
+ end
397
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
398
+
399
+ # form parameters
400
+ form_params = opts[:form_params] || {}
401
+
402
+ # http body (model)
403
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(hermoso_tag_events_send)
404
+
405
+ # return_type
406
+ return_type = opts[:debug_return_type] || 'HermosoTagEventsSent'
407
+
408
+ # auth_names
409
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
410
+
411
+ new_options = opts.merge(
412
+ :operation => :"TagApi.send_tag_events",
413
+ :header_params => header_params,
414
+ :query_params => query_params,
415
+ :form_params => form_params,
416
+ :body => post_body,
417
+ :auth_names => auth_names,
418
+ :return_type => return_type
419
+ )
420
+
421
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
422
+ if @api_client.config.debugging
423
+ @api_client.config.logger.debug "API called: TagApi#send_tag_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
424
+ end
425
+ return data, status_code, headers
426
+ end
427
+
428
+ # Save, preview, delete or sync a visitor segment
429
+ # `action`: `preview` (default; counts a rule set, saves nothing), `save` (`name` and rules `visited` (page path prefixes), `events` (any of), `not_events` (none of), `within_days` 1-180; `segment_id` to edit), `delete` (`segment_id`, `confirm: true`) or `sync` (`segment_id`, `platform` meta | google_ads | snapchat_ads | pinterest_ads | x_ads, `audience_id` (Meta: omit for a new audience; `ad_account_id`), `accept_terms` for Google Customer Match, `confirm: true`). A sync sends ONLY identified visitors whose latest consent allowed ad use, as SHA-256 hashes; without `confirm` it says what it would send and sends nothing. Free.
430
+ # @param hermoso_tag_audience_action [HermosoTagAudienceAction]
431
+ # @param [Hash] opts the optional parameters
432
+ # @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.
433
+ # @return [HermosoTagAudiences]
434
+ def tag_audiences(hermoso_tag_audience_action, opts = {})
435
+ data, _status_code, _headers = tag_audiences_with_http_info(hermoso_tag_audience_action, opts)
436
+ data
437
+ end
438
+
439
+ # Save, preview, delete or sync a visitor segment
440
+ # &#x60;action&#x60;: &#x60;preview&#x60; (default; counts a rule set, saves nothing), &#x60;save&#x60; (&#x60;name&#x60; and rules &#x60;visited&#x60; (page path prefixes), &#x60;events&#x60; (any of), &#x60;not_events&#x60; (none of), &#x60;within_days&#x60; 1-180; &#x60;segment_id&#x60; to edit), &#x60;delete&#x60; (&#x60;segment_id&#x60;, &#x60;confirm: true&#x60;) or &#x60;sync&#x60; (&#x60;segment_id&#x60;, &#x60;platform&#x60; meta | google_ads | snapchat_ads | pinterest_ads | x_ads, &#x60;audience_id&#x60; (Meta: omit for a new audience; &#x60;ad_account_id&#x60;), &#x60;accept_terms&#x60; for Google Customer Match, &#x60;confirm: true&#x60;). A sync sends ONLY identified visitors whose latest consent allowed ad use, as SHA-256 hashes; without &#x60;confirm&#x60; it says what it would send and sends nothing. Free.
441
+ # @param hermoso_tag_audience_action [HermosoTagAudienceAction]
442
+ # @param [Hash] opts the optional parameters
443
+ # @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.
444
+ # @return [Array<(HermosoTagAudiences, Integer, Hash)>] HermosoTagAudiences data, response status code and response headers
445
+ def tag_audiences_with_http_info(hermoso_tag_audience_action, opts = {})
446
+ if @api_client.config.debugging
447
+ @api_client.config.logger.debug 'Calling API: TagApi.tag_audiences ...'
448
+ end
449
+ # verify the required parameter 'hermoso_tag_audience_action' is set
450
+ if @api_client.config.client_side_validation && hermoso_tag_audience_action.nil?
451
+ fail ArgumentError, "Missing the required parameter 'hermoso_tag_audience_action' when calling TagApi.tag_audiences"
452
+ end
453
+ # resource path
454
+ local_var_path = '/v1/tag/audiences'
455
+
456
+ # query parameters
457
+ query_params = opts[:query_params] || {}
458
+
459
+ # header parameters
460
+ header_params = opts[:header_params] || {}
461
+ # HTTP header 'Accept' (if needed)
462
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
463
+ # HTTP header 'Content-Type'
464
+ content_type = @api_client.select_header_content_type(['application/json'])
465
+ if !content_type.nil?
466
+ header_params['Content-Type'] = content_type
467
+ end
468
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
469
+
470
+ # form parameters
471
+ form_params = opts[:form_params] || {}
472
+
473
+ # http body (model)
474
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(hermoso_tag_audience_action)
475
+
476
+ # return_type
477
+ return_type = opts[:debug_return_type] || 'HermosoTagAudiences'
478
+
479
+ # auth_names
480
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
481
+
482
+ new_options = opts.merge(
483
+ :operation => :"TagApi.tag_audiences",
484
+ :header_params => header_params,
485
+ :query_params => query_params,
486
+ :form_params => form_params,
487
+ :body => post_body,
488
+ :auth_names => auth_names,
489
+ :return_type => return_type
490
+ )
491
+
492
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
493
+ if @api_client.config.debugging
494
+ @api_client.config.logger.debug "API called: TagApi#tag_audiences\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
495
+ end
496
+ return data, status_code, headers
497
+ end
498
+
499
+ # Change the tag’s settings, or verify it on the site
500
+ # `action: \"update\"` (default) sets any of `consent_default` (granted | denied), `wait_for_consent`, `honor_gpc`, `honor_dnt`, `forward`, `forward_events`, `allowed_domains`, `spa`, `test_mode` (\"validate\", a TikTok / Reddit test code, or \"off\") and `conversions` (the brand’s own events counted as conversions: `{\"quote_requested\": {\"as\": \"Lead\"}}`). `action: \"verify\"` reads the site (`url`, default the brand’s website) for the snippet and reports the last event seen. Also `auto_track` ({forms, outbound, downloads, scroll}) and `link_domains` (cross-domain). `action: \"server_key\"` returns a new server key ONCE for `POST /htag/s` (a backend’s own endpoint, Authorization: Bearer htsk_…); `action: \"stripe\"` with `signing_secret` (whsec_…) turns a Stripe webhook into Purchases through the tag. Free.
501
+ # @param hermoso_tag_update [HermosoTagUpdate]
502
+ # @param [Hash] opts the optional parameters
503
+ # @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.
504
+ # @return [HermosoTag]
505
+ def update_tag(hermoso_tag_update, opts = {})
506
+ data, _status_code, _headers = update_tag_with_http_info(hermoso_tag_update, opts)
507
+ data
508
+ end
509
+
510
+ # Change the tag’s settings, or verify it on the site
511
+ # &#x60;action: \&quot;update\&quot;&#x60; (default) sets any of &#x60;consent_default&#x60; (granted | denied), &#x60;wait_for_consent&#x60;, &#x60;honor_gpc&#x60;, &#x60;honor_dnt&#x60;, &#x60;forward&#x60;, &#x60;forward_events&#x60;, &#x60;allowed_domains&#x60;, &#x60;spa&#x60;, &#x60;test_mode&#x60; (\&quot;validate\&quot;, a TikTok / Reddit test code, or \&quot;off\&quot;) and &#x60;conversions&#x60; (the brand’s own events counted as conversions: &#x60;{\&quot;quote_requested\&quot;: {\&quot;as\&quot;: \&quot;Lead\&quot;}}&#x60;). &#x60;action: \&quot;verify\&quot;&#x60; reads the site (&#x60;url&#x60;, default the brand’s website) for the snippet and reports the last event seen. Also &#x60;auto_track&#x60; ({forms, outbound, downloads, scroll}) and &#x60;link_domains&#x60; (cross-domain). &#x60;action: \&quot;server_key\&quot;&#x60; returns a new server key ONCE for &#x60;POST /htag/s&#x60; (a backend’s own endpoint, Authorization: Bearer htsk_…); &#x60;action: \&quot;stripe\&quot;&#x60; with &#x60;signing_secret&#x60; (whsec_…) turns a Stripe webhook into Purchases through the tag. Free.
512
+ # @param hermoso_tag_update [HermosoTagUpdate]
513
+ # @param [Hash] opts the optional parameters
514
+ # @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.
515
+ # @return [Array<(HermosoTag, Integer, Hash)>] HermosoTag data, response status code and response headers
516
+ def update_tag_with_http_info(hermoso_tag_update, opts = {})
517
+ if @api_client.config.debugging
518
+ @api_client.config.logger.debug 'Calling API: TagApi.update_tag ...'
519
+ end
520
+ # verify the required parameter 'hermoso_tag_update' is set
521
+ if @api_client.config.client_side_validation && hermoso_tag_update.nil?
522
+ fail ArgumentError, "Missing the required parameter 'hermoso_tag_update' when calling TagApi.update_tag"
523
+ end
524
+ # resource path
525
+ local_var_path = '/v1/tag'
526
+
527
+ # query parameters
528
+ query_params = opts[:query_params] || {}
529
+
530
+ # header parameters
531
+ header_params = opts[:header_params] || {}
532
+ # HTTP header 'Accept' (if needed)
533
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
534
+ # HTTP header 'Content-Type'
535
+ content_type = @api_client.select_header_content_type(['application/json'])
536
+ if !content_type.nil?
537
+ header_params['Content-Type'] = content_type
538
+ end
539
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
540
+
541
+ # form parameters
542
+ form_params = opts[:form_params] || {}
543
+
544
+ # http body (model)
545
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(hermoso_tag_update)
546
+
547
+ # return_type
548
+ return_type = opts[:debug_return_type] || 'HermosoTag'
549
+
550
+ # auth_names
551
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
552
+
553
+ new_options = opts.merge(
554
+ :operation => :"TagApi.update_tag",
555
+ :header_params => header_params,
556
+ :query_params => query_params,
557
+ :form_params => form_params,
558
+ :body => post_body,
559
+ :auth_names => auth_names,
560
+ :return_type => return_type
561
+ )
562
+
563
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
564
+ if @api_client.config.debugging
565
+ @api_client.config.logger.debug "API called: TagApi#update_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
566
+ end
567
+ return data, status_code, headers
568
+ end
569
+ end
570
+ end