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,159 @@
|
|
|
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
|
+
# Either pdf_url (HTTPS) or pdf_base64 — exactly one.
|
|
18
|
+
class PdfInput < ApiModelBase
|
|
19
|
+
attr_accessor :pdf_url
|
|
20
|
+
|
|
21
|
+
attr_accessor :pdf_base64
|
|
22
|
+
|
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
24
|
+
def self.attribute_map
|
|
25
|
+
{
|
|
26
|
+
:'pdf_url' => :'pdf_url',
|
|
27
|
+
:'pdf_base64' => :'pdf_base64'
|
|
28
|
+
}
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Returns attribute mapping this model knows about
|
|
32
|
+
def self.acceptable_attribute_map
|
|
33
|
+
attribute_map
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns all the JSON keys this model knows about
|
|
37
|
+
def self.acceptable_attributes
|
|
38
|
+
acceptable_attribute_map.values
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Attribute type mapping.
|
|
42
|
+
def self.openapi_types
|
|
43
|
+
{
|
|
44
|
+
:'pdf_url' => :'String',
|
|
45
|
+
:'pdf_base64' => :'String'
|
|
46
|
+
}
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# List of attributes with nullable: true
|
|
50
|
+
def self.openapi_nullable
|
|
51
|
+
Set.new([
|
|
52
|
+
:'pdf_url',
|
|
53
|
+
:'pdf_base64'
|
|
54
|
+
])
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Initializes the object
|
|
58
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
59
|
+
def initialize(attributes = {})
|
|
60
|
+
if (!attributes.is_a?(Hash))
|
|
61
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TemplateFox::PdfInput` initialize method"
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
65
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
66
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
67
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
68
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TemplateFox::PdfInput`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
69
|
+
end
|
|
70
|
+
h[k.to_sym] = v
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if attributes.key?(:'pdf_url')
|
|
74
|
+
self.pdf_url = attributes[:'pdf_url']
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
if attributes.key?(:'pdf_base64')
|
|
78
|
+
self.pdf_base64 = attributes[:'pdf_base64']
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
83
|
+
# @return Array for valid properties with the reasons
|
|
84
|
+
def list_invalid_properties
|
|
85
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
86
|
+
invalid_properties = Array.new
|
|
87
|
+
invalid_properties
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Check to see if the all the properties in the model are valid
|
|
91
|
+
# @return true if the model is valid
|
|
92
|
+
def valid?
|
|
93
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
94
|
+
true
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Checks equality by comparing each attribute.
|
|
98
|
+
# @param [Object] Object to be compared
|
|
99
|
+
def ==(o)
|
|
100
|
+
return true if self.equal?(o)
|
|
101
|
+
self.class == o.class &&
|
|
102
|
+
pdf_url == o.pdf_url &&
|
|
103
|
+
pdf_base64 == o.pdf_base64
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# @see the `==` method
|
|
107
|
+
# @param [Object] Object to be compared
|
|
108
|
+
def eql?(o)
|
|
109
|
+
self == o
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Calculates hash code according to all attributes.
|
|
113
|
+
# @return [Integer] Hash code
|
|
114
|
+
def hash
|
|
115
|
+
[pdf_url, pdf_base64].hash
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Builds the object from hash
|
|
119
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
120
|
+
# @return [Object] Returns the model itself
|
|
121
|
+
def self.build_from_hash(attributes)
|
|
122
|
+
return nil unless attributes.is_a?(Hash)
|
|
123
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
124
|
+
transformed_hash = {}
|
|
125
|
+
openapi_types.each_pair do |key, type|
|
|
126
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
127
|
+
transformed_hash["#{key}"] = nil
|
|
128
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
129
|
+
# check to ensure the input is an array given that the attribute
|
|
130
|
+
# is documented as an array but the input is not
|
|
131
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
132
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
133
|
+
end
|
|
134
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
135
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
new(transformed_hash)
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Returns the object in the form of hash
|
|
142
|
+
# @return [Hash] Returns the object in the form of hash
|
|
143
|
+
def to_hash
|
|
144
|
+
hash = {}
|
|
145
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
146
|
+
value = self.send(attr)
|
|
147
|
+
if value.nil?
|
|
148
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
149
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
hash[param] = _to_hash(value)
|
|
153
|
+
end
|
|
154
|
+
hash
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
end
|
|
@@ -0,0 +1,246 @@
|
|
|
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 PdfToolsResponse < ApiModelBase
|
|
18
|
+
# Signed URL to download the PDF
|
|
19
|
+
attr_accessor :url
|
|
20
|
+
|
|
21
|
+
# Filename of the resulting PDF
|
|
22
|
+
attr_accessor :filename
|
|
23
|
+
|
|
24
|
+
# Remaining credits after this request
|
|
25
|
+
attr_accessor :credits_remaining
|
|
26
|
+
|
|
27
|
+
# Seconds until the signed URL expires
|
|
28
|
+
attr_accessor :expires_in
|
|
29
|
+
|
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
31
|
+
def self.attribute_map
|
|
32
|
+
{
|
|
33
|
+
:'url' => :'url',
|
|
34
|
+
:'filename' => :'filename',
|
|
35
|
+
:'credits_remaining' => :'credits_remaining',
|
|
36
|
+
:'expires_in' => :'expires_in'
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Returns attribute mapping this model knows about
|
|
41
|
+
def self.acceptable_attribute_map
|
|
42
|
+
attribute_map
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Returns all the JSON keys this model knows about
|
|
46
|
+
def self.acceptable_attributes
|
|
47
|
+
acceptable_attribute_map.values
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Attribute type mapping.
|
|
51
|
+
def self.openapi_types
|
|
52
|
+
{
|
|
53
|
+
:'url' => :'String',
|
|
54
|
+
:'filename' => :'String',
|
|
55
|
+
:'credits_remaining' => :'Integer',
|
|
56
|
+
:'expires_in' => :'Integer'
|
|
57
|
+
}
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# List of attributes with nullable: true
|
|
61
|
+
def self.openapi_nullable
|
|
62
|
+
Set.new([
|
|
63
|
+
])
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Initializes the object
|
|
67
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
68
|
+
def initialize(attributes = {})
|
|
69
|
+
if (!attributes.is_a?(Hash))
|
|
70
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TemplateFox::PdfToolsResponse` initialize method"
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
74
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
75
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
76
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
77
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TemplateFox::PdfToolsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
78
|
+
end
|
|
79
|
+
h[k.to_sym] = v
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if attributes.key?(:'url')
|
|
83
|
+
self.url = attributes[:'url']
|
|
84
|
+
else
|
|
85
|
+
self.url = nil
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
if attributes.key?(:'filename')
|
|
89
|
+
self.filename = attributes[:'filename']
|
|
90
|
+
else
|
|
91
|
+
self.filename = nil
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
if attributes.key?(:'credits_remaining')
|
|
95
|
+
self.credits_remaining = attributes[:'credits_remaining']
|
|
96
|
+
else
|
|
97
|
+
self.credits_remaining = nil
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
if attributes.key?(:'expires_in')
|
|
101
|
+
self.expires_in = attributes[:'expires_in']
|
|
102
|
+
else
|
|
103
|
+
self.expires_in = nil
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
108
|
+
# @return Array for valid properties with the reasons
|
|
109
|
+
def list_invalid_properties
|
|
110
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
111
|
+
invalid_properties = Array.new
|
|
112
|
+
if @url.nil?
|
|
113
|
+
invalid_properties.push('invalid value for "url", url cannot be nil.')
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if @filename.nil?
|
|
117
|
+
invalid_properties.push('invalid value for "filename", filename cannot be nil.')
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if @credits_remaining.nil?
|
|
121
|
+
invalid_properties.push('invalid value for "credits_remaining", credits_remaining cannot be nil.')
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if @expires_in.nil?
|
|
125
|
+
invalid_properties.push('invalid value for "expires_in", expires_in cannot be nil.')
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
invalid_properties
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Check to see if the all the properties in the model are valid
|
|
132
|
+
# @return true if the model is valid
|
|
133
|
+
def valid?
|
|
134
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
135
|
+
return false if @url.nil?
|
|
136
|
+
return false if @filename.nil?
|
|
137
|
+
return false if @credits_remaining.nil?
|
|
138
|
+
return false if @expires_in.nil?
|
|
139
|
+
true
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# Custom attribute writer method with validation
|
|
143
|
+
# @param [Object] url Value to be assigned
|
|
144
|
+
def url=(url)
|
|
145
|
+
if url.nil?
|
|
146
|
+
fail ArgumentError, 'url cannot be nil'
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
@url = url
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Custom attribute writer method with validation
|
|
153
|
+
# @param [Object] filename Value to be assigned
|
|
154
|
+
def filename=(filename)
|
|
155
|
+
if filename.nil?
|
|
156
|
+
fail ArgumentError, 'filename cannot be nil'
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
@filename = filename
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# Custom attribute writer method with validation
|
|
163
|
+
# @param [Object] credits_remaining Value to be assigned
|
|
164
|
+
def credits_remaining=(credits_remaining)
|
|
165
|
+
if credits_remaining.nil?
|
|
166
|
+
fail ArgumentError, 'credits_remaining cannot be nil'
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
@credits_remaining = credits_remaining
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Custom attribute writer method with validation
|
|
173
|
+
# @param [Object] expires_in Value to be assigned
|
|
174
|
+
def expires_in=(expires_in)
|
|
175
|
+
if expires_in.nil?
|
|
176
|
+
fail ArgumentError, 'expires_in cannot be nil'
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
@expires_in = expires_in
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Checks equality by comparing each attribute.
|
|
183
|
+
# @param [Object] Object to be compared
|
|
184
|
+
def ==(o)
|
|
185
|
+
return true if self.equal?(o)
|
|
186
|
+
self.class == o.class &&
|
|
187
|
+
url == o.url &&
|
|
188
|
+
filename == o.filename &&
|
|
189
|
+
credits_remaining == o.credits_remaining &&
|
|
190
|
+
expires_in == o.expires_in
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# @see the `==` method
|
|
194
|
+
# @param [Object] Object to be compared
|
|
195
|
+
def eql?(o)
|
|
196
|
+
self == o
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# Calculates hash code according to all attributes.
|
|
200
|
+
# @return [Integer] Hash code
|
|
201
|
+
def hash
|
|
202
|
+
[url, filename, credits_remaining, expires_in].hash
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# Builds the object from hash
|
|
206
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
207
|
+
# @return [Object] Returns the model itself
|
|
208
|
+
def self.build_from_hash(attributes)
|
|
209
|
+
return nil unless attributes.is_a?(Hash)
|
|
210
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
211
|
+
transformed_hash = {}
|
|
212
|
+
openapi_types.each_pair do |key, type|
|
|
213
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
214
|
+
transformed_hash["#{key}"] = nil
|
|
215
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
216
|
+
# check to ensure the input is an array given that the attribute
|
|
217
|
+
# is documented as an array but the input is not
|
|
218
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
219
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
220
|
+
end
|
|
221
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
222
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
223
|
+
end
|
|
224
|
+
end
|
|
225
|
+
new(transformed_hash)
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# Returns the object in the form of hash
|
|
229
|
+
# @return [Hash] Returns the object in the form of hash
|
|
230
|
+
def to_hash
|
|
231
|
+
hash = {}
|
|
232
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
233
|
+
value = self.send(attr)
|
|
234
|
+
if value.nil?
|
|
235
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
236
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
hash[param] = _to_hash(value)
|
|
240
|
+
end
|
|
241
|
+
hash
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
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
|
|
@@ -0,0 +1,288 @@
|
|
|
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 RotatePdfRequest < 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
|
+
attr_accessor :rotation
|
|
31
|
+
|
|
32
|
+
attr_accessor :page_rotations
|
|
33
|
+
|
|
34
|
+
class EnumAttributeValidator
|
|
35
|
+
attr_reader :datatype
|
|
36
|
+
attr_reader :allowable_values
|
|
37
|
+
|
|
38
|
+
def initialize(datatype, allowable_values)
|
|
39
|
+
@allowable_values = allowable_values.map do |value|
|
|
40
|
+
case datatype.to_s
|
|
41
|
+
when /Integer/i
|
|
42
|
+
value.to_i
|
|
43
|
+
when /Float/i
|
|
44
|
+
value.to_f
|
|
45
|
+
else
|
|
46
|
+
value
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def valid?(value)
|
|
52
|
+
!value || allowable_values.include?(value)
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
57
|
+
def self.attribute_map
|
|
58
|
+
{
|
|
59
|
+
:'export_type' => :'export_type',
|
|
60
|
+
:'expiration' => :'expiration',
|
|
61
|
+
:'filename' => :'filename',
|
|
62
|
+
:'pdf_url' => :'pdf_url',
|
|
63
|
+
:'pdf_base64' => :'pdf_base64',
|
|
64
|
+
:'rotation' => :'rotation',
|
|
65
|
+
:'page_rotations' => :'page_rotations'
|
|
66
|
+
}
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Returns attribute mapping this model knows about
|
|
70
|
+
def self.acceptable_attribute_map
|
|
71
|
+
attribute_map
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Returns all the JSON keys this model knows about
|
|
75
|
+
def self.acceptable_attributes
|
|
76
|
+
acceptable_attribute_map.values
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Attribute type mapping.
|
|
80
|
+
def self.openapi_types
|
|
81
|
+
{
|
|
82
|
+
:'export_type' => :'AppRoutersV1PdfToolsExportType',
|
|
83
|
+
:'expiration' => :'Integer',
|
|
84
|
+
:'filename' => :'String',
|
|
85
|
+
:'pdf_url' => :'String',
|
|
86
|
+
:'pdf_base64' => :'String',
|
|
87
|
+
:'rotation' => :'Integer',
|
|
88
|
+
:'page_rotations' => :'Hash<String, Integer>'
|
|
89
|
+
}
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# List of attributes with nullable: true
|
|
93
|
+
def self.openapi_nullable
|
|
94
|
+
Set.new([
|
|
95
|
+
:'filename',
|
|
96
|
+
:'pdf_url',
|
|
97
|
+
:'pdf_base64',
|
|
98
|
+
:'rotation',
|
|
99
|
+
:'page_rotations'
|
|
100
|
+
])
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Initializes the object
|
|
104
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
105
|
+
def initialize(attributes = {})
|
|
106
|
+
if (!attributes.is_a?(Hash))
|
|
107
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TemplateFox::RotatePdfRequest` initialize method"
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
111
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
112
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
113
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
114
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TemplateFox::RotatePdfRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
115
|
+
end
|
|
116
|
+
h[k.to_sym] = v
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if attributes.key?(:'export_type')
|
|
120
|
+
self.export_type = attributes[:'export_type']
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
if attributes.key?(:'expiration')
|
|
124
|
+
self.expiration = attributes[:'expiration']
|
|
125
|
+
else
|
|
126
|
+
self.expiration = 86400
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
if attributes.key?(:'filename')
|
|
130
|
+
self.filename = attributes[:'filename']
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
if attributes.key?(:'pdf_url')
|
|
134
|
+
self.pdf_url = attributes[:'pdf_url']
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
if attributes.key?(:'pdf_base64')
|
|
138
|
+
self.pdf_base64 = attributes[:'pdf_base64']
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
if attributes.key?(:'rotation')
|
|
142
|
+
self.rotation = attributes[:'rotation']
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
if attributes.key?(:'page_rotations')
|
|
146
|
+
if (value = attributes[:'page_rotations']).is_a?(Hash)
|
|
147
|
+
self.page_rotations = value
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
153
|
+
# @return Array for valid properties with the reasons
|
|
154
|
+
def list_invalid_properties
|
|
155
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
156
|
+
invalid_properties = Array.new
|
|
157
|
+
if !@expiration.nil? && @expiration > 604800
|
|
158
|
+
invalid_properties.push('invalid value for "expiration", must be smaller than or equal to 604800.')
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
if !@expiration.nil? && @expiration < 60
|
|
162
|
+
invalid_properties.push('invalid value for "expiration", must be greater than or equal to 60.')
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
if !@filename.nil? && @filename.to_s.length > 100
|
|
166
|
+
invalid_properties.push('invalid value for "filename", the character length must be smaller than or equal to 100.')
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
pattern = Regexp.new(/^[a-zA-Z0-9_\-\.]+$/)
|
|
170
|
+
if !@filename.nil? && @filename !~ pattern
|
|
171
|
+
invalid_properties.push("invalid value for \"filename\", must conform to the pattern #{pattern}.")
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
invalid_properties
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Check to see if the all the properties in the model are valid
|
|
178
|
+
# @return true if the model is valid
|
|
179
|
+
def valid?
|
|
180
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
181
|
+
return false if !@expiration.nil? && @expiration > 604800
|
|
182
|
+
return false if !@expiration.nil? && @expiration < 60
|
|
183
|
+
return false if !@filename.nil? && @filename.to_s.length > 100
|
|
184
|
+
return false if !@filename.nil? && @filename !~ Regexp.new(/^[a-zA-Z0-9_\-\.]+$/)
|
|
185
|
+
true
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# Custom attribute writer method with validation
|
|
189
|
+
# @param [Object] expiration Value to be assigned
|
|
190
|
+
def expiration=(expiration)
|
|
191
|
+
if expiration.nil?
|
|
192
|
+
fail ArgumentError, 'expiration cannot be nil'
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
if expiration > 604800
|
|
196
|
+
fail ArgumentError, 'invalid value for "expiration", must be smaller than or equal to 604800.'
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
if expiration < 60
|
|
200
|
+
fail ArgumentError, 'invalid value for "expiration", must be greater than or equal to 60.'
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
@expiration = expiration
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# Custom attribute writer method with validation
|
|
207
|
+
# @param [Object] filename Value to be assigned
|
|
208
|
+
def filename=(filename)
|
|
209
|
+
if !filename.nil? && filename.to_s.length > 100
|
|
210
|
+
fail ArgumentError, 'invalid value for "filename", the character length must be smaller than or equal to 100.'
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
pattern = Regexp.new(/^[a-zA-Z0-9_\-\.]+$/)
|
|
214
|
+
if !filename.nil? && filename !~ pattern
|
|
215
|
+
fail ArgumentError, "invalid value for \"filename\", must conform to the pattern #{pattern}."
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
@filename = filename
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Checks equality by comparing each attribute.
|
|
222
|
+
# @param [Object] Object to be compared
|
|
223
|
+
def ==(o)
|
|
224
|
+
return true if self.equal?(o)
|
|
225
|
+
self.class == o.class &&
|
|
226
|
+
export_type == o.export_type &&
|
|
227
|
+
expiration == o.expiration &&
|
|
228
|
+
filename == o.filename &&
|
|
229
|
+
pdf_url == o.pdf_url &&
|
|
230
|
+
pdf_base64 == o.pdf_base64 &&
|
|
231
|
+
rotation == o.rotation &&
|
|
232
|
+
page_rotations == o.page_rotations
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
# @see the `==` method
|
|
236
|
+
# @param [Object] Object to be compared
|
|
237
|
+
def eql?(o)
|
|
238
|
+
self == o
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
# Calculates hash code according to all attributes.
|
|
242
|
+
# @return [Integer] Hash code
|
|
243
|
+
def hash
|
|
244
|
+
[export_type, expiration, filename, pdf_url, pdf_base64, rotation, page_rotations].hash
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
# Builds the object from hash
|
|
248
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
249
|
+
# @return [Object] Returns the model itself
|
|
250
|
+
def self.build_from_hash(attributes)
|
|
251
|
+
return nil unless attributes.is_a?(Hash)
|
|
252
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
253
|
+
transformed_hash = {}
|
|
254
|
+
openapi_types.each_pair do |key, type|
|
|
255
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
256
|
+
transformed_hash["#{key}"] = nil
|
|
257
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
258
|
+
# check to ensure the input is an array given that the attribute
|
|
259
|
+
# is documented as an array but the input is not
|
|
260
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
261
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
262
|
+
end
|
|
263
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
264
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
265
|
+
end
|
|
266
|
+
end
|
|
267
|
+
new(transformed_hash)
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
# Returns the object in the form of hash
|
|
271
|
+
# @return [Hash] Returns the object in the form of hash
|
|
272
|
+
def to_hash
|
|
273
|
+
hash = {}
|
|
274
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
275
|
+
value = self.send(attr)
|
|
276
|
+
if value.nil?
|
|
277
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
278
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
hash[param] = _to_hash(value)
|
|
282
|
+
end
|
|
283
|
+
hash
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
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
|