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.
Files changed (75) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/LICENSE +21 -0
  4. data/README.md +206 -0
  5. data/Rakefile +10 -0
  6. data/docs/AccountApi.md +152 -0
  7. data/docs/AccountInfoResponse.md +20 -0
  8. data/docs/CreatePdfRequest.md +32 -0
  9. data/docs/CreatePdfResponse.md +24 -0
  10. data/docs/ExportType.md +15 -0
  11. data/docs/HTTPValidationError.md +18 -0
  12. data/docs/IntegrationsApi.md +286 -0
  13. data/docs/LocationInner.md +15 -0
  14. data/docs/PDFApi.md +79 -0
  15. data/docs/S3ConfigRequest.md +26 -0
  16. data/docs/S3ConfigResponse.md +28 -0
  17. data/docs/S3SuccessResponse.md +18 -0
  18. data/docs/S3TestResponse.md +20 -0
  19. data/docs/TemplateField.md +26 -0
  20. data/docs/TemplateListItem.md +24 -0
  21. data/docs/TemplatesApi.md +148 -0
  22. data/docs/TemplatesListResponse.md +18 -0
  23. data/docs/Transaction.md +28 -0
  24. data/docs/TransactionsResponse.md +24 -0
  25. data/docs/ValidationError.md +22 -0
  26. data/git_push.sh +57 -0
  27. data/lib/templatefox/api/account_api.rb +154 -0
  28. data/lib/templatefox/api/integrations_api.rb +261 -0
  29. data/lib/templatefox/api/pdf_api.rb +90 -0
  30. data/lib/templatefox/api/templates_api.rb +142 -0
  31. data/lib/templatefox/api_client.rb +397 -0
  32. data/lib/templatefox/api_error.rb +58 -0
  33. data/lib/templatefox/api_model_base.rb +88 -0
  34. data/lib/templatefox/configuration.rb +308 -0
  35. data/lib/templatefox/models/account_info_response.rb +176 -0
  36. data/lib/templatefox/models/create_pdf_request.rb +414 -0
  37. data/lib/templatefox/models/create_pdf_response.rb +247 -0
  38. data/lib/templatefox/models/export_type.rb +40 -0
  39. data/lib/templatefox/models/http_validation_error.rb +149 -0
  40. data/lib/templatefox/models/location_inner.rb +103 -0
  41. data/lib/templatefox/models/s3_config_request.rb +372 -0
  42. data/lib/templatefox/models/s3_config_response.rb +301 -0
  43. data/lib/templatefox/models/s3_success_response.rb +166 -0
  44. data/lib/templatefox/models/s3_test_response.rb +193 -0
  45. data/lib/templatefox/models/template_field.rb +227 -0
  46. data/lib/templatefox/models/template_list_item.rb +247 -0
  47. data/lib/templatefox/models/templates_list_response.rb +167 -0
  48. data/lib/templatefox/models/transaction.rb +267 -0
  49. data/lib/templatefox/models/transactions_response.rb +248 -0
  50. data/lib/templatefox/models/validation_error.rb +218 -0
  51. data/lib/templatefox/version.rb +15 -0
  52. data/lib/templatefox.rb +60 -0
  53. data/spec/api/account_api_spec.rb +59 -0
  54. data/spec/api/integrations_api_spec.rb +80 -0
  55. data/spec/api/pdf_api_spec.rb +47 -0
  56. data/spec/api/templates_api_spec.rb +58 -0
  57. data/spec/models/account_info_response_spec.rb +42 -0
  58. data/spec/models/create_pdf_request_spec.rb +78 -0
  59. data/spec/models/create_pdf_response_spec.rb +54 -0
  60. data/spec/models/export_type_spec.rb +30 -0
  61. data/spec/models/http_validation_error_spec.rb +36 -0
  62. data/spec/models/location_inner_spec.rb +21 -0
  63. data/spec/models/s3_config_request_spec.rb +60 -0
  64. data/spec/models/s3_config_response_spec.rb +66 -0
  65. data/spec/models/s3_success_response_spec.rb +36 -0
  66. data/spec/models/s3_test_response_spec.rb +42 -0
  67. data/spec/models/template_field_spec.rb +60 -0
  68. data/spec/models/template_list_item_spec.rb +54 -0
  69. data/spec/models/templates_list_response_spec.rb +36 -0
  70. data/spec/models/transaction_spec.rb +66 -0
  71. data/spec/models/transactions_response_spec.rb +54 -0
  72. data/spec/models/validation_error_spec.rb +48 -0
  73. data/spec/spec_helper.rb +111 -0
  74. data/templatefox.gemspec +39 -0
  75. metadata +177 -0
