templatefox 1.0.1 → 1.6.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 +6 -6
- data/lib/templatefox/api/integrations_api.rb +10 -10
- data/lib/templatefox/api/pdf_api.rb +4 -4
- data/lib/templatefox/api/pdf_async_api.rb +219 -0
- data/lib/templatefox/api/templates_api.rb +6 -6
- data/lib/templatefox/api_client.rb +2 -2
- data/lib/templatefox/api_error.rb +2 -2
- data/lib/templatefox/api_model_base.rb +2 -2
- data/lib/templatefox/configuration.rb +2 -2
- data/lib/templatefox/models/account_info_response.rb +2 -2
- data/lib/templatefox/models/app_routers_v1_pdf_async_export_type.rb +39 -0
- data/lib/templatefox/models/{export_type.rb → app_routers_v1_pdf_export_type.rb} +5 -5
- data/lib/templatefox/models/create_async_pdf_request.rb +482 -0
- data/lib/templatefox/models/create_async_pdf_response.rb +242 -0
- data/lib/templatefox/models/create_pdf_request.rb +3 -3
- data/lib/templatefox/models/create_pdf_response.rb +2 -2
- data/lib/templatefox/models/http_validation_error.rb +2 -2
- data/lib/templatefox/models/job_list_response.rb +249 -0
- data/lib/templatefox/models/job_status.rb +42 -0
- data/lib/templatefox/models/job_status_response.rb +440 -0
- data/lib/templatefox/models/location_inner.rb +2 -2
- data/lib/templatefox/models/s3_config_request.rb +2 -2
- data/lib/templatefox/models/s3_config_response.rb +2 -2
- data/lib/templatefox/models/s3_success_response.rb +2 -2
- data/lib/templatefox/models/s3_test_response.rb +2 -2
- data/lib/templatefox/models/template_field.rb +21 -9
- data/lib/templatefox/models/template_field_spec.rb +205 -0
- data/lib/templatefox/models/template_list_item.rb +2 -2
- data/lib/templatefox/models/templates_list_response.rb +2 -2
- data/lib/templatefox/models/transaction.rb +2 -2
- data/lib/templatefox/models/transactions_response.rb +2 -2
- data/lib/templatefox/models/validation_error.rb +2 -2
- data/lib/templatefox/version.rb +3 -3
- data/lib/templatefox.rb +11 -3
- data/spec/api/account_api_spec.rb +4 -4
- data/spec/api/integrations_api_spec.rb +6 -6
- data/spec/api/pdf_api_spec.rb +3 -3
- data/spec/api/pdf_async_api_spec.rb +73 -0
- data/spec/api/templates_api_spec.rb +4 -4
- data/spec/models/account_info_response_spec.rb +2 -2
- data/spec/models/app_routers_v1_pdf_async_export_type_spec.rb +30 -0
- data/spec/models/app_routers_v1_pdf_export_type_spec.rb +30 -0
- data/spec/models/create_async_pdf_request_spec.rb +90 -0
- data/spec/models/create_async_pdf_response_spec.rb +48 -0
- data/spec/models/create_pdf_request_spec.rb +2 -2
- data/spec/models/create_pdf_response_spec.rb +2 -2
- data/spec/models/http_validation_error_spec.rb +2 -2
- data/spec/models/job_list_response_spec.rb +54 -0
- data/spec/models/job_status_response_spec.rb +126 -0
- data/spec/models/job_status_spec.rb +30 -0
- data/spec/models/location_inner_spec.rb +2 -2
- data/spec/models/s3_config_request_spec.rb +2 -2
- data/spec/models/s3_config_response_spec.rb +2 -2
- data/spec/models/s3_success_response_spec.rb +2 -2
- data/spec/models/s3_test_response_spec.rb +2 -2
- data/spec/models/template_field_spec.rb +8 -2
- data/spec/models/template_field_spec_spec.rb +48 -0
- data/spec/models/template_list_item_spec.rb +2 -2
- data/spec/models/templates_list_response_spec.rb +2 -2
- data/spec/models/transaction_spec.rb +2 -2
- data/spec/models/transactions_response_spec.rb +2 -2
- data/spec/models/validation_error_spec.rb +2 -2
- data/spec/spec_helper.rb +2 -2
- data/templatefox.gemspec +2 -2
- metadata +39 -15
- data/spec/models/export_type_spec.rb +0 -30
|
@@ -0,0 +1,242 @@
|
|
|
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.6.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module TemplateFox
|
|
17
|
+
# Response for async PDF creation
|
|
18
|
+
class CreateAsyncPdfResponse < ApiModelBase
|
|
19
|
+
# Unique job identifier for status polling
|
|
20
|
+
attr_accessor :job_id
|
|
21
|
+
|
|
22
|
+
# Initial job status (always 'pending')
|
|
23
|
+
attr_accessor :status
|
|
24
|
+
|
|
25
|
+
# Remaining credits after this request
|
|
26
|
+
attr_accessor :credits_remaining
|
|
27
|
+
|
|
28
|
+
class EnumAttributeValidator
|
|
29
|
+
attr_reader :datatype
|
|
30
|
+
attr_reader :allowable_values
|
|
31
|
+
|
|
32
|
+
def initialize(datatype, allowable_values)
|
|
33
|
+
@allowable_values = allowable_values.map do |value|
|
|
34
|
+
case datatype.to_s
|
|
35
|
+
when /Integer/i
|
|
36
|
+
value.to_i
|
|
37
|
+
when /Float/i
|
|
38
|
+
value.to_f
|
|
39
|
+
else
|
|
40
|
+
value
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def valid?(value)
|
|
46
|
+
!value || allowable_values.include?(value)
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
51
|
+
def self.attribute_map
|
|
52
|
+
{
|
|
53
|
+
:'job_id' => :'job_id',
|
|
54
|
+
:'status' => :'status',
|
|
55
|
+
:'credits_remaining' => :'credits_remaining'
|
|
56
|
+
}
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Returns attribute mapping this model knows about
|
|
60
|
+
def self.acceptable_attribute_map
|
|
61
|
+
attribute_map
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Returns all the JSON keys this model knows about
|
|
65
|
+
def self.acceptable_attributes
|
|
66
|
+
acceptable_attribute_map.values
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Attribute type mapping.
|
|
70
|
+
def self.openapi_types
|
|
71
|
+
{
|
|
72
|
+
:'job_id' => :'String',
|
|
73
|
+
:'status' => :'JobStatus',
|
|
74
|
+
:'credits_remaining' => :'Integer'
|
|
75
|
+
}
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# List of attributes with nullable: true
|
|
79
|
+
def self.openapi_nullable
|
|
80
|
+
Set.new([
|
|
81
|
+
])
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Initializes the object
|
|
85
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
86
|
+
def initialize(attributes = {})
|
|
87
|
+
if (!attributes.is_a?(Hash))
|
|
88
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TemplateFox::CreateAsyncPdfResponse` initialize method"
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
92
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
93
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
94
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
95
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TemplateFox::CreateAsyncPdfResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
96
|
+
end
|
|
97
|
+
h[k.to_sym] = v
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if attributes.key?(:'job_id')
|
|
101
|
+
self.job_id = attributes[:'job_id']
|
|
102
|
+
else
|
|
103
|
+
self.job_id = nil
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if attributes.key?(:'status')
|
|
107
|
+
self.status = attributes[:'status']
|
|
108
|
+
else
|
|
109
|
+
self.status = nil
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if attributes.key?(:'credits_remaining')
|
|
113
|
+
self.credits_remaining = attributes[:'credits_remaining']
|
|
114
|
+
else
|
|
115
|
+
self.credits_remaining = nil
|
|
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 @job_id.nil?
|
|
125
|
+
invalid_properties.push('invalid value for "job_id", job_id cannot be nil.')
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if @status.nil?
|
|
129
|
+
invalid_properties.push('invalid value for "status", status 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
|
+
invalid_properties
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Check to see if the all the properties in the model are valid
|
|
140
|
+
# @return true if the model is valid
|
|
141
|
+
def valid?
|
|
142
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
143
|
+
return false if @job_id.nil?
|
|
144
|
+
return false if @status.nil?
|
|
145
|
+
return false if @credits_remaining.nil?
|
|
146
|
+
true
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Custom attribute writer method with validation
|
|
150
|
+
# @param [Object] job_id Value to be assigned
|
|
151
|
+
def job_id=(job_id)
|
|
152
|
+
if job_id.nil?
|
|
153
|
+
fail ArgumentError, 'job_id cannot be nil'
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
@job_id = job_id
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Custom attribute writer method with validation
|
|
160
|
+
# @param [Object] status Value to be assigned
|
|
161
|
+
def status=(status)
|
|
162
|
+
if status.nil?
|
|
163
|
+
fail ArgumentError, 'status cannot be nil'
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
@status = status
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Custom attribute writer method with validation
|
|
170
|
+
# @param [Object] credits_remaining Value to be assigned
|
|
171
|
+
def credits_remaining=(credits_remaining)
|
|
172
|
+
if credits_remaining.nil?
|
|
173
|
+
fail ArgumentError, 'credits_remaining cannot be nil'
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
@credits_remaining = credits_remaining
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Checks equality by comparing each attribute.
|
|
180
|
+
# @param [Object] Object to be compared
|
|
181
|
+
def ==(o)
|
|
182
|
+
return true if self.equal?(o)
|
|
183
|
+
self.class == o.class &&
|
|
184
|
+
job_id == o.job_id &&
|
|
185
|
+
status == o.status &&
|
|
186
|
+
credits_remaining == o.credits_remaining
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# @see the `==` method
|
|
190
|
+
# @param [Object] Object to be compared
|
|
191
|
+
def eql?(o)
|
|
192
|
+
self == o
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
# Calculates hash code according to all attributes.
|
|
196
|
+
# @return [Integer] Hash code
|
|
197
|
+
def hash
|
|
198
|
+
[job_id, status, credits_remaining].hash
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# Builds the object from hash
|
|
202
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
203
|
+
# @return [Object] Returns the model itself
|
|
204
|
+
def self.build_from_hash(attributes)
|
|
205
|
+
return nil unless attributes.is_a?(Hash)
|
|
206
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
207
|
+
transformed_hash = {}
|
|
208
|
+
openapi_types.each_pair do |key, type|
|
|
209
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
210
|
+
transformed_hash["#{key}"] = nil
|
|
211
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
212
|
+
# check to ensure the input is an array given that the attribute
|
|
213
|
+
# is documented as an array but the input is not
|
|
214
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
215
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
216
|
+
end
|
|
217
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
218
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
219
|
+
end
|
|
220
|
+
end
|
|
221
|
+
new(transformed_hash)
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
# Returns the object in the form of hash
|
|
225
|
+
# @return [Hash] Returns the object in the form of hash
|
|
226
|
+
def to_hash
|
|
227
|
+
hash = {}
|
|
228
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
229
|
+
value = self.send(attr)
|
|
230
|
+
if value.nil?
|
|
231
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
232
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
hash[param] = _to_hash(value)
|
|
236
|
+
end
|
|
237
|
+
hash
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
end
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#TemplateFox API
|
|
3
3
|
|
|
4
|
-
#Generate PDFs from HTML templates via API. Design once, generate thousands.
|
|
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.6.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.19.0
|
|
@@ -88,7 +88,7 @@ module TemplateFox
|
|
|
88
88
|
{
|
|
89
89
|
:'template_id' => :'String',
|
|
90
90
|
:'data' => :'Hash<String, Object>',
|
|
91
|
-
:'export_type' => :'
|
|
91
|
+
:'export_type' => :'AppRoutersV1PdfExportType',
|
|
92
92
|
:'expiration' => :'Integer',
|
|
93
93
|
:'filename' => :'String',
|
|
94
94
|
:'store_s3' => :'Boolean',
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#TemplateFox API
|
|
3
3
|
|
|
4
|
-
#Generate PDFs from HTML templates via API. Design once, generate thousands.
|
|
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.6.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.19.0
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#TemplateFox API
|
|
3
3
|
|
|
4
|
-
#Generate PDFs from HTML templates via API. Design once, generate thousands.
|
|
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.6.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.19.0
|
|
@@ -0,0 +1,249 @@
|
|
|
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.6.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module TemplateFox
|
|
17
|
+
# Response for job list query
|
|
18
|
+
class JobListResponse < ApiModelBase
|
|
19
|
+
# List of jobs
|
|
20
|
+
attr_accessor :jobs
|
|
21
|
+
|
|
22
|
+
# Total number of jobs matching filter
|
|
23
|
+
attr_accessor :total
|
|
24
|
+
|
|
25
|
+
# Page size
|
|
26
|
+
attr_accessor :limit
|
|
27
|
+
|
|
28
|
+
# Page offset
|
|
29
|
+
attr_accessor :offset
|
|
30
|
+
|
|
31
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
32
|
+
def self.attribute_map
|
|
33
|
+
{
|
|
34
|
+
:'jobs' => :'jobs',
|
|
35
|
+
:'total' => :'total',
|
|
36
|
+
:'limit' => :'limit',
|
|
37
|
+
:'offset' => :'offset'
|
|
38
|
+
}
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Returns attribute mapping this model knows about
|
|
42
|
+
def self.acceptable_attribute_map
|
|
43
|
+
attribute_map
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Returns all the JSON keys this model knows about
|
|
47
|
+
def self.acceptable_attributes
|
|
48
|
+
acceptable_attribute_map.values
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Attribute type mapping.
|
|
52
|
+
def self.openapi_types
|
|
53
|
+
{
|
|
54
|
+
:'jobs' => :'Array<JobStatusResponse>',
|
|
55
|
+
:'total' => :'Integer',
|
|
56
|
+
:'limit' => :'Integer',
|
|
57
|
+
:'offset' => :'Integer'
|
|
58
|
+
}
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# List of attributes with nullable: true
|
|
62
|
+
def self.openapi_nullable
|
|
63
|
+
Set.new([
|
|
64
|
+
])
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Initializes the object
|
|
68
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
69
|
+
def initialize(attributes = {})
|
|
70
|
+
if (!attributes.is_a?(Hash))
|
|
71
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TemplateFox::JobListResponse` initialize method"
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
75
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
76
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
77
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
78
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TemplateFox::JobListResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
79
|
+
end
|
|
80
|
+
h[k.to_sym] = v
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if attributes.key?(:'jobs')
|
|
84
|
+
if (value = attributes[:'jobs']).is_a?(Array)
|
|
85
|
+
self.jobs = value
|
|
86
|
+
end
|
|
87
|
+
else
|
|
88
|
+
self.jobs = nil
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
if attributes.key?(:'total')
|
|
92
|
+
self.total = attributes[:'total']
|
|
93
|
+
else
|
|
94
|
+
self.total = nil
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
if attributes.key?(:'limit')
|
|
98
|
+
self.limit = attributes[:'limit']
|
|
99
|
+
else
|
|
100
|
+
self.limit = nil
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
if attributes.key?(:'offset')
|
|
104
|
+
self.offset = attributes[:'offset']
|
|
105
|
+
else
|
|
106
|
+
self.offset = nil
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
111
|
+
# @return Array for valid properties with the reasons
|
|
112
|
+
def list_invalid_properties
|
|
113
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
114
|
+
invalid_properties = Array.new
|
|
115
|
+
if @jobs.nil?
|
|
116
|
+
invalid_properties.push('invalid value for "jobs", jobs cannot be nil.')
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
if @total.nil?
|
|
120
|
+
invalid_properties.push('invalid value for "total", total cannot be nil.')
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
if @limit.nil?
|
|
124
|
+
invalid_properties.push('invalid value for "limit", limit cannot be nil.')
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
if @offset.nil?
|
|
128
|
+
invalid_properties.push('invalid value for "offset", offset cannot be nil.')
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
invalid_properties
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Check to see if the all the properties in the model are valid
|
|
135
|
+
# @return true if the model is valid
|
|
136
|
+
def valid?
|
|
137
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
138
|
+
return false if @jobs.nil?
|
|
139
|
+
return false if @total.nil?
|
|
140
|
+
return false if @limit.nil?
|
|
141
|
+
return false if @offset.nil?
|
|
142
|
+
true
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Custom attribute writer method with validation
|
|
146
|
+
# @param [Object] jobs Value to be assigned
|
|
147
|
+
def jobs=(jobs)
|
|
148
|
+
if jobs.nil?
|
|
149
|
+
fail ArgumentError, 'jobs cannot be nil'
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
@jobs = jobs
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Custom attribute writer method with validation
|
|
156
|
+
# @param [Object] total Value to be assigned
|
|
157
|
+
def total=(total)
|
|
158
|
+
if total.nil?
|
|
159
|
+
fail ArgumentError, 'total cannot be nil'
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
@total = total
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Custom attribute writer method with validation
|
|
166
|
+
# @param [Object] limit Value to be assigned
|
|
167
|
+
def limit=(limit)
|
|
168
|
+
if limit.nil?
|
|
169
|
+
fail ArgumentError, 'limit cannot be nil'
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
@limit = limit
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Custom attribute writer method with validation
|
|
176
|
+
# @param [Object] offset Value to be assigned
|
|
177
|
+
def offset=(offset)
|
|
178
|
+
if offset.nil?
|
|
179
|
+
fail ArgumentError, 'offset cannot be nil'
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
@offset = offset
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# Checks equality by comparing each attribute.
|
|
186
|
+
# @param [Object] Object to be compared
|
|
187
|
+
def ==(o)
|
|
188
|
+
return true if self.equal?(o)
|
|
189
|
+
self.class == o.class &&
|
|
190
|
+
jobs == o.jobs &&
|
|
191
|
+
total == o.total &&
|
|
192
|
+
limit == o.limit &&
|
|
193
|
+
offset == o.offset
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
# @see the `==` method
|
|
197
|
+
# @param [Object] Object to be compared
|
|
198
|
+
def eql?(o)
|
|
199
|
+
self == o
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# Calculates hash code according to all attributes.
|
|
203
|
+
# @return [Integer] Hash code
|
|
204
|
+
def hash
|
|
205
|
+
[jobs, total, limit, offset].hash
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
# Builds the object from hash
|
|
209
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
210
|
+
# @return [Object] Returns the model itself
|
|
211
|
+
def self.build_from_hash(attributes)
|
|
212
|
+
return nil unless attributes.is_a?(Hash)
|
|
213
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
214
|
+
transformed_hash = {}
|
|
215
|
+
openapi_types.each_pair do |key, type|
|
|
216
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
217
|
+
transformed_hash["#{key}"] = nil
|
|
218
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
219
|
+
# check to ensure the input is an array given that the attribute
|
|
220
|
+
# is documented as an array but the input is not
|
|
221
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
222
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
223
|
+
end
|
|
224
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
225
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
226
|
+
end
|
|
227
|
+
end
|
|
228
|
+
new(transformed_hash)
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
# Returns the object in the form of hash
|
|
232
|
+
# @return [Hash] Returns the object in the form of hash
|
|
233
|
+
def to_hash
|
|
234
|
+
hash = {}
|
|
235
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
236
|
+
value = self.send(attr)
|
|
237
|
+
if value.nil?
|
|
238
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
239
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
hash[param] = _to_hash(value)
|
|
243
|
+
end
|
|
244
|
+
hash
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
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.6.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module TemplateFox
|
|
17
|
+
class JobStatus
|
|
18
|
+
PENDING = "pending".freeze
|
|
19
|
+
PROCESSING = "processing".freeze
|
|
20
|
+
COMPLETED = "completed".freeze
|
|
21
|
+
FAILED = "failed".freeze
|
|
22
|
+
|
|
23
|
+
def self.all_vars
|
|
24
|
+
@all_vars ||= [PENDING, PROCESSING, COMPLETED, FAILED].freeze
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Builds the enum from string
|
|
28
|
+
# @param [String] The enum value in the form of the string
|
|
29
|
+
# @return [String] The enum value
|
|
30
|
+
def self.build_from_hash(value)
|
|
31
|
+
new.build_from_hash(value)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Builds the enum from string
|
|
35
|
+
# @param [String] The enum value in the form of the string
|
|
36
|
+
# @return [String] The enum value
|
|
37
|
+
def build_from_hash(value)
|
|
38
|
+
return value if JobStatus.all_vars.include?(value)
|
|
39
|
+
raise "Invalid ENUM value #{value} for class #JobStatus"
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|