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
|
@@ -0,0 +1,232 @@
|
|
|
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
|
+
# Optional brand constraints passed to the agent.
|
|
18
|
+
class BrandInputs < ApiModelBase
|
|
19
|
+
# Brand colors as hex strings, e.g. ['#0C3C5F', '#E27D28']
|
|
20
|
+
attr_accessor :colors
|
|
21
|
+
|
|
22
|
+
# Preferred font families. Non-built-in fonts are substituted with the closest built-in and noted in the result.
|
|
23
|
+
attr_accessor :fonts
|
|
24
|
+
|
|
25
|
+
# Public https:// URLs of assets (logo, photos) the agent may use.
|
|
26
|
+
attr_accessor :asset_urls
|
|
27
|
+
|
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
29
|
+
def self.attribute_map
|
|
30
|
+
{
|
|
31
|
+
:'colors' => :'colors',
|
|
32
|
+
:'fonts' => :'fonts',
|
|
33
|
+
:'asset_urls' => :'asset_urls'
|
|
34
|
+
}
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns attribute mapping this model knows about
|
|
38
|
+
def self.acceptable_attribute_map
|
|
39
|
+
attribute_map
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Returns all the JSON keys this model knows about
|
|
43
|
+
def self.acceptable_attributes
|
|
44
|
+
acceptable_attribute_map.values
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Attribute type mapping.
|
|
48
|
+
def self.openapi_types
|
|
49
|
+
{
|
|
50
|
+
:'colors' => :'Array<String>',
|
|
51
|
+
:'fonts' => :'Array<String>',
|
|
52
|
+
:'asset_urls' => :'Array<String>'
|
|
53
|
+
}
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# List of attributes with nullable: true
|
|
57
|
+
def self.openapi_nullable
|
|
58
|
+
Set.new([
|
|
59
|
+
])
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Initializes the object
|
|
63
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
64
|
+
def initialize(attributes = {})
|
|
65
|
+
if (!attributes.is_a?(Hash))
|
|
66
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TemplateFox::BrandInputs` initialize method"
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
70
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
71
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
72
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
73
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TemplateFox::BrandInputs`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
74
|
+
end
|
|
75
|
+
h[k.to_sym] = v
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'colors')
|
|
79
|
+
if (value = attributes[:'colors']).is_a?(Array)
|
|
80
|
+
self.colors = value
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
if attributes.key?(:'fonts')
|
|
85
|
+
if (value = attributes[:'fonts']).is_a?(Array)
|
|
86
|
+
self.fonts = value
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
if attributes.key?(:'asset_urls')
|
|
91
|
+
if (value = attributes[:'asset_urls']).is_a?(Array)
|
|
92
|
+
self.asset_urls = value
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
98
|
+
# @return Array for valid properties with the reasons
|
|
99
|
+
def list_invalid_properties
|
|
100
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
101
|
+
invalid_properties = Array.new
|
|
102
|
+
if !@colors.nil? && @colors.length > 8
|
|
103
|
+
invalid_properties.push('invalid value for "colors", number of items must be less than or equal to 8.')
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if !@fonts.nil? && @fonts.length > 4
|
|
107
|
+
invalid_properties.push('invalid value for "fonts", number of items must be less than or equal to 4.')
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
if !@asset_urls.nil? && @asset_urls.length > 5
|
|
111
|
+
invalid_properties.push('invalid value for "asset_urls", number of items must be less than or equal to 5.')
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
invalid_properties
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Check to see if the all the properties in the model are valid
|
|
118
|
+
# @return true if the model is valid
|
|
119
|
+
def valid?
|
|
120
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
121
|
+
return false if !@colors.nil? && @colors.length > 8
|
|
122
|
+
return false if !@fonts.nil? && @fonts.length > 4
|
|
123
|
+
return false if !@asset_urls.nil? && @asset_urls.length > 5
|
|
124
|
+
true
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Custom attribute writer method with validation
|
|
128
|
+
# @param [Object] colors Value to be assigned
|
|
129
|
+
def colors=(colors)
|
|
130
|
+
if colors.nil?
|
|
131
|
+
fail ArgumentError, 'colors cannot be nil'
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
if colors.length > 8
|
|
135
|
+
fail ArgumentError, 'invalid value for "colors", number of items must be less than or equal to 8.'
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
@colors = colors
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Custom attribute writer method with validation
|
|
142
|
+
# @param [Object] fonts Value to be assigned
|
|
143
|
+
def fonts=(fonts)
|
|
144
|
+
if fonts.nil?
|
|
145
|
+
fail ArgumentError, 'fonts cannot be nil'
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
if fonts.length > 4
|
|
149
|
+
fail ArgumentError, 'invalid value for "fonts", number of items must be less than or equal to 4.'
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
@fonts = fonts
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Custom attribute writer method with validation
|
|
156
|
+
# @param [Object] asset_urls Value to be assigned
|
|
157
|
+
def asset_urls=(asset_urls)
|
|
158
|
+
if asset_urls.nil?
|
|
159
|
+
fail ArgumentError, 'asset_urls cannot be nil'
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
if asset_urls.length > 5
|
|
163
|
+
fail ArgumentError, 'invalid value for "asset_urls", number of items must be less than or equal to 5.'
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
@asset_urls = asset_urls
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Checks equality by comparing each attribute.
|
|
170
|
+
# @param [Object] Object to be compared
|
|
171
|
+
def ==(o)
|
|
172
|
+
return true if self.equal?(o)
|
|
173
|
+
self.class == o.class &&
|
|
174
|
+
colors == o.colors &&
|
|
175
|
+
fonts == o.fonts &&
|
|
176
|
+
asset_urls == o.asset_urls
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# @see the `==` method
|
|
180
|
+
# @param [Object] Object to be compared
|
|
181
|
+
def eql?(o)
|
|
182
|
+
self == o
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# Calculates hash code according to all attributes.
|
|
186
|
+
# @return [Integer] Hash code
|
|
187
|
+
def hash
|
|
188
|
+
[colors, fonts, asset_urls].hash
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
# Builds the object from hash
|
|
192
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
193
|
+
# @return [Object] Returns the model itself
|
|
194
|
+
def self.build_from_hash(attributes)
|
|
195
|
+
return nil unless attributes.is_a?(Hash)
|
|
196
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
197
|
+
transformed_hash = {}
|
|
198
|
+
openapi_types.each_pair do |key, type|
|
|
199
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
200
|
+
transformed_hash["#{key}"] = nil
|
|
201
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
202
|
+
# check to ensure the input is an array given that the attribute
|
|
203
|
+
# is documented as an array but the input is not
|
|
204
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
205
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
206
|
+
end
|
|
207
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
208
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
209
|
+
end
|
|
210
|
+
end
|
|
211
|
+
new(transformed_hash)
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
# Returns the object in the form of hash
|
|
215
|
+
# @return [Hash] Returns the object in the form of hash
|
|
216
|
+
def to_hash
|
|
217
|
+
hash = {}
|
|
218
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
219
|
+
value = self.send(attr)
|
|
220
|
+
if value.nil?
|
|
221
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
222
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
hash[param] = _to_hash(value)
|
|
226
|
+
end
|
|
227
|
+
hash
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
end
|
|
@@ -0,0 +1,350 @@
|
|
|
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 CreateAgentTemplateRequest < ApiModelBase
|
|
18
|
+
# What the template should look like and which layers it needs, in natural language.
|
|
19
|
+
attr_accessor :instructions
|
|
20
|
+
|
|
21
|
+
# Template name
|
|
22
|
+
attr_accessor :name
|
|
23
|
+
|
|
24
|
+
attr_accessor :preset
|
|
25
|
+
|
|
26
|
+
attr_accessor :width
|
|
27
|
+
|
|
28
|
+
attr_accessor :height
|
|
29
|
+
|
|
30
|
+
attr_accessor :brand
|
|
31
|
+
|
|
32
|
+
class EnumAttributeValidator
|
|
33
|
+
attr_reader :datatype
|
|
34
|
+
attr_reader :allowable_values
|
|
35
|
+
|
|
36
|
+
def initialize(datatype, allowable_values)
|
|
37
|
+
@allowable_values = allowable_values.map do |value|
|
|
38
|
+
case datatype.to_s
|
|
39
|
+
when /Integer/i
|
|
40
|
+
value.to_i
|
|
41
|
+
when /Float/i
|
|
42
|
+
value.to_f
|
|
43
|
+
else
|
|
44
|
+
value
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def valid?(value)
|
|
50
|
+
!value || allowable_values.include?(value)
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
55
|
+
def self.attribute_map
|
|
56
|
+
{
|
|
57
|
+
:'instructions' => :'instructions',
|
|
58
|
+
:'name' => :'name',
|
|
59
|
+
:'preset' => :'preset',
|
|
60
|
+
:'width' => :'width',
|
|
61
|
+
:'height' => :'height',
|
|
62
|
+
:'brand' => :'brand'
|
|
63
|
+
}
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Returns attribute mapping this model knows about
|
|
67
|
+
def self.acceptable_attribute_map
|
|
68
|
+
attribute_map
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Returns all the JSON keys this model knows about
|
|
72
|
+
def self.acceptable_attributes
|
|
73
|
+
acceptable_attribute_map.values
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Attribute type mapping.
|
|
77
|
+
def self.openapi_types
|
|
78
|
+
{
|
|
79
|
+
:'instructions' => :'String',
|
|
80
|
+
:'name' => :'String',
|
|
81
|
+
:'preset' => :'String',
|
|
82
|
+
:'width' => :'Integer',
|
|
83
|
+
:'height' => :'Integer',
|
|
84
|
+
:'brand' => :'BrandInputs'
|
|
85
|
+
}
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# List of attributes with nullable: true
|
|
89
|
+
def self.openapi_nullable
|
|
90
|
+
Set.new([
|
|
91
|
+
:'preset',
|
|
92
|
+
:'width',
|
|
93
|
+
:'height',
|
|
94
|
+
:'brand'
|
|
95
|
+
])
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Initializes the object
|
|
99
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
100
|
+
def initialize(attributes = {})
|
|
101
|
+
if (!attributes.is_a?(Hash))
|
|
102
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TemplateFox::CreateAgentTemplateRequest` initialize method"
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
106
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
107
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
108
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
109
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TemplateFox::CreateAgentTemplateRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
110
|
+
end
|
|
111
|
+
h[k.to_sym] = v
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if attributes.key?(:'instructions')
|
|
115
|
+
self.instructions = attributes[:'instructions']
|
|
116
|
+
else
|
|
117
|
+
self.instructions = nil
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'name')
|
|
121
|
+
self.name = attributes[:'name']
|
|
122
|
+
else
|
|
123
|
+
self.name = nil
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
if attributes.key?(:'preset')
|
|
127
|
+
self.preset = attributes[:'preset']
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
if attributes.key?(:'width')
|
|
131
|
+
self.width = attributes[:'width']
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
if attributes.key?(:'height')
|
|
135
|
+
self.height = attributes[:'height']
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if attributes.key?(:'brand')
|
|
139
|
+
self.brand = attributes[:'brand']
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
144
|
+
# @return Array for valid properties with the reasons
|
|
145
|
+
def list_invalid_properties
|
|
146
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
147
|
+
invalid_properties = Array.new
|
|
148
|
+
if @instructions.nil?
|
|
149
|
+
invalid_properties.push('invalid value for "instructions", instructions cannot be nil.')
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
if @instructions.to_s.length > 4000
|
|
153
|
+
invalid_properties.push('invalid value for "instructions", the character length must be smaller than or equal to 4000.')
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if @instructions.to_s.length < 10
|
|
157
|
+
invalid_properties.push('invalid value for "instructions", the character length must be greater than or equal to 10.')
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
if @name.nil?
|
|
161
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
if @name.to_s.length > 100
|
|
165
|
+
invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.')
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
if @name.to_s.length < 1
|
|
169
|
+
invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.')
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
if !@width.nil? && @width > 8000
|
|
173
|
+
invalid_properties.push('invalid value for "width", must be smaller than or equal to 8000.')
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
if !@width.nil? && @width < 16
|
|
177
|
+
invalid_properties.push('invalid value for "width", must be greater than or equal to 16.')
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
if !@height.nil? && @height > 8000
|
|
181
|
+
invalid_properties.push('invalid value for "height", must be smaller than or equal to 8000.')
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
if !@height.nil? && @height < 16
|
|
185
|
+
invalid_properties.push('invalid value for "height", must be greater than or equal to 16.')
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
invalid_properties
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
# Check to see if the all the properties in the model are valid
|
|
192
|
+
# @return true if the model is valid
|
|
193
|
+
def valid?
|
|
194
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
195
|
+
return false if @instructions.nil?
|
|
196
|
+
return false if @instructions.to_s.length > 4000
|
|
197
|
+
return false if @instructions.to_s.length < 10
|
|
198
|
+
return false if @name.nil?
|
|
199
|
+
return false if @name.to_s.length > 100
|
|
200
|
+
return false if @name.to_s.length < 1
|
|
201
|
+
preset_validator = EnumAttributeValidator.new('String', ["instagram-square", "instagram-story", "og-image", "twitter-card", "pinterest-pin", "square-512"])
|
|
202
|
+
return false unless preset_validator.valid?(@preset)
|
|
203
|
+
return false if !@width.nil? && @width > 8000
|
|
204
|
+
return false if !@width.nil? && @width < 16
|
|
205
|
+
return false if !@height.nil? && @height > 8000
|
|
206
|
+
return false if !@height.nil? && @height < 16
|
|
207
|
+
true
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# Custom attribute writer method with validation
|
|
211
|
+
# @param [Object] instructions Value to be assigned
|
|
212
|
+
def instructions=(instructions)
|
|
213
|
+
if instructions.nil?
|
|
214
|
+
fail ArgumentError, 'instructions cannot be nil'
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
if instructions.to_s.length > 4000
|
|
218
|
+
fail ArgumentError, 'invalid value for "instructions", the character length must be smaller than or equal to 4000.'
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
if instructions.to_s.length < 10
|
|
222
|
+
fail ArgumentError, 'invalid value for "instructions", the character length must be greater than or equal to 10.'
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
@instructions = instructions
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# Custom attribute writer method with validation
|
|
229
|
+
# @param [Object] name Value to be assigned
|
|
230
|
+
def name=(name)
|
|
231
|
+
if name.nil?
|
|
232
|
+
fail ArgumentError, 'name cannot be nil'
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
if name.to_s.length > 100
|
|
236
|
+
fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.'
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
if name.to_s.length < 1
|
|
240
|
+
fail ArgumentError, 'invalid value for "name", the character length must be greater than or equal to 1.'
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
@name = name
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
247
|
+
# @param [Object] preset Object to be assigned
|
|
248
|
+
def preset=(preset)
|
|
249
|
+
validator = EnumAttributeValidator.new('String', ["instagram-square", "instagram-story", "og-image", "twitter-card", "pinterest-pin", "square-512"])
|
|
250
|
+
unless validator.valid?(preset)
|
|
251
|
+
fail ArgumentError, "invalid value for \"preset\", must be one of #{validator.allowable_values}."
|
|
252
|
+
end
|
|
253
|
+
@preset = preset
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
# Custom attribute writer method with validation
|
|
257
|
+
# @param [Object] width Value to be assigned
|
|
258
|
+
def width=(width)
|
|
259
|
+
if !width.nil? && width > 8000
|
|
260
|
+
fail ArgumentError, 'invalid value for "width", must be smaller than or equal to 8000.'
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
if !width.nil? && width < 16
|
|
264
|
+
fail ArgumentError, 'invalid value for "width", must be greater than or equal to 16.'
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
@width = width
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
# Custom attribute writer method with validation
|
|
271
|
+
# @param [Object] height Value to be assigned
|
|
272
|
+
def height=(height)
|
|
273
|
+
if !height.nil? && height > 8000
|
|
274
|
+
fail ArgumentError, 'invalid value for "height", must be smaller than or equal to 8000.'
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
if !height.nil? && height < 16
|
|
278
|
+
fail ArgumentError, 'invalid value for "height", must be greater than or equal to 16.'
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
@height = height
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
# Checks equality by comparing each attribute.
|
|
285
|
+
# @param [Object] Object to be compared
|
|
286
|
+
def ==(o)
|
|
287
|
+
return true if self.equal?(o)
|
|
288
|
+
self.class == o.class &&
|
|
289
|
+
instructions == o.instructions &&
|
|
290
|
+
name == o.name &&
|
|
291
|
+
preset == o.preset &&
|
|
292
|
+
width == o.width &&
|
|
293
|
+
height == o.height &&
|
|
294
|
+
brand == o.brand
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
# @see the `==` method
|
|
298
|
+
# @param [Object] Object to be compared
|
|
299
|
+
def eql?(o)
|
|
300
|
+
self == o
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
# Calculates hash code according to all attributes.
|
|
304
|
+
# @return [Integer] Hash code
|
|
305
|
+
def hash
|
|
306
|
+
[instructions, name, preset, width, height, brand].hash
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
# Builds the object from hash
|
|
310
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
311
|
+
# @return [Object] Returns the model itself
|
|
312
|
+
def self.build_from_hash(attributes)
|
|
313
|
+
return nil unless attributes.is_a?(Hash)
|
|
314
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
315
|
+
transformed_hash = {}
|
|
316
|
+
openapi_types.each_pair do |key, type|
|
|
317
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
318
|
+
transformed_hash["#{key}"] = nil
|
|
319
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
320
|
+
# check to ensure the input is an array given that the attribute
|
|
321
|
+
# is documented as an array but the input is not
|
|
322
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
323
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
324
|
+
end
|
|
325
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
326
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
327
|
+
end
|
|
328
|
+
end
|
|
329
|
+
new(transformed_hash)
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
# Returns the object in the form of hash
|
|
333
|
+
# @return [Hash] Returns the object in the form of hash
|
|
334
|
+
def to_hash
|
|
335
|
+
hash = {}
|
|
336
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
337
|
+
value = self.send(attr)
|
|
338
|
+
if value.nil?
|
|
339
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
340
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
hash[param] = _to_hash(value)
|
|
344
|
+
end
|
|
345
|
+
hash
|
|
346
|
+
end
|
|
347
|
+
|
|
348
|
+
end
|
|
349
|
+
|
|
350
|
+
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
|
|
@@ -70,7 +70,7 @@ module TemplateFox
|
|
|
70
70
|
def self.openapi_types
|
|
71
71
|
{
|
|
72
72
|
:'job_id' => :'String',
|
|
73
|
-
:'status' => :'
|
|
73
|
+
:'status' => :'AppRoutersV1PdfAsyncJobStatus',
|
|
74
74
|
:'credits_remaining' => :'Integer'
|
|
75
75
|
}
|
|
76
76
|
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
|
|
@@ -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
|