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,88 @@
|
|
|
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 ModelsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# List the image and video models
|
|
23
|
+
# The live model catalog this account can render with: ids, labels, the aspect ratios, sizes and lengths each takes, and its list price in credits. For the exact price of one render with your prompt and brand, ask `POST /v1/generations/quote`: brand product photos and video audio can change it. Models that only edit or only animate a supplied picture are marked `needs_reference`. The catalog grows: read it, never hard-code it.
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @option opts [String] :type image or video (default both).
|
|
26
|
+
# @option opts [String] :sort `credits`: cheapest first (an image by `credits`, a video by its cheapest length in `credits_by_duration`; a model with no list price last). Omit it for the catalog’s own order, featured models first.
|
|
27
|
+
# @option opts [String] :x_hermoso_user Which profile to act on, when the account holds more than one: an `id` from `GET /v1/brands`. Defaults to the workspace the key is pinned to. Membership is re-authorised on every request, and an id this key cannot act on is a 404 `brand_not_found`, never an empty result.
|
|
28
|
+
# @return [ModelList]
|
|
29
|
+
def list_models(opts = {})
|
|
30
|
+
data, _status_code, _headers = list_models_with_http_info(opts)
|
|
31
|
+
data
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# List the image and video models
|
|
35
|
+
# The live model catalog this account can render with: ids, labels, the aspect ratios, sizes and lengths each takes, and its list price in credits. For the exact price of one render with your prompt and brand, ask `POST /v1/generations/quote`: brand product photos and video audio can change it. Models that only edit or only animate a supplied picture are marked `needs_reference`. The catalog grows: read it, never hard-code it.
|
|
36
|
+
# @param [Hash] opts the optional parameters
|
|
37
|
+
# @option opts [String] :type image or video (default both).
|
|
38
|
+
# @option opts [String] :sort `credits`: cheapest first (an image by `credits`, a video by its cheapest length in `credits_by_duration`; a model with no list price last). Omit it for the catalog’s own order, featured models first.
|
|
39
|
+
# @option opts [String] :x_hermoso_user Which profile to act on, when the account holds more than one: an `id` from `GET /v1/brands`. Defaults to the workspace the key is pinned to. Membership is re-authorised on every request, and an id this key cannot act on is a 404 `brand_not_found`, never an empty result.
|
|
40
|
+
# @return [Array<(ModelList, Integer, Hash)>] ModelList data, response status code and response headers
|
|
41
|
+
def list_models_with_http_info(opts = {})
|
|
42
|
+
if @api_client.config.debugging
|
|
43
|
+
@api_client.config.logger.debug 'Calling API: ModelsApi.list_models ...'
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/v1/models'
|
|
47
|
+
|
|
48
|
+
# query parameters
|
|
49
|
+
query_params = opts[:query_params] || {}
|
|
50
|
+
query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
|
|
51
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
|
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
|
+
header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
|
|
58
|
+
|
|
59
|
+
# form parameters
|
|
60
|
+
form_params = opts[:form_params] || {}
|
|
61
|
+
|
|
62
|
+
# http body (model)
|
|
63
|
+
post_body = opts[:debug_body]
|
|
64
|
+
|
|
65
|
+
# return_type
|
|
66
|
+
return_type = opts[:debug_return_type] || 'ModelList'
|
|
67
|
+
|
|
68
|
+
# auth_names
|
|
69
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
70
|
+
|
|
71
|
+
new_options = opts.merge(
|
|
72
|
+
:operation => :"ModelsApi.list_models",
|
|
73
|
+
:header_params => header_params,
|
|
74
|
+
:query_params => query_params,
|
|
75
|
+
:form_params => form_params,
|
|
76
|
+
:body => post_body,
|
|
77
|
+
:auth_names => auth_names,
|
|
78
|
+
:return_type => return_type
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
82
|
+
if @api_client.config.debugging
|
|
83
|
+
@api_client.config.logger.debug "API called: ModelsApi#list_models\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
84
|
+
end
|
|
85
|
+
return data, status_code, headers
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
@@ -0,0 +1,377 @@
|
|
|
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 PostsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Create a post
|
|
23
|
+
# Publish now, or schedule for later. Omit `scheduled_at` to send immediately; pass an ISO-8601 timestamp to queue it. A post fans out across every channel in `channels` INDEPENDENTLY — one channel failing does not stop the others, and `results[]` reports each. Everything that can be refused is refused HERE, while you still hold the request: an unknown channel, a visibility the channel cannot honour, a caption over a channel limit, a carousel a channel cannot carry. Nothing is ever silently downgraded at publish time.
|
|
24
|
+
# @param post_create [PostCreate]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @option opts [String] :idempotency_key Send a unique value to make this call safe to retry. A replay returns the original response with `Idempotency-Replayed: true`, for 24 hours — except a call that queued a job, whose replay is that job as it is now (what `GET /v1/jobs/{id}` answers), so a finished render replays as done with its file.
|
|
27
|
+
# @option opts [String] :x_hermoso_user Which profile to act on, when the account holds more than one: an `id` from `GET /v1/brands`. Defaults to the workspace the key is pinned to. Membership is re-authorised on every request, and an id this key cannot act on is a 404 `brand_not_found`, never an empty result.
|
|
28
|
+
# @return [Post]
|
|
29
|
+
def create_post(post_create, opts = {})
|
|
30
|
+
data, _status_code, _headers = create_post_with_http_info(post_create, opts)
|
|
31
|
+
data
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Create a post
|
|
35
|
+
# Publish now, or schedule for later. Omit `scheduled_at` to send immediately; pass an ISO-8601 timestamp to queue it. A post fans out across every channel in `channels` INDEPENDENTLY — one channel failing does not stop the others, and `results[]` reports each. Everything that can be refused is refused HERE, while you still hold the request: an unknown channel, a visibility the channel cannot honour, a caption over a channel limit, a carousel a channel cannot carry. Nothing is ever silently downgraded at publish time.
|
|
36
|
+
# @param post_create [PostCreate]
|
|
37
|
+
# @param [Hash] opts the optional parameters
|
|
38
|
+
# @option opts [String] :idempotency_key Send a unique value to make this call safe to retry. A replay returns the original response with `Idempotency-Replayed: true`, for 24 hours — except a call that queued a job, whose replay is that job as it is now (what `GET /v1/jobs/{id}` answers), so a finished render replays as done with its file.
|
|
39
|
+
# @option opts [String] :x_hermoso_user Which profile to act on, when the account holds more than one: an `id` from `GET /v1/brands`. Defaults to the workspace the key is pinned to. Membership is re-authorised on every request, and an id this key cannot act on is a 404 `brand_not_found`, never an empty result.
|
|
40
|
+
# @return [Array<(Post, Integer, Hash)>] Post data, response status code and response headers
|
|
41
|
+
def create_post_with_http_info(post_create, opts = {})
|
|
42
|
+
if @api_client.config.debugging
|
|
43
|
+
@api_client.config.logger.debug 'Calling API: PostsApi.create_post ...'
|
|
44
|
+
end
|
|
45
|
+
# verify the required parameter 'post_create' is set
|
|
46
|
+
if @api_client.config.client_side_validation && post_create.nil?
|
|
47
|
+
fail ArgumentError, "Missing the required parameter 'post_create' when calling PostsApi.create_post"
|
|
48
|
+
end
|
|
49
|
+
# resource path
|
|
50
|
+
local_var_path = '/v1/posts'
|
|
51
|
+
|
|
52
|
+
# query parameters
|
|
53
|
+
query_params = opts[:query_params] || {}
|
|
54
|
+
|
|
55
|
+
# header parameters
|
|
56
|
+
header_params = opts[:header_params] || {}
|
|
57
|
+
# HTTP header 'Accept' (if needed)
|
|
58
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
59
|
+
# HTTP header 'Content-Type'
|
|
60
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
61
|
+
if !content_type.nil?
|
|
62
|
+
header_params['Content-Type'] = content_type
|
|
63
|
+
end
|
|
64
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
|
65
|
+
header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
|
|
66
|
+
|
|
67
|
+
# form parameters
|
|
68
|
+
form_params = opts[:form_params] || {}
|
|
69
|
+
|
|
70
|
+
# http body (model)
|
|
71
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(post_create)
|
|
72
|
+
|
|
73
|
+
# return_type
|
|
74
|
+
return_type = opts[:debug_return_type] || 'Post'
|
|
75
|
+
|
|
76
|
+
# auth_names
|
|
77
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
78
|
+
|
|
79
|
+
new_options = opts.merge(
|
|
80
|
+
:operation => :"PostsApi.create_post",
|
|
81
|
+
:header_params => header_params,
|
|
82
|
+
:query_params => query_params,
|
|
83
|
+
:form_params => form_params,
|
|
84
|
+
:body => post_body,
|
|
85
|
+
:auth_names => auth_names,
|
|
86
|
+
:return_type => return_type
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
90
|
+
if @api_client.config.debugging
|
|
91
|
+
@api_client.config.logger.debug "API called: PostsApi#create_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
92
|
+
end
|
|
93
|
+
return data, status_code, headers
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Cancel a scheduled post
|
|
97
|
+
# Only while it is still `scheduled`. A post that has already fired cannot be cancelled — it exists on the channel now, and removing it there is that channel’s own delete.
|
|
98
|
+
# @param id [String]
|
|
99
|
+
# @param [Hash] opts the optional parameters
|
|
100
|
+
# @option opts [String] :x_hermoso_user Which profile to act on, when the account holds more than one: an `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.
|
|
101
|
+
# @return [Deleted]
|
|
102
|
+
def delete_post(id, opts = {})
|
|
103
|
+
data, _status_code, _headers = delete_post_with_http_info(id, opts)
|
|
104
|
+
data
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Cancel a scheduled post
|
|
108
|
+
# Only while it is still `scheduled`. A post that has already fired cannot be cancelled — it exists on the channel now, and removing it there is that channel’s own delete.
|
|
109
|
+
# @param id [String]
|
|
110
|
+
# @param [Hash] opts the optional parameters
|
|
111
|
+
# @option opts [String] :x_hermoso_user Which profile to act on, when the account holds more than one: an `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.
|
|
112
|
+
# @return [Array<(Deleted, Integer, Hash)>] Deleted data, response status code and response headers
|
|
113
|
+
def delete_post_with_http_info(id, opts = {})
|
|
114
|
+
if @api_client.config.debugging
|
|
115
|
+
@api_client.config.logger.debug 'Calling API: PostsApi.delete_post ...'
|
|
116
|
+
end
|
|
117
|
+
# verify the required parameter 'id' is set
|
|
118
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
119
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling PostsApi.delete_post"
|
|
120
|
+
end
|
|
121
|
+
# resource path
|
|
122
|
+
local_var_path = '/v1/posts/{id}'.sub('{id}', CGI.escape(id.to_s))
|
|
123
|
+
|
|
124
|
+
# query parameters
|
|
125
|
+
query_params = opts[:query_params] || {}
|
|
126
|
+
|
|
127
|
+
# header parameters
|
|
128
|
+
header_params = opts[:header_params] || {}
|
|
129
|
+
# HTTP header 'Accept' (if needed)
|
|
130
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
131
|
+
header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
|
|
132
|
+
|
|
133
|
+
# form parameters
|
|
134
|
+
form_params = opts[:form_params] || {}
|
|
135
|
+
|
|
136
|
+
# http body (model)
|
|
137
|
+
post_body = opts[:debug_body]
|
|
138
|
+
|
|
139
|
+
# return_type
|
|
140
|
+
return_type = opts[:debug_return_type] || 'Deleted'
|
|
141
|
+
|
|
142
|
+
# auth_names
|
|
143
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
144
|
+
|
|
145
|
+
new_options = opts.merge(
|
|
146
|
+
:operation => :"PostsApi.delete_post",
|
|
147
|
+
:header_params => header_params,
|
|
148
|
+
:query_params => query_params,
|
|
149
|
+
:form_params => form_params,
|
|
150
|
+
:body => post_body,
|
|
151
|
+
:auth_names => auth_names,
|
|
152
|
+
:return_type => return_type
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
156
|
+
if @api_client.config.debugging
|
|
157
|
+
@api_client.config.logger.debug "API called: PostsApi#delete_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
158
|
+
end
|
|
159
|
+
return data, status_code, headers
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# Retrieve a post
|
|
163
|
+
# One post, including per-channel results once it has fired.
|
|
164
|
+
# @param id [String]
|
|
165
|
+
# @param [Hash] opts the optional parameters
|
|
166
|
+
# @option opts [String] :x_hermoso_user Which profile to act on, when the account holds more than one: an `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.
|
|
167
|
+
# @return [Post]
|
|
168
|
+
def get_post(id, opts = {})
|
|
169
|
+
data, _status_code, _headers = get_post_with_http_info(id, opts)
|
|
170
|
+
data
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Retrieve a post
|
|
174
|
+
# One post, including per-channel results once it has fired.
|
|
175
|
+
# @param id [String]
|
|
176
|
+
# @param [Hash] opts the optional parameters
|
|
177
|
+
# @option opts [String] :x_hermoso_user Which profile to act on, when the account holds more than one: an `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.
|
|
178
|
+
# @return [Array<(Post, Integer, Hash)>] Post data, response status code and response headers
|
|
179
|
+
def get_post_with_http_info(id, opts = {})
|
|
180
|
+
if @api_client.config.debugging
|
|
181
|
+
@api_client.config.logger.debug 'Calling API: PostsApi.get_post ...'
|
|
182
|
+
end
|
|
183
|
+
# verify the required parameter 'id' is set
|
|
184
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
185
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling PostsApi.get_post"
|
|
186
|
+
end
|
|
187
|
+
# resource path
|
|
188
|
+
local_var_path = '/v1/posts/{id}'.sub('{id}', CGI.escape(id.to_s))
|
|
189
|
+
|
|
190
|
+
# query parameters
|
|
191
|
+
query_params = opts[:query_params] || {}
|
|
192
|
+
|
|
193
|
+
# header parameters
|
|
194
|
+
header_params = opts[:header_params] || {}
|
|
195
|
+
# HTTP header 'Accept' (if needed)
|
|
196
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
197
|
+
header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
|
|
198
|
+
|
|
199
|
+
# form parameters
|
|
200
|
+
form_params = opts[:form_params] || {}
|
|
201
|
+
|
|
202
|
+
# http body (model)
|
|
203
|
+
post_body = opts[:debug_body]
|
|
204
|
+
|
|
205
|
+
# return_type
|
|
206
|
+
return_type = opts[:debug_return_type] || 'Post'
|
|
207
|
+
|
|
208
|
+
# auth_names
|
|
209
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
210
|
+
|
|
211
|
+
new_options = opts.merge(
|
|
212
|
+
:operation => :"PostsApi.get_post",
|
|
213
|
+
:header_params => header_params,
|
|
214
|
+
:query_params => query_params,
|
|
215
|
+
:form_params => form_params,
|
|
216
|
+
:body => post_body,
|
|
217
|
+
:auth_names => auth_names,
|
|
218
|
+
:return_type => return_type
|
|
219
|
+
)
|
|
220
|
+
|
|
221
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
222
|
+
if @api_client.config.debugging
|
|
223
|
+
@api_client.config.logger.debug "API called: PostsApi#get_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
224
|
+
end
|
|
225
|
+
return data, status_code, headers
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# List posts
|
|
229
|
+
# Scheduled and already-fired posts for this workspace, newest first. Cursor-paginated.
|
|
230
|
+
# @param [Hash] opts the optional parameters
|
|
231
|
+
# @option opts [Integer] :limit 1-100, default 25.
|
|
232
|
+
# @option opts [String] :starting_after A post id from a previous page; returns the page after it. An unknown cursor is an error, never a silent restart.
|
|
233
|
+
# @option opts [String] :status Filter: scheduled, processing, published, partially_published, failed, indeterminate. `indeterminate` means a restart interrupted the send and we cannot say whether it published.
|
|
234
|
+
# @option opts [String] :channel Filter to posts that include this channel.
|
|
235
|
+
# @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.
|
|
236
|
+
# @return [PostList]
|
|
237
|
+
def list_posts(opts = {})
|
|
238
|
+
data, _status_code, _headers = list_posts_with_http_info(opts)
|
|
239
|
+
data
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
# List posts
|
|
243
|
+
# Scheduled and already-fired posts for this workspace, newest first. Cursor-paginated.
|
|
244
|
+
# @param [Hash] opts the optional parameters
|
|
245
|
+
# @option opts [Integer] :limit 1-100, default 25.
|
|
246
|
+
# @option opts [String] :starting_after A post id from a previous page; returns the page after it. An unknown cursor is an error, never a silent restart.
|
|
247
|
+
# @option opts [String] :status Filter: scheduled, processing, published, partially_published, failed, indeterminate. `indeterminate` means a restart interrupted the send and we cannot say whether it published.
|
|
248
|
+
# @option opts [String] :channel Filter to posts that include this channel.
|
|
249
|
+
# @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.
|
|
250
|
+
# @return [Array<(PostList, Integer, Hash)>] PostList data, response status code and response headers
|
|
251
|
+
def list_posts_with_http_info(opts = {})
|
|
252
|
+
if @api_client.config.debugging
|
|
253
|
+
@api_client.config.logger.debug 'Calling API: PostsApi.list_posts ...'
|
|
254
|
+
end
|
|
255
|
+
# resource path
|
|
256
|
+
local_var_path = '/v1/posts'
|
|
257
|
+
|
|
258
|
+
# query parameters
|
|
259
|
+
query_params = opts[:query_params] || {}
|
|
260
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
261
|
+
query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil?
|
|
262
|
+
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
|
|
263
|
+
query_params[:'channel'] = opts[:'channel'] if !opts[:'channel'].nil?
|
|
264
|
+
|
|
265
|
+
# header parameters
|
|
266
|
+
header_params = opts[:header_params] || {}
|
|
267
|
+
# HTTP header 'Accept' (if needed)
|
|
268
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
269
|
+
header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
|
|
270
|
+
|
|
271
|
+
# form parameters
|
|
272
|
+
form_params = opts[:form_params] || {}
|
|
273
|
+
|
|
274
|
+
# http body (model)
|
|
275
|
+
post_body = opts[:debug_body]
|
|
276
|
+
|
|
277
|
+
# return_type
|
|
278
|
+
return_type = opts[:debug_return_type] || 'PostList'
|
|
279
|
+
|
|
280
|
+
# auth_names
|
|
281
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
282
|
+
|
|
283
|
+
new_options = opts.merge(
|
|
284
|
+
:operation => :"PostsApi.list_posts",
|
|
285
|
+
:header_params => header_params,
|
|
286
|
+
:query_params => query_params,
|
|
287
|
+
:form_params => form_params,
|
|
288
|
+
:body => post_body,
|
|
289
|
+
:auth_names => auth_names,
|
|
290
|
+
:return_type => return_type
|
|
291
|
+
)
|
|
292
|
+
|
|
293
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
294
|
+
if @api_client.config.debugging
|
|
295
|
+
@api_client.config.logger.debug "API called: PostsApi#list_posts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
296
|
+
end
|
|
297
|
+
return data, status_code, headers
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
# Update a scheduled post
|
|
301
|
+
# Only while it is still `scheduled`. An omitted field is left alone; an explicit empty value clears it. The edit re-runs the SAME validation a create does — it is not a looser path.
|
|
302
|
+
# @param id [String]
|
|
303
|
+
# @param request_body [Hash<String, Object>]
|
|
304
|
+
# @param [Hash] opts the optional parameters
|
|
305
|
+
# @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.
|
|
306
|
+
# @return [Post]
|
|
307
|
+
def update_post(id, request_body, opts = {})
|
|
308
|
+
data, _status_code, _headers = update_post_with_http_info(id, request_body, opts)
|
|
309
|
+
data
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
# Update a scheduled post
|
|
313
|
+
# Only while it is still `scheduled`. An omitted field is left alone; an explicit empty value clears it. The edit re-runs the SAME validation a create does — it is not a looser path.
|
|
314
|
+
# @param id [String]
|
|
315
|
+
# @param request_body [Hash<String, Object>]
|
|
316
|
+
# @param [Hash] opts the optional parameters
|
|
317
|
+
# @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.
|
|
318
|
+
# @return [Array<(Post, Integer, Hash)>] Post data, response status code and response headers
|
|
319
|
+
def update_post_with_http_info(id, request_body, opts = {})
|
|
320
|
+
if @api_client.config.debugging
|
|
321
|
+
@api_client.config.logger.debug 'Calling API: PostsApi.update_post ...'
|
|
322
|
+
end
|
|
323
|
+
# verify the required parameter 'id' is set
|
|
324
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
325
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling PostsApi.update_post"
|
|
326
|
+
end
|
|
327
|
+
# verify the required parameter 'request_body' is set
|
|
328
|
+
if @api_client.config.client_side_validation && request_body.nil?
|
|
329
|
+
fail ArgumentError, "Missing the required parameter 'request_body' when calling PostsApi.update_post"
|
|
330
|
+
end
|
|
331
|
+
# resource path
|
|
332
|
+
local_var_path = '/v1/posts/{id}'.sub('{id}', CGI.escape(id.to_s))
|
|
333
|
+
|
|
334
|
+
# query parameters
|
|
335
|
+
query_params = opts[:query_params] || {}
|
|
336
|
+
|
|
337
|
+
# header parameters
|
|
338
|
+
header_params = opts[:header_params] || {}
|
|
339
|
+
# HTTP header 'Accept' (if needed)
|
|
340
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
341
|
+
# HTTP header 'Content-Type'
|
|
342
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
343
|
+
if !content_type.nil?
|
|
344
|
+
header_params['Content-Type'] = content_type
|
|
345
|
+
end
|
|
346
|
+
header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
|
|
347
|
+
|
|
348
|
+
# form parameters
|
|
349
|
+
form_params = opts[:form_params] || {}
|
|
350
|
+
|
|
351
|
+
# http body (model)
|
|
352
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(request_body)
|
|
353
|
+
|
|
354
|
+
# return_type
|
|
355
|
+
return_type = opts[:debug_return_type] || 'Post'
|
|
356
|
+
|
|
357
|
+
# auth_names
|
|
358
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
359
|
+
|
|
360
|
+
new_options = opts.merge(
|
|
361
|
+
:operation => :"PostsApi.update_post",
|
|
362
|
+
:header_params => header_params,
|
|
363
|
+
:query_params => query_params,
|
|
364
|
+
:form_params => form_params,
|
|
365
|
+
:body => post_body,
|
|
366
|
+
:auth_names => auth_names,
|
|
367
|
+
:return_type => return_type
|
|
368
|
+
)
|
|
369
|
+
|
|
370
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
371
|
+
if @api_client.config.debugging
|
|
372
|
+
@api_client.config.logger.debug "API called: PostsApi#update_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
373
|
+
end
|
|
374
|
+
return data, status_code, headers
|
|
375
|
+
end
|
|
376
|
+
end
|
|
377
|
+
end
|
|
@@ -0,0 +1,102 @@
|
|
|
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 RecastsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Put a person into a video (motion transfer)
|
|
23
|
+
# Replace the person in a video with someone else: a saved or preset creator, a photo, or an AI person made from a description. The new person performs every move, expression and mouth shape of the original, on the same beats and cuts, in the same set and light, and the original sound is kept. Optionally give them a new voice, or have them speak another language with the mouth lip-synced. PRICED UP FRONT. Send `\"dry_run\": true` and the response is the exact price: the credits the job reserves when it starts, from the job's own pricing. It is an estimate: the real call reserves the same figure and is charged its actual cost, usually within a few percent of it. Nothing runs and nothing is charged on a dry run, except that reading a social post link uses its one lookup. ASYNC. A real call answers `202` with the job inside and a `Location` to poll (`GET /v1/jobs/{id}`), usually a few minutes. Or name a `callback_url` and the finished job is POSTed to you. PEOPLE AND LIKENESS. A photo of a real person needs a paid plan or a credit pack, and sending one is your confirmation that you have that person's permission (it is recorded). An AI person from `describe`, or a preset creator, works on every plan. A request that would be refused is refused before anything is charged, with a stable `error.code` and a plain sentence: `real_face_needs_paid`, `face_review_blocked`, `ref_unreadable`, `insufficient_credits`.
|
|
24
|
+
# @param recast_create [RecastCreate]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @option opts [String] :callback_url The same as the `X-Hermoso-Callback-Url` header or the body field, for a client that cannot set headers.
|
|
27
|
+
# @option opts [String] :x_hermoso_callback_url An https:// URL to POST the outcome to, for a platform that cannot poll (for example Zapier `z.generateCallbackUrl()`). When the call queued a job, Hermoso POSTs the job resource — exactly what `GET /v1/jobs/{id}` answers — once the job is `done` or `error`, with headers `Hermoso-Event: job.done | job.error` and `Hermoso-Delivery` (also sent as `Idempotency-Key`; drop a repeat). A 2xx ends delivery; a 4xx other than 408, 425 and 429 is final; anything else is retried for about 16 hours. When the call finished inside the request, its response body is POSTed too (`Hermoso-Event: tool.result`). The response header `Hermoso-Callback` says what happened: `registered`, `sent`, `limit-reached` or `not-registered`. Nothing about what runs or what it costs changes: the URL is attached after the job is queued. A refusal is the HTTP error and nothing is POSTed. Must be https on a public host name; a replay with the same `Idempotency-Key` and a new URL adds that URL to the same job.
|
|
28
|
+
# @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.
|
|
29
|
+
# @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.
|
|
30
|
+
# @return [Recast]
|
|
31
|
+
def create_recast(recast_create, opts = {})
|
|
32
|
+
data, _status_code, _headers = create_recast_with_http_info(recast_create, opts)
|
|
33
|
+
data
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Put a person into a video (motion transfer)
|
|
37
|
+
# Replace the person in a video with someone else: a saved or preset creator, a photo, or an AI person made from a description. The new person performs every move, expression and mouth shape of the original, on the same beats and cuts, in the same set and light, and the original sound is kept. Optionally give them a new voice, or have them speak another language with the mouth lip-synced. PRICED UP FRONT. Send `\"dry_run\": true` and the response is the exact price: the credits the job reserves when it starts, from the job's own pricing. It is an estimate: the real call reserves the same figure and is charged its actual cost, usually within a few percent of it. Nothing runs and nothing is charged on a dry run, except that reading a social post link uses its one lookup. ASYNC. A real call answers `202` with the job inside and a `Location` to poll (`GET /v1/jobs/{id}`), usually a few minutes. Or name a `callback_url` and the finished job is POSTed to you. PEOPLE AND LIKENESS. A photo of a real person needs a paid plan or a credit pack, and sending one is your confirmation that you have that person's permission (it is recorded). An AI person from `describe`, or a preset creator, works on every plan. A request that would be refused is refused before anything is charged, with a stable `error.code` and a plain sentence: `real_face_needs_paid`, `face_review_blocked`, `ref_unreadable`, `insufficient_credits`.
|
|
38
|
+
# @param recast_create [RecastCreate]
|
|
39
|
+
# @param [Hash] opts the optional parameters
|
|
40
|
+
# @option opts [String] :callback_url The same as the `X-Hermoso-Callback-Url` header or the body field, for a client that cannot set headers.
|
|
41
|
+
# @option opts [String] :x_hermoso_callback_url An https:// URL to POST the outcome to, for a platform that cannot poll (for example Zapier `z.generateCallbackUrl()`). When the call queued a job, Hermoso POSTs the job resource — exactly what `GET /v1/jobs/{id}` answers — once the job is `done` or `error`, with headers `Hermoso-Event: job.done | job.error` and `Hermoso-Delivery` (also sent as `Idempotency-Key`; drop a repeat). A 2xx ends delivery; a 4xx other than 408, 425 and 429 is final; anything else is retried for about 16 hours. When the call finished inside the request, its response body is POSTed too (`Hermoso-Event: tool.result`). The response header `Hermoso-Callback` says what happened: `registered`, `sent`, `limit-reached` or `not-registered`. Nothing about what runs or what it costs changes: the URL is attached after the job is queued. A refusal is the HTTP error and nothing is POSTed. Must be https on a public host name; a replay with the same `Idempotency-Key` and a new URL adds that URL to the same job.
|
|
42
|
+
# @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.
|
|
43
|
+
# @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.
|
|
44
|
+
# @return [Array<(Recast, Integer, Hash)>] Recast data, response status code and response headers
|
|
45
|
+
def create_recast_with_http_info(recast_create, opts = {})
|
|
46
|
+
if @api_client.config.debugging
|
|
47
|
+
@api_client.config.logger.debug 'Calling API: RecastsApi.create_recast ...'
|
|
48
|
+
end
|
|
49
|
+
# verify the required parameter 'recast_create' is set
|
|
50
|
+
if @api_client.config.client_side_validation && recast_create.nil?
|
|
51
|
+
fail ArgumentError, "Missing the required parameter 'recast_create' when calling RecastsApi.create_recast"
|
|
52
|
+
end
|
|
53
|
+
# resource path
|
|
54
|
+
local_var_path = '/v1/recasts'
|
|
55
|
+
|
|
56
|
+
# query parameters
|
|
57
|
+
query_params = opts[:query_params] || {}
|
|
58
|
+
query_params[:'callback_url'] = opts[:'callback_url'] if !opts[:'callback_url'].nil?
|
|
59
|
+
|
|
60
|
+
# header parameters
|
|
61
|
+
header_params = opts[:header_params] || {}
|
|
62
|
+
# HTTP header 'Accept' (if needed)
|
|
63
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
64
|
+
# HTTP header 'Content-Type'
|
|
65
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
66
|
+
if !content_type.nil?
|
|
67
|
+
header_params['Content-Type'] = content_type
|
|
68
|
+
end
|
|
69
|
+
header_params[:'X-Hermoso-Callback-Url'] = opts[:'x_hermoso_callback_url'] if !opts[:'x_hermoso_callback_url'].nil?
|
|
70
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
|
71
|
+
header_params[:'X-Hermoso-User'] = opts[:'x_hermoso_user'] if !opts[:'x_hermoso_user'].nil?
|
|
72
|
+
|
|
73
|
+
# form parameters
|
|
74
|
+
form_params = opts[:form_params] || {}
|
|
75
|
+
|
|
76
|
+
# http body (model)
|
|
77
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(recast_create)
|
|
78
|
+
|
|
79
|
+
# return_type
|
|
80
|
+
return_type = opts[:debug_return_type] || 'Recast'
|
|
81
|
+
|
|
82
|
+
# auth_names
|
|
83
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
84
|
+
|
|
85
|
+
new_options = opts.merge(
|
|
86
|
+
:operation => :"RecastsApi.create_recast",
|
|
87
|
+
:header_params => header_params,
|
|
88
|
+
:query_params => query_params,
|
|
89
|
+
:form_params => form_params,
|
|
90
|
+
:body => post_body,
|
|
91
|
+
:auth_names => auth_names,
|
|
92
|
+
:return_type => return_type
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
96
|
+
if @api_client.config.debugging
|
|
97
|
+
@api_client.config.logger.debug "API called: RecastsApi#create_recast\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
98
|
+
end
|
|
99
|
+
return data, status_code, headers
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|