templatefox 1.9.6 → 1.10.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/integrations_api.rb +1 -1
- data/lib/templatefox/api/pdf_api.rb +1 -1
- data/lib/templatefox/api/pdf_async_api.rb +1 -1
- data/lib/templatefox/api/pdf_tools_api.rb +226 -0
- 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/app_routers_v1_pdf_async_export_type.rb +1 -1
- data/lib/templatefox/models/app_routers_v1_pdf_export_type.rb +1 -1
- data/lib/templatefox/models/app_routers_v1_pdf_tools_export_type.rb +40 -0
- data/lib/templatefox/models/create_async_pdf_request.rb +1 -1
- data/lib/templatefox/models/create_async_pdf_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 +293 -0
- data/lib/templatefox/models/http_validation_error.rb +1 -1
- data/lib/templatefox/models/job_list_response.rb +1 -1
- data/lib/templatefox/models/job_status.rb +1 -1
- data/lib/templatefox/models/job_status_response.rb +1 -1
- data/lib/templatefox/models/location_inner.rb +1 -1
- data/lib/templatefox/models/merge_pdf_request.rb +284 -0
- data/lib/templatefox/models/pdf_input.rb +159 -0
- data/lib/templatefox/models/pdf_tools_response.rb +246 -0
- data/lib/templatefox/models/pdf_variant.rb +1 -1
- data/lib/templatefox/models/rotate_pdf_request.rb +288 -0
- 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_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 +8 -1
- data/spec/api/account_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 +1 -1
- data/spec/api/pdf_tools_api_spec.rb +71 -0
- data/spec/api/templates_api_spec.rb +1 -1
- data/spec/models/account_info_response_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_export_type_spec.rb +1 -1
- data/spec/models/app_routers_v1_pdf_tools_export_type_spec.rb +30 -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_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 +66 -0
- data/spec/models/http_validation_error_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/job_status_spec.rb +1 -1
- data/spec/models/location_inner_spec.rb +1 -1
- data/spec/models/merge_pdf_request_spec.rb +54 -0
- data/spec/models/pdf_input_spec.rb +42 -0
- data/spec/models/pdf_tools_response_spec.rb +54 -0
- data/spec/models/pdf_variant_spec.rb +1 -1
- data/spec/models/rotate_pdf_request_spec.rb +72 -0
- 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_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 +23 -2
|
@@ -0,0 +1,293 @@
|
|
|
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.10.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 ExtractPdfPagesRequest < ApiModelBase
|
|
18
|
+
# `url` uploads to CDN and returns URL, `binary` returns raw PDF bytes
|
|
19
|
+
attr_accessor :export_type
|
|
20
|
+
|
|
21
|
+
# URL expiration in seconds. Min 60, max 604800. Only applies to `url` export type.
|
|
22
|
+
attr_accessor :expiration
|
|
23
|
+
|
|
24
|
+
attr_accessor :filename
|
|
25
|
+
|
|
26
|
+
attr_accessor :pdf_url
|
|
27
|
+
|
|
28
|
+
attr_accessor :pdf_base64
|
|
29
|
+
|
|
30
|
+
# 1-indexed page selection. Supports ranges and singles separated by commas, e.g. `1-3, 5, 7-9`. Order is preserved (`5,1,3` outputs those 3 pages in that order).
|
|
31
|
+
attr_accessor :pages
|
|
32
|
+
|
|
33
|
+
class EnumAttributeValidator
|
|
34
|
+
attr_reader :datatype
|
|
35
|
+
attr_reader :allowable_values
|
|
36
|
+
|
|
37
|
+
def initialize(datatype, allowable_values)
|
|
38
|
+
@allowable_values = allowable_values.map do |value|
|
|
39
|
+
case datatype.to_s
|
|
40
|
+
when /Integer/i
|
|
41
|
+
value.to_i
|
|
42
|
+
when /Float/i
|
|
43
|
+
value.to_f
|
|
44
|
+
else
|
|
45
|
+
value
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def valid?(value)
|
|
51
|
+
!value || allowable_values.include?(value)
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
56
|
+
def self.attribute_map
|
|
57
|
+
{
|
|
58
|
+
:'export_type' => :'export_type',
|
|
59
|
+
:'expiration' => :'expiration',
|
|
60
|
+
:'filename' => :'filename',
|
|
61
|
+
:'pdf_url' => :'pdf_url',
|
|
62
|
+
:'pdf_base64' => :'pdf_base64',
|
|
63
|
+
:'pages' => :'pages'
|
|
64
|
+
}
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Returns attribute mapping this model knows about
|
|
68
|
+
def self.acceptable_attribute_map
|
|
69
|
+
attribute_map
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Returns all the JSON keys this model knows about
|
|
73
|
+
def self.acceptable_attributes
|
|
74
|
+
acceptable_attribute_map.values
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Attribute type mapping.
|
|
78
|
+
def self.openapi_types
|
|
79
|
+
{
|
|
80
|
+
:'export_type' => :'AppRoutersV1PdfToolsExportType',
|
|
81
|
+
:'expiration' => :'Integer',
|
|
82
|
+
:'filename' => :'String',
|
|
83
|
+
:'pdf_url' => :'String',
|
|
84
|
+
:'pdf_base64' => :'String',
|
|
85
|
+
:'pages' => :'String'
|
|
86
|
+
}
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# List of attributes with nullable: true
|
|
90
|
+
def self.openapi_nullable
|
|
91
|
+
Set.new([
|
|
92
|
+
:'filename',
|
|
93
|
+
:'pdf_url',
|
|
94
|
+
:'pdf_base64',
|
|
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::ExtractPdfPagesRequest` 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::ExtractPdfPagesRequest`. 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?(:'export_type')
|
|
115
|
+
self.export_type = attributes[:'export_type']
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
if attributes.key?(:'expiration')
|
|
119
|
+
self.expiration = attributes[:'expiration']
|
|
120
|
+
else
|
|
121
|
+
self.expiration = 86400
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if attributes.key?(:'filename')
|
|
125
|
+
self.filename = attributes[:'filename']
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if attributes.key?(:'pdf_url')
|
|
129
|
+
self.pdf_url = attributes[:'pdf_url']
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if attributes.key?(:'pdf_base64')
|
|
133
|
+
self.pdf_base64 = attributes[:'pdf_base64']
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if attributes.key?(:'pages')
|
|
137
|
+
self.pages = attributes[:'pages']
|
|
138
|
+
else
|
|
139
|
+
self.pages = nil
|
|
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 !@expiration.nil? && @expiration > 604800
|
|
149
|
+
invalid_properties.push('invalid value for "expiration", must be smaller than or equal to 604800.')
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
if !@expiration.nil? && @expiration < 60
|
|
153
|
+
invalid_properties.push('invalid value for "expiration", must be greater than or equal to 60.')
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if !@filename.nil? && @filename.to_s.length > 100
|
|
157
|
+
invalid_properties.push('invalid value for "filename", the character length must be smaller than or equal to 100.')
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
pattern = Regexp.new(/^[a-zA-Z0-9_\-\.]+$/)
|
|
161
|
+
if !@filename.nil? && @filename !~ pattern
|
|
162
|
+
invalid_properties.push("invalid value for \"filename\", must conform to the pattern #{pattern}.")
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
if @pages.nil?
|
|
166
|
+
invalid_properties.push('invalid value for "pages", pages cannot be nil.')
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
invalid_properties
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Check to see if the all the properties in the model are valid
|
|
173
|
+
# @return true if the model is valid
|
|
174
|
+
def valid?
|
|
175
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
176
|
+
return false if !@expiration.nil? && @expiration > 604800
|
|
177
|
+
return false if !@expiration.nil? && @expiration < 60
|
|
178
|
+
return false if !@filename.nil? && @filename.to_s.length > 100
|
|
179
|
+
return false if !@filename.nil? && @filename !~ Regexp.new(/^[a-zA-Z0-9_\-\.]+$/)
|
|
180
|
+
return false if @pages.nil?
|
|
181
|
+
true
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# Custom attribute writer method with validation
|
|
185
|
+
# @param [Object] expiration Value to be assigned
|
|
186
|
+
def expiration=(expiration)
|
|
187
|
+
if expiration.nil?
|
|
188
|
+
fail ArgumentError, 'expiration cannot be nil'
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
if expiration > 604800
|
|
192
|
+
fail ArgumentError, 'invalid value for "expiration", must be smaller than or equal to 604800.'
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
if expiration < 60
|
|
196
|
+
fail ArgumentError, 'invalid value for "expiration", must be greater than or equal to 60.'
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
@expiration = expiration
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# Custom attribute writer method with validation
|
|
203
|
+
# @param [Object] filename Value to be assigned
|
|
204
|
+
def filename=(filename)
|
|
205
|
+
if !filename.nil? && filename.to_s.length > 100
|
|
206
|
+
fail ArgumentError, 'invalid value for "filename", the character length must be smaller than or equal to 100.'
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
pattern = Regexp.new(/^[a-zA-Z0-9_\-\.]+$/)
|
|
210
|
+
if !filename.nil? && filename !~ pattern
|
|
211
|
+
fail ArgumentError, "invalid value for \"filename\", must conform to the pattern #{pattern}."
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
@filename = filename
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# Custom attribute writer method with validation
|
|
218
|
+
# @param [Object] pages Value to be assigned
|
|
219
|
+
def pages=(pages)
|
|
220
|
+
if pages.nil?
|
|
221
|
+
fail ArgumentError, 'pages cannot be nil'
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
@pages = pages
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# Checks equality by comparing each attribute.
|
|
228
|
+
# @param [Object] Object to be compared
|
|
229
|
+
def ==(o)
|
|
230
|
+
return true if self.equal?(o)
|
|
231
|
+
self.class == o.class &&
|
|
232
|
+
export_type == o.export_type &&
|
|
233
|
+
expiration == o.expiration &&
|
|
234
|
+
filename == o.filename &&
|
|
235
|
+
pdf_url == o.pdf_url &&
|
|
236
|
+
pdf_base64 == o.pdf_base64 &&
|
|
237
|
+
pages == o.pages
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
# @see the `==` method
|
|
241
|
+
# @param [Object] Object to be compared
|
|
242
|
+
def eql?(o)
|
|
243
|
+
self == o
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
# Calculates hash code according to all attributes.
|
|
247
|
+
# @return [Integer] Hash code
|
|
248
|
+
def hash
|
|
249
|
+
[export_type, expiration, filename, pdf_url, pdf_base64, pages].hash
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
# Builds the object from hash
|
|
253
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
254
|
+
# @return [Object] Returns the model itself
|
|
255
|
+
def self.build_from_hash(attributes)
|
|
256
|
+
return nil unless attributes.is_a?(Hash)
|
|
257
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
258
|
+
transformed_hash = {}
|
|
259
|
+
openapi_types.each_pair do |key, type|
|
|
260
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
261
|
+
transformed_hash["#{key}"] = nil
|
|
262
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
263
|
+
# check to ensure the input is an array given that the attribute
|
|
264
|
+
# is documented as an array but the input is not
|
|
265
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
266
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
267
|
+
end
|
|
268
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
269
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
270
|
+
end
|
|
271
|
+
end
|
|
272
|
+
new(transformed_hash)
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
# Returns the object in the form of hash
|
|
276
|
+
# @return [Hash] Returns the object in the form of hash
|
|
277
|
+
def to_hash
|
|
278
|
+
hash = {}
|
|
279
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
280
|
+
value = self.send(attr)
|
|
281
|
+
if value.nil?
|
|
282
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
283
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
hash[param] = _to_hash(value)
|
|
287
|
+
end
|
|
288
|
+
hash
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
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.10.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.10.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.10.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.10.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.10.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.21.0
|
|
@@ -0,0 +1,284 @@
|
|
|
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.10.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 MergePdfRequest < ApiModelBase
|
|
18
|
+
# `url` uploads to CDN and returns URL, `binary` returns raw PDF bytes
|
|
19
|
+
attr_accessor :export_type
|
|
20
|
+
|
|
21
|
+
# URL expiration in seconds. Min 60, max 604800. Only applies to `url` export type.
|
|
22
|
+
attr_accessor :expiration
|
|
23
|
+
|
|
24
|
+
attr_accessor :filename
|
|
25
|
+
|
|
26
|
+
# Ordered list of PDFs to merge. Each entry has either `pdf_url` or `pdf_base64`. Minimum 2.
|
|
27
|
+
attr_accessor :pdfs
|
|
28
|
+
|
|
29
|
+
class EnumAttributeValidator
|
|
30
|
+
attr_reader :datatype
|
|
31
|
+
attr_reader :allowable_values
|
|
32
|
+
|
|
33
|
+
def initialize(datatype, allowable_values)
|
|
34
|
+
@allowable_values = allowable_values.map do |value|
|
|
35
|
+
case datatype.to_s
|
|
36
|
+
when /Integer/i
|
|
37
|
+
value.to_i
|
|
38
|
+
when /Float/i
|
|
39
|
+
value.to_f
|
|
40
|
+
else
|
|
41
|
+
value
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def valid?(value)
|
|
47
|
+
!value || allowable_values.include?(value)
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
52
|
+
def self.attribute_map
|
|
53
|
+
{
|
|
54
|
+
:'export_type' => :'export_type',
|
|
55
|
+
:'expiration' => :'expiration',
|
|
56
|
+
:'filename' => :'filename',
|
|
57
|
+
:'pdfs' => :'pdfs'
|
|
58
|
+
}
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Returns attribute mapping this model knows about
|
|
62
|
+
def self.acceptable_attribute_map
|
|
63
|
+
attribute_map
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Returns all the JSON keys this model knows about
|
|
67
|
+
def self.acceptable_attributes
|
|
68
|
+
acceptable_attribute_map.values
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Attribute type mapping.
|
|
72
|
+
def self.openapi_types
|
|
73
|
+
{
|
|
74
|
+
:'export_type' => :'AppRoutersV1PdfToolsExportType',
|
|
75
|
+
:'expiration' => :'Integer',
|
|
76
|
+
:'filename' => :'String',
|
|
77
|
+
:'pdfs' => :'Array<PdfInput>'
|
|
78
|
+
}
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# List of attributes with nullable: true
|
|
82
|
+
def self.openapi_nullable
|
|
83
|
+
Set.new([
|
|
84
|
+
:'filename',
|
|
85
|
+
])
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Initializes the object
|
|
89
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
90
|
+
def initialize(attributes = {})
|
|
91
|
+
if (!attributes.is_a?(Hash))
|
|
92
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TemplateFox::MergePdfRequest` initialize method"
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
96
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
97
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
98
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
99
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TemplateFox::MergePdfRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
100
|
+
end
|
|
101
|
+
h[k.to_sym] = v
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if attributes.key?(:'export_type')
|
|
105
|
+
self.export_type = attributes[:'export_type']
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'expiration')
|
|
109
|
+
self.expiration = attributes[:'expiration']
|
|
110
|
+
else
|
|
111
|
+
self.expiration = 86400
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if attributes.key?(:'filename')
|
|
115
|
+
self.filename = attributes[:'filename']
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
if attributes.key?(:'pdfs')
|
|
119
|
+
if (value = attributes[:'pdfs']).is_a?(Array)
|
|
120
|
+
self.pdfs = value
|
|
121
|
+
end
|
|
122
|
+
else
|
|
123
|
+
self.pdfs = nil
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
128
|
+
# @return Array for valid properties with the reasons
|
|
129
|
+
def list_invalid_properties
|
|
130
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
131
|
+
invalid_properties = Array.new
|
|
132
|
+
if !@expiration.nil? && @expiration > 604800
|
|
133
|
+
invalid_properties.push('invalid value for "expiration", must be smaller than or equal to 604800.')
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if !@expiration.nil? && @expiration < 60
|
|
137
|
+
invalid_properties.push('invalid value for "expiration", must be greater than or equal to 60.')
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if !@filename.nil? && @filename.to_s.length > 100
|
|
141
|
+
invalid_properties.push('invalid value for "filename", the character length must be smaller than or equal to 100.')
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
pattern = Regexp.new(/^[a-zA-Z0-9_\-\.]+$/)
|
|
145
|
+
if !@filename.nil? && @filename !~ pattern
|
|
146
|
+
invalid_properties.push("invalid value for \"filename\", must conform to the pattern #{pattern}.")
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
if @pdfs.nil?
|
|
150
|
+
invalid_properties.push('invalid value for "pdfs", pdfs cannot be nil.')
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
if @pdfs.length < 2
|
|
154
|
+
invalid_properties.push('invalid value for "pdfs", number of items must be greater than or equal to 2.')
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
invalid_properties
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Check to see if the all the properties in the model are valid
|
|
161
|
+
# @return true if the model is valid
|
|
162
|
+
def valid?
|
|
163
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
164
|
+
return false if !@expiration.nil? && @expiration > 604800
|
|
165
|
+
return false if !@expiration.nil? && @expiration < 60
|
|
166
|
+
return false if !@filename.nil? && @filename.to_s.length > 100
|
|
167
|
+
return false if !@filename.nil? && @filename !~ Regexp.new(/^[a-zA-Z0-9_\-\.]+$/)
|
|
168
|
+
return false if @pdfs.nil?
|
|
169
|
+
return false if @pdfs.length < 2
|
|
170
|
+
true
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Custom attribute writer method with validation
|
|
174
|
+
# @param [Object] expiration Value to be assigned
|
|
175
|
+
def expiration=(expiration)
|
|
176
|
+
if expiration.nil?
|
|
177
|
+
fail ArgumentError, 'expiration cannot be nil'
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
if expiration > 604800
|
|
181
|
+
fail ArgumentError, 'invalid value for "expiration", must be smaller than or equal to 604800.'
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
if expiration < 60
|
|
185
|
+
fail ArgumentError, 'invalid value for "expiration", must be greater than or equal to 60.'
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
@expiration = expiration
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
# Custom attribute writer method with validation
|
|
192
|
+
# @param [Object] filename Value to be assigned
|
|
193
|
+
def filename=(filename)
|
|
194
|
+
if !filename.nil? && filename.to_s.length > 100
|
|
195
|
+
fail ArgumentError, 'invalid value for "filename", the character length must be smaller than or equal to 100.'
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
pattern = Regexp.new(/^[a-zA-Z0-9_\-\.]+$/)
|
|
199
|
+
if !filename.nil? && filename !~ pattern
|
|
200
|
+
fail ArgumentError, "invalid value for \"filename\", must conform to the pattern #{pattern}."
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
@filename = filename
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# Custom attribute writer method with validation
|
|
207
|
+
# @param [Object] pdfs Value to be assigned
|
|
208
|
+
def pdfs=(pdfs)
|
|
209
|
+
if pdfs.nil?
|
|
210
|
+
fail ArgumentError, 'pdfs cannot be nil'
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
if pdfs.length < 2
|
|
214
|
+
fail ArgumentError, 'invalid value for "pdfs", number of items must be greater than or equal to 2.'
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
@pdfs = pdfs
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
# Checks equality by comparing each attribute.
|
|
221
|
+
# @param [Object] Object to be compared
|
|
222
|
+
def ==(o)
|
|
223
|
+
return true if self.equal?(o)
|
|
224
|
+
self.class == o.class &&
|
|
225
|
+
export_type == o.export_type &&
|
|
226
|
+
expiration == o.expiration &&
|
|
227
|
+
filename == o.filename &&
|
|
228
|
+
pdfs == o.pdfs
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
# @see the `==` method
|
|
232
|
+
# @param [Object] Object to be compared
|
|
233
|
+
def eql?(o)
|
|
234
|
+
self == o
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
# Calculates hash code according to all attributes.
|
|
238
|
+
# @return [Integer] Hash code
|
|
239
|
+
def hash
|
|
240
|
+
[export_type, expiration, filename, pdfs].hash
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
# Builds the object from hash
|
|
244
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
245
|
+
# @return [Object] Returns the model itself
|
|
246
|
+
def self.build_from_hash(attributes)
|
|
247
|
+
return nil unless attributes.is_a?(Hash)
|
|
248
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
249
|
+
transformed_hash = {}
|
|
250
|
+
openapi_types.each_pair do |key, type|
|
|
251
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
252
|
+
transformed_hash["#{key}"] = nil
|
|
253
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
254
|
+
# check to ensure the input is an array given that the attribute
|
|
255
|
+
# is documented as an array but the input is not
|
|
256
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
257
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
258
|
+
end
|
|
259
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
260
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
261
|
+
end
|
|
262
|
+
end
|
|
263
|
+
new(transformed_hash)
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
# Returns the object in the form of hash
|
|
267
|
+
# @return [Hash] Returns the object in the form of hash
|
|
268
|
+
def to_hash
|
|
269
|
+
hash = {}
|
|
270
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
271
|
+
value = self.send(attr)
|
|
272
|
+
if value.nil?
|
|
273
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
274
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
hash[param] = _to_hash(value)
|
|
278
|
+
end
|
|
279
|
+
hash
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
end
|