templatefox 1.9.6 → 1.11.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.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/lib/templatefox/api/account_api.rb +1 -1
  3. data/lib/templatefox/api/image_api.rb +90 -0
  4. data/lib/templatefox/api/integrations_api.rb +1 -1
  5. data/lib/templatefox/api/pdf_api.rb +1 -1
  6. data/lib/templatefox/api/pdf_async_api.rb +1 -1
  7. data/lib/templatefox/api/pdf_tools_api.rb +226 -0
  8. data/lib/templatefox/api/templates_api.rb +9 -1
  9. data/lib/templatefox/api_client.rb +1 -1
  10. data/lib/templatefox/api_error.rb +1 -1
  11. data/lib/templatefox/api_model_base.rb +1 -1
  12. data/lib/templatefox/configuration.rb +1 -1
  13. data/lib/templatefox/models/account_info_response.rb +1 -1
  14. data/lib/templatefox/models/{app_routers_v1_pdf_export_type.rb → app_routers_v1_delivery_export_type.rb} +4 -4
  15. data/lib/templatefox/models/app_routers_v1_pdf_async_export_type.rb +1 -1
  16. data/lib/templatefox/models/app_routers_v1_pdf_tools_export_type.rb +40 -0
  17. data/lib/templatefox/models/create_async_pdf_request.rb +1 -1
  18. data/lib/templatefox/models/create_async_pdf_response.rb +1 -1
  19. data/lib/templatefox/models/create_image_request.rb +533 -0
  20. data/lib/templatefox/models/create_image_response.rb +259 -0
  21. data/lib/templatefox/models/create_pdf_request.rb +2 -2
  22. data/lib/templatefox/models/create_pdf_response.rb +1 -1
  23. data/lib/templatefox/models/create_version_request.rb +1 -1
  24. data/lib/templatefox/models/extract_pdf_pages_request.rb +293 -0
  25. data/lib/templatefox/models/http_validation_error.rb +1 -1
  26. data/lib/templatefox/models/image_format.rb +41 -0
  27. data/lib/templatefox/models/job_list_response.rb +1 -1
  28. data/lib/templatefox/models/job_status.rb +1 -1
  29. data/lib/templatefox/models/job_status_response.rb +1 -1
  30. data/lib/templatefox/models/location_inner.rb +1 -1
  31. data/lib/templatefox/models/merge_pdf_request.rb +284 -0
  32. data/lib/templatefox/models/modification.rb +305 -0
  33. data/lib/templatefox/models/pdf_input.rb +159 -0
  34. data/lib/templatefox/models/pdf_tools_response.rb +246 -0
  35. data/lib/templatefox/models/pdf_variant.rb +1 -1
  36. data/lib/templatefox/models/rotate_pdf_request.rb +288 -0
  37. data/lib/templatefox/models/s3_config_request.rb +1 -1
  38. data/lib/templatefox/models/s3_config_response.rb +1 -1
  39. data/lib/templatefox/models/s3_success_response.rb +1 -1
  40. data/lib/templatefox/models/s3_test_response.rb +1 -1
  41. data/lib/templatefox/models/template_field.rb +1 -1
  42. data/lib/templatefox/models/template_field_spec.rb +1 -1
  43. data/lib/templatefox/models/template_list_item.rb +14 -2
  44. data/lib/templatefox/models/templates_list_response.rb +1 -1
  45. data/lib/templatefox/models/transaction.rb +1 -1
  46. data/lib/templatefox/models/transactions_response.rb +1 -1
  47. data/lib/templatefox/models/update_version_request.rb +1 -1
  48. data/lib/templatefox/models/validation_error.rb +1 -1
  49. data/lib/templatefox/models/version_item.rb +1 -1
  50. data/lib/templatefox/models/versions_list_response.rb +1 -1
  51. data/lib/templatefox/version.rb +2 -2
  52. data/lib/templatefox.rb +14 -2
  53. data/spec/api/account_api_spec.rb +1 -1
  54. data/spec/api/image_api_spec.rb +47 -0
  55. data/spec/api/integrations_api_spec.rb +1 -1
  56. data/spec/api/pdf_api_spec.rb +1 -1
  57. data/spec/api/pdf_async_api_spec.rb +1 -1
  58. data/spec/api/pdf_tools_api_spec.rb +71 -0
  59. data/spec/api/templates_api_spec.rb +2 -1
  60. data/spec/models/account_info_response_spec.rb +1 -1
  61. data/spec/models/{app_routers_v1_pdf_export_type_spec.rb → app_routers_v1_delivery_export_type_spec.rb} +7 -7
  62. data/spec/models/app_routers_v1_pdf_async_export_type_spec.rb +1 -1
  63. data/spec/models/app_routers_v1_pdf_tools_export_type_spec.rb +30 -0
  64. data/spec/models/create_async_pdf_request_spec.rb +1 -1
  65. data/spec/models/create_async_pdf_response_spec.rb +1 -1
  66. data/spec/models/create_image_request_spec.rb +108 -0
  67. data/spec/models/create_image_response_spec.rb +60 -0
  68. data/spec/models/create_pdf_request_spec.rb +1 -1
  69. data/spec/models/create_pdf_response_spec.rb +1 -1
  70. data/spec/models/create_version_request_spec.rb +1 -1
  71. data/spec/models/extract_pdf_pages_request_spec.rb +66 -0
  72. data/spec/models/http_validation_error_spec.rb +1 -1
  73. data/spec/models/image_format_spec.rb +30 -0
  74. data/spec/models/job_list_response_spec.rb +1 -1
  75. data/spec/models/job_status_response_spec.rb +1 -1
  76. data/spec/models/job_status_spec.rb +1 -1
  77. data/spec/models/location_inner_spec.rb +1 -1
  78. data/spec/models/merge_pdf_request_spec.rb +54 -0
  79. data/spec/models/modification_spec.rb +66 -0
  80. data/spec/models/pdf_input_spec.rb +42 -0
  81. data/spec/models/pdf_tools_response_spec.rb +54 -0
  82. data/spec/models/pdf_variant_spec.rb +1 -1
  83. data/spec/models/rotate_pdf_request_spec.rb +72 -0
  84. data/spec/models/s3_config_request_spec.rb +1 -1
  85. data/spec/models/s3_config_response_spec.rb +1 -1
  86. data/spec/models/s3_success_response_spec.rb +1 -1
  87. data/spec/models/s3_test_response_spec.rb +1 -1
  88. data/spec/models/template_field_spec.rb +1 -1
  89. data/spec/models/template_field_spec_spec.rb +1 -1
  90. data/spec/models/template_list_item_spec.rb +7 -1
  91. data/spec/models/templates_list_response_spec.rb +1 -1
  92. data/spec/models/transaction_spec.rb +1 -1
  93. data/spec/models/transactions_response_spec.rb +1 -1
  94. data/spec/models/update_version_request_spec.rb +1 -1
  95. data/spec/models/validation_error_spec.rb +1 -1
  96. data/spec/models/version_item_spec.rb +1 -1
  97. data/spec/models/versions_list_response_spec.rb +1 -1
  98. data/spec/spec_helper.rb +1 -1
  99. data/templatefox.gemspec +1 -1
  100. metadata +61 -25
