-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel_create_async_pdf_request.go
More file actions
541 lines (456 loc) · 15.9 KB
/
model_create_async_pdf_request.go
File metadata and controls
541 lines (456 loc) · 15.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
/*
TemplateFox API
Generate beautiful PDFs from HTML/CSS templates with Jinja2 via API. Design once, generate thousands.
API version: 1.6.1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package templatefox
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the CreateAsyncPdfRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CreateAsyncPdfRequest{}
// CreateAsyncPdfRequest Request model for async PDF generation
type CreateAsyncPdfRequest struct {
// **Required.** Template short ID (12 characters)
TemplateId string `json:"template_id"`
// **Required.** Key-value data to render in the template.
Data map[string]interface{} `json:"data"`
// Export format. Currently only `url` is supported for async.
ExportType *AppRoutersV1PdfAsyncExportType `json:"export_type,omitempty"`
// URL expiration in seconds (60-604800). Default: 86400 (24 hours).
Expiration *int32 `json:"expiration,omitempty"`
Filename NullableString `json:"filename,omitempty" validate:"regexp=^[a-zA-Z0-9_\\\\-\\\\.]+$"`
// Upload to your configured S3 bucket instead of CDN.
StoreS3 *bool `json:"store_s3,omitempty"`
S3Filepath NullableString `json:"s3_filepath,omitempty" validate:"regexp=^[a-zA-Z0-9_\\\\-\\\\.\\/]+$"`
S3Bucket NullableString `json:"s3_bucket,omitempty" validate:"regexp=^[a-z0-9][a-z0-9.\\\\-]*[a-z0-9]$"`
WebhookUrl NullableString `json:"webhook_url,omitempty"`
WebhookSecret NullableString `json:"webhook_secret,omitempty"`
}
type _CreateAsyncPdfRequest CreateAsyncPdfRequest
// NewCreateAsyncPdfRequest instantiates a new CreateAsyncPdfRequest object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewCreateAsyncPdfRequest(templateId string, data map[string]interface{}) *CreateAsyncPdfRequest {
this := CreateAsyncPdfRequest{}
this.TemplateId = templateId
this.Data = data
var exportType AppRoutersV1PdfAsyncExportType = URL
this.ExportType = &exportType
var expiration int32 = 86400
this.Expiration = &expiration
var storeS3 bool = false
this.StoreS3 = &storeS3
return &this
}
// NewCreateAsyncPdfRequestWithDefaults instantiates a new CreateAsyncPdfRequest object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewCreateAsyncPdfRequestWithDefaults() *CreateAsyncPdfRequest {
this := CreateAsyncPdfRequest{}
var exportType AppRoutersV1PdfAsyncExportType = URL
this.ExportType = &exportType
var expiration int32 = 86400
this.Expiration = &expiration
var storeS3 bool = false
this.StoreS3 = &storeS3
return &this
}
// GetTemplateId returns the TemplateId field value
func (o *CreateAsyncPdfRequest) GetTemplateId() string {
if o == nil {
var ret string
return ret
}
return o.TemplateId
}
// GetTemplateIdOk returns a tuple with the TemplateId field value
// and a boolean to check if the value has been set.
func (o *CreateAsyncPdfRequest) GetTemplateIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.TemplateId, true
}
// SetTemplateId sets field value
func (o *CreateAsyncPdfRequest) SetTemplateId(v string) {
o.TemplateId = v
}
// GetData returns the Data field value
func (o *CreateAsyncPdfRequest) GetData() map[string]interface{} {
if o == nil {
var ret map[string]interface{}
return ret
}
return o.Data
}
// GetDataOk returns a tuple with the Data field value
// and a boolean to check if the value has been set.
func (o *CreateAsyncPdfRequest) GetDataOk() (map[string]interface{}, bool) {
if o == nil {
return map[string]interface{}{}, false
}
return o.Data, true
}
// SetData sets field value
func (o *CreateAsyncPdfRequest) SetData(v map[string]interface{}) {
o.Data = v
}
// GetExportType returns the ExportType field value if set, zero value otherwise.
func (o *CreateAsyncPdfRequest) GetExportType() AppRoutersV1PdfAsyncExportType {
if o == nil || IsNil(o.ExportType) {
var ret AppRoutersV1PdfAsyncExportType
return ret
}
return *o.ExportType
}
// GetExportTypeOk returns a tuple with the ExportType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateAsyncPdfRequest) GetExportTypeOk() (*AppRoutersV1PdfAsyncExportType, bool) {
if o == nil || IsNil(o.ExportType) {
return nil, false
}
return o.ExportType, true
}
// HasExportType returns a boolean if a field has been set.
func (o *CreateAsyncPdfRequest) HasExportType() bool {
if o != nil && !IsNil(o.ExportType) {
return true
}
return false
}
// SetExportType gets a reference to the given AppRoutersV1PdfAsyncExportType and assigns it to the ExportType field.
func (o *CreateAsyncPdfRequest) SetExportType(v AppRoutersV1PdfAsyncExportType) {
o.ExportType = &v
}
// GetExpiration returns the Expiration field value if set, zero value otherwise.
func (o *CreateAsyncPdfRequest) GetExpiration() int32 {
if o == nil || IsNil(o.Expiration) {
var ret int32
return ret
}
return *o.Expiration
}
// GetExpirationOk returns a tuple with the Expiration field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateAsyncPdfRequest) GetExpirationOk() (*int32, bool) {
if o == nil || IsNil(o.Expiration) {
return nil, false
}
return o.Expiration, true
}
// HasExpiration returns a boolean if a field has been set.
func (o *CreateAsyncPdfRequest) HasExpiration() bool {
if o != nil && !IsNil(o.Expiration) {
return true
}
return false
}
// SetExpiration gets a reference to the given int32 and assigns it to the Expiration field.
func (o *CreateAsyncPdfRequest) SetExpiration(v int32) {
o.Expiration = &v
}
// GetFilename returns the Filename field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateAsyncPdfRequest) GetFilename() string {
if o == nil || IsNil(o.Filename.Get()) {
var ret string
return ret
}
return *o.Filename.Get()
}
// GetFilenameOk returns a tuple with the Filename field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *CreateAsyncPdfRequest) GetFilenameOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Filename.Get(), o.Filename.IsSet()
}
// HasFilename returns a boolean if a field has been set.
func (o *CreateAsyncPdfRequest) HasFilename() bool {
if o != nil && o.Filename.IsSet() {
return true
}
return false
}
// SetFilename gets a reference to the given NullableString and assigns it to the Filename field.
func (o *CreateAsyncPdfRequest) SetFilename(v string) {
o.Filename.Set(&v)
}
// SetFilenameNil sets the value for Filename to be an explicit nil
func (o *CreateAsyncPdfRequest) SetFilenameNil() {
o.Filename.Set(nil)
}
// UnsetFilename ensures that no value is present for Filename, not even an explicit nil
func (o *CreateAsyncPdfRequest) UnsetFilename() {
o.Filename.Unset()
}
// GetStoreS3 returns the StoreS3 field value if set, zero value otherwise.
func (o *CreateAsyncPdfRequest) GetStoreS3() bool {
if o == nil || IsNil(o.StoreS3) {
var ret bool
return ret
}
return *o.StoreS3
}
// GetStoreS3Ok returns a tuple with the StoreS3 field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateAsyncPdfRequest) GetStoreS3Ok() (*bool, bool) {
if o == nil || IsNil(o.StoreS3) {
return nil, false
}
return o.StoreS3, true
}
// HasStoreS3 returns a boolean if a field has been set.
func (o *CreateAsyncPdfRequest) HasStoreS3() bool {
if o != nil && !IsNil(o.StoreS3) {
return true
}
return false
}
// SetStoreS3 gets a reference to the given bool and assigns it to the StoreS3 field.
func (o *CreateAsyncPdfRequest) SetStoreS3(v bool) {
o.StoreS3 = &v
}
// GetS3Filepath returns the S3Filepath field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateAsyncPdfRequest) GetS3Filepath() string {
if o == nil || IsNil(o.S3Filepath.Get()) {
var ret string
return ret
}
return *o.S3Filepath.Get()
}
// GetS3FilepathOk returns a tuple with the S3Filepath field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *CreateAsyncPdfRequest) GetS3FilepathOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.S3Filepath.Get(), o.S3Filepath.IsSet()
}
// HasS3Filepath returns a boolean if a field has been set.
func (o *CreateAsyncPdfRequest) HasS3Filepath() bool {
if o != nil && o.S3Filepath.IsSet() {
return true
}
return false
}
// SetS3Filepath gets a reference to the given NullableString and assigns it to the S3Filepath field.
func (o *CreateAsyncPdfRequest) SetS3Filepath(v string) {
o.S3Filepath.Set(&v)
}
// SetS3FilepathNil sets the value for S3Filepath to be an explicit nil
func (o *CreateAsyncPdfRequest) SetS3FilepathNil() {
o.S3Filepath.Set(nil)
}
// UnsetS3Filepath ensures that no value is present for S3Filepath, not even an explicit nil
func (o *CreateAsyncPdfRequest) UnsetS3Filepath() {
o.S3Filepath.Unset()
}
// GetS3Bucket returns the S3Bucket field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateAsyncPdfRequest) GetS3Bucket() string {
if o == nil || IsNil(o.S3Bucket.Get()) {
var ret string
return ret
}
return *o.S3Bucket.Get()
}
// GetS3BucketOk returns a tuple with the S3Bucket field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *CreateAsyncPdfRequest) GetS3BucketOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.S3Bucket.Get(), o.S3Bucket.IsSet()
}
// HasS3Bucket returns a boolean if a field has been set.
func (o *CreateAsyncPdfRequest) HasS3Bucket() bool {
if o != nil && o.S3Bucket.IsSet() {
return true
}
return false
}
// SetS3Bucket gets a reference to the given NullableString and assigns it to the S3Bucket field.
func (o *CreateAsyncPdfRequest) SetS3Bucket(v string) {
o.S3Bucket.Set(&v)
}
// SetS3BucketNil sets the value for S3Bucket to be an explicit nil
func (o *CreateAsyncPdfRequest) SetS3BucketNil() {
o.S3Bucket.Set(nil)
}
// UnsetS3Bucket ensures that no value is present for S3Bucket, not even an explicit nil
func (o *CreateAsyncPdfRequest) UnsetS3Bucket() {
o.S3Bucket.Unset()
}
// GetWebhookUrl returns the WebhookUrl field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateAsyncPdfRequest) GetWebhookUrl() string {
if o == nil || IsNil(o.WebhookUrl.Get()) {
var ret string
return ret
}
return *o.WebhookUrl.Get()
}
// GetWebhookUrlOk returns a tuple with the WebhookUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *CreateAsyncPdfRequest) GetWebhookUrlOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.WebhookUrl.Get(), o.WebhookUrl.IsSet()
}
// HasWebhookUrl returns a boolean if a field has been set.
func (o *CreateAsyncPdfRequest) HasWebhookUrl() bool {
if o != nil && o.WebhookUrl.IsSet() {
return true
}
return false
}
// SetWebhookUrl gets a reference to the given NullableString and assigns it to the WebhookUrl field.
func (o *CreateAsyncPdfRequest) SetWebhookUrl(v string) {
o.WebhookUrl.Set(&v)
}
// SetWebhookUrlNil sets the value for WebhookUrl to be an explicit nil
func (o *CreateAsyncPdfRequest) SetWebhookUrlNil() {
o.WebhookUrl.Set(nil)
}
// UnsetWebhookUrl ensures that no value is present for WebhookUrl, not even an explicit nil
func (o *CreateAsyncPdfRequest) UnsetWebhookUrl() {
o.WebhookUrl.Unset()
}
// GetWebhookSecret returns the WebhookSecret field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateAsyncPdfRequest) GetWebhookSecret() string {
if o == nil || IsNil(o.WebhookSecret.Get()) {
var ret string
return ret
}
return *o.WebhookSecret.Get()
}
// GetWebhookSecretOk returns a tuple with the WebhookSecret field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *CreateAsyncPdfRequest) GetWebhookSecretOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.WebhookSecret.Get(), o.WebhookSecret.IsSet()
}
// HasWebhookSecret returns a boolean if a field has been set.
func (o *CreateAsyncPdfRequest) HasWebhookSecret() bool {
if o != nil && o.WebhookSecret.IsSet() {
return true
}
return false
}
// SetWebhookSecret gets a reference to the given NullableString and assigns it to the WebhookSecret field.
func (o *CreateAsyncPdfRequest) SetWebhookSecret(v string) {
o.WebhookSecret.Set(&v)
}
// SetWebhookSecretNil sets the value for WebhookSecret to be an explicit nil
func (o *CreateAsyncPdfRequest) SetWebhookSecretNil() {
o.WebhookSecret.Set(nil)
}
// UnsetWebhookSecret ensures that no value is present for WebhookSecret, not even an explicit nil
func (o *CreateAsyncPdfRequest) UnsetWebhookSecret() {
o.WebhookSecret.Unset()
}
func (o CreateAsyncPdfRequest) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CreateAsyncPdfRequest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["template_id"] = o.TemplateId
toSerialize["data"] = o.Data
if !IsNil(o.ExportType) {
toSerialize["export_type"] = o.ExportType
}
if !IsNil(o.Expiration) {
toSerialize["expiration"] = o.Expiration
}
if o.Filename.IsSet() {
toSerialize["filename"] = o.Filename.Get()
}
if !IsNil(o.StoreS3) {
toSerialize["store_s3"] = o.StoreS3
}
if o.S3Filepath.IsSet() {
toSerialize["s3_filepath"] = o.S3Filepath.Get()
}
if o.S3Bucket.IsSet() {
toSerialize["s3_bucket"] = o.S3Bucket.Get()
}
if o.WebhookUrl.IsSet() {
toSerialize["webhook_url"] = o.WebhookUrl.Get()
}
if o.WebhookSecret.IsSet() {
toSerialize["webhook_secret"] = o.WebhookSecret.Get()
}
return toSerialize, nil
}
func (o *CreateAsyncPdfRequest) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"template_id",
"data",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varCreateAsyncPdfRequest := _CreateAsyncPdfRequest{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varCreateAsyncPdfRequest)
if err != nil {
return err
}
*o = CreateAsyncPdfRequest(varCreateAsyncPdfRequest)
return err
}
type NullableCreateAsyncPdfRequest struct {
value *CreateAsyncPdfRequest
isSet bool
}
func (v NullableCreateAsyncPdfRequest) Get() *CreateAsyncPdfRequest {
return v.value
}
func (v *NullableCreateAsyncPdfRequest) Set(val *CreateAsyncPdfRequest) {
v.value = val
v.isSet = true
}
func (v NullableCreateAsyncPdfRequest) IsSet() bool {
return v.isSet
}
func (v *NullableCreateAsyncPdfRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCreateAsyncPdfRequest(val *CreateAsyncPdfRequest) *NullableCreateAsyncPdfRequest {
return &NullableCreateAsyncPdfRequest{value: val, isSet: true}
}
func (v NullableCreateAsyncPdfRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCreateAsyncPdfRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}