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,932 @@
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 EventsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Add an event destination
23
+ # One platform destination: `platform` plus its ids (see `platforms` on GET). Meta pixels, Amazon profiles and LinkedIn rules are checked against the brand’s own account now; others on the first send. A ChatGPT Ads `api_key` is stored encrypted and never returned. LinkedIn and Microsoft need `event_names`. Google Ads is refused by name: Google no longer takes uploads from new integrations.
24
+ # @param conversion_destination_create [ConversionDestinationCreate]
25
+ # @param [Hash] opts the optional parameters
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 [ConversionDestinationResult]
28
+ def create_conversion_destination(conversion_destination_create, opts = {})
29
+ data, _status_code, _headers = create_conversion_destination_with_http_info(conversion_destination_create, opts)
30
+ data
31
+ end
32
+
33
+ # Add an event destination
34
+ # One platform destination: `platform` plus its ids (see `platforms` on GET). Meta pixels, Amazon profiles and LinkedIn rules are checked against the brand’s own account now; others on the first send. A ChatGPT Ads `api_key` is stored encrypted and never returned. LinkedIn and Microsoft need `event_names`. Google Ads is refused by name: Google no longer takes uploads from new integrations.
35
+ # @param conversion_destination_create [ConversionDestinationCreate]
36
+ # @param [Hash] opts the optional parameters
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<(ConversionDestinationResult, Integer, Hash)>] ConversionDestinationResult data, response status code and response headers
39
+ def create_conversion_destination_with_http_info(conversion_destination_create, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: EventsApi.create_conversion_destination ...'
42
+ end
43
+ # verify the required parameter 'conversion_destination_create' is set
44
+ if @api_client.config.client_side_validation && conversion_destination_create.nil?
45
+ fail ArgumentError, "Missing the required parameter 'conversion_destination_create' when calling EventsApi.create_conversion_destination"
46
+ end
47
+ # resource path
48
+ local_var_path = '/v1/events/destinations'
49
+
50
+ # query parameters
51
+ query_params = opts[:query_params] || {}
52
+
53
+ # header parameters
54
+ header_params = opts[:header_params] || {}
55
+ # HTTP header 'Accept' (if needed)
56
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
57
+ # HTTP header 'Content-Type'
58
+ content_type = @api_client.select_header_content_type(['application/json'])
59
+ if !content_type.nil?
60
+ header_params['Content-Type'] = content_type
61
+ end
62
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
63
+
64
+ # form parameters
65
+ form_params = opts[:form_params] || {}
66
+
67
+ # http body (model)
68
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(conversion_destination_create)
69
+
70
+ # return_type
71
+ return_type = opts[:debug_return_type] || 'ConversionDestinationResult'
72
+
73
+ # auth_names
74
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
75
+
76
+ new_options = opts.merge(
77
+ :operation => :"EventsApi.create_conversion_destination",
78
+ :header_params => header_params,
79
+ :query_params => query_params,
80
+ :form_params => form_params,
81
+ :body => post_body,
82
+ :auth_names => auth_names,
83
+ :return_type => return_type
84
+ )
85
+
86
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
87
+ if @api_client.config.debugging
88
+ @api_client.config.logger.debug "API called: EventsApi#create_conversion_destination\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
89
+ end
90
+ return data, status_code, headers
91
+ end
92
+
93
+ # Remove an event destination
94
+ # Events already sent stay on that platform.
95
+ # @param id [String]
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 [ConversionDestinationResult]
99
+ def delete_conversion_destination(id, opts = {})
100
+ data, _status_code, _headers = delete_conversion_destination_with_http_info(id, opts)
101
+ data
102
+ end
103
+
104
+ # Remove an event destination
105
+ # Events already sent stay on that platform.
106
+ # @param id [String]
107
+ # @param [Hash] opts the optional parameters
108
+ # @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.
109
+ # @return [Array<(ConversionDestinationResult, Integer, Hash)>] ConversionDestinationResult data, response status code and response headers
110
+ def delete_conversion_destination_with_http_info(id, opts = {})
111
+ if @api_client.config.debugging
112
+ @api_client.config.logger.debug 'Calling API: EventsApi.delete_conversion_destination ...'
113
+ end
114
+ # verify the required parameter 'id' is set
115
+ if @api_client.config.client_side_validation && id.nil?
116
+ fail ArgumentError, "Missing the required parameter 'id' when calling EventsApi.delete_conversion_destination"
117
+ end
118
+ # resource path
119
+ local_var_path = '/v1/events/destinations/{id}'.sub('{id}', CGI.escape(id.to_s))
120
+
121
+ # query parameters
122
+ query_params = opts[:query_params] || {}
123
+
124
+ # header parameters
125
+ header_params = opts[:header_params] || {}
126
+ # HTTP header 'Accept' (if needed)
127
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
128
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
129
+
130
+ # form parameters
131
+ form_params = opts[:form_params] || {}
132
+
133
+ # http body (model)
134
+ post_body = opts[:debug_body]
135
+
136
+ # return_type
137
+ return_type = opts[:debug_return_type] || 'ConversionDestinationResult'
138
+
139
+ # auth_names
140
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
141
+
142
+ new_options = opts.merge(
143
+ :operation => :"EventsApi.delete_conversion_destination",
144
+ :header_params => header_params,
145
+ :query_params => query_params,
146
+ :form_params => form_params,
147
+ :body => post_body,
148
+ :auth_names => auth_names,
149
+ :return_type => return_type
150
+ )
151
+
152
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
153
+ if @api_client.config.debugging
154
+ @api_client.config.logger.debug "API called: EventsApi#delete_conversion_destination\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
155
+ end
156
+ return data, status_code, headers
157
+ end
158
+
159
+ # Delivery accuracy per destination
160
+ # Per destination over the window: real sales, how many were sent, accepted, failed or never sent (with the reasons), and how many events carried an identifier the platform matches on.
161
+ # @param [Hash] opts the optional parameters
162
+ # @option opts [String] :from
163
+ # @option opts [String] :to
164
+ # @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.
165
+ # @return [ConversionInsights]
166
+ def get_conversion_accuracy(opts = {})
167
+ data, _status_code, _headers = get_conversion_accuracy_with_http_info(opts)
168
+ data
169
+ end
170
+
171
+ # Delivery accuracy per destination
172
+ # Per destination over the window: real sales, how many were sent, accepted, failed or never sent (with the reasons), and how many events carried an identifier the platform matches on.
173
+ # @param [Hash] opts the optional parameters
174
+ # @option opts [String] :from
175
+ # @option opts [String] :to
176
+ # @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.
177
+ # @return [Array<(ConversionInsights, Integer, Hash)>] ConversionInsights data, response status code and response headers
178
+ def get_conversion_accuracy_with_http_info(opts = {})
179
+ if @api_client.config.debugging
180
+ @api_client.config.logger.debug 'Calling API: EventsApi.get_conversion_accuracy ...'
181
+ end
182
+ # resource path
183
+ local_var_path = '/v1/events/accuracy'
184
+
185
+ # query parameters
186
+ query_params = opts[:query_params] || {}
187
+ query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
188
+ query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?
189
+
190
+ # header parameters
191
+ header_params = opts[:header_params] || {}
192
+ # HTTP header 'Accept' (if needed)
193
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
194
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
195
+
196
+ # form parameters
197
+ form_params = opts[:form_params] || {}
198
+
199
+ # http body (model)
200
+ post_body = opts[:debug_body]
201
+
202
+ # return_type
203
+ return_type = opts[:debug_return_type] || 'ConversionInsights'
204
+
205
+ # auth_names
206
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
207
+
208
+ new_options = opts.merge(
209
+ :operation => :"EventsApi.get_conversion_accuracy",
210
+ :header_params => header_params,
211
+ :query_params => query_params,
212
+ :form_params => form_params,
213
+ :body => post_body,
214
+ :auth_names => auth_names,
215
+ :return_type => return_type
216
+ )
217
+
218
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
219
+ if @api_client.config.debugging
220
+ @api_client.config.logger.debug "API called: EventsApi#get_conversion_accuracy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
221
+ end
222
+ return data, status_code, headers
223
+ end
224
+
225
+ # Retrieve one stored event and its deliveries
226
+ # @param event_id [String]
227
+ # @param [Hash] opts the optional parameters
228
+ # @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.
229
+ # @return [ConversionEventList]
230
+ def get_conversion_event(event_id, opts = {})
231
+ data, _status_code, _headers = get_conversion_event_with_http_info(event_id, opts)
232
+ data
233
+ end
234
+
235
+ # Retrieve one stored event and its deliveries
236
+ # @param event_id [String]
237
+ # @param [Hash] opts the optional parameters
238
+ # @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.
239
+ # @return [Array<(ConversionEventList, Integer, Hash)>] ConversionEventList data, response status code and response headers
240
+ def get_conversion_event_with_http_info(event_id, opts = {})
241
+ if @api_client.config.debugging
242
+ @api_client.config.logger.debug 'Calling API: EventsApi.get_conversion_event ...'
243
+ end
244
+ # verify the required parameter 'event_id' is set
245
+ if @api_client.config.client_side_validation && event_id.nil?
246
+ fail ArgumentError, "Missing the required parameter 'event_id' when calling EventsApi.get_conversion_event"
247
+ end
248
+ # resource path
249
+ local_var_path = '/v1/events/{event_id}'.sub('{event_id}', CGI.escape(event_id.to_s))
250
+
251
+ # query parameters
252
+ query_params = opts[:query_params] || {}
253
+
254
+ # header parameters
255
+ header_params = opts[:header_params] || {}
256
+ # HTTP header 'Accept' (if needed)
257
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
258
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
259
+
260
+ # form parameters
261
+ form_params = opts[:form_params] || {}
262
+
263
+ # http body (model)
264
+ post_body = opts[:debug_body]
265
+
266
+ # return_type
267
+ return_type = opts[:debug_return_type] || 'ConversionEventList'
268
+
269
+ # auth_names
270
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
271
+
272
+ new_options = opts.merge(
273
+ :operation => :"EventsApi.get_conversion_event",
274
+ :header_params => header_params,
275
+ :query_params => query_params,
276
+ :form_params => form_params,
277
+ :body => post_body,
278
+ :auth_names => auth_names,
279
+ :return_type => return_type
280
+ )
281
+
282
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
283
+ if @api_client.config.debugging
284
+ @api_client.config.logger.debug "API called: EventsApi#get_conversion_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
285
+ end
286
+ return data, status_code, headers
287
+ end
288
+
289
+ # One customer’s journey
290
+ # Every touch and conversion of one person, oldest first, with lifetime value per currency. Name them by `email`, `phone`, `external_id`, `visitor_id` or a `customer` key from GET /v1/events/customers. People are tied together across events by any identifier they share.
291
+ # @param [Hash] opts the optional parameters
292
+ # @option opts [String] :customer
293
+ # @option opts [String] :email
294
+ # @option opts [String] :phone
295
+ # @option opts [String] :external_id
296
+ # @option opts [String] :visitor_id
297
+ # @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.
298
+ # @return [ConversionInsights]
299
+ def get_conversion_journey(opts = {})
300
+ data, _status_code, _headers = get_conversion_journey_with_http_info(opts)
301
+ data
302
+ end
303
+
304
+ # One customer’s journey
305
+ # Every touch and conversion of one person, oldest first, with lifetime value per currency. Name them by &#x60;email&#x60;, &#x60;phone&#x60;, &#x60;external_id&#x60;, &#x60;visitor_id&#x60; or a &#x60;customer&#x60; key from GET /v1/events/customers. People are tied together across events by any identifier they share.
306
+ # @param [Hash] opts the optional parameters
307
+ # @option opts [String] :customer
308
+ # @option opts [String] :email
309
+ # @option opts [String] :phone
310
+ # @option opts [String] :external_id
311
+ # @option opts [String] :visitor_id
312
+ # @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.
313
+ # @return [Array<(ConversionInsights, Integer, Hash)>] ConversionInsights data, response status code and response headers
314
+ def get_conversion_journey_with_http_info(opts = {})
315
+ if @api_client.config.debugging
316
+ @api_client.config.logger.debug 'Calling API: EventsApi.get_conversion_journey ...'
317
+ end
318
+ # resource path
319
+ local_var_path = '/v1/events/journey'
320
+
321
+ # query parameters
322
+ query_params = opts[:query_params] || {}
323
+ query_params[:'customer'] = opts[:'customer'] if !opts[:'customer'].nil?
324
+ query_params[:'email'] = opts[:'email'] if !opts[:'email'].nil?
325
+ query_params[:'phone'] = opts[:'phone'] if !opts[:'phone'].nil?
326
+ query_params[:'external_id'] = opts[:'external_id'] if !opts[:'external_id'].nil?
327
+ query_params[:'visitor_id'] = opts[:'visitor_id'] if !opts[:'visitor_id'].nil?
328
+
329
+ # header parameters
330
+ header_params = opts[:header_params] || {}
331
+ # HTTP header 'Accept' (if needed)
332
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
333
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
334
+
335
+ # form parameters
336
+ form_params = opts[:form_params] || {}
337
+
338
+ # http body (model)
339
+ post_body = opts[:debug_body]
340
+
341
+ # return_type
342
+ return_type = opts[:debug_return_type] || 'ConversionInsights'
343
+
344
+ # auth_names
345
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
346
+
347
+ new_options = opts.merge(
348
+ :operation => :"EventsApi.get_conversion_journey",
349
+ :header_params => header_params,
350
+ :query_params => query_params,
351
+ :form_params => form_params,
352
+ :body => post_body,
353
+ :auth_names => auth_names,
354
+ :return_type => return_type
355
+ )
356
+
357
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
358
+ if @api_client.config.debugging
359
+ @api_client.config.logger.debug "API called: EventsApi#get_conversion_journey\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
360
+ end
361
+ return data, status_code, headers
362
+ end
363
+
364
+ # Buyer cohorts by first purchase month and first channel
365
+ # Cumulative revenue at months 0, 1, 3, 6 and 12 after the first purchase, per currency. A month not reached yet is null.
366
+ # @param [Hash] opts the optional parameters
367
+ # @option opts [String] :from_month YYYY-MM
368
+ # @option opts [String] :to_month YYYY-MM
369
+ # @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.
370
+ # @return [ConversionInsights]
371
+ def get_conversion_ltv(opts = {})
372
+ data, _status_code, _headers = get_conversion_ltv_with_http_info(opts)
373
+ data
374
+ end
375
+
376
+ # Buyer cohorts by first purchase month and first channel
377
+ # Cumulative revenue at months 0, 1, 3, 6 and 12 after the first purchase, per currency. A month not reached yet is null.
378
+ # @param [Hash] opts the optional parameters
379
+ # @option opts [String] :from_month YYYY-MM
380
+ # @option opts [String] :to_month YYYY-MM
381
+ # @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.
382
+ # @return [Array<(ConversionInsights, Integer, Hash)>] ConversionInsights data, response status code and response headers
383
+ def get_conversion_ltv_with_http_info(opts = {})
384
+ if @api_client.config.debugging
385
+ @api_client.config.logger.debug 'Calling API: EventsApi.get_conversion_ltv ...'
386
+ end
387
+ # resource path
388
+ local_var_path = '/v1/events/ltv'
389
+
390
+ # query parameters
391
+ query_params = opts[:query_params] || {}
392
+ query_params[:'from_month'] = opts[:'from_month'] if !opts[:'from_month'].nil?
393
+ query_params[:'to_month'] = opts[:'to_month'] if !opts[:'to_month'].nil?
394
+
395
+ # header parameters
396
+ header_params = opts[:header_params] || {}
397
+ # HTTP header 'Accept' (if needed)
398
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
399
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
400
+
401
+ # form parameters
402
+ form_params = opts[:form_params] || {}
403
+
404
+ # http body (model)
405
+ post_body = opts[:debug_body]
406
+
407
+ # return_type
408
+ return_type = opts[:debug_return_type] || 'ConversionInsights'
409
+
410
+ # auth_names
411
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
412
+
413
+ new_options = opts.merge(
414
+ :operation => :"EventsApi.get_conversion_ltv",
415
+ :header_params => header_params,
416
+ :query_params => query_params,
417
+ :form_params => form_params,
418
+ :body => post_body,
419
+ :auth_names => auth_names,
420
+ :return_type => return_type
421
+ )
422
+
423
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
424
+ if @api_client.config.debugging
425
+ @api_client.config.logger.debug "API called: EventsApi#get_conversion_ltv\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
426
+ end
427
+ return data, status_code, headers
428
+ end
429
+
430
+ # Customers who converted
431
+ # Everyone with a conversion in the window, most valuable first, with their touch path and lifetime value.
432
+ # @param [Hash] opts the optional parameters
433
+ # @option opts [String] :from
434
+ # @option opts [String] :to
435
+ # @option opts [Integer] :limit
436
+ # @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.
437
+ # @return [ConversionInsights]
438
+ def list_conversion_customers(opts = {})
439
+ data, _status_code, _headers = list_conversion_customers_with_http_info(opts)
440
+ data
441
+ end
442
+
443
+ # Customers who converted
444
+ # Everyone with a conversion in the window, most valuable first, with their touch path and lifetime value.
445
+ # @param [Hash] opts the optional parameters
446
+ # @option opts [String] :from
447
+ # @option opts [String] :to
448
+ # @option opts [Integer] :limit
449
+ # @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.
450
+ # @return [Array<(ConversionInsights, Integer, Hash)>] ConversionInsights data, response status code and response headers
451
+ def list_conversion_customers_with_http_info(opts = {})
452
+ if @api_client.config.debugging
453
+ @api_client.config.logger.debug 'Calling API: EventsApi.list_conversion_customers ...'
454
+ end
455
+ # resource path
456
+ local_var_path = '/v1/events/customers'
457
+
458
+ # query parameters
459
+ query_params = opts[:query_params] || {}
460
+ query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
461
+ query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?
462
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
463
+
464
+ # header parameters
465
+ header_params = opts[:header_params] || {}
466
+ # HTTP header 'Accept' (if needed)
467
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
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]
475
+
476
+ # return_type
477
+ return_type = opts[:debug_return_type] || 'ConversionInsights'
478
+
479
+ # auth_names
480
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
481
+
482
+ new_options = opts.merge(
483
+ :operation => :"EventsApi.list_conversion_customers",
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(:GET, local_var_path, new_options)
493
+ if @api_client.config.debugging
494
+ @api_client.config.logger.debug "API called: EventsApi#list_conversion_customers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
495
+ end
496
+ return data, status_code, headers
497
+ end
498
+
499
+ # List event destinations
500
+ # The ad platform conversions APIs events go to, and for each platform what a destination needs, its test mode and its dedup key.
501
+ # @param [Hash] opts the optional parameters
502
+ # @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.
503
+ # @return [ConversionDestinationList]
504
+ def list_conversion_destinations(opts = {})
505
+ data, _status_code, _headers = list_conversion_destinations_with_http_info(opts)
506
+ data
507
+ end
508
+
509
+ # List event destinations
510
+ # The ad platform conversions APIs events go to, and for each platform what a destination needs, its test mode and its dedup key.
511
+ # @param [Hash] opts the optional parameters
512
+ # @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.
513
+ # @return [Array<(ConversionDestinationList, Integer, Hash)>] ConversionDestinationList data, response status code and response headers
514
+ def list_conversion_destinations_with_http_info(opts = {})
515
+ if @api_client.config.debugging
516
+ @api_client.config.logger.debug 'Calling API: EventsApi.list_conversion_destinations ...'
517
+ end
518
+ # resource path
519
+ local_var_path = '/v1/events/destinations'
520
+
521
+ # query parameters
522
+ query_params = opts[:query_params] || {}
523
+
524
+ # header parameters
525
+ header_params = opts[:header_params] || {}
526
+ # HTTP header 'Accept' (if needed)
527
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
528
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
529
+
530
+ # form parameters
531
+ form_params = opts[:form_params] || {}
532
+
533
+ # http body (model)
534
+ post_body = opts[:debug_body]
535
+
536
+ # return_type
537
+ return_type = opts[:debug_return_type] || 'ConversionDestinationList'
538
+
539
+ # auth_names
540
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
541
+
542
+ new_options = opts.merge(
543
+ :operation => :"EventsApi.list_conversion_destinations",
544
+ :header_params => header_params,
545
+ :query_params => query_params,
546
+ :form_params => form_params,
547
+ :body => post_body,
548
+ :auth_names => auth_names,
549
+ :return_type => return_type
550
+ )
551
+
552
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
553
+ if @api_client.config.debugging
554
+ @api_client.config.logger.debug "API called: EventsApi#list_conversion_destinations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
555
+ end
556
+ return data, status_code, headers
557
+ end
558
+
559
+ # List stored conversion events
560
+ # Stored events, newest first, each with its latest delivery per platform. Identifiers are never returned, only whether each was present.
561
+ # @param [Hash] opts the optional parameters
562
+ # @option opts [String] :from YYYY-MM-DD, on the event time.
563
+ # @option opts [String] :to YYYY-MM-DD, inclusive.
564
+ # @option opts [String] :event_name Only this event name.
565
+ # @option opts [String] :source Only this source.
566
+ # @option opts [String] :platform Only events sent to this platform.
567
+ # @option opts [String] :delivery_status sent or failed.
568
+ # @option opts [String] :campaign_id Only events tied to this campaign.
569
+ # @option opts [Integer] :limit 1-200, default 50.
570
+ # @option opts [String] :cursor &#x60;next_cursor&#x60; from the previous page.
571
+ # @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.
572
+ # @return [ConversionEventList]
573
+ def list_conversion_events(opts = {})
574
+ data, _status_code, _headers = list_conversion_events_with_http_info(opts)
575
+ data
576
+ end
577
+
578
+ # List stored conversion events
579
+ # Stored events, newest first, each with its latest delivery per platform. Identifiers are never returned, only whether each was present.
580
+ # @param [Hash] opts the optional parameters
581
+ # @option opts [String] :from YYYY-MM-DD, on the event time.
582
+ # @option opts [String] :to YYYY-MM-DD, inclusive.
583
+ # @option opts [String] :event_name Only this event name.
584
+ # @option opts [String] :source Only this source.
585
+ # @option opts [String] :platform Only events sent to this platform.
586
+ # @option opts [String] :delivery_status sent or failed.
587
+ # @option opts [String] :campaign_id Only events tied to this campaign.
588
+ # @option opts [Integer] :limit 1-200, default 50.
589
+ # @option opts [String] :cursor &#x60;next_cursor&#x60; from the previous page.
590
+ # @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.
591
+ # @return [Array<(ConversionEventList, Integer, Hash)>] ConversionEventList data, response status code and response headers
592
+ def list_conversion_events_with_http_info(opts = {})
593
+ if @api_client.config.debugging
594
+ @api_client.config.logger.debug 'Calling API: EventsApi.list_conversion_events ...'
595
+ end
596
+ # resource path
597
+ local_var_path = '/v1/events'
598
+
599
+ # query parameters
600
+ query_params = opts[:query_params] || {}
601
+ query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
602
+ query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?
603
+ query_params[:'event_name'] = opts[:'event_name'] if !opts[:'event_name'].nil?
604
+ query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?
605
+ query_params[:'platform'] = opts[:'platform'] if !opts[:'platform'].nil?
606
+ query_params[:'delivery_status'] = opts[:'delivery_status'] if !opts[:'delivery_status'].nil?
607
+ query_params[:'campaign_id'] = opts[:'campaign_id'] if !opts[:'campaign_id'].nil?
608
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
609
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
610
+
611
+ # header parameters
612
+ header_params = opts[:header_params] || {}
613
+ # HTTP header 'Accept' (if needed)
614
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
615
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
616
+
617
+ # form parameters
618
+ form_params = opts[:form_params] || {}
619
+
620
+ # http body (model)
621
+ post_body = opts[:debug_body]
622
+
623
+ # return_type
624
+ return_type = opts[:debug_return_type] || 'ConversionEventList'
625
+
626
+ # auth_names
627
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
628
+
629
+ new_options = opts.merge(
630
+ :operation => :"EventsApi.list_conversion_events",
631
+ :header_params => header_params,
632
+ :query_params => query_params,
633
+ :form_params => form_params,
634
+ :body => post_body,
635
+ :auth_names => auth_names,
636
+ :return_type => return_type
637
+ )
638
+
639
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
640
+ if @api_client.config.debugging
641
+ @api_client.config.logger.debug "API called: EventsApi#list_conversion_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
642
+ end
643
+ return data, status_code, headers
644
+ end
645
+
646
+ # Touch paths that lead to conversions
647
+ # The most frequent sequences of touches (ad clicks by platform, organic search, social, referral, email) before a conversion in the window. Only conversions with more than one touch have a path.
648
+ # @param [Hash] opts the optional parameters
649
+ # @option opts [String] :from
650
+ # @option opts [String] :to
651
+ # @option opts [Integer] :limit
652
+ # @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.
653
+ # @return [ConversionInsights]
654
+ def list_conversion_paths(opts = {})
655
+ data, _status_code, _headers = list_conversion_paths_with_http_info(opts)
656
+ data
657
+ end
658
+
659
+ # Touch paths that lead to conversions
660
+ # The most frequent sequences of touches (ad clicks by platform, organic search, social, referral, email) before a conversion in the window. Only conversions with more than one touch have a path.
661
+ # @param [Hash] opts the optional parameters
662
+ # @option opts [String] :from
663
+ # @option opts [String] :to
664
+ # @option opts [Integer] :limit
665
+ # @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.
666
+ # @return [Array<(ConversionInsights, Integer, Hash)>] ConversionInsights data, response status code and response headers
667
+ def list_conversion_paths_with_http_info(opts = {})
668
+ if @api_client.config.debugging
669
+ @api_client.config.logger.debug 'Calling API: EventsApi.list_conversion_paths ...'
670
+ end
671
+ # resource path
672
+ local_var_path = '/v1/events/paths'
673
+
674
+ # query parameters
675
+ query_params = opts[:query_params] || {}
676
+ query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
677
+ query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?
678
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
679
+
680
+ # header parameters
681
+ header_params = opts[:header_params] || {}
682
+ # HTTP header 'Accept' (if needed)
683
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
684
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
685
+
686
+ # form parameters
687
+ form_params = opts[:form_params] || {}
688
+
689
+ # http body (model)
690
+ post_body = opts[:debug_body]
691
+
692
+ # return_type
693
+ return_type = opts[:debug_return_type] || 'ConversionInsights'
694
+
695
+ # auth_names
696
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
697
+
698
+ new_options = opts.merge(
699
+ :operation => :"EventsApi.list_conversion_paths",
700
+ :header_params => header_params,
701
+ :query_params => query_params,
702
+ :form_params => form_params,
703
+ :body => post_body,
704
+ :auth_names => auth_names,
705
+ :return_type => return_type
706
+ )
707
+
708
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
709
+ if @api_client.config.debugging
710
+ @api_client.config.logger.debug "API called: EventsApi#list_conversion_paths\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
711
+ end
712
+ return data, status_code, headers
713
+ end
714
+
715
+ # Retract a stored event
716
+ # Removes it from Hermoso’s records (journeys, LTV, profit). No conversions API deletes a sent conversion, so the platforms keep it.
717
+ # @param event_id [String]
718
+ # @param [Hash] opts the optional parameters
719
+ # @option opts [String] :event_name Which copy, when one id was stored under two names.
720
+ # @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.
721
+ # @return [ConversionEventList]
722
+ def retract_conversion_event(event_id, opts = {})
723
+ data, _status_code, _headers = retract_conversion_event_with_http_info(event_id, opts)
724
+ data
725
+ end
726
+
727
+ # Retract a stored event
728
+ # Removes it from Hermoso’s records (journeys, LTV, profit). No conversions API deletes a sent conversion, so the platforms keep it.
729
+ # @param event_id [String]
730
+ # @param [Hash] opts the optional parameters
731
+ # @option opts [String] :event_name Which copy, when one id was stored under two names.
732
+ # @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.
733
+ # @return [Array<(ConversionEventList, Integer, Hash)>] ConversionEventList data, response status code and response headers
734
+ def retract_conversion_event_with_http_info(event_id, opts = {})
735
+ if @api_client.config.debugging
736
+ @api_client.config.logger.debug 'Calling API: EventsApi.retract_conversion_event ...'
737
+ end
738
+ # verify the required parameter 'event_id' is set
739
+ if @api_client.config.client_side_validation && event_id.nil?
740
+ fail ArgumentError, "Missing the required parameter 'event_id' when calling EventsApi.retract_conversion_event"
741
+ end
742
+ # resource path
743
+ local_var_path = '/v1/events/{event_id}'.sub('{event_id}', CGI.escape(event_id.to_s))
744
+
745
+ # query parameters
746
+ query_params = opts[:query_params] || {}
747
+ query_params[:'event_name'] = opts[:'event_name'] if !opts[:'event_name'].nil?
748
+
749
+ # header parameters
750
+ header_params = opts[:header_params] || {}
751
+ # HTTP header 'Accept' (if needed)
752
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
753
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
754
+
755
+ # form parameters
756
+ form_params = opts[:form_params] || {}
757
+
758
+ # http body (model)
759
+ post_body = opts[:debug_body]
760
+
761
+ # return_type
762
+ return_type = opts[:debug_return_type] || 'ConversionEventList'
763
+
764
+ # auth_names
765
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
766
+
767
+ new_options = opts.merge(
768
+ :operation => :"EventsApi.retract_conversion_event",
769
+ :header_params => header_params,
770
+ :query_params => query_params,
771
+ :form_params => form_params,
772
+ :body => post_body,
773
+ :auth_names => auth_names,
774
+ :return_type => return_type
775
+ )
776
+
777
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
778
+ if @api_client.config.debugging
779
+ @api_client.config.logger.debug "API called: EventsApi#retract_conversion_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
780
+ end
781
+ return data, status_code, headers
782
+ end
783
+
784
+ # Send conversion events to every destination
785
+ # Sends each event ONCE to every ad platform conversions API saved for the brand (GET /v1/events/destinations), or to the `destinations` given. Plain identifiers in, hashed per platform on our server; every platform gets the same `event_id` as its dedup key. Each destination reports on its own, read back from the platform. `validate_only` / `test_code` is a dry run that reaches only platforms with a mode that records nothing and skips the rest by name (never Meta, which keeps test events). `forward: false` stores events (page views, touches) without sending them. Non-test events are stored with identifiers hashed. Free.
786
+ # @param conversion_events_send [ConversionEventsSend]
787
+ # @param [Hash] opts the optional parameters
788
+ # @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.
789
+ # @return [ConversionSendResult]
790
+ def send_conversion_events(conversion_events_send, opts = {})
791
+ data, _status_code, _headers = send_conversion_events_with_http_info(conversion_events_send, opts)
792
+ data
793
+ end
794
+
795
+ # Send conversion events to every destination
796
+ # Sends each event ONCE to every ad platform conversions API saved for the brand (GET /v1/events/destinations), or to the &#x60;destinations&#x60; given. Plain identifiers in, hashed per platform on our server; every platform gets the same &#x60;event_id&#x60; as its dedup key. Each destination reports on its own, read back from the platform. &#x60;validate_only&#x60; / &#x60;test_code&#x60; is a dry run that reaches only platforms with a mode that records nothing and skips the rest by name (never Meta, which keeps test events). &#x60;forward: false&#x60; stores events (page views, touches) without sending them. Non-test events are stored with identifiers hashed. Free.
797
+ # @param conversion_events_send [ConversionEventsSend]
798
+ # @param [Hash] opts the optional parameters
799
+ # @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.
800
+ # @return [Array<(ConversionSendResult, Integer, Hash)>] ConversionSendResult data, response status code and response headers
801
+ def send_conversion_events_with_http_info(conversion_events_send, opts = {})
802
+ if @api_client.config.debugging
803
+ @api_client.config.logger.debug 'Calling API: EventsApi.send_conversion_events ...'
804
+ end
805
+ # verify the required parameter 'conversion_events_send' is set
806
+ if @api_client.config.client_side_validation && conversion_events_send.nil?
807
+ fail ArgumentError, "Missing the required parameter 'conversion_events_send' when calling EventsApi.send_conversion_events"
808
+ end
809
+ # resource path
810
+ local_var_path = '/v1/events'
811
+
812
+ # query parameters
813
+ query_params = opts[:query_params] || {}
814
+
815
+ # header parameters
816
+ header_params = opts[:header_params] || {}
817
+ # HTTP header 'Accept' (if needed)
818
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
819
+ # HTTP header 'Content-Type'
820
+ content_type = @api_client.select_header_content_type(['application/json'])
821
+ if !content_type.nil?
822
+ header_params['Content-Type'] = content_type
823
+ end
824
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
825
+
826
+ # form parameters
827
+ form_params = opts[:form_params] || {}
828
+
829
+ # http body (model)
830
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(conversion_events_send)
831
+
832
+ # return_type
833
+ return_type = opts[:debug_return_type] || 'ConversionSendResult'
834
+
835
+ # auth_names
836
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
837
+
838
+ new_options = opts.merge(
839
+ :operation => :"EventsApi.send_conversion_events",
840
+ :header_params => header_params,
841
+ :query_params => query_params,
842
+ :form_params => form_params,
843
+ :body => post_body,
844
+ :auth_names => auth_names,
845
+ :return_type => return_type
846
+ )
847
+
848
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
849
+ if @api_client.config.debugging
850
+ @api_client.config.logger.debug "API called: EventsApi#send_conversion_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
851
+ end
852
+ return data, status_code, headers
853
+ end
854
+
855
+ # Change a stored event’s value
856
+ # For journeys, LTV and profit. The ad platforms keep the value they were sent; send the event again with the same `event_id` to correct it there.
857
+ # @param event_id [String]
858
+ # @param conversion_event_update [ConversionEventUpdate]
859
+ # @param [Hash] opts the optional parameters
860
+ # @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.
861
+ # @return [ConversionEventList]
862
+ def update_conversion_event(event_id, conversion_event_update, opts = {})
863
+ data, _status_code, _headers = update_conversion_event_with_http_info(event_id, conversion_event_update, opts)
864
+ data
865
+ end
866
+
867
+ # Change a stored event’s value
868
+ # For journeys, LTV and profit. The ad platforms keep the value they were sent; send the event again with the same &#x60;event_id&#x60; to correct it there.
869
+ # @param event_id [String]
870
+ # @param conversion_event_update [ConversionEventUpdate]
871
+ # @param [Hash] opts the optional parameters
872
+ # @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.
873
+ # @return [Array<(ConversionEventList, Integer, Hash)>] ConversionEventList data, response status code and response headers
874
+ def update_conversion_event_with_http_info(event_id, conversion_event_update, opts = {})
875
+ if @api_client.config.debugging
876
+ @api_client.config.logger.debug 'Calling API: EventsApi.update_conversion_event ...'
877
+ end
878
+ # verify the required parameter 'event_id' is set
879
+ if @api_client.config.client_side_validation && event_id.nil?
880
+ fail ArgumentError, "Missing the required parameter 'event_id' when calling EventsApi.update_conversion_event"
881
+ end
882
+ # verify the required parameter 'conversion_event_update' is set
883
+ if @api_client.config.client_side_validation && conversion_event_update.nil?
884
+ fail ArgumentError, "Missing the required parameter 'conversion_event_update' when calling EventsApi.update_conversion_event"
885
+ end
886
+ # resource path
887
+ local_var_path = '/v1/events/{event_id}'.sub('{event_id}', CGI.escape(event_id.to_s))
888
+
889
+ # query parameters
890
+ query_params = opts[:query_params] || {}
891
+
892
+ # header parameters
893
+ header_params = opts[:header_params] || {}
894
+ # HTTP header 'Accept' (if needed)
895
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
896
+ # HTTP header 'Content-Type'
897
+ content_type = @api_client.select_header_content_type(['application/json'])
898
+ if !content_type.nil?
899
+ header_params['Content-Type'] = content_type
900
+ end
901
+ header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
902
+
903
+ # form parameters
904
+ form_params = opts[:form_params] || {}
905
+
906
+ # http body (model)
907
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(conversion_event_update)
908
+
909
+ # return_type
910
+ return_type = opts[:debug_return_type] || 'ConversionEventList'
911
+
912
+ # auth_names
913
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
914
+
915
+ new_options = opts.merge(
916
+ :operation => :"EventsApi.update_conversion_event",
917
+ :header_params => header_params,
918
+ :query_params => query_params,
919
+ :form_params => form_params,
920
+ :body => post_body,
921
+ :auth_names => auth_names,
922
+ :return_type => return_type
923
+ )
924
+
925
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
926
+ if @api_client.config.debugging
927
+ @api_client.config.logger.debug "API called: EventsApi#update_conversion_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
928
+ end
929
+ return data, status_code, headers
930
+ end
931
+ end
932
+ end