templatefox 1.12.0 → 1.13.0
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 +4 -4
- data/lib/templatefox/api/account_api.rb +1 -1
- data/lib/templatefox/api/agent_api.rb +227 -0
- data/lib/templatefox/api/image_api.rb +1 -1
- data/lib/templatefox/api/integrations_api.rb +1 -1
- data/lib/templatefox/api/pdf_api.rb +1 -1
- data/lib/templatefox/api/pdf_async_api.rb +3 -3
- data/lib/templatefox/api/pdf_tools_api.rb +1 -1
- data/lib/templatefox/api/templates_api.rb +1 -1
- data/lib/templatefox/api_client.rb +1 -1
- data/lib/templatefox/api_error.rb +1 -1
- data/lib/templatefox/api_model_base.rb +1 -1
- data/lib/templatefox/configuration.rb +1 -1
- data/lib/templatefox/models/account_info_response.rb +1 -1
- data/lib/templatefox/models/agent_job_created_response.rb +266 -0
- data/lib/templatefox/models/agent_job_status_response.rb +388 -0
- data/lib/templatefox/models/{job_status.rb → app_routers_v1_agent_job_status.rb} +4 -4
- data/lib/templatefox/models/app_routers_v1_delivery_export_type.rb +1 -1
- data/lib/templatefox/models/app_routers_v1_pdf_async_export_type.rb +1 -1
- data/lib/templatefox/models/app_routers_v1_pdf_async_job_status.rb +42 -0
- data/lib/templatefox/models/app_routers_v1_pdf_tools_export_type.rb +1 -1
- data/lib/templatefox/models/brand_inputs.rb +232 -0
- data/lib/templatefox/models/create_agent_template_request.rb +350 -0
- data/lib/templatefox/models/create_async_pdf_request.rb +1 -1
- data/lib/templatefox/models/create_async_pdf_response.rb +2 -2
- data/lib/templatefox/models/create_image_request.rb +1 -1
- data/lib/templatefox/models/create_image_response.rb +1 -1
- data/lib/templatefox/models/create_pdf_request.rb +1 -1
- data/lib/templatefox/models/create_pdf_response.rb +1 -1
- data/lib/templatefox/models/create_version_request.rb +1 -1
- data/lib/templatefox/models/extract_pdf_pages_request.rb +1 -1
- data/lib/templatefox/models/http_validation_error.rb +1 -1
- data/lib/templatefox/models/image_format.rb +1 -1
- data/lib/templatefox/models/job_list_response.rb +1 -1
- data/lib/templatefox/models/job_status_response.rb +2 -2
- data/lib/templatefox/models/location_inner.rb +1 -1
- data/lib/templatefox/models/merge_pdf_request.rb +1 -1
- data/lib/templatefox/models/modification.rb +1 -1
- data/lib/templatefox/models/pdf_input.rb +1 -1
- data/lib/templatefox/models/pdf_tools_response.rb +1 -1
- data/lib/templatefox/models/pdf_variant.rb +1 -1
- data/lib/templatefox/models/revise_agent_template_request.rb +193 -0
- data/lib/templatefox/models/rotate_pdf_request.rb +1 -1
- data/lib/templatefox/models/s3_config_request.rb +1 -1
- data/lib/templatefox/models/s3_config_response.rb +1 -1
- data/lib/templatefox/models/s3_success_response.rb +1 -1
- data/lib/templatefox/models/s3_test_response.rb +1 -1
- data/lib/templatefox/models/template_field.rb +1 -1
- data/lib/templatefox/models/template_field_spec.rb +1 -1
- data/lib/templatefox/models/template_layer.rb +1 -1
- data/lib/templatefox/models/template_layers_response.rb +1 -1
- data/lib/templatefox/models/template_list_item.rb +1 -1
- data/lib/templatefox/models/templates_list_response.rb +1 -1
- data/lib/templatefox/models/transaction.rb +1 -1
- data/lib/templatefox/models/transactions_response.rb +1 -1
- data/lib/templatefox/models/update_version_request.rb +1 -1
- data/lib/templatefox/models/validation_error.rb +1 -1
- data/lib/templatefox/models/version_item.rb +1 -1
- data/lib/templatefox/models/versions_list_response.rb +1 -1
- data/lib/templatefox/version.rb +2 -2
- data/lib/templatefox.rb +9 -2
- data/spec/api/account_api_spec.rb +1 -1
- data/spec/api/agent_api_spec.rb +72 -0
- data/spec/api/image_api_spec.rb +1 -1
- data/spec/api/integrations_api_spec.rb +1 -1
- data/spec/api/pdf_api_spec.rb +1 -1
- data/spec/api/pdf_async_api_spec.rb +2 -2
- data/spec/api/pdf_tools_api_spec.rb +1 -1
- data/spec/api/templates_api_spec.rb +1 -1
- data/spec/models/account_info_response_spec.rb +1 -1
- data/spec/models/agent_job_created_response_spec.rb +58 -0
- data/spec/models/agent_job_status_response_spec.rb +112 -0
- data/spec/models/{job_status_spec.rb → app_routers_v1_agent_job_status_spec.rb} +7 -7
- data/spec/models/app_routers_v1_delivery_export_type_spec.rb +1 -1
- data/spec/models/app_routers_v1_pdf_async_export_type_spec.rb +1 -1
- data/spec/models/app_routers_v1_pdf_async_job_status_spec.rb +30 -0
- data/spec/models/app_routers_v1_pdf_tools_export_type_spec.rb +1 -1
- data/spec/models/brand_inputs_spec.rb +48 -0
- data/spec/models/create_agent_template_request_spec.rb +70 -0
- data/spec/models/create_async_pdf_request_spec.rb +1 -1
- data/spec/models/create_async_pdf_response_spec.rb +1 -1
- data/spec/models/create_image_request_spec.rb +1 -1
- data/spec/models/create_image_response_spec.rb +1 -1
- data/spec/models/create_pdf_request_spec.rb +1 -1
- data/spec/models/create_pdf_response_spec.rb +1 -1
- data/spec/models/create_version_request_spec.rb +1 -1
- data/spec/models/extract_pdf_pages_request_spec.rb +1 -1
- data/spec/models/http_validation_error_spec.rb +1 -1
- data/spec/models/image_format_spec.rb +1 -1
- data/spec/models/job_list_response_spec.rb +1 -1
- data/spec/models/job_status_response_spec.rb +1 -1
- data/spec/models/location_inner_spec.rb +1 -1
- data/spec/models/merge_pdf_request_spec.rb +1 -1
- data/spec/models/modification_spec.rb +1 -1
- data/spec/models/pdf_input_spec.rb +1 -1
- data/spec/models/pdf_tools_response_spec.rb +1 -1
- data/spec/models/pdf_variant_spec.rb +1 -1
- data/spec/models/revise_agent_template_request_spec.rb +42 -0
- data/spec/models/rotate_pdf_request_spec.rb +1 -1
- data/spec/models/s3_config_request_spec.rb +1 -1
- data/spec/models/s3_config_response_spec.rb +1 -1
- data/spec/models/s3_success_response_spec.rb +1 -1
- data/spec/models/s3_test_response_spec.rb +1 -1
- data/spec/models/template_field_spec.rb +1 -1
- data/spec/models/template_field_spec_spec.rb +1 -1
- data/spec/models/template_layer_spec.rb +1 -1
- data/spec/models/template_layers_response_spec.rb +1 -1
- data/spec/models/template_list_item_spec.rb +1 -1
- data/spec/models/templates_list_response_spec.rb +1 -1
- data/spec/models/transaction_spec.rb +1 -1
- data/spec/models/transactions_response_spec.rb +1 -1
- data/spec/models/update_version_request_spec.rb +1 -1
- data/spec/models/validation_error_spec.rb +1 -1
- data/spec/models/version_item_spec.rb +1 -1
- data/spec/models/versions_list_response_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- data/templatefox.gemspec +1 -1
- metadata +26 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fc47542a2310895261806bc35ca01fa7b64979e66102cd458daa25f032e5c9d7
|
|
4
|
+
data.tar.gz: f719747a2cc567d04191a92604054bab887fda22d05150955d0759bd1a96f09f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 542a2e8dd8eba7baf68630854da0fd85dbd57aede360c794a3b71035cdc128fdfe8f3eefb14b15c61ad44f1bdd378491a9889552d67212ad0b68da8127174066
|
|
7
|
+
data.tar.gz: 0eb54f9a0bb497315b4d2ccd9df4021ebd69c601bb1c3720f8fdc884a4c9d9e9fbe604ee86f78e306cd2e599ce0cdf4e37a719310b5d4e1f95dbd442be4e8260
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.
|
|
6
|
+
The version of the OpenAPI document: 1.13.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.21.0
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#TemplateFox API
|
|
3
|
+
|
|
4
|
+
#Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.13.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.21.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module TemplateFox
|
|
16
|
+
class AgentApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Create a template with the authoring agent
|
|
23
|
+
# Describe the image template you want; the TemplateFox agent authors it for you — valid HTML that renders deterministically AND stays editable in the visual editor, with every layer named and drivable through `/v1/image/create` modifications. The job is asynchronous: poll `GET /v1/agent/jobs/{job_id}`. When completed, the response always includes a **preview_url** (rendered PNG) plus the `template_id`. Iterate with `POST /v1/agent/templates/{template_id}/revise`. **Authentication:** API Key required (`x-api-key` header) ## Credits Creation costs **25 credits**, deducted when the job is queued and fully refunded if the job fails. ## Canvas Pass a `preset` (instagram-square, instagram-story, og-image, twitter-card, pinterest-pin, square-512) or explicit `width` + `height` in px. ## Rate Limits Standard rate limits apply (60 req/min free, 120 req/min paid).
|
|
24
|
+
# @param create_agent_template_request [CreateAgentTemplateRequest]
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [AgentJobCreatedResponse]
|
|
27
|
+
def create_agent_template(create_agent_template_request, opts = {})
|
|
28
|
+
data, _status_code, _headers = create_agent_template_with_http_info(create_agent_template_request, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Create a template with the authoring agent
|
|
33
|
+
# Describe the image template you want; the TemplateFox agent authors it for you — valid HTML that renders deterministically AND stays editable in the visual editor, with every layer named and drivable through `/v1/image/create` modifications. The job is asynchronous: poll `GET /v1/agent/jobs/{job_id}`. When completed, the response always includes a **preview_url** (rendered PNG) plus the `template_id`. Iterate with `POST /v1/agent/templates/{template_id}/revise`. **Authentication:** API Key required (`x-api-key` header) ## Credits Creation costs **25 credits**, deducted when the job is queued and fully refunded if the job fails. ## Canvas Pass a `preset` (instagram-square, instagram-story, og-image, twitter-card, pinterest-pin, square-512) or explicit `width` + `height` in px. ## Rate Limits Standard rate limits apply (60 req/min free, 120 req/min paid).
|
|
34
|
+
# @param create_agent_template_request [CreateAgentTemplateRequest]
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(AgentJobCreatedResponse, Integer, Hash)>] AgentJobCreatedResponse data, response status code and response headers
|
|
37
|
+
def create_agent_template_with_http_info(create_agent_template_request, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: AgentApi.create_agent_template ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'create_agent_template_request' is set
|
|
42
|
+
if @api_client.config.client_side_validation && create_agent_template_request.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'create_agent_template_request' when calling AgentApi.create_agent_template"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/v1/agent/templates'
|
|
47
|
+
|
|
48
|
+
# query parameters
|
|
49
|
+
query_params = opts[:query_params] || {}
|
|
50
|
+
|
|
51
|
+
# header parameters
|
|
52
|
+
header_params = opts[:header_params] || {}
|
|
53
|
+
# HTTP header 'Accept' (if needed)
|
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
55
|
+
# HTTP header 'Content-Type'
|
|
56
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
57
|
+
if !content_type.nil?
|
|
58
|
+
header_params['Content-Type'] = content_type
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# form parameters
|
|
62
|
+
form_params = opts[:form_params] || {}
|
|
63
|
+
|
|
64
|
+
# http body (model)
|
|
65
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_agent_template_request)
|
|
66
|
+
|
|
67
|
+
# return_type
|
|
68
|
+
return_type = opts[:debug_return_type] || 'AgentJobCreatedResponse'
|
|
69
|
+
|
|
70
|
+
# auth_names
|
|
71
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
72
|
+
|
|
73
|
+
new_options = opts.merge(
|
|
74
|
+
:operation => :"AgentApi.create_agent_template",
|
|
75
|
+
:header_params => header_params,
|
|
76
|
+
:query_params => query_params,
|
|
77
|
+
:form_params => form_params,
|
|
78
|
+
:body => post_body,
|
|
79
|
+
:auth_names => auth_names,
|
|
80
|
+
:return_type => return_type
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
84
|
+
if @api_client.config.debugging
|
|
85
|
+
@api_client.config.logger.debug "API called: AgentApi#create_agent_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
86
|
+
end
|
|
87
|
+
return data, status_code, headers
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Get authoring-agent job status
|
|
91
|
+
# Poll the status of an authoring-agent job. **Authentication:** API Key required (`x-api-key` header) ## Status Values | Status | Description | |--------|-------------| | `pending` | Job is queued | | `processing` | The agent is authoring (typically 30s-3min) | | `completed` | Done — `template_id` and `preview_url` are set | | `failed` | Job failed (see error_message); credits were refunded | Poll every 2-5 seconds. A job stuck in `processing` for more than 10 minutes is failed automatically and its credits refunded.
|
|
92
|
+
# @param job_id [String] Job UUID
|
|
93
|
+
# @param [Hash] opts the optional parameters
|
|
94
|
+
# @return [AgentJobStatusResponse]
|
|
95
|
+
def get_agent_job(job_id, opts = {})
|
|
96
|
+
data, _status_code, _headers = get_agent_job_with_http_info(job_id, opts)
|
|
97
|
+
data
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Get authoring-agent job status
|
|
101
|
+
# Poll the status of an authoring-agent job. **Authentication:** API Key required (`x-api-key` header) ## Status Values | Status | Description | |--------|-------------| | `pending` | Job is queued | | `processing` | The agent is authoring (typically 30s-3min) | | `completed` | Done — `template_id` and `preview_url` are set | | `failed` | Job failed (see error_message); credits were refunded | Poll every 2-5 seconds. A job stuck in `processing` for more than 10 minutes is failed automatically and its credits refunded.
|
|
102
|
+
# @param job_id [String] Job UUID
|
|
103
|
+
# @param [Hash] opts the optional parameters
|
|
104
|
+
# @return [Array<(AgentJobStatusResponse, Integer, Hash)>] AgentJobStatusResponse data, response status code and response headers
|
|
105
|
+
def get_agent_job_with_http_info(job_id, opts = {})
|
|
106
|
+
if @api_client.config.debugging
|
|
107
|
+
@api_client.config.logger.debug 'Calling API: AgentApi.get_agent_job ...'
|
|
108
|
+
end
|
|
109
|
+
# verify the required parameter 'job_id' is set
|
|
110
|
+
if @api_client.config.client_side_validation && job_id.nil?
|
|
111
|
+
fail ArgumentError, "Missing the required parameter 'job_id' when calling AgentApi.get_agent_job"
|
|
112
|
+
end
|
|
113
|
+
# resource path
|
|
114
|
+
local_var_path = '/v1/agent/jobs/{job_id}'.sub('{' + 'job_id' + '}', CGI.escape(job_id.to_s))
|
|
115
|
+
|
|
116
|
+
# query parameters
|
|
117
|
+
query_params = opts[:query_params] || {}
|
|
118
|
+
|
|
119
|
+
# header parameters
|
|
120
|
+
header_params = opts[:header_params] || {}
|
|
121
|
+
# HTTP header 'Accept' (if needed)
|
|
122
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
123
|
+
|
|
124
|
+
# form parameters
|
|
125
|
+
form_params = opts[:form_params] || {}
|
|
126
|
+
|
|
127
|
+
# http body (model)
|
|
128
|
+
post_body = opts[:debug_body]
|
|
129
|
+
|
|
130
|
+
# return_type
|
|
131
|
+
return_type = opts[:debug_return_type] || 'AgentJobStatusResponse'
|
|
132
|
+
|
|
133
|
+
# auth_names
|
|
134
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
135
|
+
|
|
136
|
+
new_options = opts.merge(
|
|
137
|
+
:operation => :"AgentApi.get_agent_job",
|
|
138
|
+
:header_params => header_params,
|
|
139
|
+
:query_params => query_params,
|
|
140
|
+
:form_params => form_params,
|
|
141
|
+
:body => post_body,
|
|
142
|
+
:auth_names => auth_names,
|
|
143
|
+
:return_type => return_type
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
147
|
+
if @api_client.config.debugging
|
|
148
|
+
@api_client.config.logger.debug "API called: AgentApi#get_agent_job\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
149
|
+
end
|
|
150
|
+
return data, status_code, headers
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Revise a template with the authoring agent
|
|
154
|
+
# Send natural-language feedback on an existing image template; the agent revises the draft while keeping layer names stable. Asynchronous — poll `GET /v1/agent/jobs/{job_id}`; the completed job always includes a fresh **preview_url**. **Authentication:** API Key required (`x-api-key` header) ## Credits A revision costs **10 credits**, deducted when the job is queued and fully refunded if the job fails.
|
|
155
|
+
# @param template_id [String] Template short ID (12 characters)
|
|
156
|
+
# @param revise_agent_template_request [ReviseAgentTemplateRequest]
|
|
157
|
+
# @param [Hash] opts the optional parameters
|
|
158
|
+
# @return [AgentJobCreatedResponse]
|
|
159
|
+
def revise_agent_template(template_id, revise_agent_template_request, opts = {})
|
|
160
|
+
data, _status_code, _headers = revise_agent_template_with_http_info(template_id, revise_agent_template_request, opts)
|
|
161
|
+
data
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Revise a template with the authoring agent
|
|
165
|
+
# Send natural-language feedback on an existing image template; the agent revises the draft while keeping layer names stable. Asynchronous — poll `GET /v1/agent/jobs/{job_id}`; the completed job always includes a fresh **preview_url**. **Authentication:** API Key required (`x-api-key` header) ## Credits A revision costs **10 credits**, deducted when the job is queued and fully refunded if the job fails.
|
|
166
|
+
# @param template_id [String] Template short ID (12 characters)
|
|
167
|
+
# @param revise_agent_template_request [ReviseAgentTemplateRequest]
|
|
168
|
+
# @param [Hash] opts the optional parameters
|
|
169
|
+
# @return [Array<(AgentJobCreatedResponse, Integer, Hash)>] AgentJobCreatedResponse data, response status code and response headers
|
|
170
|
+
def revise_agent_template_with_http_info(template_id, revise_agent_template_request, opts = {})
|
|
171
|
+
if @api_client.config.debugging
|
|
172
|
+
@api_client.config.logger.debug 'Calling API: AgentApi.revise_agent_template ...'
|
|
173
|
+
end
|
|
174
|
+
# verify the required parameter 'template_id' is set
|
|
175
|
+
if @api_client.config.client_side_validation && template_id.nil?
|
|
176
|
+
fail ArgumentError, "Missing the required parameter 'template_id' when calling AgentApi.revise_agent_template"
|
|
177
|
+
end
|
|
178
|
+
# verify the required parameter 'revise_agent_template_request' is set
|
|
179
|
+
if @api_client.config.client_side_validation && revise_agent_template_request.nil?
|
|
180
|
+
fail ArgumentError, "Missing the required parameter 'revise_agent_template_request' when calling AgentApi.revise_agent_template"
|
|
181
|
+
end
|
|
182
|
+
# resource path
|
|
183
|
+
local_var_path = '/v1/agent/templates/{template_id}/revise'.sub('{' + 'template_id' + '}', CGI.escape(template_id.to_s))
|
|
184
|
+
|
|
185
|
+
# query parameters
|
|
186
|
+
query_params = opts[:query_params] || {}
|
|
187
|
+
|
|
188
|
+
# header parameters
|
|
189
|
+
header_params = opts[:header_params] || {}
|
|
190
|
+
# HTTP header 'Accept' (if needed)
|
|
191
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
192
|
+
# HTTP header 'Content-Type'
|
|
193
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
194
|
+
if !content_type.nil?
|
|
195
|
+
header_params['Content-Type'] = content_type
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
# form parameters
|
|
199
|
+
form_params = opts[:form_params] || {}
|
|
200
|
+
|
|
201
|
+
# http body (model)
|
|
202
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(revise_agent_template_request)
|
|
203
|
+
|
|
204
|
+
# return_type
|
|
205
|
+
return_type = opts[:debug_return_type] || 'AgentJobCreatedResponse'
|
|
206
|
+
|
|
207
|
+
# auth_names
|
|
208
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
209
|
+
|
|
210
|
+
new_options = opts.merge(
|
|
211
|
+
:operation => :"AgentApi.revise_agent_template",
|
|
212
|
+
:header_params => header_params,
|
|
213
|
+
:query_params => query_params,
|
|
214
|
+
:form_params => form_params,
|
|
215
|
+
:body => post_body,
|
|
216
|
+
:auth_names => auth_names,
|
|
217
|
+
:return_type => return_type
|
|
218
|
+
)
|
|
219
|
+
|
|
220
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
221
|
+
if @api_client.config.debugging
|
|
222
|
+
@api_client.config.logger.debug "API called: AgentApi#revise_agent_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
223
|
+
end
|
|
224
|
+
return data, status_code, headers
|
|
225
|
+
end
|
|
226
|
+
end
|
|
227
|
+
end
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.
|
|
6
|
+
The version of the OpenAPI document: 1.13.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.21.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.
|
|
6
|
+
The version of the OpenAPI document: 1.13.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.21.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.
|
|
6
|
+
The version of the OpenAPI document: 1.13.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.21.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.
|
|
6
|
+
The version of the OpenAPI document: 1.13.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.21.0
|
|
@@ -155,7 +155,7 @@ module TemplateFox
|
|
|
155
155
|
# @param [Hash] opts the optional parameters
|
|
156
156
|
# @option opts [Integer] :limit Maximum number of results to return (default to 20)
|
|
157
157
|
# @option opts [Integer] :offset Number of results to skip (for pagination) (default to 0)
|
|
158
|
-
# @option opts [
|
|
158
|
+
# @option opts [AppRoutersV1PdfAsyncJobStatus] :status Filter jobs by status
|
|
159
159
|
# @return [JobListResponse]
|
|
160
160
|
def list_pdf_jobs(opts = {})
|
|
161
161
|
data, _status_code, _headers = list_pdf_jobs_with_http_info(opts)
|
|
@@ -167,7 +167,7 @@ module TemplateFox
|
|
|
167
167
|
# @param [Hash] opts the optional parameters
|
|
168
168
|
# @option opts [Integer] :limit Maximum number of results to return (default to 20)
|
|
169
169
|
# @option opts [Integer] :offset Number of results to skip (for pagination) (default to 0)
|
|
170
|
-
# @option opts [
|
|
170
|
+
# @option opts [AppRoutersV1PdfAsyncJobStatus] :status Filter jobs by status
|
|
171
171
|
# @return [Array<(JobListResponse, Integer, Hash)>] JobListResponse data, response status code and response headers
|
|
172
172
|
def list_pdf_jobs_with_http_info(opts = {})
|
|
173
173
|
if @api_client.config.debugging
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.
|
|
6
|
+
The version of the OpenAPI document: 1.13.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.21.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.
|
|
6
|
+
The version of the OpenAPI document: 1.13.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.21.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.
|
|
6
|
+
The version of the OpenAPI document: 1.13.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.21.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.
|
|
6
|
+
The version of the OpenAPI document: 1.13.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.21.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.
|
|
6
|
+
The version of the OpenAPI document: 1.13.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.21.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.
|
|
6
|
+
The version of the OpenAPI document: 1.13.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.21.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 1.
|
|
6
|
+
The version of the OpenAPI document: 1.13.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.21.0
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#TemplateFox API
|
|
3
|
+
|
|
4
|
+
#Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.13.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.21.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module TemplateFox
|
|
17
|
+
class AgentJobCreatedResponse < ApiModelBase
|
|
18
|
+
attr_accessor :job_id
|
|
19
|
+
|
|
20
|
+
attr_accessor :status
|
|
21
|
+
|
|
22
|
+
attr_accessor :credits_charged
|
|
23
|
+
|
|
24
|
+
attr_accessor :credits_remaining
|
|
25
|
+
|
|
26
|
+
class EnumAttributeValidator
|
|
27
|
+
attr_reader :datatype
|
|
28
|
+
attr_reader :allowable_values
|
|
29
|
+
|
|
30
|
+
def initialize(datatype, allowable_values)
|
|
31
|
+
@allowable_values = allowable_values.map do |value|
|
|
32
|
+
case datatype.to_s
|
|
33
|
+
when /Integer/i
|
|
34
|
+
value.to_i
|
|
35
|
+
when /Float/i
|
|
36
|
+
value.to_f
|
|
37
|
+
else
|
|
38
|
+
value
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def valid?(value)
|
|
44
|
+
!value || allowable_values.include?(value)
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
49
|
+
def self.attribute_map
|
|
50
|
+
{
|
|
51
|
+
:'job_id' => :'job_id',
|
|
52
|
+
:'status' => :'status',
|
|
53
|
+
:'credits_charged' => :'credits_charged',
|
|
54
|
+
:'credits_remaining' => :'credits_remaining'
|
|
55
|
+
}
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Returns attribute mapping this model knows about
|
|
59
|
+
def self.acceptable_attribute_map
|
|
60
|
+
attribute_map
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Returns all the JSON keys this model knows about
|
|
64
|
+
def self.acceptable_attributes
|
|
65
|
+
acceptable_attribute_map.values
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Attribute type mapping.
|
|
69
|
+
def self.openapi_types
|
|
70
|
+
{
|
|
71
|
+
:'job_id' => :'String',
|
|
72
|
+
:'status' => :'String',
|
|
73
|
+
:'credits_charged' => :'Integer',
|
|
74
|
+
:'credits_remaining' => :'Integer'
|
|
75
|
+
}
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# List of attributes with nullable: true
|
|
79
|
+
def self.openapi_nullable
|
|
80
|
+
Set.new([
|
|
81
|
+
])
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Initializes the object
|
|
85
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
86
|
+
def initialize(attributes = {})
|
|
87
|
+
if (!attributes.is_a?(Hash))
|
|
88
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TemplateFox::AgentJobCreatedResponse` initialize method"
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
92
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
93
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
94
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
95
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TemplateFox::AgentJobCreatedResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
96
|
+
end
|
|
97
|
+
h[k.to_sym] = v
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if attributes.key?(:'job_id')
|
|
101
|
+
self.job_id = attributes[:'job_id']
|
|
102
|
+
else
|
|
103
|
+
self.job_id = nil
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if attributes.key?(:'status')
|
|
107
|
+
self.status = attributes[:'status']
|
|
108
|
+
else
|
|
109
|
+
self.status = nil
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if attributes.key?(:'credits_charged')
|
|
113
|
+
self.credits_charged = attributes[:'credits_charged']
|
|
114
|
+
else
|
|
115
|
+
self.credits_charged = nil
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
if attributes.key?(:'credits_remaining')
|
|
119
|
+
self.credits_remaining = attributes[:'credits_remaining']
|
|
120
|
+
else
|
|
121
|
+
self.credits_remaining = nil
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
126
|
+
# @return Array for valid properties with the reasons
|
|
127
|
+
def list_invalid_properties
|
|
128
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
129
|
+
invalid_properties = Array.new
|
|
130
|
+
if @job_id.nil?
|
|
131
|
+
invalid_properties.push('invalid value for "job_id", job_id cannot be nil.')
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
if @status.nil?
|
|
135
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if @credits_charged.nil?
|
|
139
|
+
invalid_properties.push('invalid value for "credits_charged", credits_charged cannot be nil.')
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
if @credits_remaining.nil?
|
|
143
|
+
invalid_properties.push('invalid value for "credits_remaining", credits_remaining cannot be nil.')
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
invalid_properties
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Check to see if the all the properties in the model are valid
|
|
150
|
+
# @return true if the model is valid
|
|
151
|
+
def valid?
|
|
152
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
153
|
+
return false if @job_id.nil?
|
|
154
|
+
return false if @status.nil?
|
|
155
|
+
status_validator = EnumAttributeValidator.new('String', ["pending"])
|
|
156
|
+
return false unless status_validator.valid?(@status)
|
|
157
|
+
return false if @credits_charged.nil?
|
|
158
|
+
return false if @credits_remaining.nil?
|
|
159
|
+
true
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# Custom attribute writer method with validation
|
|
163
|
+
# @param [Object] job_id Value to be assigned
|
|
164
|
+
def job_id=(job_id)
|
|
165
|
+
if job_id.nil?
|
|
166
|
+
fail ArgumentError, 'job_id cannot be nil'
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
@job_id = job_id
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
173
|
+
# @param [Object] status Object to be assigned
|
|
174
|
+
def status=(status)
|
|
175
|
+
validator = EnumAttributeValidator.new('String', ["pending"])
|
|
176
|
+
unless validator.valid?(status)
|
|
177
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
|
178
|
+
end
|
|
179
|
+
@status = status
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Custom attribute writer method with validation
|
|
183
|
+
# @param [Object] credits_charged Value to be assigned
|
|
184
|
+
def credits_charged=(credits_charged)
|
|
185
|
+
if credits_charged.nil?
|
|
186
|
+
fail ArgumentError, 'credits_charged cannot be nil'
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
@credits_charged = credits_charged
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# Custom attribute writer method with validation
|
|
193
|
+
# @param [Object] credits_remaining Value to be assigned
|
|
194
|
+
def credits_remaining=(credits_remaining)
|
|
195
|
+
if credits_remaining.nil?
|
|
196
|
+
fail ArgumentError, 'credits_remaining cannot be nil'
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
@credits_remaining = credits_remaining
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# Checks equality by comparing each attribute.
|
|
203
|
+
# @param [Object] Object to be compared
|
|
204
|
+
def ==(o)
|
|
205
|
+
return true if self.equal?(o)
|
|
206
|
+
self.class == o.class &&
|
|
207
|
+
job_id == o.job_id &&
|
|
208
|
+
status == o.status &&
|
|
209
|
+
credits_charged == o.credits_charged &&
|
|
210
|
+
credits_remaining == o.credits_remaining
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
# @see the `==` method
|
|
214
|
+
# @param [Object] Object to be compared
|
|
215
|
+
def eql?(o)
|
|
216
|
+
self == o
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
# Calculates hash code according to all attributes.
|
|
220
|
+
# @return [Integer] Hash code
|
|
221
|
+
def hash
|
|
222
|
+
[job_id, status, credits_charged, credits_remaining].hash
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
# Builds the object from hash
|
|
226
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
227
|
+
# @return [Object] Returns the model itself
|
|
228
|
+
def self.build_from_hash(attributes)
|
|
229
|
+
return nil unless attributes.is_a?(Hash)
|
|
230
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
231
|
+
transformed_hash = {}
|
|
232
|
+
openapi_types.each_pair do |key, type|
|
|
233
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
234
|
+
transformed_hash["#{key}"] = nil
|
|
235
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
236
|
+
# check to ensure the input is an array given that the attribute
|
|
237
|
+
# is documented as an array but the input is not
|
|
238
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
239
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
240
|
+
end
|
|
241
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
242
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
243
|
+
end
|
|
244
|
+
end
|
|
245
|
+
new(transformed_hash)
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
# Returns the object in the form of hash
|
|
249
|
+
# @return [Hash] Returns the object in the form of hash
|
|
250
|
+
def to_hash
|
|
251
|
+
hash = {}
|
|
252
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
253
|
+
value = self.send(attr)
|
|
254
|
+
if value.nil?
|
|
255
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
256
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
hash[param] = _to_hash(value)
|
|
260
|
+
end
|
|
261
|
+
hash
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
end
|