@@ -0,0 +1,259 @@
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.11.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
+ # Response for URL export type
18
+ class CreateImageResponse < ApiModelBase
19
+ # Signed URL to download the image (expires after specified time)
20
+ attr_accessor :url
21
+
22
+ # Filename of the generated image
23
+ attr_accessor :filename
24
+
25
+ # Remaining credits after this request
26
+ attr_accessor :credits_remaining
27
+
28
+ # Seconds until the signed URL expires
29
+ attr_accessor :expires_in
30
+
31
+ attr_accessor :warnings
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'url' => :'url',
37
+ :'filename' => :'filename',
38
+ :'credits_remaining' => :'credits_remaining',
39
+ :'expires_in' => :'expires_in',
40
+ :'warnings' => :'warnings'
41
+ }
42
+ end
43
+
44
+ # Returns attribute mapping this model knows about
45
+ def self.acceptable_attribute_map
46
+ attribute_map
47
+ end
48
+
49
+ # Returns all the JSON keys this model knows about
50
+ def self.acceptable_attributes
51
+ acceptable_attribute_map.values
52
+ end
53
+
54
+ # Attribute type mapping.
55
+ def self.openapi_types
56
+ {
57
+ :'url' => :'String',
58
+ :'filename' => :'String',
59
+ :'credits_remaining' => :'Integer',
60
+ :'expires_in' => :'Integer',
61
+ :'warnings' => :'Array<String>'
62
+ }
63
+ end
64
+
65
+ # List of attributes with nullable: true
66
+ def self.openapi_nullable
67
+ Set.new([
68
+ :'warnings'
69
+ ])
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ if (!attributes.is_a?(Hash))
76
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TemplateFox::CreateImageResponse` initialize method"
77
+ end
78
+
79
+ # check to see if the attribute exists and convert string to symbol for hash key
80
+ acceptable_attribute_map = self.class.acceptable_attribute_map
81
+ attributes = attributes.each_with_object({}) { |(k, v), h|
82
+ if (!acceptable_attribute_map.key?(k.to_sym))
83
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TemplateFox::CreateImageResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
84
+ end
85
+ h[k.to_sym] = v
86
+ }
87
+
88
+ if attributes.key?(:'url')
89
+ self.url = attributes[:'url']
90
+ else
91
+ self.url = nil
92
+ end
93
+
94
+ if attributes.key?(:'filename')
95
+ self.filename = attributes[:'filename']
96
+ else
97
+ self.filename = nil
98
+ end
99
+
100
+ if attributes.key?(:'credits_remaining')
101
+ self.credits_remaining = attributes[:'credits_remaining']
102
+ else
103
+ self.credits_remaining = nil
104
+ end
105
+
106
+ if attributes.key?(:'expires_in')
107
+ self.expires_in = attributes[:'expires_in']
108
+ else
109
+ self.expires_in = nil
110
+ end
111
+
112
+ if attributes.key?(:'warnings')
113
+ if (value = attributes[:'warnings']).is_a?(Array)
114
+ self.warnings = value
115
+ end
116
+ end
117
+ end
118
+
119
+ # Show invalid properties with the reasons. Usually used together with valid?
120
+ # @return Array for valid properties with the reasons
121
+ def list_invalid_properties
122
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
123
+ invalid_properties = Array.new
124
+ if @url.nil?
125
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
126
+ end
127
+
128
+ if @filename.nil?
129
+ invalid_properties.push('invalid value for "filename", filename cannot be nil.')
130
+ end
131
+
132
+ if @credits_remaining.nil?
133
+ invalid_properties.push('invalid value for "credits_remaining", credits_remaining cannot be nil.')
134
+ end
135
+
136
+ if @expires_in.nil?
137
+ invalid_properties.push('invalid value for "expires_in", expires_in cannot be nil.')
138
+ end
139
+
140
+ invalid_properties
141
+ end
142
+
143
+ # Check to see if the all the properties in the model are valid
144
+ # @return true if the model is valid
145
+ def valid?
146
+ warn '[DEPRECATED] the `valid?` method is obsolete'
147
+ return false if @url.nil?
148
+ return false if @filename.nil?
149
+ return false if @credits_remaining.nil?
150
+ return false if @expires_in.nil?
151
+ true
152
+ end
153
+
154
+ # Custom attribute writer method with validation
155
+ # @param [Object] url Value to be assigned
156
+ def url=(url)
157
+ if url.nil?
158
+ fail ArgumentError, 'url cannot be nil'
159
+ end
160
+
161
+ @url = url
162
+ end
163
+
164
+ # Custom attribute writer method with validation
165
+ # @param [Object] filename Value to be assigned
166
+ def filename=(filename)
167
+ if filename.nil?
168
+ fail ArgumentError, 'filename cannot be nil'
169
+ end
170
+
171
+ @filename = filename
172
+ end
173
+
174
+ # Custom attribute writer method with validation
175
+ # @param [Object] credits_remaining Value to be assigned
176
+ def credits_remaining=(credits_remaining)
177
+ if credits_remaining.nil?
178
+ fail ArgumentError, 'credits_remaining cannot be nil'
179
+ end
180
+
181
+ @credits_remaining = credits_remaining
182
+ end
183
+
184
+ # Custom attribute writer method with validation
185
+ # @param [Object] expires_in Value to be assigned
186
+ def expires_in=(expires_in)
187
+ if expires_in.nil?
188
+ fail ArgumentError, 'expires_in cannot be nil'
189
+ end
190
+
191
+ @expires_in = expires_in
192
+ end
193
+
194
+ # Checks equality by comparing each attribute.
195
+ # @param [Object] Object to be compared
196
+ def ==(o)
197
+ return true if self.equal?(o)
198
+ self.class == o.class &&
199
+ url == o.url &&
200
+ filename == o.filename &&
201
+ credits_remaining == o.credits_remaining &&
202
+ expires_in == o.expires_in &&
203
+ warnings == o.warnings
204
+ end
205
+
206
+ # @see the `==` method
207
+ # @param [Object] Object to be compared
208
+ def eql?(o)
209
+ self == o
210
+ end
211
+
212
+ # Calculates hash code according to all attributes.
213
+ # @return [Integer] Hash code
214
+ def hash
215
+ [url, filename, credits_remaining, expires_in, warnings].hash
216
+ end
217
+
218
+ # Builds the object from hash
219
+ # @param [Hash] attributes Model attributes in the form of hash
220
+ # @return [Object] Returns the model itself
221
+ def self.build_from_hash(attributes)
222
+ return nil unless attributes.is_a?(Hash)
223
+ attributes = attributes.transform_keys(&:to_sym)
224
+ transformed_hash = {}
225
+ openapi_types.each_pair do |key, type|
226
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
227
+ transformed_hash["#{key}"] = nil
228
+ elsif type =~ /\AArray<(.*)>/i
229
+ # check to ensure the input is an array given that the attribute
230
+ # is documented as an array but the input is not
231
+ if attributes[attribute_map[key]].is_a?(Array)
232
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
233
+ end
234
+ elsif !attributes[attribute_map[key]].nil?
235
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
236
+ end
237
+ end
238
+ new(transformed_hash)
239
+ end
240
+
241
+ # Returns the object in the form of hash
242
+ # @return [Hash] Returns the object in the form of hash
243
+ def to_hash
244
+ hash = {}
245
+ self.class.attribute_map.each_pair do |attr, param|
246
+ value = self.send(attr)
247
+ if value.nil?
248
+ is_nullable = self.class.openapi_nullable.include?(attr)
249
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
250
+ end
251
+
252
+ hash[param] = _to_hash(value)
253
+ end
254
+ hash
255
+ end
256
+
257
+ end
258
+
259
+ 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.9.6
6
+ The version of the OpenAPI document: 1.11.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.21.0
@@ -94,7 +94,7 @@ module TemplateFox
94
94
  {
95
95
  :'template_id' => :'String',
96
96
  :'data' => :'Hash<String, Object>',
97
- :'export_type' => :'AppRoutersV1PdfExportType',
97
+ :'export_type' => :'AppRoutersV1DeliveryExportType',
98
98
  :'expiration' => :'Integer',
99
99
  :'filename' => :'String',
100
100
  :'store_s3' => :'Boolean',
@@ -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.9.6
6
+ The version of the OpenAPI document: 1.11.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.9.6
6
+ The version of the OpenAPI document: 1.11.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.21.0
@@ -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.11.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.9.6
6
+ The version of the OpenAPI document: 1.11.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.21.0
@@ -0,0 +1,41 @@
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.11.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 ImageFormat
18
+ PNG = "png".freeze
19
+ JPEG = "jpeg".freeze
20
+ WEBP = "webp".freeze
21
+
22
+ def self.all_vars
23
+ @all_vars ||= [PNG, JPEG, WEBP].freeze
24
+ end
25
+
26
+ # Builds the enum from string
27
+ # @param [String] The enum value in the form of the string
28
+ # @return [String] The enum value
29
+ def self.build_from_hash(value)
30
+ new.build_from_hash(value)
31
+ end
32
+
33
+ # Builds the enum from string
34
+ # @param [String] The enum value in the form of the string
35
+ # @return [String] The enum value
36
+ def build_from_hash(value)
37
+ return value if ImageFormat.all_vars.include?(value)
38
+ raise "Invalid ENUM value #{value} for class #ImageFormat"
39
+ end
40
+ end
41
+ 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.9.6
6
+ The version of the OpenAPI document: 1.11.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.9.6
6
+ The version of the OpenAPI document: 1.11.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.9.6
6
+ The version of the OpenAPI document: 1.11.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.9.6
6
+ The version of the OpenAPI document: 1.11.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.21.0