docspring 4.1.0 → 4.2.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/.openapi-generator/FILES +15 -0
- data/.travis.yml +1 -1
- data/AGENTS.md +3 -2
- data/CHANGELOG.md +40 -0
- data/Gemfile.lock +9 -9
- data/README.md +5 -1
- data/docs/Client.md +176 -10
- data/docs/CombinedPdf.md +1 -1
- data/docs/CreateCombinedPdfRequest.md +1 -1
- data/docs/CreateSubmissionRequest.md +2 -2
- data/docs/CreateTemplatePreviewRequest.md +18 -0
- data/docs/CreateTemplateRequest.md +3 -1
- data/docs/ErrorDetail.md +1 -1
- data/docs/ErrorInfo.md +4 -4
- data/docs/Submission.md +15 -15
- data/docs/SubmissionInput.md +2 -2
- data/docs/SubmissionList.md +1 -1
- data/docs/SubmissionSummary.md +54 -0
- data/docs/Template.md +12 -10
- data/docs/TemplateActor.md +1 -1
- data/docs/TemplateDocument.md +5 -5
- data/docs/TemplateDocumentSummary.md +24 -0
- data/docs/TemplatePreview.md +32 -0
- data/docs/TemplatePreviewState.md +15 -0
- data/docs/TemplateSummary.md +2 -48
- data/docs/UpdateTemplateRequest.md +4 -2
- data/docs/ValidateSubmissionRequest.md +2 -2
- data/lib/docspring/api/client.rb +178 -8
- data/lib/docspring/api_client.rb +4 -2
- data/lib/docspring/date_time_values.rb +33 -0
- data/lib/docspring/models/combined_pdf.rb +1 -1
- data/lib/docspring/models/create_combined_pdf_request.rb +1 -1
- data/lib/docspring/models/create_submission_request.rb +2 -2
- data/lib/docspring/models/create_template_preview_request.rb +187 -0
- data/lib/docspring/models/create_template_request.rb +12 -2
- data/lib/docspring/models/error_code.rb +3 -1
- data/lib/docspring/models/error_detail.rb +1 -1
- data/lib/docspring/models/error_info.rb +4 -4
- data/lib/docspring/models/submission.rb +140 -140
- data/lib/docspring/models/submission_input.rb +2 -2
- data/lib/docspring/models/submission_list.rb +1 -1
- data/lib/docspring/models/submission_summary.rb +601 -0
- data/lib/docspring/models/template.rb +96 -83
- data/lib/docspring/models/template_actor.rb +1 -1
- data/lib/docspring/models/template_document.rb +42 -42
- data/lib/docspring/models/template_document_summary.rb +260 -0
- data/lib/docspring/models/template_preview.rb +356 -0
- data/lib/docspring/models/template_preview_state.rb +42 -0
- data/lib/docspring/models/template_summary.rb +5 -572
- data/lib/docspring/models/update_template_request.rb +16 -6
- data/lib/docspring/models/validate_submission_request.rb +2 -2
- data/lib/docspring/request_schemas.json +105 -8
- data/lib/docspring/version.rb +1 -1
- data/lib/docspring/webhook_signature.rb +45 -0
- data/lib/docspring.rb +6 -0
- data/spec/api/client_spec.rb +39 -4
- data/spec/models/create_template_preview_request_spec.rb +36 -0
- data/spec/models/create_template_request_spec.rb +6 -0
- data/spec/models/submission_spec.rb +12 -12
- data/spec/models/submission_summary_spec.rb +144 -0
- data/spec/models/template_document_spec.rb +5 -5
- data/spec/models/template_document_summary_spec.rb +54 -0
- data/spec/models/template_preview_spec.rb +78 -0
- data/spec/models/template_preview_state_spec.rb +30 -0
- data/spec/models/template_spec.rb +28 -22
- data/spec/models/template_summary_spec.rb +0 -138
- data/spec/models/update_template_request_spec.rb +6 -0
- metadata +23 -1
|
@@ -0,0 +1,601 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#DocSpring API
|
|
3
|
+
|
|
4
|
+
#Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: v2
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.26.0-DOCSPRING
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module DocSpring
|
|
17
|
+
# A submission in a list: its template, state, test or live, metadata and timestamps, with its data and files when you ask for them. Get a submission by its ID for its signature requests, uploads and page images.
|
|
18
|
+
class SubmissionSummary < ApiModelBase
|
|
19
|
+
# The submission's ID.
|
|
20
|
+
attr_accessor :id
|
|
21
|
+
|
|
22
|
+
# Null once the template has been permanently deleted.
|
|
23
|
+
attr_accessor :template_id
|
|
24
|
+
|
|
25
|
+
# The template's type: `pdf` or `html`.
|
|
26
|
+
attr_accessor :template_type
|
|
27
|
+
|
|
28
|
+
# The published version of the template the submission used. Null for the draft.
|
|
29
|
+
attr_accessor :template_version
|
|
30
|
+
|
|
31
|
+
# The ID of the batch the submission was created in.
|
|
32
|
+
attr_accessor :batch_id
|
|
33
|
+
|
|
34
|
+
# `api`: created with the API. `web`: a web form. `reprocess`: a copy of another submission, made to generate its PDF again.
|
|
35
|
+
attr_accessor :source
|
|
36
|
+
|
|
37
|
+
# `pending` until the PDF has been generated, then `processed`. `waiting_for_signature_requests` until every signature request is completed. `insufficient_credits`: waiting for credits; `error_message` says whether the PDF is generated once you add them. `account_suspended`: waiting for the account to be reactivated, for up to 30 days. Waiting ends in `error` if it's discarded or takes over 30 days. Every other state is final, with no PDF: `invalid_data` (the data doesn't match the template's fields: see `data_errors`), `declined` (a signature request was declined), and the states where generating the PDF failed, which have an `error_message`: `syntax_error` (a mistake in an HTML template's Liquid or SCSS), `image_download_failed` or `image_processing_failed` (an image in the data or the template couldn't be downloaded or read) and `error` (anything else). Older submissions can also be `license_revoked` or `accidental`.
|
|
38
|
+
attr_accessor :state
|
|
39
|
+
|
|
40
|
+
# Test PDFs have a watermark and are free. Live PDFs use credits. Submissions made with a test API token are always test submissions.
|
|
41
|
+
attr_accessor :test
|
|
42
|
+
|
|
43
|
+
# `true` keeps the PDF's text and check fields fillable, and `false` flattens every field. Left out, the template decides: its `editable_submissions` setting, or each field's own Editable option. A response shows the template's setting when the request left this out. Can't be `true` with `signature_requests`.
|
|
44
|
+
attr_accessor :editable
|
|
45
|
+
|
|
46
|
+
# The submission's data, with the values entered in completed signature requests. Null unless you pass `include_data=true`. Empty once the submission has expired.
|
|
47
|
+
attr_accessor :data
|
|
48
|
+
|
|
49
|
+
# Why the data doesn't match the template's fields, when `state` is `invalid_data`: the same details as the 422 response that recorded it, with pointers into the request that created the submission (`/data/name`). Cleared once the submission has expired.
|
|
50
|
+
attr_accessor :data_errors
|
|
51
|
+
|
|
52
|
+
# Why the PDF couldn't be generated, when `state` is `error`.
|
|
53
|
+
attr_accessor :error_message
|
|
54
|
+
|
|
55
|
+
# Your own data about the submission, such as an ID from your app. It isn't printed on the PDF. Two keys also change the PDF: `pdf_filename` names its file (`files.pdf.filename`, and its download), and `pdf_title` is its title in the PDF's document properties (and an HTML template's `<title>`, unless its HTML has one). Without `pdf_title`, the title is the template's name. In `pdf_filename`, a `.pdf` ending is removed, each run of characters other than letters, digits, `-`, `_` and `.` becomes one `_`, and the first 128 characters are kept, then `.pdf` is added. Without it, the file is named after the submission's ID (`sub_1234567890abcdef01.pdf`).
|
|
56
|
+
attr_accessor :metadata
|
|
57
|
+
|
|
58
|
+
# Empty unless you pass `include_files=true`: then the generated files, as when you get the submission, without the `png` pages' links (`files.png.pages` is null). Get the submission for its page images.
|
|
59
|
+
attr_accessor :files
|
|
60
|
+
|
|
61
|
+
# An expired submission's data, metadata, password and PDF have been deleted.
|
|
62
|
+
attr_accessor :expired
|
|
63
|
+
|
|
64
|
+
# When the submission expires. Null if it's kept until you delete it.
|
|
65
|
+
attr_accessor :expires_at
|
|
66
|
+
|
|
67
|
+
# When the PDF was generated. Null until then.
|
|
68
|
+
attr_accessor :processed_at
|
|
69
|
+
|
|
70
|
+
# When the submission was created.
|
|
71
|
+
attr_accessor :created_at
|
|
72
|
+
|
|
73
|
+
# When the submission was last updated.
|
|
74
|
+
attr_accessor :updated_at
|
|
75
|
+
|
|
76
|
+
class EnumAttributeValidator
|
|
77
|
+
attr_reader :datatype
|
|
78
|
+
attr_reader :allowable_values
|
|
79
|
+
|
|
80
|
+
def initialize(datatype, allowable_values)
|
|
81
|
+
@allowable_values = allowable_values.map do |value|
|
|
82
|
+
case datatype.to_s
|
|
83
|
+
when /Integer/i
|
|
84
|
+
value.to_i
|
|
85
|
+
when /Float/i
|
|
86
|
+
value.to_f
|
|
87
|
+
else
|
|
88
|
+
value
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
def valid?(value)
|
|
94
|
+
!value || allowable_values.include?(value)
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
99
|
+
def self.attribute_map
|
|
100
|
+
{
|
|
101
|
+
:'id' => :'id',
|
|
102
|
+
:'template_id' => :'template_id',
|
|
103
|
+
:'template_type' => :'template_type',
|
|
104
|
+
:'template_version' => :'template_version',
|
|
105
|
+
:'batch_id' => :'batch_id',
|
|
106
|
+
:'source' => :'source',
|
|
107
|
+
:'state' => :'state',
|
|
108
|
+
:'test' => :'test',
|
|
109
|
+
:'editable' => :'editable',
|
|
110
|
+
:'data' => :'data',
|
|
111
|
+
:'data_errors' => :'data_errors',
|
|
112
|
+
:'error_message' => :'error_message',
|
|
113
|
+
:'metadata' => :'metadata',
|
|
114
|
+
:'files' => :'files',
|
|
115
|
+
:'expired' => :'expired',
|
|
116
|
+
:'expires_at' => :'expires_at',
|
|
117
|
+
:'processed_at' => :'processed_at',
|
|
118
|
+
:'created_at' => :'created_at',
|
|
119
|
+
:'updated_at' => :'updated_at'
|
|
120
|
+
}
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Returns attribute mapping this model knows about
|
|
124
|
+
def self.acceptable_attribute_map
|
|
125
|
+
attribute_map
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Returns all the JSON keys this model knows about
|
|
129
|
+
def self.acceptable_attributes
|
|
130
|
+
acceptable_attribute_map.values
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Attribute type mapping.
|
|
134
|
+
def self.openapi_types
|
|
135
|
+
{
|
|
136
|
+
:'id' => :'String',
|
|
137
|
+
:'template_id' => :'String',
|
|
138
|
+
:'template_type' => :'TemplateType',
|
|
139
|
+
:'template_version' => :'String',
|
|
140
|
+
:'batch_id' => :'String',
|
|
141
|
+
:'source' => :'SubmissionSource',
|
|
142
|
+
:'state' => :'SubmissionState',
|
|
143
|
+
:'test' => :'Boolean',
|
|
144
|
+
:'editable' => :'Boolean',
|
|
145
|
+
:'data' => :'Hash<String, Object>',
|
|
146
|
+
:'data_errors' => :'Array<ErrorDetail>',
|
|
147
|
+
:'error_message' => :'String',
|
|
148
|
+
:'metadata' => :'Hash<String, Object>',
|
|
149
|
+
:'files' => :'SubmissionFiles',
|
|
150
|
+
:'expired' => :'Boolean',
|
|
151
|
+
:'expires_at' => :'Time',
|
|
152
|
+
:'processed_at' => :'Time',
|
|
153
|
+
:'created_at' => :'Time',
|
|
154
|
+
:'updated_at' => :'Time'
|
|
155
|
+
}
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# List of attributes with nullable: true
|
|
159
|
+
def self.openapi_nullable
|
|
160
|
+
Set.new([
|
|
161
|
+
:'template_id',
|
|
162
|
+
:'template_version',
|
|
163
|
+
:'batch_id',
|
|
164
|
+
:'data',
|
|
165
|
+
:'error_message',
|
|
166
|
+
:'expires_at',
|
|
167
|
+
:'processed_at',
|
|
168
|
+
])
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Returns attribute type mapping
|
|
172
|
+
def self.acceptable_openapi_types
|
|
173
|
+
openapi_types
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
# Returns the nullable attributes
|
|
177
|
+
def self.acceptable_openapi_nullable
|
|
178
|
+
openapi_nullable
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Initializes the object
|
|
182
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
183
|
+
def initialize(attributes = {})
|
|
184
|
+
if (!attributes.is_a?(Hash))
|
|
185
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::SubmissionSummary` initialize method"
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
189
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
190
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
191
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
192
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::SubmissionSummary`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
193
|
+
end
|
|
194
|
+
h[k.to_sym] = v
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
if attributes.key?(:'id')
|
|
198
|
+
self.id = attributes[:'id']
|
|
199
|
+
else
|
|
200
|
+
self.id = nil
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
if attributes.key?(:'template_id')
|
|
204
|
+
self.template_id = attributes[:'template_id']
|
|
205
|
+
else
|
|
206
|
+
self.template_id = nil
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
if attributes.key?(:'template_type')
|
|
210
|
+
self.template_type = attributes[:'template_type']
|
|
211
|
+
else
|
|
212
|
+
self.template_type = nil
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
if attributes.key?(:'template_version')
|
|
216
|
+
self.template_version = attributes[:'template_version']
|
|
217
|
+
else
|
|
218
|
+
self.template_version = nil
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
if attributes.key?(:'batch_id')
|
|
222
|
+
self.batch_id = attributes[:'batch_id']
|
|
223
|
+
else
|
|
224
|
+
self.batch_id = nil
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
if attributes.key?(:'source')
|
|
228
|
+
self.source = attributes[:'source']
|
|
229
|
+
else
|
|
230
|
+
self.source = nil
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
if attributes.key?(:'state')
|
|
234
|
+
self.state = attributes[:'state']
|
|
235
|
+
else
|
|
236
|
+
self.state = nil
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
if attributes.key?(:'test')
|
|
240
|
+
self.test = attributes[:'test']
|
|
241
|
+
else
|
|
242
|
+
self.test = nil
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
if attributes.key?(:'editable')
|
|
246
|
+
self.editable = attributes[:'editable']
|
|
247
|
+
else
|
|
248
|
+
self.editable = nil
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
if attributes.key?(:'data')
|
|
252
|
+
if (value = attributes[:'data']).is_a?(Hash) || value.nil?
|
|
253
|
+
self.data = value
|
|
254
|
+
end
|
|
255
|
+
else
|
|
256
|
+
self.data = nil
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
if attributes.key?(:'data_errors')
|
|
260
|
+
if (value = attributes[:'data_errors']).is_a?(Array)
|
|
261
|
+
self.data_errors = value
|
|
262
|
+
end
|
|
263
|
+
else
|
|
264
|
+
self.data_errors = nil
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
if attributes.key?(:'error_message')
|
|
268
|
+
self.error_message = attributes[:'error_message']
|
|
269
|
+
else
|
|
270
|
+
self.error_message = nil
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
if attributes.key?(:'metadata')
|
|
274
|
+
if (value = attributes[:'metadata']).is_a?(Hash)
|
|
275
|
+
self.metadata = value
|
|
276
|
+
end
|
|
277
|
+
else
|
|
278
|
+
self.metadata = nil
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
if attributes.key?(:'files')
|
|
282
|
+
self.files = attributes[:'files']
|
|
283
|
+
else
|
|
284
|
+
self.files = nil
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
if attributes.key?(:'expired')
|
|
288
|
+
self.expired = attributes[:'expired']
|
|
289
|
+
else
|
|
290
|
+
self.expired = nil
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
if attributes.key?(:'expires_at')
|
|
294
|
+
self.expires_at = attributes[:'expires_at']
|
|
295
|
+
else
|
|
296
|
+
self.expires_at = nil
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
if attributes.key?(:'processed_at')
|
|
300
|
+
self.processed_at = attributes[:'processed_at']
|
|
301
|
+
else
|
|
302
|
+
self.processed_at = nil
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
if attributes.key?(:'created_at')
|
|
306
|
+
self.created_at = attributes[:'created_at']
|
|
307
|
+
else
|
|
308
|
+
self.created_at = nil
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
if attributes.key?(:'updated_at')
|
|
312
|
+
self.updated_at = attributes[:'updated_at']
|
|
313
|
+
else
|
|
314
|
+
self.updated_at = nil
|
|
315
|
+
end
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
319
|
+
# @return Array for valid properties with the reasons
|
|
320
|
+
def list_invalid_properties
|
|
321
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
322
|
+
invalid_properties = Array.new
|
|
323
|
+
if @id.nil?
|
|
324
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
325
|
+
end
|
|
326
|
+
|
|
327
|
+
if @template_type.nil?
|
|
328
|
+
invalid_properties.push('invalid value for "template_type", template_type cannot be nil.')
|
|
329
|
+
end
|
|
330
|
+
|
|
331
|
+
if @source.nil?
|
|
332
|
+
invalid_properties.push('invalid value for "source", source cannot be nil.')
|
|
333
|
+
end
|
|
334
|
+
|
|
335
|
+
if @state.nil?
|
|
336
|
+
invalid_properties.push('invalid value for "state", state cannot be nil.')
|
|
337
|
+
end
|
|
338
|
+
|
|
339
|
+
if @test.nil?
|
|
340
|
+
invalid_properties.push('invalid value for "test", test cannot be nil.')
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
if @editable.nil?
|
|
344
|
+
invalid_properties.push('invalid value for "editable", editable cannot be nil.')
|
|
345
|
+
end
|
|
346
|
+
|
|
347
|
+
if @data_errors.nil?
|
|
348
|
+
invalid_properties.push('invalid value for "data_errors", data_errors cannot be nil.')
|
|
349
|
+
end
|
|
350
|
+
|
|
351
|
+
if @metadata.nil?
|
|
352
|
+
invalid_properties.push('invalid value for "metadata", metadata cannot be nil.')
|
|
353
|
+
end
|
|
354
|
+
|
|
355
|
+
if @files.nil?
|
|
356
|
+
invalid_properties.push('invalid value for "files", files cannot be nil.')
|
|
357
|
+
end
|
|
358
|
+
|
|
359
|
+
if @expired.nil?
|
|
360
|
+
invalid_properties.push('invalid value for "expired", expired cannot be nil.')
|
|
361
|
+
end
|
|
362
|
+
|
|
363
|
+
if @created_at.nil?
|
|
364
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
|
365
|
+
end
|
|
366
|
+
|
|
367
|
+
if @updated_at.nil?
|
|
368
|
+
invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
|
|
369
|
+
end
|
|
370
|
+
|
|
371
|
+
invalid_properties
|
|
372
|
+
end
|
|
373
|
+
|
|
374
|
+
# Check to see if the all the properties in the model are valid
|
|
375
|
+
# @return true if the model is valid
|
|
376
|
+
def valid?
|
|
377
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
378
|
+
return false if @id.nil?
|
|
379
|
+
return false if @template_type.nil?
|
|
380
|
+
return false if @source.nil?
|
|
381
|
+
return false if @state.nil?
|
|
382
|
+
return false if @test.nil?
|
|
383
|
+
return false if @editable.nil?
|
|
384
|
+
return false if @data_errors.nil?
|
|
385
|
+
return false if @metadata.nil?
|
|
386
|
+
return false if @files.nil?
|
|
387
|
+
return false if @expired.nil?
|
|
388
|
+
return false if @created_at.nil?
|
|
389
|
+
return false if @updated_at.nil?
|
|
390
|
+
true
|
|
391
|
+
end
|
|
392
|
+
|
|
393
|
+
# Custom attribute writer method with validation
|
|
394
|
+
# @param [Object] id Value to be assigned
|
|
395
|
+
def id=(id)
|
|
396
|
+
if id.nil?
|
|
397
|
+
fail ArgumentError, 'id cannot be nil'
|
|
398
|
+
end
|
|
399
|
+
|
|
400
|
+
@id = id
|
|
401
|
+
end
|
|
402
|
+
|
|
403
|
+
# Custom attribute writer method with validation
|
|
404
|
+
# @param [Object] template_type Value to be assigned
|
|
405
|
+
def template_type=(template_type)
|
|
406
|
+
if template_type.nil?
|
|
407
|
+
fail ArgumentError, 'template_type cannot be nil'
|
|
408
|
+
end
|
|
409
|
+
|
|
410
|
+
@template_type = template_type
|
|
411
|
+
end
|
|
412
|
+
|
|
413
|
+
# Custom attribute writer method with validation
|
|
414
|
+
# @param [Object] source Value to be assigned
|
|
415
|
+
def source=(source)
|
|
416
|
+
if source.nil?
|
|
417
|
+
fail ArgumentError, 'source cannot be nil'
|
|
418
|
+
end
|
|
419
|
+
|
|
420
|
+
@source = source
|
|
421
|
+
end
|
|
422
|
+
|
|
423
|
+
# Custom attribute writer method with validation
|
|
424
|
+
# @param [Object] state Value to be assigned
|
|
425
|
+
def state=(state)
|
|
426
|
+
if state.nil?
|
|
427
|
+
fail ArgumentError, 'state cannot be nil'
|
|
428
|
+
end
|
|
429
|
+
|
|
430
|
+
@state = state
|
|
431
|
+
end
|
|
432
|
+
|
|
433
|
+
# Custom attribute writer method with validation
|
|
434
|
+
# @param [Object] test Value to be assigned
|
|
435
|
+
def test=(test)
|
|
436
|
+
if test.nil?
|
|
437
|
+
fail ArgumentError, 'test cannot be nil'
|
|
438
|
+
end
|
|
439
|
+
|
|
440
|
+
@test = test
|
|
441
|
+
end
|
|
442
|
+
|
|
443
|
+
# Custom attribute writer method with validation
|
|
444
|
+
# @param [Object] editable Value to be assigned
|
|
445
|
+
def editable=(editable)
|
|
446
|
+
if editable.nil?
|
|
447
|
+
fail ArgumentError, 'editable cannot be nil'
|
|
448
|
+
end
|
|
449
|
+
|
|
450
|
+
@editable = editable
|
|
451
|
+
end
|
|
452
|
+
|
|
453
|
+
# Custom attribute writer method with validation
|
|
454
|
+
# @param [Object] data_errors Value to be assigned
|
|
455
|
+
def data_errors=(data_errors)
|
|
456
|
+
if data_errors.nil?
|
|
457
|
+
fail ArgumentError, 'data_errors cannot be nil'
|
|
458
|
+
end
|
|
459
|
+
|
|
460
|
+
@data_errors = data_errors
|
|
461
|
+
end
|
|
462
|
+
|
|
463
|
+
# Custom attribute writer method with validation
|
|
464
|
+
# @param [Object] metadata Value to be assigned
|
|
465
|
+
def metadata=(metadata)
|
|
466
|
+
if metadata.nil?
|
|
467
|
+
fail ArgumentError, 'metadata cannot be nil'
|
|
468
|
+
end
|
|
469
|
+
|
|
470
|
+
@metadata = metadata
|
|
471
|
+
end
|
|
472
|
+
|
|
473
|
+
# Custom attribute writer method with validation
|
|
474
|
+
# @param [Object] files Value to be assigned
|
|
475
|
+
def files=(files)
|
|
476
|
+
if files.nil?
|
|
477
|
+
fail ArgumentError, 'files cannot be nil'
|
|
478
|
+
end
|
|
479
|
+
|
|
480
|
+
@files = files
|
|
481
|
+
end
|
|
482
|
+
|
|
483
|
+
# Custom attribute writer method with validation
|
|
484
|
+
# @param [Object] expired Value to be assigned
|
|
485
|
+
def expired=(expired)
|
|
486
|
+
if expired.nil?
|
|
487
|
+
fail ArgumentError, 'expired cannot be nil'
|
|
488
|
+
end
|
|
489
|
+
|
|
490
|
+
@expired = expired
|
|
491
|
+
end
|
|
492
|
+
|
|
493
|
+
# Custom attribute writer method with validation
|
|
494
|
+
# @param [Object] created_at Value to be assigned
|
|
495
|
+
def created_at=(created_at)
|
|
496
|
+
if created_at.nil?
|
|
497
|
+
fail ArgumentError, 'created_at cannot be nil'
|
|
498
|
+
end
|
|
499
|
+
|
|
500
|
+
@created_at = created_at
|
|
501
|
+
end
|
|
502
|
+
|
|
503
|
+
# Custom attribute writer method with validation
|
|
504
|
+
# @param [Object] updated_at Value to be assigned
|
|
505
|
+
def updated_at=(updated_at)
|
|
506
|
+
if updated_at.nil?
|
|
507
|
+
fail ArgumentError, 'updated_at cannot be nil'
|
|
508
|
+
end
|
|
509
|
+
|
|
510
|
+
@updated_at = updated_at
|
|
511
|
+
end
|
|
512
|
+
|
|
513
|
+
# Checks equality by comparing each attribute.
|
|
514
|
+
# @param [Object] Object to be compared
|
|
515
|
+
def ==(o)
|
|
516
|
+
return true if self.equal?(o)
|
|
517
|
+
self.class == o.class &&
|
|
518
|
+
id == o.id &&
|
|
519
|
+
template_id == o.template_id &&
|
|
520
|
+
template_type == o.template_type &&
|
|
521
|
+
template_version == o.template_version &&
|
|
522
|
+
batch_id == o.batch_id &&
|
|
523
|
+
source == o.source &&
|
|
524
|
+
state == o.state &&
|
|
525
|
+
test == o.test &&
|
|
526
|
+
editable == o.editable &&
|
|
527
|
+
data == o.data &&
|
|
528
|
+
data_errors == o.data_errors &&
|
|
529
|
+
error_message == o.error_message &&
|
|
530
|
+
metadata == o.metadata &&
|
|
531
|
+
files == o.files &&
|
|
532
|
+
expired == o.expired &&
|
|
533
|
+
expires_at == o.expires_at &&
|
|
534
|
+
processed_at == o.processed_at &&
|
|
535
|
+
created_at == o.created_at &&
|
|
536
|
+
updated_at == o.updated_at
|
|
537
|
+
end
|
|
538
|
+
|
|
539
|
+
# @see the `==` method
|
|
540
|
+
# @param [Object] Object to be compared
|
|
541
|
+
def eql?(o)
|
|
542
|
+
self == o
|
|
543
|
+
end
|
|
544
|
+
|
|
545
|
+
# Calculates hash code according to all attributes.
|
|
546
|
+
# @return [Integer] Hash code
|
|
547
|
+
def hash
|
|
548
|
+
[id, template_id, template_type, template_version, batch_id, source, state, test, editable, data, data_errors, error_message, metadata, files, expired, expires_at, processed_at, created_at, updated_at].hash
|
|
549
|
+
end
|
|
550
|
+
|
|
551
|
+
# Builds the object from hash
|
|
552
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
553
|
+
# @return [Object] Returns the model itself
|
|
554
|
+
def self.build_from_hash(attributes)
|
|
555
|
+
return nil unless attributes.is_a?(Hash)
|
|
556
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
557
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
558
|
+
map = acceptable_attribute_map
|
|
559
|
+
transformed_hash = {}
|
|
560
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
561
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
562
|
+
transformed_hash["#{key}"] = nil
|
|
563
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
564
|
+
# check to ensure the input is an array given that the attribute
|
|
565
|
+
# is documented as an array but the input is not
|
|
566
|
+
if attributes[map[key]].is_a?(Array)
|
|
567
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
568
|
+
end
|
|
569
|
+
elsif !attributes[map[key]].nil?
|
|
570
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
571
|
+
end
|
|
572
|
+
end
|
|
573
|
+
# Responses can include enum values added after this client was released, so the enum setters
|
|
574
|
+
# accept any value while the model is built from a response
|
|
575
|
+
allocate.tap do |model|
|
|
576
|
+
model.instance_variable_set(:@_skip_enum_validation, true)
|
|
577
|
+
model.send(:initialize, transformed_hash)
|
|
578
|
+
model.remove_instance_variable(:@_skip_enum_validation)
|
|
579
|
+
end
|
|
580
|
+
end
|
|
581
|
+
|
|
582
|
+
# Returns the object in the form of hash
|
|
583
|
+
# @return [Hash] Returns the object in the form of hash
|
|
584
|
+
def to_hash
|
|
585
|
+
hash = {}
|
|
586
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
587
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
588
|
+
value = self.send(attr)
|
|
589
|
+
if value.nil?
|
|
590
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
591
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
592
|
+
end
|
|
593
|
+
|
|
594
|
+
hash[param] = _to_hash(value)
|
|
595
|
+
end
|
|
596
|
+
hash
|
|
597
|
+
end
|
|
598
|
+
|
|
599
|
+
end
|
|
600
|
+
|
|
601
|
+
end
|