/
model_cdx_v1_consumer_shared_resource.go
659 lines (567 loc) · 19.8 KB
/
model_cdx_v1_consumer_shared_resource.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
// 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.
/*
Stream Share APIs
# Introduction
API version: 0.1.0-alpha0
Contact: cdx@confluent.io
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package v1
import (
"encoding/json"
)
import (
"reflect"
)
// CdxV1ConsumerSharedResource Resources accessible by the consumer ## The Consumer Shared Resources Model <SchemaDefinition schemaRef=\"#/components/schemas/cdx.v1.ConsumerSharedResource\" />
type CdxV1ConsumerSharedResource struct {
// APIVersion defines the schema version of this representation of a resource.
ApiVersion *string `json:"api_version,omitempty"`
// Kind defines the object this REST resource represents.
Kind *string `json:"kind,omitempty"`
// ID is the \"natural identifier\" for an object within its scope/namespace; it is normally unique across time but not space. That is, you can assume that the ID will not be reclaimed and reused after an object is deleted (\"time\"); however, it may collide with IDs for other object `kinds` or objects of the same `kind` within a different scope/namespace (\"space\").
Id *string `json:"id,omitempty"`
Metadata *ObjectMeta `json:"metadata,omitempty"`
Cloud *string `json:"cloud,omitempty"`
NetworkConnectionTypes *CdxV1ConnectionTypes `json:"network_connection_types,omitempty"`
// Consumer resource display name
DisplayName *string `json:"display_name,omitempty"`
// Description of consumer resource
Description *string `json:"description,omitempty"`
// list of tags
Tags *[]string `json:"tags,omitempty"`
// List of schemas in JSON format. This field is work in progress and subject to changes.
Schemas *[]CdxV1Schema `json:"schemas,omitempty"`
// Shared resource's organization name
OrganizationName *string `json:"organization_name,omitempty"`
// Shared resource's organization description
OrganizationDescription *string `json:"organization_description,omitempty"`
// Email of the shared resource's organization contact
OrganizationContact *string `json:"organization_contact,omitempty"`
// Resource logo url
LogoUrl *string `json:"logo_url,omitempty"`
}
// NewCdxV1ConsumerSharedResource instantiates a new CdxV1ConsumerSharedResource 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 NewCdxV1ConsumerSharedResource() *CdxV1ConsumerSharedResource {
this := CdxV1ConsumerSharedResource{}
return &this
}
// NewCdxV1ConsumerSharedResourceWithDefaults instantiates a new CdxV1ConsumerSharedResource 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 NewCdxV1ConsumerSharedResourceWithDefaults() *CdxV1ConsumerSharedResource {
this := CdxV1ConsumerSharedResource{}
return &this
}
// GetApiVersion returns the ApiVersion field value if set, zero value otherwise.
func (o *CdxV1ConsumerSharedResource) GetApiVersion() string {
if o == nil || o.ApiVersion == nil {
var ret string
return ret
}
return *o.ApiVersion
}
// GetApiVersionOk returns a tuple with the ApiVersion field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CdxV1ConsumerSharedResource) GetApiVersionOk() (*string, bool) {
if o == nil || o.ApiVersion == nil {
return nil, false
}
return o.ApiVersion, true
}
// HasApiVersion returns a boolean if a field has been set.
func (o *CdxV1ConsumerSharedResource) HasApiVersion() bool {
if o != nil && o.ApiVersion != nil {
return true
}
return false
}
// SetApiVersion gets a reference to the given string and assigns it to the ApiVersion field.
func (o *CdxV1ConsumerSharedResource) SetApiVersion(v string) {
o.ApiVersion = &v
}
// GetKind returns the Kind field value if set, zero value otherwise.
func (o *CdxV1ConsumerSharedResource) GetKind() string {
if o == nil || o.Kind == nil {
var ret string
return ret
}
return *o.Kind
}
// GetKindOk returns a tuple with the Kind field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CdxV1ConsumerSharedResource) GetKindOk() (*string, bool) {
if o == nil || o.Kind == nil {
return nil, false
}
return o.Kind, true
}
// HasKind returns a boolean if a field has been set.
func (o *CdxV1ConsumerSharedResource) HasKind() bool {
if o != nil && o.Kind != nil {
return true
}
return false
}
// SetKind gets a reference to the given string and assigns it to the Kind field.
func (o *CdxV1ConsumerSharedResource) SetKind(v string) {
o.Kind = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *CdxV1ConsumerSharedResource) GetId() string {
if o == nil || o.Id == nil {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CdxV1ConsumerSharedResource) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *CdxV1ConsumerSharedResource) HasId() bool {
if o != nil && o.Id != nil {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *CdxV1ConsumerSharedResource) SetId(v string) {
o.Id = &v
}
// GetMetadata returns the Metadata field value if set, zero value otherwise.
func (o *CdxV1ConsumerSharedResource) GetMetadata() ObjectMeta {
if o == nil || o.Metadata == nil {
var ret ObjectMeta
return ret
}
return *o.Metadata
}
// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CdxV1ConsumerSharedResource) GetMetadataOk() (*ObjectMeta, bool) {
if o == nil || o.Metadata == nil {
return nil, false
}
return o.Metadata, true
}
// HasMetadata returns a boolean if a field has been set.
func (o *CdxV1ConsumerSharedResource) HasMetadata() bool {
if o != nil && o.Metadata != nil {
return true
}
return false
}
// SetMetadata gets a reference to the given ObjectMeta and assigns it to the Metadata field.
func (o *CdxV1ConsumerSharedResource) SetMetadata(v ObjectMeta) {
o.Metadata = &v
}
// GetCloud returns the Cloud field value if set, zero value otherwise.
func (o *CdxV1ConsumerSharedResource) GetCloud() string {
if o == nil || o.Cloud == nil {
var ret string
return ret
}
return *o.Cloud
}
// GetCloudOk returns a tuple with the Cloud field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CdxV1ConsumerSharedResource) GetCloudOk() (*string, bool) {
if o == nil || o.Cloud == nil {
return nil, false
}
return o.Cloud, true
}
// HasCloud returns a boolean if a field has been set.
func (o *CdxV1ConsumerSharedResource) HasCloud() bool {
if o != nil && o.Cloud != nil {
return true
}
return false
}
// SetCloud gets a reference to the given string and assigns it to the Cloud field.
func (o *CdxV1ConsumerSharedResource) SetCloud(v string) {
o.Cloud = &v
}
// GetNetworkConnectionTypes returns the NetworkConnectionTypes field value if set, zero value otherwise.
func (o *CdxV1ConsumerSharedResource) GetNetworkConnectionTypes() CdxV1ConnectionTypes {
if o == nil || o.NetworkConnectionTypes == nil {
var ret CdxV1ConnectionTypes
return ret
}
return *o.NetworkConnectionTypes
}
// GetNetworkConnectionTypesOk returns a tuple with the NetworkConnectionTypes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CdxV1ConsumerSharedResource) GetNetworkConnectionTypesOk() (*CdxV1ConnectionTypes, bool) {
if o == nil || o.NetworkConnectionTypes == nil {
return nil, false
}
return o.NetworkConnectionTypes, true
}
// HasNetworkConnectionTypes returns a boolean if a field has been set.
func (o *CdxV1ConsumerSharedResource) HasNetworkConnectionTypes() bool {
if o != nil && o.NetworkConnectionTypes != nil {
return true
}
return false
}
// SetNetworkConnectionTypes gets a reference to the given CdxV1ConnectionTypes and assigns it to the NetworkConnectionTypes field.
func (o *CdxV1ConsumerSharedResource) SetNetworkConnectionTypes(v CdxV1ConnectionTypes) {
o.NetworkConnectionTypes = &v
}
// GetDisplayName returns the DisplayName field value if set, zero value otherwise.
func (o *CdxV1ConsumerSharedResource) GetDisplayName() string {
if o == nil || o.DisplayName == nil {
var ret string
return ret
}
return *o.DisplayName
}
// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CdxV1ConsumerSharedResource) GetDisplayNameOk() (*string, bool) {
if o == nil || o.DisplayName == nil {
return nil, false
}
return o.DisplayName, true
}
// HasDisplayName returns a boolean if a field has been set.
func (o *CdxV1ConsumerSharedResource) HasDisplayName() bool {
if o != nil && o.DisplayName != nil {
return true
}
return false
}
// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field.
func (o *CdxV1ConsumerSharedResource) SetDisplayName(v string) {
o.DisplayName = &v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *CdxV1ConsumerSharedResource) GetDescription() string {
if o == nil || o.Description == nil {
var ret string
return ret
}
return *o.Description
}
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CdxV1ConsumerSharedResource) GetDescriptionOk() (*string, bool) {
if o == nil || o.Description == nil {
return nil, false
}
return o.Description, true
}
// HasDescription returns a boolean if a field has been set.
func (o *CdxV1ConsumerSharedResource) HasDescription() bool {
if o != nil && o.Description != nil {
return true
}
return false
}
// SetDescription gets a reference to the given string and assigns it to the Description field.
func (o *CdxV1ConsumerSharedResource) SetDescription(v string) {
o.Description = &v
}
// GetTags returns the Tags field value if set, zero value otherwise.
func (o *CdxV1ConsumerSharedResource) GetTags() []string {
if o == nil || o.Tags == nil {
var ret []string
return ret
}
return *o.Tags
}
// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CdxV1ConsumerSharedResource) GetTagsOk() (*[]string, bool) {
if o == nil || o.Tags == nil {
return nil, false
}
return o.Tags, true
}
// HasTags returns a boolean if a field has been set.
func (o *CdxV1ConsumerSharedResource) HasTags() bool {
if o != nil && o.Tags != nil {
return true
}
return false
}
// SetTags gets a reference to the given []string and assigns it to the Tags field.
func (o *CdxV1ConsumerSharedResource) SetTags(v []string) {
o.Tags = &v
}
// GetSchemas returns the Schemas field value if set, zero value otherwise.
func (o *CdxV1ConsumerSharedResource) GetSchemas() []CdxV1Schema {
if o == nil || o.Schemas == nil {
var ret []CdxV1Schema
return ret
}
return *o.Schemas
}
// GetSchemasOk returns a tuple with the Schemas field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CdxV1ConsumerSharedResource) GetSchemasOk() (*[]CdxV1Schema, bool) {
if o == nil || o.Schemas == nil {
return nil, false
}
return o.Schemas, true
}
// HasSchemas returns a boolean if a field has been set.
func (o *CdxV1ConsumerSharedResource) HasSchemas() bool {
if o != nil && o.Schemas != nil {
return true
}
return false
}
// SetSchemas gets a reference to the given []CdxV1Schema and assigns it to the Schemas field.
func (o *CdxV1ConsumerSharedResource) SetSchemas(v []CdxV1Schema) {
o.Schemas = &v
}
// GetOrganizationName returns the OrganizationName field value if set, zero value otherwise.
func (o *CdxV1ConsumerSharedResource) GetOrganizationName() string {
if o == nil || o.OrganizationName == nil {
var ret string
return ret
}
return *o.OrganizationName
}
// GetOrganizationNameOk returns a tuple with the OrganizationName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CdxV1ConsumerSharedResource) GetOrganizationNameOk() (*string, bool) {
if o == nil || o.OrganizationName == nil {
return nil, false
}
return o.OrganizationName, true
}
// HasOrganizationName returns a boolean if a field has been set.
func (o *CdxV1ConsumerSharedResource) HasOrganizationName() bool {
if o != nil && o.OrganizationName != nil {
return true
}
return false
}
// SetOrganizationName gets a reference to the given string and assigns it to the OrganizationName field.
func (o *CdxV1ConsumerSharedResource) SetOrganizationName(v string) {
o.OrganizationName = &v
}
// GetOrganizationDescription returns the OrganizationDescription field value if set, zero value otherwise.
func (o *CdxV1ConsumerSharedResource) GetOrganizationDescription() string {
if o == nil || o.OrganizationDescription == nil {
var ret string
return ret
}
return *o.OrganizationDescription
}
// GetOrganizationDescriptionOk returns a tuple with the OrganizationDescription field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CdxV1ConsumerSharedResource) GetOrganizationDescriptionOk() (*string, bool) {
if o == nil || o.OrganizationDescription == nil {
return nil, false
}
return o.OrganizationDescription, true
}
// HasOrganizationDescription returns a boolean if a field has been set.
func (o *CdxV1ConsumerSharedResource) HasOrganizationDescription() bool {
if o != nil && o.OrganizationDescription != nil {
return true
}
return false
}
// SetOrganizationDescription gets a reference to the given string and assigns it to the OrganizationDescription field.
func (o *CdxV1ConsumerSharedResource) SetOrganizationDescription(v string) {
o.OrganizationDescription = &v
}
// GetOrganizationContact returns the OrganizationContact field value if set, zero value otherwise.
func (o *CdxV1ConsumerSharedResource) GetOrganizationContact() string {
if o == nil || o.OrganizationContact == nil {
var ret string
return ret
}
return *o.OrganizationContact
}
// GetOrganizationContactOk returns a tuple with the OrganizationContact field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CdxV1ConsumerSharedResource) GetOrganizationContactOk() (*string, bool) {
if o == nil || o.OrganizationContact == nil {
return nil, false
}
return o.OrganizationContact, true
}
// HasOrganizationContact returns a boolean if a field has been set.
func (o *CdxV1ConsumerSharedResource) HasOrganizationContact() bool {
if o != nil && o.OrganizationContact != nil {
return true
}
return false
}
// SetOrganizationContact gets a reference to the given string and assigns it to the OrganizationContact field.
func (o *CdxV1ConsumerSharedResource) SetOrganizationContact(v string) {
o.OrganizationContact = &v
}
// GetLogoUrl returns the LogoUrl field value if set, zero value otherwise.
func (o *CdxV1ConsumerSharedResource) GetLogoUrl() string {
if o == nil || o.LogoUrl == nil {
var ret string
return ret
}
return *o.LogoUrl
}
// GetLogoUrlOk returns a tuple with the LogoUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CdxV1ConsumerSharedResource) GetLogoUrlOk() (*string, bool) {
if o == nil || o.LogoUrl == nil {
return nil, false
}
return o.LogoUrl, true
}
// HasLogoUrl returns a boolean if a field has been set.
func (o *CdxV1ConsumerSharedResource) HasLogoUrl() bool {
if o != nil && o.LogoUrl != nil {
return true
}
return false
}
// SetLogoUrl gets a reference to the given string and assigns it to the LogoUrl field.
func (o *CdxV1ConsumerSharedResource) SetLogoUrl(v string) {
o.LogoUrl = &v
}
// Redact resets all sensitive fields to their zero value.
func (o *CdxV1ConsumerSharedResource) Redact() {
o.recurseRedact(o.ApiVersion)
o.recurseRedact(o.Kind)
o.recurseRedact(o.Id)
o.recurseRedact(o.Metadata)
o.recurseRedact(o.Cloud)
o.recurseRedact(o.NetworkConnectionTypes)
o.recurseRedact(o.DisplayName)
o.recurseRedact(o.Description)
o.recurseRedact(o.Tags)
o.recurseRedact(o.Schemas)
o.recurseRedact(o.OrganizationName)
o.recurseRedact(o.OrganizationDescription)
o.recurseRedact(o.OrganizationContact)
o.recurseRedact(o.LogoUrl)
}
func (o *CdxV1ConsumerSharedResource) 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 CdxV1ConsumerSharedResource) zeroField(v interface{}) {
p := reflect.ValueOf(v).Elem()
p.Set(reflect.Zero(p.Type()))
}
func (o CdxV1ConsumerSharedResource) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.ApiVersion != nil {
toSerialize["api_version"] = o.ApiVersion
}
if o.Kind != nil {
toSerialize["kind"] = o.Kind
}
if o.Id != nil {
toSerialize["id"] = o.Id
}
if o.Metadata != nil {
toSerialize["metadata"] = o.Metadata
}
if o.Cloud != nil {
toSerialize["cloud"] = o.Cloud
}
if o.NetworkConnectionTypes != nil {
toSerialize["network_connection_types"] = o.NetworkConnectionTypes
}
if o.DisplayName != nil {
toSerialize["display_name"] = o.DisplayName
}
if o.Description != nil {
toSerialize["description"] = o.Description
}
if o.Tags != nil {
toSerialize["tags"] = o.Tags
}
if o.Schemas != nil {
toSerialize["schemas"] = o.Schemas
}
if o.OrganizationName != nil {
toSerialize["organization_name"] = o.OrganizationName
}
if o.OrganizationDescription != nil {
toSerialize["organization_description"] = o.OrganizationDescription
}
if o.OrganizationContact != nil {
toSerialize["organization_contact"] = o.OrganizationContact
}
if o.LogoUrl != nil {
toSerialize["logo_url"] = o.LogoUrl
}
return json.Marshal(toSerialize)
}
type NullableCdxV1ConsumerSharedResource struct {
value *CdxV1ConsumerSharedResource
isSet bool
}
func (v NullableCdxV1ConsumerSharedResource) Get() *CdxV1ConsumerSharedResource {
return v.value
}
func (v *NullableCdxV1ConsumerSharedResource) Set(val *CdxV1ConsumerSharedResource) {
v.value = val
v.isSet = true
}
func (v NullableCdxV1ConsumerSharedResource) IsSet() bool {
return v.isSet
}
func (v *NullableCdxV1ConsumerSharedResource) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCdxV1ConsumerSharedResource(val *CdxV1ConsumerSharedResource) *NullableCdxV1ConsumerSharedResource {
return &NullableCdxV1ConsumerSharedResource{value: val, isSet: true}
}
func (v NullableCdxV1ConsumerSharedResource) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCdxV1ConsumerSharedResource) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}