-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmodel_create_proxy_host_request.go
More file actions
746 lines (629 loc) · 21.8 KB
/
Copy pathmodel_create_proxy_host_request.go
File metadata and controls
746 lines (629 loc) · 21.8 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
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
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
/*
Nginx Proxy Manager API
This is the official API documentation for Nginx Proxy Manager. Most endpoints require authentication via Bearer Token (JWT). You can generate a token by logging in via the `POST /tokens` endpoint. For more information, visit the [Nginx Proxy Manager Documentation](https://nginxproxymanager.com).
API version: 2.13.4
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package nginxproxymanager
import (
"encoding/json"
"fmt"
)
// checks if the CreateProxyHostRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CreateProxyHostRequest{}
// CreateProxyHostRequest struct for CreateProxyHostRequest
type CreateProxyHostRequest struct {
// Domain Names separated by a comma
DomainNames []string `json:"domain_names"`
ForwardScheme string `json:"forward_scheme"`
ForwardHost string `json:"forward_host"`
ForwardPort int64 `json:"forward_port"`
CertificateId *GetProxyHosts200ResponseInnerCertificateId `json:"certificate_id,omitempty"`
// Is SSL Forced
SslForced *bool `json:"ssl_forced,omitempty"`
// Is HSTS Enabled
HstsEnabled *bool `json:"hsts_enabled,omitempty"`
// Is HSTS applicable to all subdomains
HstsSubdomains *bool `json:"hsts_subdomains,omitempty"`
// HTTP2 Protocol Support
Http2Support *bool `json:"http2_support,omitempty"`
// Should we block common exploits
BlockExploits *bool `json:"block_exploits,omitempty"`
// Should we cache assets
CachingEnabled *bool `json:"caching_enabled,omitempty"`
// Allow Websocket Upgrade for all paths
AllowWebsocketUpgrade *bool `json:"allow_websocket_upgrade,omitempty"`
// Access List ID
AccessListId *int64 `json:"access_list_id,omitempty"`
AdvancedConfig *string `json:"advanced_config,omitempty"`
// Is Enabled
Enabled *bool `json:"enabled,omitempty"`
Meta map[string]interface{} `json:"meta,omitempty"`
Locations []GetProxyHosts200ResponseInnerLocationsInner `json:"locations,omitempty"`
AdditionalProperties map[string]interface{}
}
type _CreateProxyHostRequest CreateProxyHostRequest
// NewCreateProxyHostRequest instantiates a new CreateProxyHostRequest 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 NewCreateProxyHostRequest(domainNames []string, forwardScheme string, forwardHost string, forwardPort int64) *CreateProxyHostRequest {
this := CreateProxyHostRequest{}
this.DomainNames = domainNames
this.ForwardScheme = forwardScheme
this.ForwardHost = forwardHost
this.ForwardPort = forwardPort
return &this
}
// NewCreateProxyHostRequestWithDefaults instantiates a new CreateProxyHostRequest 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 NewCreateProxyHostRequestWithDefaults() *CreateProxyHostRequest {
this := CreateProxyHostRequest{}
return &this
}
// GetDomainNames returns the DomainNames field value
func (o *CreateProxyHostRequest) GetDomainNames() []string {
if o == nil {
var ret []string
return ret
}
return o.DomainNames
}
// GetDomainNamesOk returns a tuple with the DomainNames field value
// and a boolean to check if the value has been set.
func (o *CreateProxyHostRequest) GetDomainNamesOk() ([]string, bool) {
if o == nil {
return nil, false
}
return o.DomainNames, true
}
// SetDomainNames sets field value
func (o *CreateProxyHostRequest) SetDomainNames(v []string) {
o.DomainNames = v
}
// GetForwardScheme returns the ForwardScheme field value
func (o *CreateProxyHostRequest) GetForwardScheme() string {
if o == nil {
var ret string
return ret
}
return o.ForwardScheme
}
// GetForwardSchemeOk returns a tuple with the ForwardScheme field value
// and a boolean to check if the value has been set.
func (o *CreateProxyHostRequest) GetForwardSchemeOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ForwardScheme, true
}
// SetForwardScheme sets field value
func (o *CreateProxyHostRequest) SetForwardScheme(v string) {
o.ForwardScheme = v
}
// GetForwardHost returns the ForwardHost field value
func (o *CreateProxyHostRequest) GetForwardHost() string {
if o == nil {
var ret string
return ret
}
return o.ForwardHost
}
// GetForwardHostOk returns a tuple with the ForwardHost field value
// and a boolean to check if the value has been set.
func (o *CreateProxyHostRequest) GetForwardHostOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ForwardHost, true
}
// SetForwardHost sets field value
func (o *CreateProxyHostRequest) SetForwardHost(v string) {
o.ForwardHost = v
}
// GetForwardPort returns the ForwardPort field value
func (o *CreateProxyHostRequest) GetForwardPort() int64 {
if o == nil {
var ret int64
return ret
}
return o.ForwardPort
}
// GetForwardPortOk returns a tuple with the ForwardPort field value
// and a boolean to check if the value has been set.
func (o *CreateProxyHostRequest) GetForwardPortOk() (*int64, bool) {
if o == nil {
return nil, false
}
return &o.ForwardPort, true
}
// SetForwardPort sets field value
func (o *CreateProxyHostRequest) SetForwardPort(v int64) {
o.ForwardPort = v
}
// GetCertificateId returns the CertificateId field value if set, zero value otherwise.
func (o *CreateProxyHostRequest) GetCertificateId() GetProxyHosts200ResponseInnerCertificateId {
if o == nil || IsNil(o.CertificateId) {
var ret GetProxyHosts200ResponseInnerCertificateId
return ret
}
return *o.CertificateId
}
// GetCertificateIdOk returns a tuple with the CertificateId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateProxyHostRequest) GetCertificateIdOk() (*GetProxyHosts200ResponseInnerCertificateId, bool) {
if o == nil || IsNil(o.CertificateId) {
return nil, false
}
return o.CertificateId, true
}
// HasCertificateId returns a boolean if a field has been set.
func (o *CreateProxyHostRequest) HasCertificateId() bool {
if o != nil && !IsNil(o.CertificateId) {
return true
}
return false
}
// SetCertificateId gets a reference to the given GetProxyHosts200ResponseInnerCertificateId and assigns it to the CertificateId field.
func (o *CreateProxyHostRequest) SetCertificateId(v GetProxyHosts200ResponseInnerCertificateId) {
o.CertificateId = &v
}
// GetSslForced returns the SslForced field value if set, zero value otherwise.
func (o *CreateProxyHostRequest) GetSslForced() bool {
if o == nil || IsNil(o.SslForced) {
var ret bool
return ret
}
return *o.SslForced
}
// GetSslForcedOk returns a tuple with the SslForced field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateProxyHostRequest) GetSslForcedOk() (*bool, bool) {
if o == nil || IsNil(o.SslForced) {
return nil, false
}
return o.SslForced, true
}
// HasSslForced returns a boolean if a field has been set.
func (o *CreateProxyHostRequest) HasSslForced() bool {
if o != nil && !IsNil(o.SslForced) {
return true
}
return false
}
// SetSslForced gets a reference to the given bool and assigns it to the SslForced field.
func (o *CreateProxyHostRequest) SetSslForced(v bool) {
o.SslForced = &v
}
// GetHstsEnabled returns the HstsEnabled field value if set, zero value otherwise.
func (o *CreateProxyHostRequest) GetHstsEnabled() bool {
if o == nil || IsNil(o.HstsEnabled) {
var ret bool
return ret
}
return *o.HstsEnabled
}
// GetHstsEnabledOk returns a tuple with the HstsEnabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateProxyHostRequest) GetHstsEnabledOk() (*bool, bool) {
if o == nil || IsNil(o.HstsEnabled) {
return nil, false
}
return o.HstsEnabled, true
}
// HasHstsEnabled returns a boolean if a field has been set.
func (o *CreateProxyHostRequest) HasHstsEnabled() bool {
if o != nil && !IsNil(o.HstsEnabled) {
return true
}
return false
}
// SetHstsEnabled gets a reference to the given bool and assigns it to the HstsEnabled field.
func (o *CreateProxyHostRequest) SetHstsEnabled(v bool) {
o.HstsEnabled = &v
}
// GetHstsSubdomains returns the HstsSubdomains field value if set, zero value otherwise.
func (o *CreateProxyHostRequest) GetHstsSubdomains() bool {
if o == nil || IsNil(o.HstsSubdomains) {
var ret bool
return ret
}
return *o.HstsSubdomains
}
// GetHstsSubdomainsOk returns a tuple with the HstsSubdomains field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateProxyHostRequest) GetHstsSubdomainsOk() (*bool, bool) {
if o == nil || IsNil(o.HstsSubdomains) {
return nil, false
}
return o.HstsSubdomains, true
}
// HasHstsSubdomains returns a boolean if a field has been set.
func (o *CreateProxyHostRequest) HasHstsSubdomains() bool {
if o != nil && !IsNil(o.HstsSubdomains) {
return true
}
return false
}
// SetHstsSubdomains gets a reference to the given bool and assigns it to the HstsSubdomains field.
func (o *CreateProxyHostRequest) SetHstsSubdomains(v bool) {
o.HstsSubdomains = &v
}
// GetHttp2Support returns the Http2Support field value if set, zero value otherwise.
func (o *CreateProxyHostRequest) GetHttp2Support() bool {
if o == nil || IsNil(o.Http2Support) {
var ret bool
return ret
}
return *o.Http2Support
}
// GetHttp2SupportOk returns a tuple with the Http2Support field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateProxyHostRequest) GetHttp2SupportOk() (*bool, bool) {
if o == nil || IsNil(o.Http2Support) {
return nil, false
}
return o.Http2Support, true
}
// HasHttp2Support returns a boolean if a field has been set.
func (o *CreateProxyHostRequest) HasHttp2Support() bool {
if o != nil && !IsNil(o.Http2Support) {
return true
}
return false
}
// SetHttp2Support gets a reference to the given bool and assigns it to the Http2Support field.
func (o *CreateProxyHostRequest) SetHttp2Support(v bool) {
o.Http2Support = &v
}
// GetBlockExploits returns the BlockExploits field value if set, zero value otherwise.
func (o *CreateProxyHostRequest) GetBlockExploits() bool {
if o == nil || IsNil(o.BlockExploits) {
var ret bool
return ret
}
return *o.BlockExploits
}
// GetBlockExploitsOk returns a tuple with the BlockExploits field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateProxyHostRequest) GetBlockExploitsOk() (*bool, bool) {
if o == nil || IsNil(o.BlockExploits) {
return nil, false
}
return o.BlockExploits, true
}
// HasBlockExploits returns a boolean if a field has been set.
func (o *CreateProxyHostRequest) HasBlockExploits() bool {
if o != nil && !IsNil(o.BlockExploits) {
return true
}
return false
}
// SetBlockExploits gets a reference to the given bool and assigns it to the BlockExploits field.
func (o *CreateProxyHostRequest) SetBlockExploits(v bool) {
o.BlockExploits = &v
}
// GetCachingEnabled returns the CachingEnabled field value if set, zero value otherwise.
func (o *CreateProxyHostRequest) GetCachingEnabled() bool {
if o == nil || IsNil(o.CachingEnabled) {
var ret bool
return ret
}
return *o.CachingEnabled
}
// GetCachingEnabledOk returns a tuple with the CachingEnabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateProxyHostRequest) GetCachingEnabledOk() (*bool, bool) {
if o == nil || IsNil(o.CachingEnabled) {
return nil, false
}
return o.CachingEnabled, true
}
// HasCachingEnabled returns a boolean if a field has been set.
func (o *CreateProxyHostRequest) HasCachingEnabled() bool {
if o != nil && !IsNil(o.CachingEnabled) {
return true
}
return false
}
// SetCachingEnabled gets a reference to the given bool and assigns it to the CachingEnabled field.
func (o *CreateProxyHostRequest) SetCachingEnabled(v bool) {
o.CachingEnabled = &v
}
// GetAllowWebsocketUpgrade returns the AllowWebsocketUpgrade field value if set, zero value otherwise.
func (o *CreateProxyHostRequest) GetAllowWebsocketUpgrade() bool {
if o == nil || IsNil(o.AllowWebsocketUpgrade) {
var ret bool
return ret
}
return *o.AllowWebsocketUpgrade
}
// GetAllowWebsocketUpgradeOk returns a tuple with the AllowWebsocketUpgrade field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateProxyHostRequest) GetAllowWebsocketUpgradeOk() (*bool, bool) {
if o == nil || IsNil(o.AllowWebsocketUpgrade) {
return nil, false
}
return o.AllowWebsocketUpgrade, true
}
// HasAllowWebsocketUpgrade returns a boolean if a field has been set.
func (o *CreateProxyHostRequest) HasAllowWebsocketUpgrade() bool {
if o != nil && !IsNil(o.AllowWebsocketUpgrade) {
return true
}
return false
}
// SetAllowWebsocketUpgrade gets a reference to the given bool and assigns it to the AllowWebsocketUpgrade field.
func (o *CreateProxyHostRequest) SetAllowWebsocketUpgrade(v bool) {
o.AllowWebsocketUpgrade = &v
}
// GetAccessListId returns the AccessListId field value if set, zero value otherwise.
func (o *CreateProxyHostRequest) GetAccessListId() int64 {
if o == nil || IsNil(o.AccessListId) {
var ret int64
return ret
}
return *o.AccessListId
}
// GetAccessListIdOk returns a tuple with the AccessListId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateProxyHostRequest) GetAccessListIdOk() (*int64, bool) {
if o == nil || IsNil(o.AccessListId) {
return nil, false
}
return o.AccessListId, true
}
// HasAccessListId returns a boolean if a field has been set.
func (o *CreateProxyHostRequest) HasAccessListId() bool {
if o != nil && !IsNil(o.AccessListId) {
return true
}
return false
}
// SetAccessListId gets a reference to the given int64 and assigns it to the AccessListId field.
func (o *CreateProxyHostRequest) SetAccessListId(v int64) {
o.AccessListId = &v
}
// GetAdvancedConfig returns the AdvancedConfig field value if set, zero value otherwise.
func (o *CreateProxyHostRequest) GetAdvancedConfig() string {
if o == nil || IsNil(o.AdvancedConfig) {
var ret string
return ret
}
return *o.AdvancedConfig
}
// GetAdvancedConfigOk returns a tuple with the AdvancedConfig field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateProxyHostRequest) GetAdvancedConfigOk() (*string, bool) {
if o == nil || IsNil(o.AdvancedConfig) {
return nil, false
}
return o.AdvancedConfig, true
}
// HasAdvancedConfig returns a boolean if a field has been set.
func (o *CreateProxyHostRequest) HasAdvancedConfig() bool {
if o != nil && !IsNil(o.AdvancedConfig) {
return true
}
return false
}
// SetAdvancedConfig gets a reference to the given string and assigns it to the AdvancedConfig field.
func (o *CreateProxyHostRequest) SetAdvancedConfig(v string) {
o.AdvancedConfig = &v
}
// GetEnabled returns the Enabled field value if set, zero value otherwise.
func (o *CreateProxyHostRequest) GetEnabled() bool {
if o == nil || IsNil(o.Enabled) {
var ret bool
return ret
}
return *o.Enabled
}
// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateProxyHostRequest) GetEnabledOk() (*bool, bool) {
if o == nil || IsNil(o.Enabled) {
return nil, false
}
return o.Enabled, true
}
// HasEnabled returns a boolean if a field has been set.
func (o *CreateProxyHostRequest) HasEnabled() bool {
if o != nil && !IsNil(o.Enabled) {
return true
}
return false
}
// SetEnabled gets a reference to the given bool and assigns it to the Enabled field.
func (o *CreateProxyHostRequest) SetEnabled(v bool) {
o.Enabled = &v
}
// GetMeta returns the Meta field value if set, zero value otherwise.
func (o *CreateProxyHostRequest) GetMeta() map[string]interface{} {
if o == nil || IsNil(o.Meta) {
var ret map[string]interface{}
return ret
}
return o.Meta
}
// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateProxyHostRequest) GetMetaOk() (map[string]interface{}, bool) {
if o == nil || IsNil(o.Meta) {
return map[string]interface{}{}, false
}
return o.Meta, true
}
// HasMeta returns a boolean if a field has been set.
func (o *CreateProxyHostRequest) HasMeta() bool {
if o != nil && !IsNil(o.Meta) {
return true
}
return false
}
// SetMeta gets a reference to the given map[string]interface{} and assigns it to the Meta field.
func (o *CreateProxyHostRequest) SetMeta(v map[string]interface{}) {
o.Meta = v
}
// GetLocations returns the Locations field value if set, zero value otherwise.
func (o *CreateProxyHostRequest) GetLocations() []GetProxyHosts200ResponseInnerLocationsInner {
if o == nil || IsNil(o.Locations) {
var ret []GetProxyHosts200ResponseInnerLocationsInner
return ret
}
return o.Locations
}
// GetLocationsOk returns a tuple with the Locations field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateProxyHostRequest) GetLocationsOk() ([]GetProxyHosts200ResponseInnerLocationsInner, bool) {
if o == nil || IsNil(o.Locations) {
return nil, false
}
return o.Locations, true
}
// HasLocations returns a boolean if a field has been set.
func (o *CreateProxyHostRequest) HasLocations() bool {
if o != nil && !IsNil(o.Locations) {
return true
}
return false
}
// SetLocations gets a reference to the given []GetProxyHosts200ResponseInnerLocationsInner and assigns it to the Locations field.
func (o *CreateProxyHostRequest) SetLocations(v []GetProxyHosts200ResponseInnerLocationsInner) {
o.Locations = v
}
func (o CreateProxyHostRequest) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CreateProxyHostRequest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["domain_names"] = o.DomainNames
toSerialize["forward_scheme"] = o.ForwardScheme
toSerialize["forward_host"] = o.ForwardHost
toSerialize["forward_port"] = o.ForwardPort
if !IsNil(o.CertificateId) {
toSerialize["certificate_id"] = o.CertificateId
}
if !IsNil(o.SslForced) {
toSerialize["ssl_forced"] = o.SslForced
}
if !IsNil(o.HstsEnabled) {
toSerialize["hsts_enabled"] = o.HstsEnabled
}
if !IsNil(o.HstsSubdomains) {
toSerialize["hsts_subdomains"] = o.HstsSubdomains
}
if !IsNil(o.Http2Support) {
toSerialize["http2_support"] = o.Http2Support
}
if !IsNil(o.BlockExploits) {
toSerialize["block_exploits"] = o.BlockExploits
}
if !IsNil(o.CachingEnabled) {
toSerialize["caching_enabled"] = o.CachingEnabled
}
if !IsNil(o.AllowWebsocketUpgrade) {
toSerialize["allow_websocket_upgrade"] = o.AllowWebsocketUpgrade
}
if !IsNil(o.AccessListId) {
toSerialize["access_list_id"] = o.AccessListId
}
if !IsNil(o.AdvancedConfig) {
toSerialize["advanced_config"] = o.AdvancedConfig
}
if !IsNil(o.Enabled) {
toSerialize["enabled"] = o.Enabled
}
if !IsNil(o.Meta) {
toSerialize["meta"] = o.Meta
}
if !IsNil(o.Locations) {
toSerialize["locations"] = o.Locations
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *CreateProxyHostRequest) 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{
"domain_names",
"forward_scheme",
"forward_host",
"forward_port",
}
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)
}
}
varCreateProxyHostRequest := _CreateProxyHostRequest{}
err = json.Unmarshal(data, &varCreateProxyHostRequest)
if err != nil {
return err
}
*o = CreateProxyHostRequest(varCreateProxyHostRequest)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "domain_names")
delete(additionalProperties, "forward_scheme")
delete(additionalProperties, "forward_host")
delete(additionalProperties, "forward_port")
delete(additionalProperties, "certificate_id")
delete(additionalProperties, "ssl_forced")
delete(additionalProperties, "hsts_enabled")
delete(additionalProperties, "hsts_subdomains")
delete(additionalProperties, "http2_support")
delete(additionalProperties, "block_exploits")
delete(additionalProperties, "caching_enabled")
delete(additionalProperties, "allow_websocket_upgrade")
delete(additionalProperties, "access_list_id")
delete(additionalProperties, "advanced_config")
delete(additionalProperties, "enabled")
delete(additionalProperties, "meta")
delete(additionalProperties, "locations")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableCreateProxyHostRequest struct {
value *CreateProxyHostRequest
isSet bool
}
func (v NullableCreateProxyHostRequest) Get() *CreateProxyHostRequest {
return v.value
}
func (v *NullableCreateProxyHostRequest) Set(val *CreateProxyHostRequest) {
v.value = val
v.isSet = true
}
func (v NullableCreateProxyHostRequest) IsSet() bool {
return v.isSet
}
func (v *NullableCreateProxyHostRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCreateProxyHostRequest(val *CreateProxyHostRequest) *NullableCreateProxyHostRequest {
return &NullableCreateProxyHostRequest{value: val, isSet: true}
}
func (v NullableCreateProxyHostRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCreateProxyHostRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}