/
model_cluster_config_data.go
487 lines (418 loc) · 12 KB
/
model_cluster_config_data.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
// Copyright 2021 Confluent Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
REST Admin API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
API version: 3.0.0
Contact: kafka-clients-proxy-team@confluent.io
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package v3
import (
"bytes"
"encoding/json"
)
import (
"reflect"
)
// ClusterConfigData struct for ClusterConfigData
type ClusterConfigData struct {
Kind string `json:"kind,omitempty"`
Metadata ResourceMetadata `json:"metadata,omitempty"`
ClusterId string `json:"cluster_id,omitempty"`
Name string `json:"name,omitempty"`
Value NullableString `json:"value,omitempty"`
IsDefault bool `json:"is_default,omitempty"`
IsReadOnly bool `json:"is_read_only,omitempty"`
IsSensitive bool `json:"is_sensitive,omitempty"`
Source string `json:"source,omitempty"`
Synonyms []ConfigSynonymData `json:"synonyms,omitempty"`
ConfigType string `json:"config_type,omitempty"`
}
// NewClusterConfigData instantiates a new ClusterConfigData 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 NewClusterConfigData(kind string, metadata ResourceMetadata, clusterId string, name string, isDefault bool, isReadOnly bool, isSensitive bool, source string, synonyms []ConfigSynonymData, configType string) *ClusterConfigData {
this := ClusterConfigData{}
this.Kind = kind
this.Metadata = metadata
this.ClusterId = clusterId
this.Name = name
this.IsDefault = isDefault
this.IsReadOnly = isReadOnly
this.IsSensitive = isSensitive
this.Source = source
this.Synonyms = synonyms
this.ConfigType = configType
return &this
}
// NewClusterConfigDataWithDefaults instantiates a new ClusterConfigData 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 NewClusterConfigDataWithDefaults() *ClusterConfigData {
this := ClusterConfigData{}
return &this
}
// GetKind returns the Kind field value
func (o *ClusterConfigData) GetKind() string {
if o == nil {
var ret string
return ret
}
return o.Kind
}
// GetKindOk returns a tuple with the Kind field value
// and a boolean to check if the value has been set.
func (o *ClusterConfigData) GetKindOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Kind, true
}
// SetKind sets field value
func (o *ClusterConfigData) SetKind(v string) {
o.Kind = v
}
// GetMetadata returns the Metadata field value
func (o *ClusterConfigData) GetMetadata() ResourceMetadata {
if o == nil {
var ret ResourceMetadata
return ret
}
return o.Metadata
}
// GetMetadataOk returns a tuple with the Metadata field value
// and a boolean to check if the value has been set.
func (o *ClusterConfigData) GetMetadataOk() (*ResourceMetadata, bool) {
if o == nil {
return nil, false
}
return &o.Metadata, true
}
// SetMetadata sets field value
func (o *ClusterConfigData) SetMetadata(v ResourceMetadata) {
o.Metadata = v
}
// GetClusterId returns the ClusterId field value
func (o *ClusterConfigData) GetClusterId() string {
if o == nil {
var ret string
return ret
}
return o.ClusterId
}
// GetClusterIdOk returns a tuple with the ClusterId field value
// and a boolean to check if the value has been set.
func (o *ClusterConfigData) GetClusterIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ClusterId, true
}
// SetClusterId sets field value
func (o *ClusterConfigData) SetClusterId(v string) {
o.ClusterId = v
}
// GetName returns the Name field value
func (o *ClusterConfigData) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *ClusterConfigData) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *ClusterConfigData) SetName(v string) {
o.Name = v
}
// GetValue returns the Value field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ClusterConfigData) GetValue() string {
if o == nil || o.Value.Get() == nil {
var ret string
return ret
}
return *o.Value.Get()
}
// GetValueOk returns a tuple with the Value 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 *ClusterConfigData) GetValueOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Value.Get(), o.Value.IsSet()
}
// HasValue returns a boolean if a field has been set.
func (o *ClusterConfigData) HasValue() bool {
if o != nil && o.Value.IsSet() {
return true
}
return false
}
// SetValue gets a reference to the given NullableString and assigns it to the Value field.
func (o *ClusterConfigData) SetValue(v string) {
o.Value.Set(&v)
}
// SetValueNil sets the value for Value to be an explicit nil
func (o *ClusterConfigData) SetValueNil() {
o.Value.Set(nil)
}
// UnsetValue ensures that no value is present for Value, not even an explicit nil
func (o *ClusterConfigData) UnsetValue() {
o.Value.Unset()
}
// GetIsDefault returns the IsDefault field value
func (o *ClusterConfigData) GetIsDefault() bool {
if o == nil {
var ret bool
return ret
}
return o.IsDefault
}
// GetIsDefaultOk returns a tuple with the IsDefault field value
// and a boolean to check if the value has been set.
func (o *ClusterConfigData) GetIsDefaultOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.IsDefault, true
}
// SetIsDefault sets field value
func (o *ClusterConfigData) SetIsDefault(v bool) {
o.IsDefault = v
}
// GetIsReadOnly returns the IsReadOnly field value
func (o *ClusterConfigData) GetIsReadOnly() bool {
if o == nil {
var ret bool
return ret
}
return o.IsReadOnly
}
// GetIsReadOnlyOk returns a tuple with the IsReadOnly field value
// and a boolean to check if the value has been set.
func (o *ClusterConfigData) GetIsReadOnlyOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.IsReadOnly, true
}
// SetIsReadOnly sets field value
func (o *ClusterConfigData) SetIsReadOnly(v bool) {
o.IsReadOnly = v
}
// GetIsSensitive returns the IsSensitive field value
func (o *ClusterConfigData) GetIsSensitive() bool {
if o == nil {
var ret bool
return ret
}
return o.IsSensitive
}
// GetIsSensitiveOk returns a tuple with the IsSensitive field value
// and a boolean to check if the value has been set.
func (o *ClusterConfigData) GetIsSensitiveOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.IsSensitive, true
}
// SetIsSensitive sets field value
func (o *ClusterConfigData) SetIsSensitive(v bool) {
o.IsSensitive = v
}
// GetSource returns the Source field value
func (o *ClusterConfigData) GetSource() string {
if o == nil {
var ret string
return ret
}
return o.Source
}
// GetSourceOk returns a tuple with the Source field value
// and a boolean to check if the value has been set.
func (o *ClusterConfigData) GetSourceOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Source, true
}
// SetSource sets field value
func (o *ClusterConfigData) SetSource(v string) {
o.Source = v
}
// GetSynonyms returns the Synonyms field value
func (o *ClusterConfigData) GetSynonyms() []ConfigSynonymData {
if o == nil {
var ret []ConfigSynonymData
return ret
}
return o.Synonyms
}
// GetSynonymsOk returns a tuple with the Synonyms field value
// and a boolean to check if the value has been set.
func (o *ClusterConfigData) GetSynonymsOk() (*[]ConfigSynonymData, bool) {
if o == nil {
return nil, false
}
return &o.Synonyms, true
}
// SetSynonyms sets field value
func (o *ClusterConfigData) SetSynonyms(v []ConfigSynonymData) {
o.Synonyms = v
}
// GetConfigType returns the ConfigType field value
func (o *ClusterConfigData) GetConfigType() string {
if o == nil {
var ret string
return ret
}
return o.ConfigType
}
// GetConfigTypeOk returns a tuple with the ConfigType field value
// and a boolean to check if the value has been set.
func (o *ClusterConfigData) GetConfigTypeOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ConfigType, true
}
// SetConfigType sets field value
func (o *ClusterConfigData) SetConfigType(v string) {
o.ConfigType = v
}
// Redact resets all sensitive fields to their zero value.
func (o *ClusterConfigData) Redact() {
o.recurseRedact(&o.Kind)
o.recurseRedact(&o.Metadata)
o.recurseRedact(&o.ClusterId)
o.recurseRedact(&o.Name)
o.recurseRedact(o.Value)
o.recurseRedact(&o.IsDefault)
o.recurseRedact(&o.IsReadOnly)
o.recurseRedact(&o.IsSensitive)
o.recurseRedact(&o.Source)
o.recurseRedact(&o.Synonyms)
o.recurseRedact(&o.ConfigType)
}
func (o *ClusterConfigData) recurseRedact(v interface{}) {
type redactor interface {
Redact()
}
if r, ok := v.(redactor); ok {
r.Redact()
} else {
val := reflect.ValueOf(v)
if val.Kind() == reflect.Ptr {
val = val.Elem()
}
switch val.Kind() {
case reflect.Slice, reflect.Array:
for i := 0; i < val.Len(); i++ {
// support data types declared without pointers
o.recurseRedact(val.Index(i).Interface())
// ... and data types that were declared without but need pointers (for Redact)
if val.Index(i).CanAddr() {
o.recurseRedact(val.Index(i).Addr().Interface())
}
}
}
}
}
func (o ClusterConfigData) zeroField(v interface{}) {
p := reflect.ValueOf(v).Elem()
p.Set(reflect.Zero(p.Type()))
}
func (o ClusterConfigData) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["kind"] = o.Kind
}
if true {
toSerialize["metadata"] = o.Metadata
}
if true {
toSerialize["cluster_id"] = o.ClusterId
}
if true {
toSerialize["name"] = o.Name
}
if o.Value.IsSet() {
toSerialize["value"] = o.Value.Get()
}
if true {
toSerialize["is_default"] = o.IsDefault
}
if true {
toSerialize["is_read_only"] = o.IsReadOnly
}
if true {
toSerialize["is_sensitive"] = o.IsSensitive
}
if true {
toSerialize["source"] = o.Source
}
if true {
toSerialize["synonyms"] = o.Synonyms
}
if true {
toSerialize["config_type"] = o.ConfigType
}
buffer := &bytes.Buffer{}
encoder := json.NewEncoder(buffer)
encoder.SetEscapeHTML(false)
err := encoder.Encode(toSerialize)
return buffer.Bytes(), err
}
type NullableClusterConfigData struct {
value *ClusterConfigData
isSet bool
}
func (v NullableClusterConfigData) Get() *ClusterConfigData {
return v.value
}
func (v *NullableClusterConfigData) Set(val *ClusterConfigData) {
v.value = val
v.isSet = true
}
func (v NullableClusterConfigData) IsSet() bool {
return v.isSet
}
func (v *NullableClusterConfigData) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableClusterConfigData(val *ClusterConfigData) *NullableClusterConfigData {
return &NullableClusterConfigData{value: val, isSet: true}
}
func (v NullableClusterConfigData) MarshalJSON() ([]byte, error) {
buffer := &bytes.Buffer{}
encoder := json.NewEncoder(buffer)
encoder.SetEscapeHTML(false)
err := encoder.Encode(v.value)
return buffer.Bytes(), err
}
func (v *NullableClusterConfigData) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}