templatefox 1.0.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 +7 -0
- data/Gemfile +9 -0
- data/LICENSE +21 -0
- data/README.md +206 -0
- data/Rakefile +10 -0
- data/docs/AccountApi.md +152 -0
- data/docs/AccountInfoResponse.md +20 -0
- data/docs/CreatePdfRequest.md +32 -0
- data/docs/CreatePdfResponse.md +24 -0
- data/docs/ExportType.md +15 -0
- data/docs/HTTPValidationError.md +18 -0
- data/docs/IntegrationsApi.md +286 -0
- data/docs/LocationInner.md +15 -0
- data/docs/PDFApi.md +79 -0
- data/docs/S3ConfigRequest.md +26 -0
- data/docs/S3ConfigResponse.md +28 -0
- data/docs/S3SuccessResponse.md +18 -0
- data/docs/S3TestResponse.md +20 -0
- data/docs/TemplateField.md +26 -0
- data/docs/TemplateListItem.md +24 -0
- data/docs/TemplatesApi.md +148 -0
- data/docs/TemplatesListResponse.md +18 -0
- data/docs/Transaction.md +28 -0
- data/docs/TransactionsResponse.md +24 -0
- data/docs/ValidationError.md +22 -0
- data/git_push.sh +57 -0
- data/lib/templatefox/api/account_api.rb +154 -0
- data/lib/templatefox/api/integrations_api.rb +261 -0
- data/lib/templatefox/api/pdf_api.rb +90 -0
- data/lib/templatefox/api/templates_api.rb +142 -0
- data/lib/templatefox/api_client.rb +397 -0
- data/lib/templatefox/api_error.rb +58 -0
- data/lib/templatefox/api_model_base.rb +88 -0
- data/lib/templatefox/configuration.rb +308 -0
- data/lib/templatefox/models/account_info_response.rb +176 -0
- data/lib/templatefox/models/create_pdf_request.rb +414 -0
- data/lib/templatefox/models/create_pdf_response.rb +247 -0
- data/lib/templatefox/models/export_type.rb +40 -0
- data/lib/templatefox/models/http_validation_error.rb +149 -0
- data/lib/templatefox/models/location_inner.rb +103 -0
- data/lib/templatefox/models/s3_config_request.rb +372 -0
- data/lib/templatefox/models/s3_config_response.rb +301 -0
- data/lib/templatefox/models/s3_success_response.rb +166 -0
- data/lib/templatefox/models/s3_test_response.rb +193 -0
- data/lib/templatefox/models/template_field.rb +227 -0
- data/lib/templatefox/models/template_list_item.rb +247 -0
- data/lib/templatefox/models/templates_list_response.rb +167 -0
- data/lib/templatefox/models/transaction.rb +267 -0
- data/lib/templatefox/models/transactions_response.rb +248 -0
- data/lib/templatefox/models/validation_error.rb +218 -0
- data/lib/templatefox/version.rb +15 -0
- data/lib/templatefox.rb +60 -0
- data/spec/api/account_api_spec.rb +59 -0
- data/spec/api/integrations_api_spec.rb +80 -0
- data/spec/api/pdf_api_spec.rb +47 -0
- data/spec/api/templates_api_spec.rb +58 -0
- data/spec/models/account_info_response_spec.rb +42 -0
- data/spec/models/create_pdf_request_spec.rb +78 -0
- data/spec/models/create_pdf_response_spec.rb +54 -0
- data/spec/models/export_type_spec.rb +30 -0
- data/spec/models/http_validation_error_spec.rb +36 -0
- data/spec/models/location_inner_spec.rb +21 -0
- data/spec/models/s3_config_request_spec.rb +60 -0
- data/spec/models/s3_config_response_spec.rb +66 -0
- data/spec/models/s3_success_response_spec.rb +36 -0
- data/spec/models/s3_test_response_spec.rb +42 -0
- data/spec/models/template_field_spec.rb +60 -0
- data/spec/models/template_list_item_spec.rb +54 -0
- data/spec/models/templates_list_response_spec.rb +36 -0
- data/spec/models/transaction_spec.rb +66 -0
- data/spec/models/transactions_response_spec.rb +54 -0
- data/spec/models/validation_error_spec.rb +48 -0
- data/spec/spec_helper.rb +111 -0
- data/templatefox.gemspec +39 -0
- metadata +177 -0
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#TemplateFox API
|
|
3
|
+
|
|
4
|
+
#Generate PDFs from HTML templates via API. Design once, generate thousands.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.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 ValidationError < ApiModelBase
|
|
18
|
+
attr_accessor :loc
|
|
19
|
+
|
|
20
|
+
attr_accessor :msg
|
|
21
|
+
|
|
22
|
+
attr_accessor :type
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'loc' => :'loc',
|
|
28
|
+
:'msg' => :'msg',
|
|
29
|
+
:'type' => :'type'
|
|
30
|
+
}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns attribute mapping this model knows about
|
|
34
|
+
def self.acceptable_attribute_map
|
|
35
|
+
attribute_map
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Returns all the JSON keys this model knows about
|
|
39
|
+
def self.acceptable_attributes
|
|
40
|
+
acceptable_attribute_map.values
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Attribute type mapping.
|
|
44
|
+
def self.openapi_types
|
|
45
|
+
{
|
|
46
|
+
:'loc' => :'Array<LocationInner>',
|
|
47
|
+
:'msg' => :'String',
|
|
48
|
+
:'type' => :'String'
|
|
49
|
+
}
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# List of attributes with nullable: true
|
|
53
|
+
def self.openapi_nullable
|
|
54
|
+
Set.new([
|
|
55
|
+
])
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Initializes the object
|
|
59
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
60
|
+
def initialize(attributes = {})
|
|
61
|
+
if (!attributes.is_a?(Hash))
|
|
62
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TemplateFox::ValidationError` initialize method"
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
66
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
67
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
68
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
69
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TemplateFox::ValidationError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
70
|
+
end
|
|
71
|
+
h[k.to_sym] = v
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if attributes.key?(:'loc')
|
|
75
|
+
if (value = attributes[:'loc']).is_a?(Array)
|
|
76
|
+
self.loc = value
|
|
77
|
+
end
|
|
78
|
+
else
|
|
79
|
+
self.loc = nil
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
if attributes.key?(:'msg')
|
|
83
|
+
self.msg = attributes[:'msg']
|
|
84
|
+
else
|
|
85
|
+
self.msg = nil
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
if attributes.key?(:'type')
|
|
89
|
+
self.type = attributes[:'type']
|
|
90
|
+
else
|
|
91
|
+
self.type = nil
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
96
|
+
# @return Array for valid properties with the reasons
|
|
97
|
+
def list_invalid_properties
|
|
98
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
99
|
+
invalid_properties = Array.new
|
|
100
|
+
if @loc.nil?
|
|
101
|
+
invalid_properties.push('invalid value for "loc", loc cannot be nil.')
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if @msg.nil?
|
|
105
|
+
invalid_properties.push('invalid value for "msg", msg cannot be nil.')
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if @type.nil?
|
|
109
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
invalid_properties
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Check to see if the all the properties in the model are valid
|
|
116
|
+
# @return true if the model is valid
|
|
117
|
+
def valid?
|
|
118
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
119
|
+
return false if @loc.nil?
|
|
120
|
+
return false if @msg.nil?
|
|
121
|
+
return false if @type.nil?
|
|
122
|
+
true
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Custom attribute writer method with validation
|
|
126
|
+
# @param [Object] loc Value to be assigned
|
|
127
|
+
def loc=(loc)
|
|
128
|
+
if loc.nil?
|
|
129
|
+
fail ArgumentError, 'loc cannot be nil'
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
@loc = loc
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Custom attribute writer method with validation
|
|
136
|
+
# @param [Object] msg Value to be assigned
|
|
137
|
+
def msg=(msg)
|
|
138
|
+
if msg.nil?
|
|
139
|
+
fail ArgumentError, 'msg cannot be nil'
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
@msg = msg
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Custom attribute writer method with validation
|
|
146
|
+
# @param [Object] type Value to be assigned
|
|
147
|
+
def type=(type)
|
|
148
|
+
if type.nil?
|
|
149
|
+
fail ArgumentError, 'type cannot be nil'
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
@type = type
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Checks equality by comparing each attribute.
|
|
156
|
+
# @param [Object] Object to be compared
|
|
157
|
+
def ==(o)
|
|
158
|
+
return true if self.equal?(o)
|
|
159
|
+
self.class == o.class &&
|
|
160
|
+
loc == o.loc &&
|
|
161
|
+
msg == o.msg &&
|
|
162
|
+
type == o.type
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# @see the `==` method
|
|
166
|
+
# @param [Object] Object to be compared
|
|
167
|
+
def eql?(o)
|
|
168
|
+
self == o
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Calculates hash code according to all attributes.
|
|
172
|
+
# @return [Integer] Hash code
|
|
173
|
+
def hash
|
|
174
|
+
[loc, msg, type].hash
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Builds the object from hash
|
|
178
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
179
|
+
# @return [Object] Returns the model itself
|
|
180
|
+
def self.build_from_hash(attributes)
|
|
181
|
+
return nil unless attributes.is_a?(Hash)
|
|
182
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
183
|
+
transformed_hash = {}
|
|
184
|
+
openapi_types.each_pair do |key, type|
|
|
185
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
186
|
+
transformed_hash["#{key}"] = nil
|
|
187
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
188
|
+
# check to ensure the input is an array given that the attribute
|
|
189
|
+
# is documented as an array but the input is not
|
|
190
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
191
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
192
|
+
end
|
|
193
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
194
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
195
|
+
end
|
|
196
|
+
end
|
|
197
|
+
new(transformed_hash)
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Returns the object in the form of hash
|
|
201
|
+
# @return [Hash] Returns the object in the form of hash
|
|
202
|
+
def to_hash
|
|
203
|
+
hash = {}
|
|
204
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
205
|
+
value = self.send(attr)
|
|
206
|
+
if value.nil?
|
|
207
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
208
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
hash[param] = _to_hash(value)
|
|
212
|
+
end
|
|
213
|
+
hash
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#TemplateFox API
|
|
3
|
+
|
|
4
|
+
#Generate PDFs from HTML templates via API. Design once, generate thousands.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
module TemplateFox
|
|
14
|
+
VERSION = '1.0.0'
|
|
15
|
+
end
|
data/lib/templatefox.rb
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#TemplateFox API
|
|
3
|
+
|
|
4
|
+
#Generate PDFs from HTML templates via API. Design once, generate thousands.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
# Common files
|
|
14
|
+
require 'templatefox/api_client'
|
|
15
|
+
require 'templatefox/api_error'
|
|
16
|
+
require 'templatefox/api_model_base'
|
|
17
|
+
require 'templatefox/version'
|
|
18
|
+
require 'templatefox/configuration'
|
|
19
|
+
|
|
20
|
+
# Models
|
|
21
|
+
require 'templatefox/models/account_info_response'
|
|
22
|
+
require 'templatefox/models/create_pdf_request'
|
|
23
|
+
require 'templatefox/models/create_pdf_response'
|
|
24
|
+
require 'templatefox/models/export_type'
|
|
25
|
+
require 'templatefox/models/http_validation_error'
|
|
26
|
+
require 'templatefox/models/location_inner'
|
|
27
|
+
require 'templatefox/models/s3_config_request'
|
|
28
|
+
require 'templatefox/models/s3_config_response'
|
|
29
|
+
require 'templatefox/models/s3_success_response'
|
|
30
|
+
require 'templatefox/models/s3_test_response'
|
|
31
|
+
require 'templatefox/models/template_field'
|
|
32
|
+
require 'templatefox/models/template_list_item'
|
|
33
|
+
require 'templatefox/models/templates_list_response'
|
|
34
|
+
require 'templatefox/models/transaction'
|
|
35
|
+
require 'templatefox/models/transactions_response'
|
|
36
|
+
require 'templatefox/models/validation_error'
|
|
37
|
+
|
|
38
|
+
# APIs
|
|
39
|
+
require 'templatefox/api/account_api'
|
|
40
|
+
require 'templatefox/api/integrations_api'
|
|
41
|
+
require 'templatefox/api/pdf_api'
|
|
42
|
+
require 'templatefox/api/templates_api'
|
|
43
|
+
|
|
44
|
+
module TemplateFox
|
|
45
|
+
class << self
|
|
46
|
+
# Customize default settings for the SDK using block.
|
|
47
|
+
# TemplateFox.configure do |config|
|
|
48
|
+
# config.username = "xxx"
|
|
49
|
+
# config.password = "xxx"
|
|
50
|
+
# end
|
|
51
|
+
# If no block given, return the default Configuration object.
|
|
52
|
+
def configure
|
|
53
|
+
if block_given?
|
|
54
|
+
yield(Configuration.default)
|
|
55
|
+
else
|
|
56
|
+
Configuration.default
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#TemplateFox API
|
|
3
|
+
|
|
4
|
+
#Generate PDFs from HTML templates via API. Design once, generate thousands.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
|
|
16
|
+
# Unit tests for TemplateFox::AccountApi
|
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe 'AccountApi' do
|
|
20
|
+
before do
|
|
21
|
+
# run before each test
|
|
22
|
+
@api_instance = TemplateFox::AccountApi.new
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after do
|
|
26
|
+
# run after each test
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test an instance of AccountApi' do
|
|
30
|
+
it 'should create an instance of AccountApi' do
|
|
31
|
+
expect(@api_instance).to be_instance_of(TemplateFox::AccountApi)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# unit tests for get_account
|
|
36
|
+
# Get account info
|
|
37
|
+
# Get account information including remaining credits. **Authentication:** API Key required (`x-api-key` header) or JWT token **Usage:** Check credit balance before performing operations. **No credits consumed:** This is a read-only endpoint.
|
|
38
|
+
# @param [Hash] opts the optional parameters
|
|
39
|
+
# @return [AccountInfoResponse]
|
|
40
|
+
describe 'get_account test' do
|
|
41
|
+
it 'should work' do
|
|
42
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# unit tests for list_transactions
|
|
47
|
+
# List transactions
|
|
48
|
+
# List transaction history for the authenticated user. **Authentication:** API Key required (`x-api-key` header) or JWT token **Pagination:** Use `limit` and `offset` query parameters. **Transaction types:** - `PDFGEN`: PDF generation (consumes credits) - `REFUND`: Credit refund (on failed generation) - `PURCHASE`: Credit purchase - `BONUS`: Bonus credits **Credits field:** - Positive value = credits consumed - Negative value = credits added **No credits consumed:** This is a read-only endpoint.
|
|
49
|
+
# @param [Hash] opts the optional parameters
|
|
50
|
+
# @option opts [Integer] :limit Number of records to return
|
|
51
|
+
# @option opts [Integer] :offset Number of records to skip
|
|
52
|
+
# @return [TransactionsResponse]
|
|
53
|
+
describe 'list_transactions test' do
|
|
54
|
+
it 'should work' do
|
|
55
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
end
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#TemplateFox API
|
|
3
|
+
|
|
4
|
+
#Generate PDFs from HTML templates via API. Design once, generate thousands.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
|
|
16
|
+
# Unit tests for TemplateFox::IntegrationsApi
|
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe 'IntegrationsApi' do
|
|
20
|
+
before do
|
|
21
|
+
# run before each test
|
|
22
|
+
@api_instance = TemplateFox::IntegrationsApi.new
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after do
|
|
26
|
+
# run after each test
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test an instance of IntegrationsApi' do
|
|
30
|
+
it 'should create an instance of IntegrationsApi' do
|
|
31
|
+
expect(@api_instance).to be_instance_of(TemplateFox::IntegrationsApi)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# unit tests for delete_s3_config
|
|
36
|
+
# Delete S3 configuration
|
|
37
|
+
# Delete S3 storage configuration. **Authentication:** API Key required (`x-api-key` header) with admin privileges **Usage:** Remove your S3 integration. Generated PDFs will use the default CDN storage after deletion. **Warning:** This action is irreversible. You'll need to reconfigure S3 to use it again. **No credits consumed:** This is a configuration endpoint.
|
|
38
|
+
# @param [Hash] opts the optional parameters
|
|
39
|
+
# @return [S3SuccessResponse]
|
|
40
|
+
describe 'delete_s3_config test' do
|
|
41
|
+
it 'should work' do
|
|
42
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# unit tests for get_s3_config
|
|
47
|
+
# Get S3 configuration
|
|
48
|
+
# Get current S3 storage configuration. **Authentication:** API Key required (`x-api-key` header) with admin privileges **Usage:** Retrieve your S3 integration settings. Secret access key is masked for security. **Returns 404** if S3 is not configured. **No credits consumed:** This is a read-only endpoint.
|
|
49
|
+
# @param [Hash] opts the optional parameters
|
|
50
|
+
# @return [S3ConfigResponse]
|
|
51
|
+
describe 'get_s3_config test' do
|
|
52
|
+
it 'should work' do
|
|
53
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# unit tests for save_s3_config
|
|
58
|
+
# Save S3 configuration
|
|
59
|
+
# Save or update S3-compatible storage configuration. **Authentication:** API Key required (`x-api-key` header) with admin privileges **Usage:** Configure your S3-compatible storage to receive generated PDFs directly in your own bucket instead of the default CDN. **Supported providers:** - Amazon S3 - DigitalOcean Spaces - Cloudflare R2 - MinIO - Any S3-compatible storage **Secret key behavior:** - For new configuration: `secret_access_key` is required - For updates: Omit `secret_access_key` to keep existing value **No credits consumed:** This is a configuration endpoint.
|
|
60
|
+
# @param s3_config_request
|
|
61
|
+
# @param [Hash] opts the optional parameters
|
|
62
|
+
# @return [S3SuccessResponse]
|
|
63
|
+
describe 'save_s3_config test' do
|
|
64
|
+
it 'should work' do
|
|
65
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# unit tests for test_s3_connection
|
|
70
|
+
# Test S3 connection
|
|
71
|
+
# Test S3 connection with stored credentials. **Authentication:** API Key required (`x-api-key` header) with admin privileges **Usage:** Verify your S3 configuration is working correctly. The test will: 1. Connect to the endpoint 2. Verify bucket access 3. Check write permissions by uploading a small test file **Prerequisite:** S3 must be configured first using `POST /v1/integrations/s3` **No credits consumed:** This is a diagnostic endpoint.
|
|
72
|
+
# @param [Hash] opts the optional parameters
|
|
73
|
+
# @return [S3TestResponse]
|
|
74
|
+
describe 'test_s3_connection test' do
|
|
75
|
+
it 'should work' do
|
|
76
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
end
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#TemplateFox API
|
|
3
|
+
|
|
4
|
+
#Generate PDFs from HTML templates via API. Design once, generate thousands.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
|
|
16
|
+
# Unit tests for TemplateFox::PDFApi
|
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe 'PDFApi' do
|
|
20
|
+
before do
|
|
21
|
+
# run before each test
|
|
22
|
+
@api_instance = TemplateFox::PDFApi.new
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after do
|
|
26
|
+
# run after each test
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test an instance of PDFApi' do
|
|
30
|
+
it 'should create an instance of PDFApi' do
|
|
31
|
+
expect(@api_instance).to be_instance_of(TemplateFox::PDFApi)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# unit tests for create_pdf
|
|
36
|
+
# Generate PDF from template
|
|
37
|
+
# Generate a PDF from a saved template with dynamic data. **Authentication:** API Key required (`x-api-key` header) ## Request Body | Field | Type | Required | Description | |-------|------|----------|-------------| | `template_id` | string | ✅ Yes | Template short ID (12 characters) | | `data` | object | ✅ Yes | Key-value data to render in template | | `export_type` | string | No | `url` (default) or `binary` | | `expiration` | integer | No | URL expiration in seconds (60-604800, default: 86400) | ## Export Types - `url` (default): PDF is uploaded to CDN, returns JSON with URL - `binary`: Returns raw PDF bytes directly **Credits:** 1 credit deducted per successful generation.
|
|
38
|
+
# @param create_pdf_request
|
|
39
|
+
# @param [Hash] opts the optional parameters
|
|
40
|
+
# @return [CreatePdfResponse]
|
|
41
|
+
describe 'create_pdf test' do
|
|
42
|
+
it 'should work' do
|
|
43
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
end
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#TemplateFox API
|
|
3
|
+
|
|
4
|
+
#Generate PDFs from HTML templates via API. Design once, generate thousands.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
|
|
16
|
+
# Unit tests for TemplateFox::TemplatesApi
|
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe 'TemplatesApi' do
|
|
20
|
+
before do
|
|
21
|
+
# run before each test
|
|
22
|
+
@api_instance = TemplateFox::TemplatesApi.new
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after do
|
|
26
|
+
# run after each test
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test an instance of TemplatesApi' do
|
|
30
|
+
it 'should create an instance of TemplatesApi' do
|
|
31
|
+
expect(@api_instance).to be_instance_of(TemplateFox::TemplatesApi)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# unit tests for get_template_fields
|
|
36
|
+
# Get template fields
|
|
37
|
+
# Get the dynamic fields for a template. **Authentication:** API Key required (`x-api-key` header) or JWT token **Usage:** This endpoint is designed for Zapier Dynamic Fields integration. It returns an array of field definitions that Zapier uses to dynamically generate input forms. **Response format:** Array of objects compatible with Zapier InputFieldsSchema. Each field has: `key`, `label`, `type`, `required`, and optional `helpText`. **Field types:** - `string`: Text input (also used for JSON arrays/objects) - `integer`: Integer number - `number`: Decimal number - `boolean`: True/False checkbox **Arrays and objects:** Complex types are returned as `string` type with a `helpText` showing the expected JSON format. **No credits consumed:** This is a read-only endpoint.
|
|
38
|
+
# @param template_id
|
|
39
|
+
# @param [Hash] opts the optional parameters
|
|
40
|
+
# @return [Array<TemplateField>]
|
|
41
|
+
describe 'get_template_fields test' do
|
|
42
|
+
it 'should work' do
|
|
43
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# unit tests for list_templates
|
|
48
|
+
# List templates
|
|
49
|
+
# List all templates for the authenticated user. **Authentication:** API Key required (`x-api-key` header) or JWT token **Usage:** This endpoint is designed for no-code tools (Zapier, Make, n8n) to populate template selection dropdowns. **No credits consumed:** This is a read-only endpoint.
|
|
50
|
+
# @param [Hash] opts the optional parameters
|
|
51
|
+
# @return [TemplatesListResponse]
|
|
52
|
+
describe 'list_templates test' do
|
|
53
|
+
it 'should work' do
|
|
54
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#TemplateFox API
|
|
3
|
+
|
|
4
|
+
#Generate PDFs from HTML templates via API. Design once, generate thousands.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for TemplateFox::AccountInfoResponse
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe TemplateFox::AccountInfoResponse do
|
|
21
|
+
#let(:instance) { TemplateFox::AccountInfoResponse.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of AccountInfoResponse' do
|
|
24
|
+
it 'should create an instance of AccountInfoResponse' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(TemplateFox::AccountInfoResponse)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "credits"' do
|
|
31
|
+
it 'should work' do
|
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
describe 'test attribute "email"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
end
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#TemplateFox API
|
|
3
|
+
|
|
4
|
+
#Generate PDFs from HTML templates via API. Design once, generate thousands.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for TemplateFox::CreatePdfRequest
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe TemplateFox::CreatePdfRequest do
|
|
21
|
+
#let(:instance) { TemplateFox::CreatePdfRequest.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of CreatePdfRequest' do
|
|
24
|
+
it 'should create an instance of CreatePdfRequest' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(TemplateFox::CreatePdfRequest)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "template_id"' do
|
|
31
|
+
it 'should work' do
|
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
describe 'test attribute "data"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
describe 'test attribute "export_type"' do
|
|
43
|
+
it 'should work' do
|
|
44
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
describe 'test attribute "expiration"' do
|
|
49
|
+
it 'should work' do
|
|
50
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
describe 'test attribute "filename"' do
|
|
55
|
+
it 'should work' do
|
|
56
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
describe 'test attribute "store_s3"' do
|
|
61
|
+
it 'should work' do
|
|
62
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
describe 'test attribute "s3_filepath"' do
|
|
67
|
+
it 'should work' do
|
|
68
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
describe 'test attribute "s3_bucket"' do
|
|
73
|
+
it 'should work' do
|
|
74
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
end
|