-
Notifications
You must be signed in to change notification settings - Fork 1
/
model_create_email_task_vm.go
588 lines (496 loc) · 15.8 KB
/
model_create_email_task_vm.go
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
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
/*
FastReport Cloud
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
API version: v1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package gofrcloud
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the CreateEmailTaskVM type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CreateEmailTaskVM{}
// CreateEmailTaskVM struct for CreateEmailTaskVM
type CreateEmailTaskVM struct {
CreateTransportTaskBaseVM
Body NullableString `json:"body,omitempty"`
EnableSsl *bool `json:"enableSsl,omitempty"`
From NullableString `json:"from,omitempty"`
IsBodyHtml *bool `json:"isBodyHtml,omitempty"`
Password NullableString `json:"password,omitempty"`
Port *int32 `json:"port,omitempty"`
Server NullableString `json:"server,omitempty"`
Subject NullableString `json:"subject,omitempty"`
To []string `json:"to,omitempty"`
Username NullableString `json:"username,omitempty"`
T string `json:"$t"`
}
type _CreateEmailTaskVM CreateEmailTaskVM
// NewCreateEmailTaskVM instantiates a new CreateEmailTaskVM 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 NewCreateEmailTaskVM(t string) *CreateEmailTaskVM {
this := CreateEmailTaskVM{}
this.T = t
return &this
}
// NewCreateEmailTaskVMWithDefaults instantiates a new CreateEmailTaskVM 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 NewCreateEmailTaskVMWithDefaults() *CreateEmailTaskVM {
this := CreateEmailTaskVM{}
return &this
}
// GetBody returns the Body field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateEmailTaskVM) GetBody() string {
if o == nil || IsNil(o.Body.Get()) {
var ret string
return ret
}
return *o.Body.Get()
}
// GetBodyOk returns a tuple with the Body 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 *CreateEmailTaskVM) GetBodyOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Body.Get(), o.Body.IsSet()
}
// HasBody returns a boolean if a field has been set.
func (o *CreateEmailTaskVM) HasBody() bool {
if o != nil && o.Body.IsSet() {
return true
}
return false
}
// SetBody gets a reference to the given NullableString and assigns it to the Body field.
func (o *CreateEmailTaskVM) SetBody(v string) {
o.Body.Set(&v)
}
// SetBodyNil sets the value for Body to be an explicit nil
func (o *CreateEmailTaskVM) SetBodyNil() {
o.Body.Set(nil)
}
// UnsetBody ensures that no value is present for Body, not even an explicit nil
func (o *CreateEmailTaskVM) UnsetBody() {
o.Body.Unset()
}
// GetEnableSsl returns the EnableSsl field value if set, zero value otherwise.
func (o *CreateEmailTaskVM) GetEnableSsl() bool {
if o == nil || IsNil(o.EnableSsl) {
var ret bool
return ret
}
return *o.EnableSsl
}
// GetEnableSslOk returns a tuple with the EnableSsl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateEmailTaskVM) GetEnableSslOk() (*bool, bool) {
if o == nil || IsNil(o.EnableSsl) {
return nil, false
}
return o.EnableSsl, true
}
// HasEnableSsl returns a boolean if a field has been set.
func (o *CreateEmailTaskVM) HasEnableSsl() bool {
if o != nil && !IsNil(o.EnableSsl) {
return true
}
return false
}
// SetEnableSsl gets a reference to the given bool and assigns it to the EnableSsl field.
func (o *CreateEmailTaskVM) SetEnableSsl(v bool) {
o.EnableSsl = &v
}
// GetFrom returns the From field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateEmailTaskVM) GetFrom() string {
if o == nil || IsNil(o.From.Get()) {
var ret string
return ret
}
return *o.From.Get()
}
// GetFromOk returns a tuple with the From 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 *CreateEmailTaskVM) GetFromOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.From.Get(), o.From.IsSet()
}
// HasFrom returns a boolean if a field has been set.
func (o *CreateEmailTaskVM) HasFrom() bool {
if o != nil && o.From.IsSet() {
return true
}
return false
}
// SetFrom gets a reference to the given NullableString and assigns it to the From field.
func (o *CreateEmailTaskVM) SetFrom(v string) {
o.From.Set(&v)
}
// SetFromNil sets the value for From to be an explicit nil
func (o *CreateEmailTaskVM) SetFromNil() {
o.From.Set(nil)
}
// UnsetFrom ensures that no value is present for From, not even an explicit nil
func (o *CreateEmailTaskVM) UnsetFrom() {
o.From.Unset()
}
// GetIsBodyHtml returns the IsBodyHtml field value if set, zero value otherwise.
func (o *CreateEmailTaskVM) GetIsBodyHtml() bool {
if o == nil || IsNil(o.IsBodyHtml) {
var ret bool
return ret
}
return *o.IsBodyHtml
}
// GetIsBodyHtmlOk returns a tuple with the IsBodyHtml field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateEmailTaskVM) GetIsBodyHtmlOk() (*bool, bool) {
if o == nil || IsNil(o.IsBodyHtml) {
return nil, false
}
return o.IsBodyHtml, true
}
// HasIsBodyHtml returns a boolean if a field has been set.
func (o *CreateEmailTaskVM) HasIsBodyHtml() bool {
if o != nil && !IsNil(o.IsBodyHtml) {
return true
}
return false
}
// SetIsBodyHtml gets a reference to the given bool and assigns it to the IsBodyHtml field.
func (o *CreateEmailTaskVM) SetIsBodyHtml(v bool) {
o.IsBodyHtml = &v
}
// GetPassword returns the Password field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateEmailTaskVM) GetPassword() string {
if o == nil || IsNil(o.Password.Get()) {
var ret string
return ret
}
return *o.Password.Get()
}
// GetPasswordOk returns a tuple with the Password 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 *CreateEmailTaskVM) GetPasswordOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Password.Get(), o.Password.IsSet()
}
// HasPassword returns a boolean if a field has been set.
func (o *CreateEmailTaskVM) HasPassword() bool {
if o != nil && o.Password.IsSet() {
return true
}
return false
}
// SetPassword gets a reference to the given NullableString and assigns it to the Password field.
func (o *CreateEmailTaskVM) SetPassword(v string) {
o.Password.Set(&v)
}
// SetPasswordNil sets the value for Password to be an explicit nil
func (o *CreateEmailTaskVM) SetPasswordNil() {
o.Password.Set(nil)
}
// UnsetPassword ensures that no value is present for Password, not even an explicit nil
func (o *CreateEmailTaskVM) UnsetPassword() {
o.Password.Unset()
}
// GetPort returns the Port field value if set, zero value otherwise.
func (o *CreateEmailTaskVM) GetPort() int32 {
if o == nil || IsNil(o.Port) {
var ret int32
return ret
}
return *o.Port
}
// GetPortOk returns a tuple with the Port field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateEmailTaskVM) GetPortOk() (*int32, bool) {
if o == nil || IsNil(o.Port) {
return nil, false
}
return o.Port, true
}
// HasPort returns a boolean if a field has been set.
func (o *CreateEmailTaskVM) HasPort() bool {
if o != nil && !IsNil(o.Port) {
return true
}
return false
}
// SetPort gets a reference to the given int32 and assigns it to the Port field.
func (o *CreateEmailTaskVM) SetPort(v int32) {
o.Port = &v
}
// GetServer returns the Server field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateEmailTaskVM) GetServer() string {
if o == nil || IsNil(o.Server.Get()) {
var ret string
return ret
}
return *o.Server.Get()
}
// GetServerOk returns a tuple with the Server 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 *CreateEmailTaskVM) GetServerOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Server.Get(), o.Server.IsSet()
}
// HasServer returns a boolean if a field has been set.
func (o *CreateEmailTaskVM) HasServer() bool {
if o != nil && o.Server.IsSet() {
return true
}
return false
}
// SetServer gets a reference to the given NullableString and assigns it to the Server field.
func (o *CreateEmailTaskVM) SetServer(v string) {
o.Server.Set(&v)
}
// SetServerNil sets the value for Server to be an explicit nil
func (o *CreateEmailTaskVM) SetServerNil() {
o.Server.Set(nil)
}
// UnsetServer ensures that no value is present for Server, not even an explicit nil
func (o *CreateEmailTaskVM) UnsetServer() {
o.Server.Unset()
}
// GetSubject returns the Subject field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateEmailTaskVM) GetSubject() string {
if o == nil || IsNil(o.Subject.Get()) {
var ret string
return ret
}
return *o.Subject.Get()
}
// GetSubjectOk returns a tuple with the Subject 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 *CreateEmailTaskVM) GetSubjectOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Subject.Get(), o.Subject.IsSet()
}
// HasSubject returns a boolean if a field has been set.
func (o *CreateEmailTaskVM) HasSubject() bool {
if o != nil && o.Subject.IsSet() {
return true
}
return false
}
// SetSubject gets a reference to the given NullableString and assigns it to the Subject field.
func (o *CreateEmailTaskVM) SetSubject(v string) {
o.Subject.Set(&v)
}
// SetSubjectNil sets the value for Subject to be an explicit nil
func (o *CreateEmailTaskVM) SetSubjectNil() {
o.Subject.Set(nil)
}
// UnsetSubject ensures that no value is present for Subject, not even an explicit nil
func (o *CreateEmailTaskVM) UnsetSubject() {
o.Subject.Unset()
}
// GetTo returns the To field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateEmailTaskVM) GetTo() []string {
if o == nil {
var ret []string
return ret
}
return o.To
}
// GetToOk returns a tuple with the To 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 *CreateEmailTaskVM) GetToOk() ([]string, bool) {
if o == nil || IsNil(o.To) {
return nil, false
}
return o.To, true
}
// HasTo returns a boolean if a field has been set.
func (o *CreateEmailTaskVM) HasTo() bool {
if o != nil && IsNil(o.To) {
return true
}
return false
}
// SetTo gets a reference to the given []string and assigns it to the To field.
func (o *CreateEmailTaskVM) SetTo(v []string) {
o.To = v
}
// GetUsername returns the Username field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateEmailTaskVM) GetUsername() string {
if o == nil || IsNil(o.Username.Get()) {
var ret string
return ret
}
return *o.Username.Get()
}
// GetUsernameOk returns a tuple with the Username 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 *CreateEmailTaskVM) GetUsernameOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Username.Get(), o.Username.IsSet()
}
// HasUsername returns a boolean if a field has been set.
func (o *CreateEmailTaskVM) HasUsername() bool {
if o != nil && o.Username.IsSet() {
return true
}
return false
}
// SetUsername gets a reference to the given NullableString and assigns it to the Username field.
func (o *CreateEmailTaskVM) SetUsername(v string) {
o.Username.Set(&v)
}
// SetUsernameNil sets the value for Username to be an explicit nil
func (o *CreateEmailTaskVM) SetUsernameNil() {
o.Username.Set(nil)
}
// UnsetUsername ensures that no value is present for Username, not even an explicit nil
func (o *CreateEmailTaskVM) UnsetUsername() {
o.Username.Unset()
}
// GetT returns the T field value
func (o *CreateEmailTaskVM) GetT() string {
if o == nil {
var ret string
return ret
}
return o.T
}
// GetTOk returns a tuple with the T field value
// and a boolean to check if the value has been set.
func (o *CreateEmailTaskVM) GetTOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.T, true
}
// SetT sets field value
func (o *CreateEmailTaskVM) SetT(v string) {
o.T = v
}
func (o CreateEmailTaskVM) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CreateEmailTaskVM) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
serializedCreateTransportTaskBaseVM, errCreateTransportTaskBaseVM := json.Marshal(o.CreateTransportTaskBaseVM)
if errCreateTransportTaskBaseVM != nil {
return map[string]interface{}{}, errCreateTransportTaskBaseVM
}
errCreateTransportTaskBaseVM = json.Unmarshal([]byte(serializedCreateTransportTaskBaseVM), &toSerialize)
if errCreateTransportTaskBaseVM != nil {
return map[string]interface{}{}, errCreateTransportTaskBaseVM
}
if o.Body.IsSet() {
toSerialize["body"] = o.Body.Get()
}
if !IsNil(o.EnableSsl) {
toSerialize["enableSsl"] = o.EnableSsl
}
if o.From.IsSet() {
toSerialize["from"] = o.From.Get()
}
if !IsNil(o.IsBodyHtml) {
toSerialize["isBodyHtml"] = o.IsBodyHtml
}
if o.Password.IsSet() {
toSerialize["password"] = o.Password.Get()
}
if !IsNil(o.Port) {
toSerialize["port"] = o.Port
}
if o.Server.IsSet() {
toSerialize["server"] = o.Server.Get()
}
if o.Subject.IsSet() {
toSerialize["subject"] = o.Subject.Get()
}
if o.To != nil {
toSerialize["to"] = o.To
}
if o.Username.IsSet() {
toSerialize["username"] = o.Username.Get()
}
toSerialize["$t"] = o.T
return toSerialize, nil
}
func (o *CreateEmailTaskVM) 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{
"$t",
}
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)
}
}
varCreateEmailTaskVM := _CreateEmailTaskVM{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varCreateEmailTaskVM)
if err != nil {
return err
}
*o = CreateEmailTaskVM(varCreateEmailTaskVM)
return err
}
type NullableCreateEmailTaskVM struct {
value *CreateEmailTaskVM
isSet bool
}
func (v NullableCreateEmailTaskVM) Get() *CreateEmailTaskVM {
return v.value
}
func (v *NullableCreateEmailTaskVM) Set(val *CreateEmailTaskVM) {
v.value = val
v.isSet = true
}
func (v NullableCreateEmailTaskVM) IsSet() bool {
return v.isSet
}
func (v *NullableCreateEmailTaskVM) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCreateEmailTaskVM(val *CreateEmailTaskVM) *NullableCreateEmailTaskVM {
return &NullableCreateEmailTaskVM{value: val, isSet: true}
}
func (v NullableCreateEmailTaskVM) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCreateEmailTaskVM) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}