-
Notifications
You must be signed in to change notification settings - Fork 1
/
model_composer_upstream_request_patch.go
685 lines (579 loc) · 21.6 KB
/
model_composer_upstream_request_patch.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
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
/*
Cloudsmith API (v1)
The API to the Cloudsmith Service
API version: 1.568.8
Contact: support@cloudsmith.io
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package cloudsmith
import (
"encoding/json"
)
// checks if the ComposerUpstreamRequestPatch type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ComposerUpstreamRequestPatch{}
// ComposerUpstreamRequestPatch struct for ComposerUpstreamRequestPatch
type ComposerUpstreamRequestPatch struct {
// The authentication mode to use when accessing this upstream.
AuthMode *string `json:"auth_mode,omitempty"`
// Secret to provide with requests to upstream.
AuthSecret NullableString `json:"auth_secret,omitempty"`
// Username to provide with requests to upstream.
AuthUsername NullableString `json:"auth_username,omitempty"`
// The key for extra header #1 to send to upstream.
ExtraHeader1 NullableString `json:"extra_header_1,omitempty" validate:"regexp=^[-\\\\w]+$"`
// The key for extra header #2 to send to upstream.
ExtraHeader2 NullableString `json:"extra_header_2,omitempty" validate:"regexp=^[-\\\\w]+$"`
// The value for extra header #1 to send to upstream. This is stored as plaintext, and is NOT encrypted.
ExtraValue1 NullableString `json:"extra_value_1,omitempty" validate:"regexp=^[^\\\\n\\\\r]+$"`
// The value for extra header #2 to send to upstream. This is stored as plaintext, and is NOT encrypted.
ExtraValue2 NullableString `json:"extra_value_2,omitempty" validate:"regexp=^[^\\\\n\\\\r]+$"`
// Whether or not this upstream is active and ready for requests.
IsActive *bool `json:"is_active,omitempty"`
// The mode that this upstream should operate in. Upstream sources can be used to proxy resolved packages, as well as operate in a proxy/cache or cache only mode.
Mode *string `json:"mode,omitempty"`
// A descriptive name for this upstream source. A shortened version of this name will be used for tagging cached packages retrieved from this upstream.
Name *string `json:"name,omitempty" validate:"regexp=^\\\\w[\\\\w \\\\-'\\\\.\\/()]+$"`
// Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date.
Priority *int64 `json:"priority,omitempty"`
// The URL for this upstream source. This must be a fully qualified URL including any path elements required to reach the root of the repository.
UpstreamUrl *string `json:"upstream_url,omitempty"`
// If enabled, SSL certificates are verified when requests are made to this upstream. It's recommended to leave this enabled for all public sources to help mitigate Man-In-The-Middle (MITM) attacks. Please note this only applies to HTTPS upstreams.
VerifySsl *bool `json:"verify_ssl,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ComposerUpstreamRequestPatch ComposerUpstreamRequestPatch
// NewComposerUpstreamRequestPatch instantiates a new ComposerUpstreamRequestPatch 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 NewComposerUpstreamRequestPatch() *ComposerUpstreamRequestPatch {
this := ComposerUpstreamRequestPatch{}
var authMode string = "None"
this.AuthMode = &authMode
var mode string = "Proxy Only"
this.Mode = &mode
return &this
}
// NewComposerUpstreamRequestPatchWithDefaults instantiates a new ComposerUpstreamRequestPatch 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 NewComposerUpstreamRequestPatchWithDefaults() *ComposerUpstreamRequestPatch {
this := ComposerUpstreamRequestPatch{}
var authMode string = "None"
this.AuthMode = &authMode
var mode string = "Proxy Only"
this.Mode = &mode
return &this
}
// GetAuthMode returns the AuthMode field value if set, zero value otherwise.
func (o *ComposerUpstreamRequestPatch) GetAuthMode() string {
if o == nil || IsNil(o.AuthMode) {
var ret string
return ret
}
return *o.AuthMode
}
// GetAuthModeOk returns a tuple with the AuthMode field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComposerUpstreamRequestPatch) GetAuthModeOk() (*string, bool) {
if o == nil || IsNil(o.AuthMode) {
return nil, false
}
return o.AuthMode, true
}
// HasAuthMode returns a boolean if a field has been set.
func (o *ComposerUpstreamRequestPatch) HasAuthMode() bool {
if o != nil && !IsNil(o.AuthMode) {
return true
}
return false
}
// SetAuthMode gets a reference to the given string and assigns it to the AuthMode field.
func (o *ComposerUpstreamRequestPatch) SetAuthMode(v string) {
o.AuthMode = &v
}
// GetAuthSecret returns the AuthSecret field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ComposerUpstreamRequestPatch) GetAuthSecret() string {
if o == nil || IsNil(o.AuthSecret.Get()) {
var ret string
return ret
}
return *o.AuthSecret.Get()
}
// GetAuthSecretOk returns a tuple with the AuthSecret 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 *ComposerUpstreamRequestPatch) GetAuthSecretOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.AuthSecret.Get(), o.AuthSecret.IsSet()
}
// HasAuthSecret returns a boolean if a field has been set.
func (o *ComposerUpstreamRequestPatch) HasAuthSecret() bool {
if o != nil && o.AuthSecret.IsSet() {
return true
}
return false
}
// SetAuthSecret gets a reference to the given NullableString and assigns it to the AuthSecret field.
func (o *ComposerUpstreamRequestPatch) SetAuthSecret(v string) {
o.AuthSecret.Set(&v)
}
// SetAuthSecretNil sets the value for AuthSecret to be an explicit nil
func (o *ComposerUpstreamRequestPatch) SetAuthSecretNil() {
o.AuthSecret.Set(nil)
}
// UnsetAuthSecret ensures that no value is present for AuthSecret, not even an explicit nil
func (o *ComposerUpstreamRequestPatch) UnsetAuthSecret() {
o.AuthSecret.Unset()
}
// GetAuthUsername returns the AuthUsername field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ComposerUpstreamRequestPatch) GetAuthUsername() string {
if o == nil || IsNil(o.AuthUsername.Get()) {
var ret string
return ret
}
return *o.AuthUsername.Get()
}
// GetAuthUsernameOk returns a tuple with the AuthUsername 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 *ComposerUpstreamRequestPatch) GetAuthUsernameOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.AuthUsername.Get(), o.AuthUsername.IsSet()
}
// HasAuthUsername returns a boolean if a field has been set.
func (o *ComposerUpstreamRequestPatch) HasAuthUsername() bool {
if o != nil && o.AuthUsername.IsSet() {
return true
}
return false
}
// SetAuthUsername gets a reference to the given NullableString and assigns it to the AuthUsername field.
func (o *ComposerUpstreamRequestPatch) SetAuthUsername(v string) {
o.AuthUsername.Set(&v)
}
// SetAuthUsernameNil sets the value for AuthUsername to be an explicit nil
func (o *ComposerUpstreamRequestPatch) SetAuthUsernameNil() {
o.AuthUsername.Set(nil)
}
// UnsetAuthUsername ensures that no value is present for AuthUsername, not even an explicit nil
func (o *ComposerUpstreamRequestPatch) UnsetAuthUsername() {
o.AuthUsername.Unset()
}
// GetExtraHeader1 returns the ExtraHeader1 field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ComposerUpstreamRequestPatch) GetExtraHeader1() string {
if o == nil || IsNil(o.ExtraHeader1.Get()) {
var ret string
return ret
}
return *o.ExtraHeader1.Get()
}
// GetExtraHeader1Ok returns a tuple with the ExtraHeader1 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 *ComposerUpstreamRequestPatch) GetExtraHeader1Ok() (*string, bool) {
if o == nil {
return nil, false
}
return o.ExtraHeader1.Get(), o.ExtraHeader1.IsSet()
}
// HasExtraHeader1 returns a boolean if a field has been set.
func (o *ComposerUpstreamRequestPatch) HasExtraHeader1() bool {
if o != nil && o.ExtraHeader1.IsSet() {
return true
}
return false
}
// SetExtraHeader1 gets a reference to the given NullableString and assigns it to the ExtraHeader1 field.
func (o *ComposerUpstreamRequestPatch) SetExtraHeader1(v string) {
o.ExtraHeader1.Set(&v)
}
// SetExtraHeader1Nil sets the value for ExtraHeader1 to be an explicit nil
func (o *ComposerUpstreamRequestPatch) SetExtraHeader1Nil() {
o.ExtraHeader1.Set(nil)
}
// UnsetExtraHeader1 ensures that no value is present for ExtraHeader1, not even an explicit nil
func (o *ComposerUpstreamRequestPatch) UnsetExtraHeader1() {
o.ExtraHeader1.Unset()
}
// GetExtraHeader2 returns the ExtraHeader2 field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ComposerUpstreamRequestPatch) GetExtraHeader2() string {
if o == nil || IsNil(o.ExtraHeader2.Get()) {
var ret string
return ret
}
return *o.ExtraHeader2.Get()
}
// GetExtraHeader2Ok returns a tuple with the ExtraHeader2 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 *ComposerUpstreamRequestPatch) GetExtraHeader2Ok() (*string, bool) {
if o == nil {
return nil, false
}
return o.ExtraHeader2.Get(), o.ExtraHeader2.IsSet()
}
// HasExtraHeader2 returns a boolean if a field has been set.
func (o *ComposerUpstreamRequestPatch) HasExtraHeader2() bool {
if o != nil && o.ExtraHeader2.IsSet() {
return true
}
return false
}
// SetExtraHeader2 gets a reference to the given NullableString and assigns it to the ExtraHeader2 field.
func (o *ComposerUpstreamRequestPatch) SetExtraHeader2(v string) {
o.ExtraHeader2.Set(&v)
}
// SetExtraHeader2Nil sets the value for ExtraHeader2 to be an explicit nil
func (o *ComposerUpstreamRequestPatch) SetExtraHeader2Nil() {
o.ExtraHeader2.Set(nil)
}
// UnsetExtraHeader2 ensures that no value is present for ExtraHeader2, not even an explicit nil
func (o *ComposerUpstreamRequestPatch) UnsetExtraHeader2() {
o.ExtraHeader2.Unset()
}
// GetExtraValue1 returns the ExtraValue1 field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ComposerUpstreamRequestPatch) GetExtraValue1() string {
if o == nil || IsNil(o.ExtraValue1.Get()) {
var ret string
return ret
}
return *o.ExtraValue1.Get()
}
// GetExtraValue1Ok returns a tuple with the ExtraValue1 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 *ComposerUpstreamRequestPatch) GetExtraValue1Ok() (*string, bool) {
if o == nil {
return nil, false
}
return o.ExtraValue1.Get(), o.ExtraValue1.IsSet()
}
// HasExtraValue1 returns a boolean if a field has been set.
func (o *ComposerUpstreamRequestPatch) HasExtraValue1() bool {
if o != nil && o.ExtraValue1.IsSet() {
return true
}
return false
}
// SetExtraValue1 gets a reference to the given NullableString and assigns it to the ExtraValue1 field.
func (o *ComposerUpstreamRequestPatch) SetExtraValue1(v string) {
o.ExtraValue1.Set(&v)
}
// SetExtraValue1Nil sets the value for ExtraValue1 to be an explicit nil
func (o *ComposerUpstreamRequestPatch) SetExtraValue1Nil() {
o.ExtraValue1.Set(nil)
}
// UnsetExtraValue1 ensures that no value is present for ExtraValue1, not even an explicit nil
func (o *ComposerUpstreamRequestPatch) UnsetExtraValue1() {
o.ExtraValue1.Unset()
}
// GetExtraValue2 returns the ExtraValue2 field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ComposerUpstreamRequestPatch) GetExtraValue2() string {
if o == nil || IsNil(o.ExtraValue2.Get()) {
var ret string
return ret
}
return *o.ExtraValue2.Get()
}
// GetExtraValue2Ok returns a tuple with the ExtraValue2 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 *ComposerUpstreamRequestPatch) GetExtraValue2Ok() (*string, bool) {
if o == nil {
return nil, false
}
return o.ExtraValue2.Get(), o.ExtraValue2.IsSet()
}
// HasExtraValue2 returns a boolean if a field has been set.
func (o *ComposerUpstreamRequestPatch) HasExtraValue2() bool {
if o != nil && o.ExtraValue2.IsSet() {
return true
}
return false
}
// SetExtraValue2 gets a reference to the given NullableString and assigns it to the ExtraValue2 field.
func (o *ComposerUpstreamRequestPatch) SetExtraValue2(v string) {
o.ExtraValue2.Set(&v)
}
// SetExtraValue2Nil sets the value for ExtraValue2 to be an explicit nil
func (o *ComposerUpstreamRequestPatch) SetExtraValue2Nil() {
o.ExtraValue2.Set(nil)
}
// UnsetExtraValue2 ensures that no value is present for ExtraValue2, not even an explicit nil
func (o *ComposerUpstreamRequestPatch) UnsetExtraValue2() {
o.ExtraValue2.Unset()
}
// GetIsActive returns the IsActive field value if set, zero value otherwise.
func (o *ComposerUpstreamRequestPatch) GetIsActive() bool {
if o == nil || IsNil(o.IsActive) {
var ret bool
return ret
}
return *o.IsActive
}
// GetIsActiveOk returns a tuple with the IsActive field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComposerUpstreamRequestPatch) GetIsActiveOk() (*bool, bool) {
if o == nil || IsNil(o.IsActive) {
return nil, false
}
return o.IsActive, true
}
// HasIsActive returns a boolean if a field has been set.
func (o *ComposerUpstreamRequestPatch) HasIsActive() bool {
if o != nil && !IsNil(o.IsActive) {
return true
}
return false
}
// SetIsActive gets a reference to the given bool and assigns it to the IsActive field.
func (o *ComposerUpstreamRequestPatch) SetIsActive(v bool) {
o.IsActive = &v
}
// GetMode returns the Mode field value if set, zero value otherwise.
func (o *ComposerUpstreamRequestPatch) GetMode() string {
if o == nil || IsNil(o.Mode) {
var ret string
return ret
}
return *o.Mode
}
// GetModeOk returns a tuple with the Mode field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComposerUpstreamRequestPatch) GetModeOk() (*string, bool) {
if o == nil || IsNil(o.Mode) {
return nil, false
}
return o.Mode, true
}
// HasMode returns a boolean if a field has been set.
func (o *ComposerUpstreamRequestPatch) HasMode() bool {
if o != nil && !IsNil(o.Mode) {
return true
}
return false
}
// SetMode gets a reference to the given string and assigns it to the Mode field.
func (o *ComposerUpstreamRequestPatch) SetMode(v string) {
o.Mode = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *ComposerUpstreamRequestPatch) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComposerUpstreamRequestPatch) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *ComposerUpstreamRequestPatch) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *ComposerUpstreamRequestPatch) SetName(v string) {
o.Name = &v
}
// GetPriority returns the Priority field value if set, zero value otherwise.
func (o *ComposerUpstreamRequestPatch) GetPriority() int64 {
if o == nil || IsNil(o.Priority) {
var ret int64
return ret
}
return *o.Priority
}
// GetPriorityOk returns a tuple with the Priority field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComposerUpstreamRequestPatch) GetPriorityOk() (*int64, bool) {
if o == nil || IsNil(o.Priority) {
return nil, false
}
return o.Priority, true
}
// HasPriority returns a boolean if a field has been set.
func (o *ComposerUpstreamRequestPatch) HasPriority() bool {
if o != nil && !IsNil(o.Priority) {
return true
}
return false
}
// SetPriority gets a reference to the given int64 and assigns it to the Priority field.
func (o *ComposerUpstreamRequestPatch) SetPriority(v int64) {
o.Priority = &v
}
// GetUpstreamUrl returns the UpstreamUrl field value if set, zero value otherwise.
func (o *ComposerUpstreamRequestPatch) GetUpstreamUrl() string {
if o == nil || IsNil(o.UpstreamUrl) {
var ret string
return ret
}
return *o.UpstreamUrl
}
// GetUpstreamUrlOk returns a tuple with the UpstreamUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComposerUpstreamRequestPatch) GetUpstreamUrlOk() (*string, bool) {
if o == nil || IsNil(o.UpstreamUrl) {
return nil, false
}
return o.UpstreamUrl, true
}
// HasUpstreamUrl returns a boolean if a field has been set.
func (o *ComposerUpstreamRequestPatch) HasUpstreamUrl() bool {
if o != nil && !IsNil(o.UpstreamUrl) {
return true
}
return false
}
// SetUpstreamUrl gets a reference to the given string and assigns it to the UpstreamUrl field.
func (o *ComposerUpstreamRequestPatch) SetUpstreamUrl(v string) {
o.UpstreamUrl = &v
}
// GetVerifySsl returns the VerifySsl field value if set, zero value otherwise.
func (o *ComposerUpstreamRequestPatch) GetVerifySsl() bool {
if o == nil || IsNil(o.VerifySsl) {
var ret bool
return ret
}
return *o.VerifySsl
}
// GetVerifySslOk returns a tuple with the VerifySsl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ComposerUpstreamRequestPatch) GetVerifySslOk() (*bool, bool) {
if o == nil || IsNil(o.VerifySsl) {
return nil, false
}
return o.VerifySsl, true
}
// HasVerifySsl returns a boolean if a field has been set.
func (o *ComposerUpstreamRequestPatch) HasVerifySsl() bool {
if o != nil && !IsNil(o.VerifySsl) {
return true
}
return false
}
// SetVerifySsl gets a reference to the given bool and assigns it to the VerifySsl field.
func (o *ComposerUpstreamRequestPatch) SetVerifySsl(v bool) {
o.VerifySsl = &v
}
func (o ComposerUpstreamRequestPatch) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ComposerUpstreamRequestPatch) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.AuthMode) {
toSerialize["auth_mode"] = o.AuthMode
}
if o.AuthSecret.IsSet() {
toSerialize["auth_secret"] = o.AuthSecret.Get()
}
if o.AuthUsername.IsSet() {
toSerialize["auth_username"] = o.AuthUsername.Get()
}
if o.ExtraHeader1.IsSet() {
toSerialize["extra_header_1"] = o.ExtraHeader1.Get()
}
if o.ExtraHeader2.IsSet() {
toSerialize["extra_header_2"] = o.ExtraHeader2.Get()
}
if o.ExtraValue1.IsSet() {
toSerialize["extra_value_1"] = o.ExtraValue1.Get()
}
if o.ExtraValue2.IsSet() {
toSerialize["extra_value_2"] = o.ExtraValue2.Get()
}
if !IsNil(o.IsActive) {
toSerialize["is_active"] = o.IsActive
}
if !IsNil(o.Mode) {
toSerialize["mode"] = o.Mode
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Priority) {
toSerialize["priority"] = o.Priority
}
if !IsNil(o.UpstreamUrl) {
toSerialize["upstream_url"] = o.UpstreamUrl
}
if !IsNil(o.VerifySsl) {
toSerialize["verify_ssl"] = o.VerifySsl
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ComposerUpstreamRequestPatch) UnmarshalJSON(data []byte) (err error) {
varComposerUpstreamRequestPatch := _ComposerUpstreamRequestPatch{}
err = json.Unmarshal(data, &varComposerUpstreamRequestPatch)
if err != nil {
return err
}
*o = ComposerUpstreamRequestPatch(varComposerUpstreamRequestPatch)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "auth_mode")
delete(additionalProperties, "auth_secret")
delete(additionalProperties, "auth_username")
delete(additionalProperties, "extra_header_1")
delete(additionalProperties, "extra_header_2")
delete(additionalProperties, "extra_value_1")
delete(additionalProperties, "extra_value_2")
delete(additionalProperties, "is_active")
delete(additionalProperties, "mode")
delete(additionalProperties, "name")
delete(additionalProperties, "priority")
delete(additionalProperties, "upstream_url")
delete(additionalProperties, "verify_ssl")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableComposerUpstreamRequestPatch struct {
value *ComposerUpstreamRequestPatch
isSet bool
}
func (v NullableComposerUpstreamRequestPatch) Get() *ComposerUpstreamRequestPatch {
return v.value
}
func (v *NullableComposerUpstreamRequestPatch) Set(val *ComposerUpstreamRequestPatch) {
v.value = val
v.isSet = true
}
func (v NullableComposerUpstreamRequestPatch) IsSet() bool {
return v.isSet
}
func (v *NullableComposerUpstreamRequestPatch) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableComposerUpstreamRequestPatch(val *ComposerUpstreamRequestPatch) *NullableComposerUpstreamRequestPatch {
return &NullableComposerUpstreamRequestPatch{value: val, isSet: true}
}
func (v NullableComposerUpstreamRequestPatch) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableComposerUpstreamRequestPatch) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}