hermoso 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +53 -0
- data/lib/hermoso/api/account_api.rb +156 -0
- data/lib/hermoso/api/analytics_api.rb +400 -0
- data/lib/hermoso/api/brands_api.rb +82 -0
- data/lib/hermoso/api/campaign_profit_api.rb +103 -0
- data/lib/hermoso/api/campaign_results_api.rb +289 -0
- data/lib/hermoso/api/channels_api.rb +82 -0
- data/lib/hermoso/api/clones_api.rb +93 -0
- data/lib/hermoso/api/connect_links_api.rb +228 -0
- data/lib/hermoso/api/connect_redirects_api.rb +153 -0
- data/lib/hermoso/api/connections_api.rb +151 -0
- data/lib/hermoso/api/credits_api.rb +85 -0
- data/lib/hermoso/api/edits_api.rb +102 -0
- data/lib/hermoso/api/events_api.rb +932 -0
- data/lib/hermoso/api/generations_api.rb +173 -0
- data/lib/hermoso/api/jobs_api.rb +226 -0
- data/lib/hermoso/api/library_api.rb +88 -0
- data/lib/hermoso/api/media_api.rb +158 -0
- data/lib/hermoso/api/models_api.rb +88 -0
- data/lib/hermoso/api/posts_api.rb +377 -0
- data/lib/hermoso/api/recasts_api.rb +102 -0
- data/lib/hermoso/api/signup_api.rb +164 -0
- data/lib/hermoso/api/tag_api.rb +570 -0
- data/lib/hermoso/api/tools_api.rb +252 -0
- data/lib/hermoso/api_client.rb +441 -0
- data/lib/hermoso/api_error.rb +58 -0
- data/lib/hermoso/api_model_base.rb +92 -0
- data/lib/hermoso/configuration.rb +400 -0
- data/lib/hermoso/helpers.rb +116 -0
- data/lib/hermoso/models/asset.rb +241 -0
- data/lib/hermoso/models/asset_list.rb +203 -0
- data/lib/hermoso/models/best_time.rb +250 -0
- data/lib/hermoso/models/best_time_slots_inner.rb +205 -0
- data/lib/hermoso/models/brand.rb +273 -0
- data/lib/hermoso/models/brand_list.rb +203 -0
- data/lib/hermoso/models/campaign_profit.rb +261 -0
- data/lib/hermoso/models/campaign_results.rb +250 -0
- data/lib/hermoso/models/campaign_results_upload.rb +171 -0
- data/lib/hermoso/models/campaign_results_upload_rows_inner.rb +259 -0
- data/lib/hermoso/models/channel.rb +326 -0
- data/lib/hermoso/models/channel_carousel.rb +188 -0
- data/lib/hermoso/models/channel_list.rb +203 -0
- data/lib/hermoso/models/clone_quote.rb +243 -0
- data/lib/hermoso/models/clone_quote_request.rb +227 -0
- data/lib/hermoso/models/clone_quote_step.rb +201 -0
- data/lib/hermoso/models/connect_link.rb +321 -0
- data/lib/hermoso/models/connect_link_account.rb +178 -0
- data/lib/hermoso/models/connect_link_create.rb +236 -0
- data/lib/hermoso/models/connect_link_error.rb +169 -0
- data/lib/hermoso/models/connect_redirects.rb +203 -0
- data/lib/hermoso/models/connect_redirects_set.rb +180 -0
- data/lib/hermoso/models/connection.rb +250 -0
- data/lib/hermoso/models/connection_accounts_inner.rb +178 -0
- data/lib/hermoso/models/connection_deleted.rb +228 -0
- data/lib/hermoso/models/connection_list.rb +203 -0
- data/lib/hermoso/models/contact_email.rb +189 -0
- data/lib/hermoso/models/contact_email_resend.rb +161 -0
- data/lib/hermoso/models/content_decay.rb +223 -0
- data/lib/hermoso/models/content_decay_buckets_inner.rb +187 -0
- data/lib/hermoso/models/conversion_destination_create.rb +317 -0
- data/lib/hermoso/models/conversion_destination_list.rb +223 -0
- data/lib/hermoso/models/conversion_destination_result.rb +221 -0
- data/lib/hermoso/models/conversion_event_list.rb +230 -0
- data/lib/hermoso/models/conversion_event_update.rb +195 -0
- data/lib/hermoso/models/conversion_events_send.rb +236 -0
- data/lib/hermoso/models/conversion_events_send_events_inner.rb +314 -0
- data/lib/hermoso/models/conversion_insights.rb +265 -0
- data/lib/hermoso/models/conversion_send_result.rb +257 -0
- data/lib/hermoso/models/conversion_send_result_destinations_inner.rb +286 -0
- data/lib/hermoso/models/credits.rb +240 -0
- data/lib/hermoso/models/credits_limits.rb +234 -0
- data/lib/hermoso/models/credits_limits_brands_inner.rb +218 -0
- data/lib/hermoso/models/credits_limits_brands_inner_members_inner.rb +196 -0
- data/lib/hermoso/models/deleted.rb +210 -0
- data/lib/hermoso/models/edit.rb +278 -0
- data/lib/hermoso/models/edit_create.rb +317 -0
- data/lib/hermoso/models/edit_preview.rb +199 -0
- data/lib/hermoso/models/edit_quote.rb +231 -0
- data/lib/hermoso/models/error.rb +198 -0
- data/lib/hermoso/models/error_error.rb +335 -0
- data/lib/hermoso/models/error_error_unknown_arguments_inner.rb +171 -0
- data/lib/hermoso/models/follower_history.rb +239 -0
- data/lib/hermoso/models/follower_history_accounts_inner.rb +207 -0
- data/lib/hermoso/models/follower_history_accounts_inner_points_inner.rb +178 -0
- data/lib/hermoso/models/follower_history_date_range.rb +169 -0
- data/lib/hermoso/models/generation_create.rb +435 -0
- data/lib/hermoso/models/generation_quote.rb +263 -0
- data/lib/hermoso/models/hermoso_tag.rb +230 -0
- data/lib/hermoso/models/hermoso_tag_audience_action.rb +325 -0
- data/lib/hermoso/models/hermoso_tag_audiences.rb +241 -0
- data/lib/hermoso/models/hermoso_tag_events.rb +223 -0
- data/lib/hermoso/models/hermoso_tag_events_send.rb +179 -0
- data/lib/hermoso/models/hermoso_tag_events_sent.rb +221 -0
- data/lib/hermoso/models/hermoso_tag_install.rb +246 -0
- data/lib/hermoso/models/hermoso_tag_install_result.rb +255 -0
- data/lib/hermoso/models/hermoso_tag_report.rb +261 -0
- data/lib/hermoso/models/hermoso_tag_tag.rb +211 -0
- data/lib/hermoso/models/hermoso_tag_update.rb +356 -0
- data/lib/hermoso/models/inbox_stats.rb +315 -0
- data/lib/hermoso/models/job.rb +359 -0
- data/lib/hermoso/models/job_cancel.rb +221 -0
- data/lib/hermoso/models/job_list.rb +232 -0
- data/lib/hermoso/models/media.rb +230 -0
- data/lib/hermoso/models/model.rb +327 -0
- data/lib/hermoso/models/model_list.rb +203 -0
- data/lib/hermoso/models/post.rb +382 -0
- data/lib/hermoso/models/post_create.rb +318 -0
- data/lib/hermoso/models/post_create_media_inner.rb +104 -0
- data/lib/hermoso/models/post_create_media_inner_one_of.rb +201 -0
- data/lib/hermoso/models/post_list.rb +221 -0
- data/lib/hermoso/models/post_media_inner.rb +169 -0
- data/lib/hermoso/models/post_results_inner.rb +205 -0
- data/lib/hermoso/models/post_results_inner_first_comment.rb +188 -0
- data/lib/hermoso/models/posting_frequency.rb +241 -0
- data/lib/hermoso/models/posting_frequency_frequency_inner.rb +205 -0
- data/lib/hermoso/models/profit_settings.rb +230 -0
- data/lib/hermoso/models/recast.rb +308 -0
- data/lib/hermoso/models/recast_create.rb +274 -0
- data/lib/hermoso/models/recast_person.rb +182 -0
- data/lib/hermoso/models/recast_quote.rb +232 -0
- data/lib/hermoso/models/recast_step.rb +201 -0
- data/lib/hermoso/models/recast_subject.rb +170 -0
- data/lib/hermoso/models/recast_voice.rb +178 -0
- data/lib/hermoso/models/recast_window.rb +179 -0
- data/lib/hermoso/models/signup.rb +329 -0
- data/lib/hermoso/models/signup_claim.rb +178 -0
- data/lib/hermoso/models/signup_create.rb +247 -0
- data/lib/hermoso/models/tool.rb +360 -0
- data/lib/hermoso/models/tool_invoke.rb +169 -0
- data/lib/hermoso/models/tool_job.rb +262 -0
- data/lib/hermoso/models/tool_list.rb +273 -0
- data/lib/hermoso/models/tool_list_areas_inner.rb +219 -0
- data/lib/hermoso/models/tool_list_search.rb +181 -0
- data/lib/hermoso/models/tool_result.rb +245 -0
- data/lib/hermoso/models/tool_result_images_inner.rb +170 -0
- data/lib/hermoso/models/warning.rb +244 -0
- data/lib/hermoso/spec.rb +8 -0
- data/lib/hermoso/version.rb +15 -0
- data/lib/hermoso.rb +174 -0
- metadata +237 -0
|
@@ -0,0 +1,82 @@
|
|
|
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 BrandsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# List profiles
|
|
23
|
+
# Every profile this key can act on (each is a business brand, a creator or a personal workspace): the account’s own, plus any another account shared with you. `id` is the value `X-Hermoso-User` takes. A shared profile also needs `X-Hermoso-Owner`, and each row’s `headers` spells out exactly what to send. `current` marks the profile THIS request resolved to. This is the one endpoint that ignores an unknown `X-Hermoso-User` instead of refusing it, because it is how you find a valid one.
|
|
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 `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.
|
|
26
|
+
# @return [BrandList]
|
|
27
|
+
def list_brands(opts = {})
|
|
28
|
+
data, _status_code, _headers = list_brands_with_http_info(opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# List profiles
|
|
33
|
+
# Every profile this key can act on (each is a business brand, a creator or a personal workspace): the account’s own, plus any another account shared with you. `id` is the value `X-Hermoso-User` takes. A shared profile also needs `X-Hermoso-Owner`, and each row’s `headers` spells out exactly what to send. `current` marks the profile THIS request resolved to. This is the one endpoint that ignores an unknown `X-Hermoso-User` instead of refusing it, because it is how you find a valid one.
|
|
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 `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.
|
|
36
|
+
# @return [Array<(BrandList, Integer, Hash)>] BrandList data, response status code and response headers
|
|
37
|
+
def list_brands_with_http_info(opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: BrandsApi.list_brands ...'
|
|
40
|
+
end
|
|
41
|
+
# resource path
|
|
42
|
+
local_var_path = '/v1/brands'
|
|
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] || 'BrandList'
|
|
61
|
+
|
|
62
|
+
# auth_names
|
|
63
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
64
|
+
|
|
65
|
+
new_options = opts.merge(
|
|
66
|
+
:operation => :"BrandsApi.list_brands",
|
|
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: BrandsApi#list_brands\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
78
|
+
end
|
|
79
|
+
return data, status_code, headers
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
@@ -0,0 +1,103 @@
|
|
|
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 CampaignProfitApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Profit per campaign
|
|
23
|
+
# Each campaign’s spend read live from every connected ad platform, joined to the brand’s sales from ONE source per campaign (uploaded results, else conversion events credited by `model`, else Shopify / Stripe orders matched by utm_campaign). Money stays per currency; a platform that could not be read is listed in `unreadable`, never shown as zero. At most 92 days.
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @option opts [String] :from
|
|
26
|
+
# @option opts [String] :to
|
|
27
|
+
# @option opts [Integer] :days
|
|
28
|
+
# @option opts [String] :platforms Comma-separated, e.g. meta,tiktok_ads.
|
|
29
|
+
# @option opts [String] :model last_click (default), first_touch, linear, position_based, time_decay.
|
|
30
|
+
# @option opts [String] :revenue_from Comma-separated: uploads, events, store.
|
|
31
|
+
# @option opts [Boolean] :include_idle
|
|
32
|
+
# @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.
|
|
33
|
+
# @return [CampaignProfit]
|
|
34
|
+
def get_campaign_profit(opts = {})
|
|
35
|
+
data, _status_code, _headers = get_campaign_profit_with_http_info(opts)
|
|
36
|
+
data
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Profit per campaign
|
|
40
|
+
# Each campaign’s spend read live from every connected ad platform, joined to the brand’s sales from ONE source per campaign (uploaded results, else conversion events credited by `model`, else Shopify / Stripe orders matched by utm_campaign). Money stays per currency; a platform that could not be read is listed in `unreadable`, never shown as zero. At most 92 days.
|
|
41
|
+
# @param [Hash] opts the optional parameters
|
|
42
|
+
# @option opts [String] :from
|
|
43
|
+
# @option opts [String] :to
|
|
44
|
+
# @option opts [Integer] :days
|
|
45
|
+
# @option opts [String] :platforms Comma-separated, e.g. meta,tiktok_ads.
|
|
46
|
+
# @option opts [String] :model last_click (default), first_touch, linear, position_based, time_decay.
|
|
47
|
+
# @option opts [String] :revenue_from Comma-separated: uploads, events, store.
|
|
48
|
+
# @option opts [Boolean] :include_idle
|
|
49
|
+
# @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.
|
|
50
|
+
# @return [Array<(CampaignProfit, Integer, Hash)>] CampaignProfit data, response status code and response headers
|
|
51
|
+
def get_campaign_profit_with_http_info(opts = {})
|
|
52
|
+
if @api_client.config.debugging
|
|
53
|
+
@api_client.config.logger.debug 'Calling API: CampaignProfitApi.get_campaign_profit ...'
|
|
54
|
+
end
|
|
55
|
+
# resource path
|
|
56
|
+
local_var_path = '/v1/campaign-profit'
|
|
57
|
+
|
|
58
|
+
# query parameters
|
|
59
|
+
query_params = opts[:query_params] || {}
|
|
60
|
+
query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
|
|
61
|
+
query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?
|
|
62
|
+
query_params[:'days'] = opts[:'days'] if !opts[:'days'].nil?
|
|
63
|
+
query_params[:'platforms'] = opts[:'platforms'] if !opts[:'platforms'].nil?
|
|
64
|
+
query_params[:'model'] = opts[:'model'] if !opts[:'model'].nil?
|
|
65
|
+
query_params[:'revenue_from'] = opts[:'revenue_from'] if !opts[:'revenue_from'].nil?
|
|
66
|
+
query_params[:'include_idle'] = opts[:'include_idle'] if !opts[:'include_idle'].nil?
|
|
67
|
+
|
|
68
|
+
# header parameters
|
|
69
|
+
header_params = opts[:header_params] || {}
|
|
70
|
+
# HTTP header 'Accept' (if needed)
|
|
71
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
72
|
+
header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
|
|
73
|
+
|
|
74
|
+
# form parameters
|
|
75
|
+
form_params = opts[:form_params] || {}
|
|
76
|
+
|
|
77
|
+
# http body (model)
|
|
78
|
+
post_body = opts[:debug_body]
|
|
79
|
+
|
|
80
|
+
# return_type
|
|
81
|
+
return_type = opts[:debug_return_type] || 'CampaignProfit'
|
|
82
|
+
|
|
83
|
+
# auth_names
|
|
84
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
85
|
+
|
|
86
|
+
new_options = opts.merge(
|
|
87
|
+
:operation => :"CampaignProfitApi.get_campaign_profit",
|
|
88
|
+
:header_params => header_params,
|
|
89
|
+
:query_params => query_params,
|
|
90
|
+
:form_params => form_params,
|
|
91
|
+
:body => post_body,
|
|
92
|
+
:auth_names => auth_names,
|
|
93
|
+
:return_type => return_type
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
97
|
+
if @api_client.config.debugging
|
|
98
|
+
@api_client.config.logger.debug "API called: CampaignProfitApi#get_campaign_profit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
99
|
+
end
|
|
100
|
+
return data, status_code, headers
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
@@ -0,0 +1,289 @@
|
|
|
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 CampaignResultsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Get your margin and cost per order
|
|
23
|
+
# @param [Hash] opts the optional parameters
|
|
24
|
+
# @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.
|
|
25
|
+
# @return [ProfitSettings]
|
|
26
|
+
def get_profit_settings(opts = {})
|
|
27
|
+
data, _status_code, _headers = get_profit_settings_with_http_info(opts)
|
|
28
|
+
data
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Get your margin and cost per order
|
|
32
|
+
# @param [Hash] opts the optional parameters
|
|
33
|
+
# @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.
|
|
34
|
+
# @return [Array<(ProfitSettings, Integer, Hash)>] ProfitSettings data, response status code and response headers
|
|
35
|
+
def get_profit_settings_with_http_info(opts = {})
|
|
36
|
+
if @api_client.config.debugging
|
|
37
|
+
@api_client.config.logger.debug 'Calling API: CampaignResultsApi.get_profit_settings ...'
|
|
38
|
+
end
|
|
39
|
+
# resource path
|
|
40
|
+
local_var_path = '/v1/campaign-results/profit-settings'
|
|
41
|
+
|
|
42
|
+
# query parameters
|
|
43
|
+
query_params = opts[:query_params] || {}
|
|
44
|
+
|
|
45
|
+
# header parameters
|
|
46
|
+
header_params = opts[:header_params] || {}
|
|
47
|
+
# HTTP header 'Accept' (if needed)
|
|
48
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
49
|
+
header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
|
|
50
|
+
|
|
51
|
+
# form parameters
|
|
52
|
+
form_params = opts[:form_params] || {}
|
|
53
|
+
|
|
54
|
+
# http body (model)
|
|
55
|
+
post_body = opts[:debug_body]
|
|
56
|
+
|
|
57
|
+
# return_type
|
|
58
|
+
return_type = opts[:debug_return_type] || 'ProfitSettings'
|
|
59
|
+
|
|
60
|
+
# auth_names
|
|
61
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
62
|
+
|
|
63
|
+
new_options = opts.merge(
|
|
64
|
+
:operation => :"CampaignResultsApi.get_profit_settings",
|
|
65
|
+
:header_params => header_params,
|
|
66
|
+
:query_params => query_params,
|
|
67
|
+
:form_params => form_params,
|
|
68
|
+
:body => post_body,
|
|
69
|
+
:auth_names => auth_names,
|
|
70
|
+
:return_type => return_type
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
74
|
+
if @api_client.config.debugging
|
|
75
|
+
@api_client.config.logger.debug "API called: CampaignResultsApi#get_profit_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
76
|
+
end
|
|
77
|
+
return data, status_code, headers
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# List uploaded results
|
|
81
|
+
# @param [Hash] opts the optional parameters
|
|
82
|
+
# @option opts [String] :from
|
|
83
|
+
# @option opts [String] :to
|
|
84
|
+
# @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.
|
|
85
|
+
# @return [CampaignResults]
|
|
86
|
+
def list_campaign_results(opts = {})
|
|
87
|
+
data, _status_code, _headers = list_campaign_results_with_http_info(opts)
|
|
88
|
+
data
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# List uploaded results
|
|
92
|
+
# @param [Hash] opts the optional parameters
|
|
93
|
+
# @option opts [String] :from
|
|
94
|
+
# @option opts [String] :to
|
|
95
|
+
# @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.
|
|
96
|
+
# @return [Array<(CampaignResults, Integer, Hash)>] CampaignResults data, response status code and response headers
|
|
97
|
+
def list_campaign_results_with_http_info(opts = {})
|
|
98
|
+
if @api_client.config.debugging
|
|
99
|
+
@api_client.config.logger.debug 'Calling API: CampaignResultsApi.list_campaign_results ...'
|
|
100
|
+
end
|
|
101
|
+
# resource path
|
|
102
|
+
local_var_path = '/v1/campaign-results'
|
|
103
|
+
|
|
104
|
+
# query parameters
|
|
105
|
+
query_params = opts[:query_params] || {}
|
|
106
|
+
query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
|
|
107
|
+
query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?
|
|
108
|
+
|
|
109
|
+
# header parameters
|
|
110
|
+
header_params = opts[:header_params] || {}
|
|
111
|
+
# HTTP header 'Accept' (if needed)
|
|
112
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
113
|
+
header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
|
|
114
|
+
|
|
115
|
+
# form parameters
|
|
116
|
+
form_params = opts[:form_params] || {}
|
|
117
|
+
|
|
118
|
+
# http body (model)
|
|
119
|
+
post_body = opts[:debug_body]
|
|
120
|
+
|
|
121
|
+
# return_type
|
|
122
|
+
return_type = opts[:debug_return_type] || 'CampaignResults'
|
|
123
|
+
|
|
124
|
+
# auth_names
|
|
125
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
126
|
+
|
|
127
|
+
new_options = opts.merge(
|
|
128
|
+
:operation => :"CampaignResultsApi.list_campaign_results",
|
|
129
|
+
:header_params => header_params,
|
|
130
|
+
:query_params => query_params,
|
|
131
|
+
:form_params => form_params,
|
|
132
|
+
:body => post_body,
|
|
133
|
+
:auth_names => auth_names,
|
|
134
|
+
:return_type => return_type
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
138
|
+
if @api_client.config.debugging
|
|
139
|
+
@api_client.config.logger.debug "API called: CampaignResultsApi#list_campaign_results\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
140
|
+
end
|
|
141
|
+
return data, status_code, headers
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Set your margin and cost per order
|
|
145
|
+
# profit = revenue × margin_percent / 100 − sales × cost_per_order; poas = profit ÷ spend; profit_after_ads = profit − spend. `margin_percent: null` removes profit. `campaign_margins` overrides the margin per campaign.
|
|
146
|
+
# @param profit_settings [ProfitSettings]
|
|
147
|
+
# @param [Hash] opts the optional parameters
|
|
148
|
+
# @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.
|
|
149
|
+
# @return [ProfitSettings]
|
|
150
|
+
def set_profit_settings(profit_settings, opts = {})
|
|
151
|
+
data, _status_code, _headers = set_profit_settings_with_http_info(profit_settings, opts)
|
|
152
|
+
data
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Set your margin and cost per order
|
|
156
|
+
# profit = revenue × margin_percent / 100 − sales × cost_per_order; poas = profit ÷ spend; profit_after_ads = profit − spend. `margin_percent: null` removes profit. `campaign_margins` overrides the margin per campaign.
|
|
157
|
+
# @param profit_settings [ProfitSettings]
|
|
158
|
+
# @param [Hash] opts the optional parameters
|
|
159
|
+
# @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.
|
|
160
|
+
# @return [Array<(ProfitSettings, Integer, Hash)>] ProfitSettings data, response status code and response headers
|
|
161
|
+
def set_profit_settings_with_http_info(profit_settings, opts = {})
|
|
162
|
+
if @api_client.config.debugging
|
|
163
|
+
@api_client.config.logger.debug 'Calling API: CampaignResultsApi.set_profit_settings ...'
|
|
164
|
+
end
|
|
165
|
+
# verify the required parameter 'profit_settings' is set
|
|
166
|
+
if @api_client.config.client_side_validation && profit_settings.nil?
|
|
167
|
+
fail ArgumentError, "Missing the required parameter 'profit_settings' when calling CampaignResultsApi.set_profit_settings"
|
|
168
|
+
end
|
|
169
|
+
# resource path
|
|
170
|
+
local_var_path = '/v1/campaign-results/profit-settings'
|
|
171
|
+
|
|
172
|
+
# query parameters
|
|
173
|
+
query_params = opts[:query_params] || {}
|
|
174
|
+
|
|
175
|
+
# header parameters
|
|
176
|
+
header_params = opts[:header_params] || {}
|
|
177
|
+
# HTTP header 'Accept' (if needed)
|
|
178
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
179
|
+
# HTTP header 'Content-Type'
|
|
180
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
181
|
+
if !content_type.nil?
|
|
182
|
+
header_params['Content-Type'] = content_type
|
|
183
|
+
end
|
|
184
|
+
header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
|
|
185
|
+
|
|
186
|
+
# form parameters
|
|
187
|
+
form_params = opts[:form_params] || {}
|
|
188
|
+
|
|
189
|
+
# http body (model)
|
|
190
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(profit_settings)
|
|
191
|
+
|
|
192
|
+
# return_type
|
|
193
|
+
return_type = opts[:debug_return_type] || 'ProfitSettings'
|
|
194
|
+
|
|
195
|
+
# auth_names
|
|
196
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
197
|
+
|
|
198
|
+
new_options = opts.merge(
|
|
199
|
+
:operation => :"CampaignResultsApi.set_profit_settings",
|
|
200
|
+
:header_params => header_params,
|
|
201
|
+
:query_params => query_params,
|
|
202
|
+
:form_params => form_params,
|
|
203
|
+
:body => post_body,
|
|
204
|
+
:auth_names => auth_names,
|
|
205
|
+
:return_type => return_type
|
|
206
|
+
)
|
|
207
|
+
|
|
208
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
|
209
|
+
if @api_client.config.debugging
|
|
210
|
+
@api_client.config.logger.debug "API called: CampaignResultsApi#set_profit_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
211
|
+
end
|
|
212
|
+
return data, status_code, headers
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# Upload your own results per campaign
|
|
216
|
+
# Daily numbers per campaign (sales, revenue, qualified_leads, cogs, gross_profit or any snake_case metric), each row naming its campaign by exactly one of `campaign_id`, `utm_campaign` or `campaign_name`. Re-sending a day replaces it. Or send `csv`. Up to 1,000 rows.
|
|
217
|
+
# @param campaign_results_upload [CampaignResultsUpload]
|
|
218
|
+
# @param [Hash] opts the optional parameters
|
|
219
|
+
# @option opts [String] :idempotency_key Send a unique value to make this call safe to retry. A replay returns the original response with `Idempotency-Replayed: true`, for 24 hours — except a call that queued a job, whose replay is that job as it is now (what `GET /v1/jobs/{id}` answers), so a finished render replays as done with its file.
|
|
220
|
+
# @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.
|
|
221
|
+
# @return [CampaignResults]
|
|
222
|
+
def upload_campaign_results(campaign_results_upload, opts = {})
|
|
223
|
+
data, _status_code, _headers = upload_campaign_results_with_http_info(campaign_results_upload, opts)
|
|
224
|
+
data
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# Upload your own results per campaign
|
|
228
|
+
# Daily numbers per campaign (sales, revenue, qualified_leads, cogs, gross_profit or any snake_case metric), each row naming its campaign by exactly one of `campaign_id`, `utm_campaign` or `campaign_name`. Re-sending a day replaces it. Or send `csv`. Up to 1,000 rows.
|
|
229
|
+
# @param campaign_results_upload [CampaignResultsUpload]
|
|
230
|
+
# @param [Hash] opts the optional parameters
|
|
231
|
+
# @option opts [String] :idempotency_key Send a unique value to make this call safe to retry. A replay returns the original response with `Idempotency-Replayed: true`, for 24 hours — except a call that queued a job, whose replay is that job as it is now (what `GET /v1/jobs/{id}` answers), so a finished render replays as done with its file.
|
|
232
|
+
# @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.
|
|
233
|
+
# @return [Array<(CampaignResults, Integer, Hash)>] CampaignResults data, response status code and response headers
|
|
234
|
+
def upload_campaign_results_with_http_info(campaign_results_upload, opts = {})
|
|
235
|
+
if @api_client.config.debugging
|
|
236
|
+
@api_client.config.logger.debug 'Calling API: CampaignResultsApi.upload_campaign_results ...'
|
|
237
|
+
end
|
|
238
|
+
# verify the required parameter 'campaign_results_upload' is set
|
|
239
|
+
if @api_client.config.client_side_validation && campaign_results_upload.nil?
|
|
240
|
+
fail ArgumentError, "Missing the required parameter 'campaign_results_upload' when calling CampaignResultsApi.upload_campaign_results"
|
|
241
|
+
end
|
|
242
|
+
# resource path
|
|
243
|
+
local_var_path = '/v1/campaign-results'
|
|
244
|
+
|
|
245
|
+
# query parameters
|
|
246
|
+
query_params = opts[:query_params] || {}
|
|
247
|
+
|
|
248
|
+
# header parameters
|
|
249
|
+
header_params = opts[:header_params] || {}
|
|
250
|
+
# HTTP header 'Accept' (if needed)
|
|
251
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
252
|
+
# HTTP header 'Content-Type'
|
|
253
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
254
|
+
if !content_type.nil?
|
|
255
|
+
header_params['Content-Type'] = content_type
|
|
256
|
+
end
|
|
257
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
|
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] || @api_client.object_to_http_body(campaign_results_upload)
|
|
265
|
+
|
|
266
|
+
# return_type
|
|
267
|
+
return_type = opts[:debug_return_type] || 'CampaignResults'
|
|
268
|
+
|
|
269
|
+
# auth_names
|
|
270
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
271
|
+
|
|
272
|
+
new_options = opts.merge(
|
|
273
|
+
:operation => :"CampaignResultsApi.upload_campaign_results",
|
|
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(:POST, local_var_path, new_options)
|
|
283
|
+
if @api_client.config.debugging
|
|
284
|
+
@api_client.config.logger.debug "API called: CampaignResultsApi#upload_campaign_results\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
285
|
+
end
|
|
286
|
+
return data, status_code, headers
|
|
287
|
+
end
|
|
288
|
+
end
|
|
289
|
+
end
|
|
@@ -0,0 +1,82 @@
|
|
|
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 ChannelsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# List publishing channels
|
|
23
|
+
# Every channel Hermoso can publish to, whether this workspace has it connected, and what each supports (visibilities, carousel limits, caption length). A channel that is NOT connected is still listed, with `connected: false` — \"we do not support that\" and \"you have not connected it\" are different answers and a client must be able to tell them apart.
|
|
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 `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.
|
|
26
|
+
# @return [ChannelList]
|
|
27
|
+
def list_channels(opts = {})
|
|
28
|
+
data, _status_code, _headers = list_channels_with_http_info(opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# List publishing channels
|
|
33
|
+
# Every channel Hermoso can publish to, whether this workspace has it connected, and what each supports (visibilities, carousel limits, caption length). A channel that is NOT connected is still listed, with `connected: false` — \"we do not support that\" and \"you have not connected it\" are different answers and a client must be able to tell them apart.
|
|
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 `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.
|
|
36
|
+
# @return [Array<(ChannelList, Integer, Hash)>] ChannelList data, response status code and response headers
|
|
37
|
+
def list_channels_with_http_info(opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: ChannelsApi.list_channels ...'
|
|
40
|
+
end
|
|
41
|
+
# resource path
|
|
42
|
+
local_var_path = '/v1/channels'
|
|
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] || 'ChannelList'
|
|
61
|
+
|
|
62
|
+
# auth_names
|
|
63
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
64
|
+
|
|
65
|
+
new_options = opts.merge(
|
|
66
|
+
:operation => :"ChannelsApi.list_channels",
|
|
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: ChannelsApi#list_channels\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
78
|
+
end
|
|
79
|
+
return data, status_code, headers
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
@@ -0,0 +1,93 @@
|
|
|
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 ClonesApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Price a clone before running it
|
|
23
|
+
# What cloning an ad for this profile will cost, step by step, before anything runs. `type: image` prices the static clone (`clone_static`): reading the layout (a flat charge) plus the image render’s own hold, with the brand’s product photo attached exactly as the clone attaches it; the copy writing and the final brand check are billed at their real model cost and are listed with `credits: null`. `type: video` prices the first step of a video clone (`clone_video`: watching the original and planning the storyboard) as the server’s own estimate; the render is priced exactly once the plan exists, by calling `render_ad` with `dryRun: true`. Free: nothing is read, reserved or charged.
|
|
24
|
+
# @param clone_quote_request [CloneQuoteRequest]
|
|
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 [CloneQuote]
|
|
28
|
+
def quote_clone(clone_quote_request, opts = {})
|
|
29
|
+
data, _status_code, _headers = quote_clone_with_http_info(clone_quote_request, opts)
|
|
30
|
+
data
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Price a clone before running it
|
|
34
|
+
# What cloning an ad for this profile will cost, step by step, before anything runs. `type: image` prices the static clone (`clone_static`): reading the layout (a flat charge) plus the image render’s own hold, with the brand’s product photo attached exactly as the clone attaches it; the copy writing and the final brand check are billed at their real model cost and are listed with `credits: null`. `type: video` prices the first step of a video clone (`clone_video`: watching the original and planning the storyboard) as the server’s own estimate; the render is priced exactly once the plan exists, by calling `render_ad` with `dryRun: true`. Free: nothing is read, reserved or charged.
|
|
35
|
+
# @param clone_quote_request [CloneQuoteRequest]
|
|
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<(CloneQuote, Integer, Hash)>] CloneQuote data, response status code and response headers
|
|
39
|
+
def quote_clone_with_http_info(clone_quote_request, opts = {})
|
|
40
|
+
if @api_client.config.debugging
|
|
41
|
+
@api_client.config.logger.debug 'Calling API: ClonesApi.quote_clone ...'
|
|
42
|
+
end
|
|
43
|
+
# verify the required parameter 'clone_quote_request' is set
|
|
44
|
+
if @api_client.config.client_side_validation && clone_quote_request.nil?
|
|
45
|
+
fail ArgumentError, "Missing the required parameter 'clone_quote_request' when calling ClonesApi.quote_clone"
|
|
46
|
+
end
|
|
47
|
+
# resource path
|
|
48
|
+
local_var_path = '/v1/clones/quote'
|
|
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(clone_quote_request)
|
|
69
|
+
|
|
70
|
+
# return_type
|
|
71
|
+
return_type = opts[:debug_return_type] || 'CloneQuote'
|
|
72
|
+
|
|
73
|
+
# auth_names
|
|
74
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
75
|
+
|
|
76
|
+
new_options = opts.merge(
|
|
77
|
+
:operation => :"ClonesApi.quote_clone",
|
|
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: ClonesApi#quote_clone\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
89
|
+
end
|
|
90
|
+
return data, status_code, headers
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
end
|