-
Notifications
You must be signed in to change notification settings - Fork 1
/
model_create_ftp_upload_task_vm.go
505 lines (424 loc) · 14.6 KB
/
model_create_ftp_upload_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
/*
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 CreateFTPUploadTaskVM type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CreateFTPUploadTaskVM{}
// CreateFTPUploadTaskVM struct for CreateFTPUploadTaskVM
type CreateFTPUploadTaskVM struct {
CreateTransportTaskBaseVM
Archive *bool `json:"archive,omitempty"`
ArchiveName NullableString `json:"archiveName,omitempty"`
DestinationFolder NullableString `json:"destinationFolder,omitempty"`
FtpHost NullableString `json:"ftpHost,omitempty"`
FtpPassword NullableString `json:"ftpPassword,omitempty"`
FtpPort *int32 `json:"ftpPort,omitempty"`
FtpUsername NullableString `json:"ftpUsername,omitempty"`
UseSFTP *bool `json:"useSFTP,omitempty"`
T string `json:"$t"`
}
type _CreateFTPUploadTaskVM CreateFTPUploadTaskVM
// NewCreateFTPUploadTaskVM instantiates a new CreateFTPUploadTaskVM 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 NewCreateFTPUploadTaskVM(t string) *CreateFTPUploadTaskVM {
this := CreateFTPUploadTaskVM{}
this.T = t
return &this
}
// NewCreateFTPUploadTaskVMWithDefaults instantiates a new CreateFTPUploadTaskVM 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 NewCreateFTPUploadTaskVMWithDefaults() *CreateFTPUploadTaskVM {
this := CreateFTPUploadTaskVM{}
return &this
}
// GetArchive returns the Archive field value if set, zero value otherwise.
func (o *CreateFTPUploadTaskVM) GetArchive() bool {
if o == nil || IsNil(o.Archive) {
var ret bool
return ret
}
return *o.Archive
}
// GetArchiveOk returns a tuple with the Archive field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateFTPUploadTaskVM) GetArchiveOk() (*bool, bool) {
if o == nil || IsNil(o.Archive) {
return nil, false
}
return o.Archive, true
}
// HasArchive returns a boolean if a field has been set.
func (o *CreateFTPUploadTaskVM) HasArchive() bool {
if o != nil && !IsNil(o.Archive) {
return true
}
return false
}
// SetArchive gets a reference to the given bool and assigns it to the Archive field.
func (o *CreateFTPUploadTaskVM) SetArchive(v bool) {
o.Archive = &v
}
// GetArchiveName returns the ArchiveName field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateFTPUploadTaskVM) GetArchiveName() string {
if o == nil || IsNil(o.ArchiveName.Get()) {
var ret string
return ret
}
return *o.ArchiveName.Get()
}
// GetArchiveNameOk returns a tuple with the ArchiveName 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 *CreateFTPUploadTaskVM) GetArchiveNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.ArchiveName.Get(), o.ArchiveName.IsSet()
}
// HasArchiveName returns a boolean if a field has been set.
func (o *CreateFTPUploadTaskVM) HasArchiveName() bool {
if o != nil && o.ArchiveName.IsSet() {
return true
}
return false
}
// SetArchiveName gets a reference to the given NullableString and assigns it to the ArchiveName field.
func (o *CreateFTPUploadTaskVM) SetArchiveName(v string) {
o.ArchiveName.Set(&v)
}
// SetArchiveNameNil sets the value for ArchiveName to be an explicit nil
func (o *CreateFTPUploadTaskVM) SetArchiveNameNil() {
o.ArchiveName.Set(nil)
}
// UnsetArchiveName ensures that no value is present for ArchiveName, not even an explicit nil
func (o *CreateFTPUploadTaskVM) UnsetArchiveName() {
o.ArchiveName.Unset()
}
// GetDestinationFolder returns the DestinationFolder field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateFTPUploadTaskVM) GetDestinationFolder() string {
if o == nil || IsNil(o.DestinationFolder.Get()) {
var ret string
return ret
}
return *o.DestinationFolder.Get()
}
// GetDestinationFolderOk returns a tuple with the DestinationFolder 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 *CreateFTPUploadTaskVM) GetDestinationFolderOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.DestinationFolder.Get(), o.DestinationFolder.IsSet()
}
// HasDestinationFolder returns a boolean if a field has been set.
func (o *CreateFTPUploadTaskVM) HasDestinationFolder() bool {
if o != nil && o.DestinationFolder.IsSet() {
return true
}
return false
}
// SetDestinationFolder gets a reference to the given NullableString and assigns it to the DestinationFolder field.
func (o *CreateFTPUploadTaskVM) SetDestinationFolder(v string) {
o.DestinationFolder.Set(&v)
}
// SetDestinationFolderNil sets the value for DestinationFolder to be an explicit nil
func (o *CreateFTPUploadTaskVM) SetDestinationFolderNil() {
o.DestinationFolder.Set(nil)
}
// UnsetDestinationFolder ensures that no value is present for DestinationFolder, not even an explicit nil
func (o *CreateFTPUploadTaskVM) UnsetDestinationFolder() {
o.DestinationFolder.Unset()
}
// GetFtpHost returns the FtpHost field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateFTPUploadTaskVM) GetFtpHost() string {
if o == nil || IsNil(o.FtpHost.Get()) {
var ret string
return ret
}
return *o.FtpHost.Get()
}
// GetFtpHostOk returns a tuple with the FtpHost 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 *CreateFTPUploadTaskVM) GetFtpHostOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.FtpHost.Get(), o.FtpHost.IsSet()
}
// HasFtpHost returns a boolean if a field has been set.
func (o *CreateFTPUploadTaskVM) HasFtpHost() bool {
if o != nil && o.FtpHost.IsSet() {
return true
}
return false
}
// SetFtpHost gets a reference to the given NullableString and assigns it to the FtpHost field.
func (o *CreateFTPUploadTaskVM) SetFtpHost(v string) {
o.FtpHost.Set(&v)
}
// SetFtpHostNil sets the value for FtpHost to be an explicit nil
func (o *CreateFTPUploadTaskVM) SetFtpHostNil() {
o.FtpHost.Set(nil)
}
// UnsetFtpHost ensures that no value is present for FtpHost, not even an explicit nil
func (o *CreateFTPUploadTaskVM) UnsetFtpHost() {
o.FtpHost.Unset()
}
// GetFtpPassword returns the FtpPassword field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateFTPUploadTaskVM) GetFtpPassword() string {
if o == nil || IsNil(o.FtpPassword.Get()) {
var ret string
return ret
}
return *o.FtpPassword.Get()
}
// GetFtpPasswordOk returns a tuple with the FtpPassword 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 *CreateFTPUploadTaskVM) GetFtpPasswordOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.FtpPassword.Get(), o.FtpPassword.IsSet()
}
// HasFtpPassword returns a boolean if a field has been set.
func (o *CreateFTPUploadTaskVM) HasFtpPassword() bool {
if o != nil && o.FtpPassword.IsSet() {
return true
}
return false
}
// SetFtpPassword gets a reference to the given NullableString and assigns it to the FtpPassword field.
func (o *CreateFTPUploadTaskVM) SetFtpPassword(v string) {
o.FtpPassword.Set(&v)
}
// SetFtpPasswordNil sets the value for FtpPassword to be an explicit nil
func (o *CreateFTPUploadTaskVM) SetFtpPasswordNil() {
o.FtpPassword.Set(nil)
}
// UnsetFtpPassword ensures that no value is present for FtpPassword, not even an explicit nil
func (o *CreateFTPUploadTaskVM) UnsetFtpPassword() {
o.FtpPassword.Unset()
}
// GetFtpPort returns the FtpPort field value if set, zero value otherwise.
func (o *CreateFTPUploadTaskVM) GetFtpPort() int32 {
if o == nil || IsNil(o.FtpPort) {
var ret int32
return ret
}
return *o.FtpPort
}
// GetFtpPortOk returns a tuple with the FtpPort field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateFTPUploadTaskVM) GetFtpPortOk() (*int32, bool) {
if o == nil || IsNil(o.FtpPort) {
return nil, false
}
return o.FtpPort, true
}
// HasFtpPort returns a boolean if a field has been set.
func (o *CreateFTPUploadTaskVM) HasFtpPort() bool {
if o != nil && !IsNil(o.FtpPort) {
return true
}
return false
}
// SetFtpPort gets a reference to the given int32 and assigns it to the FtpPort field.
func (o *CreateFTPUploadTaskVM) SetFtpPort(v int32) {
o.FtpPort = &v
}
// GetFtpUsername returns the FtpUsername field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateFTPUploadTaskVM) GetFtpUsername() string {
if o == nil || IsNil(o.FtpUsername.Get()) {
var ret string
return ret
}
return *o.FtpUsername.Get()
}
// GetFtpUsernameOk returns a tuple with the FtpUsername 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 *CreateFTPUploadTaskVM) GetFtpUsernameOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.FtpUsername.Get(), o.FtpUsername.IsSet()
}
// HasFtpUsername returns a boolean if a field has been set.
func (o *CreateFTPUploadTaskVM) HasFtpUsername() bool {
if o != nil && o.FtpUsername.IsSet() {
return true
}
return false
}
// SetFtpUsername gets a reference to the given NullableString and assigns it to the FtpUsername field.
func (o *CreateFTPUploadTaskVM) SetFtpUsername(v string) {
o.FtpUsername.Set(&v)
}
// SetFtpUsernameNil sets the value for FtpUsername to be an explicit nil
func (o *CreateFTPUploadTaskVM) SetFtpUsernameNil() {
o.FtpUsername.Set(nil)
}
// UnsetFtpUsername ensures that no value is present for FtpUsername, not even an explicit nil
func (o *CreateFTPUploadTaskVM) UnsetFtpUsername() {
o.FtpUsername.Unset()
}
// GetUseSFTP returns the UseSFTP field value if set, zero value otherwise.
func (o *CreateFTPUploadTaskVM) GetUseSFTP() bool {
if o == nil || IsNil(o.UseSFTP) {
var ret bool
return ret
}
return *o.UseSFTP
}
// GetUseSFTPOk returns a tuple with the UseSFTP field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateFTPUploadTaskVM) GetUseSFTPOk() (*bool, bool) {
if o == nil || IsNil(o.UseSFTP) {
return nil, false
}
return o.UseSFTP, true
}
// HasUseSFTP returns a boolean if a field has been set.
func (o *CreateFTPUploadTaskVM) HasUseSFTP() bool {
if o != nil && !IsNil(o.UseSFTP) {
return true
}
return false
}
// SetUseSFTP gets a reference to the given bool and assigns it to the UseSFTP field.
func (o *CreateFTPUploadTaskVM) SetUseSFTP(v bool) {
o.UseSFTP = &v
}
// GetT returns the T field value
func (o *CreateFTPUploadTaskVM) 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 *CreateFTPUploadTaskVM) GetTOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.T, true
}
// SetT sets field value
func (o *CreateFTPUploadTaskVM) SetT(v string) {
o.T = v
}
func (o CreateFTPUploadTaskVM) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CreateFTPUploadTaskVM) 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 !IsNil(o.Archive) {
toSerialize["archive"] = o.Archive
}
if o.ArchiveName.IsSet() {
toSerialize["archiveName"] = o.ArchiveName.Get()
}
if o.DestinationFolder.IsSet() {
toSerialize["destinationFolder"] = o.DestinationFolder.Get()
}
if o.FtpHost.IsSet() {
toSerialize["ftpHost"] = o.FtpHost.Get()
}
if o.FtpPassword.IsSet() {
toSerialize["ftpPassword"] = o.FtpPassword.Get()
}
if !IsNil(o.FtpPort) {
toSerialize["ftpPort"] = o.FtpPort
}
if o.FtpUsername.IsSet() {
toSerialize["ftpUsername"] = o.FtpUsername.Get()
}
if !IsNil(o.UseSFTP) {
toSerialize["useSFTP"] = o.UseSFTP
}
toSerialize["$t"] = o.T
return toSerialize, nil
}
func (o *CreateFTPUploadTaskVM) 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)
}
}
varCreateFTPUploadTaskVM := _CreateFTPUploadTaskVM{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varCreateFTPUploadTaskVM)
if err != nil {
return err
}
*o = CreateFTPUploadTaskVM(varCreateFTPUploadTaskVM)
return err
}
type NullableCreateFTPUploadTaskVM struct {
value *CreateFTPUploadTaskVM
isSet bool
}
func (v NullableCreateFTPUploadTaskVM) Get() *CreateFTPUploadTaskVM {
return v.value
}
func (v *NullableCreateFTPUploadTaskVM) Set(val *CreateFTPUploadTaskVM) {
v.value = val
v.isSet = true
}
func (v NullableCreateFTPUploadTaskVM) IsSet() bool {
return v.isSet
}
func (v *NullableCreateFTPUploadTaskVM) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCreateFTPUploadTaskVM(val *CreateFTPUploadTaskVM) *NullableCreateFTPUploadTaskVM {
return &NullableCreateFTPUploadTaskVM{value: val, isSet: true}
}
func (v NullableCreateFTPUploadTaskVM) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCreateFTPUploadTaskVM) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}