@@ -0,0 +1,267 @@
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
+ # Transaction record
18
+ class Transaction < ApiModelBase
19
+ # Unique transaction reference (UUID)
20
+ attr_accessor :transaction_ref
21
+
22
+ # Transaction type: PDFGEN, PURCHASE, REFUND, BONUS
23
+ attr_accessor :transaction_type
24
+
25
+ attr_accessor :template_id
26
+
27
+ attr_accessor :exec_tm
28
+
29
+ # Credits consumed (positive) or added (negative)
30
+ attr_accessor :credits
31
+
32
+ # ISO 8601 timestamp
33
+ attr_accessor :created_at
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'transaction_ref' => :'transaction_ref',
39
+ :'transaction_type' => :'transaction_type',
40
+ :'template_id' => :'template_id',
41
+ :'exec_tm' => :'exec_tm',
42
+ :'credits' => :'credits',
43
+ :'created_at' => :'created_at'
44
+ }
45
+ end
46
+
47
+ # Returns attribute mapping this model knows about
48
+ def self.acceptable_attribute_map
49
+ attribute_map
50
+ end
51
+
52
+ # Returns all the JSON keys this model knows about
53
+ def self.acceptable_attributes
54
+ acceptable_attribute_map.values
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.openapi_types
59
+ {
60
+ :'transaction_ref' => :'String',
61
+ :'transaction_type' => :'String',
62
+ :'template_id' => :'String',
63
+ :'exec_tm' => :'Integer',
64
+ :'credits' => :'Integer',
65
+ :'created_at' => :'String'
66
+ }
67
+ end
68
+
69
+ # List of attributes with nullable: true
70
+ def self.openapi_nullable
71
+ Set.new([
72
+ :'template_id',
73
+ :'exec_tm',
74
+ ])
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TemplateFox::Transaction` initialize method"
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ acceptable_attribute_map = self.class.acceptable_attribute_map
86
+ attributes = attributes.each_with_object({}) { |(k, v), h|
87
+ if (!acceptable_attribute_map.key?(k.to_sym))
88
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TemplateFox::Transaction`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
89
+ end
90
+ h[k.to_sym] = v
91
+ }
92
+
93
+ if attributes.key?(:'transaction_ref')
94
+ self.transaction_ref = attributes[:'transaction_ref']
95
+ else
96
+ self.transaction_ref = nil
97
+ end
98
+
99
+ if attributes.key?(:'transaction_type')
100
+ self.transaction_type = attributes[:'transaction_type']
101
+ else
102
+ self.transaction_type = nil
103
+ end
104
+
105
+ if attributes.key?(:'template_id')
106
+ self.template_id = attributes[:'template_id']
107
+ end
108
+
109
+ if attributes.key?(:'exec_tm')
110
+ self.exec_tm = attributes[:'exec_tm']
111
+ end
112
+
113
+ if attributes.key?(:'credits')
114
+ self.credits = attributes[:'credits']
115
+ else
116
+ self.credits = nil
117
+ end
118
+
119
+ if attributes.key?(:'created_at')
120
+ self.created_at = attributes[:'created_at']
121
+ else
122
+ self.created_at = nil
123
+ end
124
+ end
125
+
126
+ # Show invalid properties with the reasons. Usually used together with valid?
127
+ # @return Array for valid properties with the reasons
128
+ def list_invalid_properties
129
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
130
+ invalid_properties = Array.new
131
+ if @transaction_ref.nil?
132
+ invalid_properties.push('invalid value for "transaction_ref", transaction_ref cannot be nil.')
133
+ end
134
+
135
+ if @transaction_type.nil?
136
+ invalid_properties.push('invalid value for "transaction_type", transaction_type cannot be nil.')
137
+ end
138
+
139
+ if @credits.nil?
140
+ invalid_properties.push('invalid value for "credits", credits cannot be nil.')
141
+ end
142
+
143
+ if @created_at.nil?
144
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
145
+ end
146
+
147
+ invalid_properties
148
+ end
149
+
150
+ # Check to see if the all the properties in the model are valid
151
+ # @return true if the model is valid
152
+ def valid?
153
+ warn '[DEPRECATED] the `valid?` method is obsolete'
154
+ return false if @transaction_ref.nil?
155
+ return false if @transaction_type.nil?
156
+ return false if @credits.nil?
157
+ return false if @created_at.nil?
158
+ true
159
+ end
160
+
161
+ # Custom attribute writer method with validation
162
+ # @param [Object] transaction_ref Value to be assigned
163
+ def transaction_ref=(transaction_ref)
164
+ if transaction_ref.nil?
165
+ fail ArgumentError, 'transaction_ref cannot be nil'
166
+ end
167
+
168
+ @transaction_ref = transaction_ref
169
+ end
170
+
171
+ # Custom attribute writer method with validation
172
+ # @param [Object] transaction_type Value to be assigned
173
+ def transaction_type=(transaction_type)
174
+ if transaction_type.nil?
175
+ fail ArgumentError, 'transaction_type cannot be nil'
176
+ end
177
+
178
+ @transaction_type = transaction_type
179
+ end
180
+
181
+ # Custom attribute writer method with validation
182
+ # @param [Object] credits Value to be assigned
183
+ def credits=(credits)
184
+ if credits.nil?
185
+ fail ArgumentError, 'credits cannot be nil'
186
+ end
187
+
188
+ @credits = credits
189
+ end
190
+
191
+ # Custom attribute writer method with validation
192
+ # @param [Object] created_at Value to be assigned
193
+ def created_at=(created_at)
194
+ if created_at.nil?
195
+ fail ArgumentError, 'created_at cannot be nil'
196
+ end
197
+
198
+ @created_at = created_at
199
+ end
200
+
201
+ # Checks equality by comparing each attribute.
202
+ # @param [Object] Object to be compared
203
+ def ==(o)
204
+ return true if self.equal?(o)
205
+ self.class == o.class &&
206
+ transaction_ref == o.transaction_ref &&
207
+ transaction_type == o.transaction_type &&
208
+ template_id == o.template_id &&
209
+ exec_tm == o.exec_tm &&
210
+ credits == o.credits &&
211
+ created_at == o.created_at
212
+ end
213
+
214
+ # @see the `==` method
215
+ # @param [Object] Object to be compared
216
+ def eql?(o)
217
+ self == o
218
+ end
219
+
220
+ # Calculates hash code according to all attributes.
221
+ # @return [Integer] Hash code
222
+ def hash
223
+ [transaction_ref, transaction_type, template_id, exec_tm, credits, created_at].hash
224
+ end
225
+
226
+ # Builds the object from hash
227
+ # @param [Hash] attributes Model attributes in the form of hash
228
+ # @return [Object] Returns the model itself
229
+ def self.build_from_hash(attributes)
230
+ return nil unless attributes.is_a?(Hash)
231
+ attributes = attributes.transform_keys(&:to_sym)
232
+ transformed_hash = {}
233
+ openapi_types.each_pair do |key, type|
234
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
235
+ transformed_hash["#{key}"] = nil
236
+ elsif type =~ /\AArray<(.*)>/i
237
+ # check to ensure the input is an array given that the attribute
238
+ # is documented as an array but the input is not
239
+ if attributes[attribute_map[key]].is_a?(Array)
240
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
241
+ end
242
+ elsif !attributes[attribute_map[key]].nil?
243
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
244
+ end
245
+ end
246
+ new(transformed_hash)
247
+ end
248
+
249
+ # Returns the object in the form of hash
250
+ # @return [Hash] Returns the object in the form of hash
251
+ def to_hash
252
+ hash = {}
253
+ self.class.attribute_map.each_pair do |attr, param|
254
+ value = self.send(attr)
255
+ if value.nil?
256
+ is_nullable = self.class.openapi_nullable.include?(attr)
257
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
258
+ end
259
+
260
+ hash[param] = _to_hash(value)
261
+ end
262
+ hash
263
+ end
264
+
265
+ end
266
+
267
+ end
@@ -0,0 +1,248 @@
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
+ # Response for transactions list endpoint
18
+ class TransactionsResponse < ApiModelBase
19
+ attr_accessor :transactions
20
+
21
+ # Total number of transactions
22
+ attr_accessor :total
23
+
24
+ # Number of records returned
25
+ attr_accessor :limit
26
+
27
+ # Number of records skipped
28
+ attr_accessor :offset
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'transactions' => :'transactions',
34
+ :'total' => :'total',
35
+ :'limit' => :'limit',
36
+ :'offset' => :'offset'
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
+ :'transactions' => :'Array<Transaction>',
54
+ :'total' => :'Integer',
55
+ :'limit' => :'Integer',
56
+ :'offset' => :'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::TransactionsResponse` 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::TransactionsResponse`. 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?(:'transactions')
83
+ if (value = attributes[:'transactions']).is_a?(Array)
84
+ self.transactions = value
85
+ end
86
+ else
87
+ self.transactions = nil
88
+ end
89
+
90
+ if attributes.key?(:'total')
91
+ self.total = attributes[:'total']
92
+ else
93
+ self.total = nil
94
+ end
95
+
96
+ if attributes.key?(:'limit')
97
+ self.limit = attributes[:'limit']
98
+ else
99
+ self.limit = nil
100
+ end
101
+
102
+ if attributes.key?(:'offset')
103
+ self.offset = attributes[:'offset']
104
+ else
105
+ self.offset = nil
106
+ end
107
+ end
108
+
109
+ # Show invalid properties with the reasons. Usually used together with valid?
110
+ # @return Array for valid properties with the reasons
111
+ def list_invalid_properties
112
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
113
+ invalid_properties = Array.new
114
+ if @transactions.nil?
115
+ invalid_properties.push('invalid value for "transactions", transactions cannot be nil.')
116
+ end
117
+
118
+ if @total.nil?
119
+ invalid_properties.push('invalid value for "total", total cannot be nil.')
120
+ end
121
+
122
+ if @limit.nil?
123
+ invalid_properties.push('invalid value for "limit", limit cannot be nil.')
124
+ end
125
+
126
+ if @offset.nil?
127
+ invalid_properties.push('invalid value for "offset", offset cannot be nil.')
128
+ end
129
+
130
+ invalid_properties
131
+ end
132
+
133
+ # Check to see if the all the properties in the model are valid
134
+ # @return true if the model is valid
135
+ def valid?
136
+ warn '[DEPRECATED] the `valid?` method is obsolete'
137
+ return false if @transactions.nil?
138
+ return false if @total.nil?
139
+ return false if @limit.nil?
140
+ return false if @offset.nil?
141
+ true
142
+ end
143
+
144
+ # Custom attribute writer method with validation
145
+ # @param [Object] transactions Value to be assigned
146
+ def transactions=(transactions)
147
+ if transactions.nil?
148
+ fail ArgumentError, 'transactions cannot be nil'
149
+ end
150
+
151
+ @transactions = transactions
152
+ end
153
+
154
+ # Custom attribute writer method with validation
155
+ # @param [Object] total Value to be assigned
156
+ def total=(total)
157
+ if total.nil?
158
+ fail ArgumentError, 'total cannot be nil'
159
+ end
160
+
161
+ @total = total
162
+ end
163
+
164
+ # Custom attribute writer method with validation
165
+ # @param [Object] limit Value to be assigned
166
+ def limit=(limit)
167
+ if limit.nil?
168
+ fail ArgumentError, 'limit cannot be nil'
169
+ end
170
+
171
+ @limit = limit
172
+ end
173
+
174
+ # Custom attribute writer method with validation
175
+ # @param [Object] offset Value to be assigned
176
+ def offset=(offset)
177
+ if offset.nil?
178
+ fail ArgumentError, 'offset cannot be nil'
179
+ end
180
+
181
+ @offset = offset
182
+ end
183
+
184
+ # Checks equality by comparing each attribute.
185
+ # @param [Object] Object to be compared
186
+ def ==(o)
187
+ return true if self.equal?(o)
188
+ self.class == o.class &&
189
+ transactions == o.transactions &&
190
+ total == o.total &&
191
+ limit == o.limit &&
192
+ offset == o.offset
193
+ end
194
+
195
+ # @see the `==` method
196
+ # @param [Object] Object to be compared
197
+ def eql?(o)
198
+ self == o
199
+ end
200
+
201
+ # Calculates hash code according to all attributes.
202
+ # @return [Integer] Hash code
203
+ def hash
204
+ [transactions, total, limit, offset].hash
205
+ end
206
+
207
+ # Builds the object from hash
208
+ # @param [Hash] attributes Model attributes in the form of hash
209
+ # @return [Object] Returns the model itself
210
+ def self.build_from_hash(attributes)
211
+ return nil unless attributes.is_a?(Hash)
212
+ attributes = attributes.transform_keys(&:to_sym)
213
+ transformed_hash = {}
214
+ openapi_types.each_pair do |key, type|
215
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
216
+ transformed_hash["#{key}"] = nil
217
+ elsif type =~ /\AArray<(.*)>/i
218
+ # check to ensure the input is an array given that the attribute
219
+ # is documented as an array but the input is not
220
+ if attributes[attribute_map[key]].is_a?(Array)
221
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
222
+ end
223
+ elsif !attributes[attribute_map[key]].nil?
224
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
225
+ end
226
+ end
227
+ new(transformed_hash)
228
+ end
229
+
230
+ # Returns the object in the form of hash
231
+ # @return [Hash] Returns the object in the form of hash
232
+ def to_hash
233
+ hash = {}
234
+ self.class.attribute_map.each_pair do |attr, param|
235
+ value = self.send(attr)
236
+ if value.nil?
237
+ is_nullable = self.class.openapi_nullable.include?(attr)
238
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
239
+ end
240
+
241
+ hash[param] = _to_hash(value)
242
+ end
243
+ hash
244
+ end
245
+
246
+ end
247
+
248
+ end