/
cluster_builder.go
1284 lines (1213 loc) · 33.4 KB
/
cluster_builder.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
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
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
Copyright (c) 2020 Red Hat, Inc.
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.
*/
// IMPORTANT: This file has been generated automatically, refrain from modifying it manually as all
// your changes will be lost when the file is generated again.
package v1 // github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1
import (
time "time"
)
// ClusterBuilder contains the data and logic needed to build 'cluster' objects.
//
// Definition of an _OpenShift_ cluster.
//
// The `cloud_provider` attribute is a reference to the cloud provider. When a
// cluster is retrieved it will be a link to the cloud provider, containing only
// the kind, id and href attributes:
//
// ```json
//
// {
// "cloud_provider": {
// "kind": "CloudProviderLink",
// "id": "123",
// "href": "/api/clusters_mgmt/v1/cloud_providers/123"
// }
// }
//
// ```
//
// When a cluster is created this is optional, and if used it should contain the
// identifier of the cloud provider to use:
//
// ```json
//
// {
// "cloud_provider": {
// "id": "123",
// }
// }
//
// ```
//
// If not included, then the cluster will be created using the default cloud
// provider, which is currently Amazon Web Services.
//
// The region attribute is mandatory when a cluster is created.
//
// The `aws.access_key_id`, `aws.secret_access_key` and `dns.base_domain`
// attributes are mandatory when creation a cluster with your own Amazon Web
// Services account.
type ClusterBuilder struct {
bitmap_ uint64
id string
href string
api *ClusterAPIBuilder
aws *AWSBuilder
awsInfrastructureAccessRoleGrants *AWSInfrastructureAccessRoleGrantListBuilder
ccs *CCSBuilder
dns *DNSBuilder
gcp *GCPBuilder
gcpEncryptionKey *GCPEncryptionKeyBuilder
gcpNetwork *GCPNetworkBuilder
additionalTrustBundle string
addons *AddOnInstallationListBuilder
autoscaler *ClusterAutoscalerBuilder
azure *AzureBuilder
billingModel BillingModel
byoOidc *ByoOidcBuilder
cloudProvider *CloudProviderBuilder
console *ClusterConsoleBuilder
creationTimestamp time.Time
deleteProtection *DeleteProtectionBuilder
domainPrefix string
expirationTimestamp time.Time
externalID string
externalAuthConfig *ExternalAuthConfigBuilder
externalConfiguration *ExternalConfigurationBuilder
flavour *FlavourBuilder
groups *GroupListBuilder
healthState ClusterHealthState
htpasswd *HTPasswdIdentityProviderBuilder
hypershift *HypershiftBuilder
identityProviders *IdentityProviderListBuilder
inflightChecks *InflightCheckListBuilder
infraID string
ingresses *IngressListBuilder
kubeletConfig *KubeletConfigBuilder
loadBalancerQuota int
machinePools *MachinePoolListBuilder
managedService *ManagedServiceBuilder
name string
network *NetworkBuilder
nodeDrainGracePeriod *ValueBuilder
nodePools *NodePoolListBuilder
nodes *ClusterNodesBuilder
openshiftVersion string
product *ProductBuilder
properties map[string]string
provisionShard *ProvisionShardBuilder
proxy *ProxyBuilder
region *CloudRegionBuilder
state ClusterState
status *ClusterStatusBuilder
storageQuota *ValueBuilder
subscription *SubscriptionBuilder
version *VersionBuilder
fips bool
disableUserWorkloadMonitoring bool
etcdEncryption bool
managed bool
multiAZ bool
}
// NewCluster creates a new builder of 'cluster' objects.
func NewCluster() *ClusterBuilder {
return &ClusterBuilder{}
}
// Link sets the flag that indicates if this is a link.
func (b *ClusterBuilder) Link(value bool) *ClusterBuilder {
b.bitmap_ |= 1
return b
}
// ID sets the identifier of the object.
func (b *ClusterBuilder) ID(value string) *ClusterBuilder {
b.id = value
b.bitmap_ |= 2
return b
}
// HREF sets the link to the object.
func (b *ClusterBuilder) HREF(value string) *ClusterBuilder {
b.href = value
b.bitmap_ |= 4
return b
}
// Empty returns true if the builder is empty, i.e. no attribute has a value.
func (b *ClusterBuilder) Empty() bool {
return b == nil || b.bitmap_&^1 == 0
}
// API sets the value of the 'API' attribute to the given value.
//
// Information about the API of a cluster.
func (b *ClusterBuilder) API(value *ClusterAPIBuilder) *ClusterBuilder {
b.api = value
if value != nil {
b.bitmap_ |= 8
} else {
b.bitmap_ &^= 8
}
return b
}
// AWS sets the value of the 'AWS' attribute to the given value.
//
// _Amazon Web Services_ specific settings of a cluster.
func (b *ClusterBuilder) AWS(value *AWSBuilder) *ClusterBuilder {
b.aws = value
if value != nil {
b.bitmap_ |= 16
} else {
b.bitmap_ &^= 16
}
return b
}
// AWSInfrastructureAccessRoleGrants sets the value of the 'AWS_infrastructure_access_role_grants' attribute to the given values.
func (b *ClusterBuilder) AWSInfrastructureAccessRoleGrants(value *AWSInfrastructureAccessRoleGrantListBuilder) *ClusterBuilder {
b.awsInfrastructureAccessRoleGrants = value
b.bitmap_ |= 32
return b
}
// CCS sets the value of the 'CCS' attribute to the given value.
func (b *ClusterBuilder) CCS(value *CCSBuilder) *ClusterBuilder {
b.ccs = value
if value != nil {
b.bitmap_ |= 64
} else {
b.bitmap_ &^= 64
}
return b
}
// DNS sets the value of the 'DNS' attribute to the given value.
//
// DNS settings of the cluster.
func (b *ClusterBuilder) DNS(value *DNSBuilder) *ClusterBuilder {
b.dns = value
if value != nil {
b.bitmap_ |= 128
} else {
b.bitmap_ &^= 128
}
return b
}
// FIPS sets the value of the 'FIPS' attribute to the given value.
func (b *ClusterBuilder) FIPS(value bool) *ClusterBuilder {
b.fips = value
b.bitmap_ |= 256
return b
}
// GCP sets the value of the 'GCP' attribute to the given value.
//
// Google cloud platform settings of a cluster.
func (b *ClusterBuilder) GCP(value *GCPBuilder) *ClusterBuilder {
b.gcp = value
if value != nil {
b.bitmap_ |= 512
} else {
b.bitmap_ &^= 512
}
return b
}
// GCPEncryptionKey sets the value of the 'GCP_encryption_key' attribute to the given value.
//
// GCP Encryption Key for CCS clusters.
func (b *ClusterBuilder) GCPEncryptionKey(value *GCPEncryptionKeyBuilder) *ClusterBuilder {
b.gcpEncryptionKey = value
if value != nil {
b.bitmap_ |= 1024
} else {
b.bitmap_ &^= 1024
}
return b
}
// GCPNetwork sets the value of the 'GCP_network' attribute to the given value.
//
// GCP Network configuration of a cluster.
func (b *ClusterBuilder) GCPNetwork(value *GCPNetworkBuilder) *ClusterBuilder {
b.gcpNetwork = value
if value != nil {
b.bitmap_ |= 2048
} else {
b.bitmap_ &^= 2048
}
return b
}
// AdditionalTrustBundle sets the value of the 'additional_trust_bundle' attribute to the given value.
func (b *ClusterBuilder) AdditionalTrustBundle(value string) *ClusterBuilder {
b.additionalTrustBundle = value
b.bitmap_ |= 4096
return b
}
// Addons sets the value of the 'addons' attribute to the given values.
func (b *ClusterBuilder) Addons(value *AddOnInstallationListBuilder) *ClusterBuilder {
b.addons = value
b.bitmap_ |= 8192
return b
}
// Autoscaler sets the value of the 'autoscaler' attribute to the given value.
//
// Cluster-wide autoscaling configuration.
func (b *ClusterBuilder) Autoscaler(value *ClusterAutoscalerBuilder) *ClusterBuilder {
b.autoscaler = value
if value != nil {
b.bitmap_ |= 16384
} else {
b.bitmap_ &^= 16384
}
return b
}
// Azure sets the value of the 'azure' attribute to the given value.
//
// Microsoft Azure settings of a cluster.
func (b *ClusterBuilder) Azure(value *AzureBuilder) *ClusterBuilder {
b.azure = value
if value != nil {
b.bitmap_ |= 32768
} else {
b.bitmap_ &^= 32768
}
return b
}
// BillingModel sets the value of the 'billing_model' attribute to the given value.
//
// Billing model for cluster resources.
func (b *ClusterBuilder) BillingModel(value BillingModel) *ClusterBuilder {
b.billingModel = value
b.bitmap_ |= 65536
return b
}
// ByoOidc sets the value of the 'byo_oidc' attribute to the given value.
//
// ByoOidc configuration.
func (b *ClusterBuilder) ByoOidc(value *ByoOidcBuilder) *ClusterBuilder {
b.byoOidc = value
if value != nil {
b.bitmap_ |= 131072
} else {
b.bitmap_ &^= 131072
}
return b
}
// CloudProvider sets the value of the 'cloud_provider' attribute to the given value.
//
// Cloud provider.
func (b *ClusterBuilder) CloudProvider(value *CloudProviderBuilder) *ClusterBuilder {
b.cloudProvider = value
if value != nil {
b.bitmap_ |= 262144
} else {
b.bitmap_ &^= 262144
}
return b
}
// Console sets the value of the 'console' attribute to the given value.
//
// Information about the console of a cluster.
func (b *ClusterBuilder) Console(value *ClusterConsoleBuilder) *ClusterBuilder {
b.console = value
if value != nil {
b.bitmap_ |= 524288
} else {
b.bitmap_ &^= 524288
}
return b
}
// CreationTimestamp sets the value of the 'creation_timestamp' attribute to the given value.
func (b *ClusterBuilder) CreationTimestamp(value time.Time) *ClusterBuilder {
b.creationTimestamp = value
b.bitmap_ |= 1048576
return b
}
// DeleteProtection sets the value of the 'delete_protection' attribute to the given value.
//
// DeleteProtection configuration.
func (b *ClusterBuilder) DeleteProtection(value *DeleteProtectionBuilder) *ClusterBuilder {
b.deleteProtection = value
if value != nil {
b.bitmap_ |= 2097152
} else {
b.bitmap_ &^= 2097152
}
return b
}
// DisableUserWorkloadMonitoring sets the value of the 'disable_user_workload_monitoring' attribute to the given value.
func (b *ClusterBuilder) DisableUserWorkloadMonitoring(value bool) *ClusterBuilder {
b.disableUserWorkloadMonitoring = value
b.bitmap_ |= 4194304
return b
}
// DomainPrefix sets the value of the 'domain_prefix' attribute to the given value.
func (b *ClusterBuilder) DomainPrefix(value string) *ClusterBuilder {
b.domainPrefix = value
b.bitmap_ |= 8388608
return b
}
// EtcdEncryption sets the value of the 'etcd_encryption' attribute to the given value.
func (b *ClusterBuilder) EtcdEncryption(value bool) *ClusterBuilder {
b.etcdEncryption = value
b.bitmap_ |= 16777216
return b
}
// ExpirationTimestamp sets the value of the 'expiration_timestamp' attribute to the given value.
func (b *ClusterBuilder) ExpirationTimestamp(value time.Time) *ClusterBuilder {
b.expirationTimestamp = value
b.bitmap_ |= 33554432
return b
}
// ExternalID sets the value of the 'external_ID' attribute to the given value.
func (b *ClusterBuilder) ExternalID(value string) *ClusterBuilder {
b.externalID = value
b.bitmap_ |= 67108864
return b
}
// ExternalAuthConfig sets the value of the 'external_auth_config' attribute to the given value.
//
// ExternalAuthConfig configuration
func (b *ClusterBuilder) ExternalAuthConfig(value *ExternalAuthConfigBuilder) *ClusterBuilder {
b.externalAuthConfig = value
if value != nil {
b.bitmap_ |= 134217728
} else {
b.bitmap_ &^= 134217728
}
return b
}
// ExternalConfiguration sets the value of the 'external_configuration' attribute to the given value.
//
// Representation of cluster external configuration.
func (b *ClusterBuilder) ExternalConfiguration(value *ExternalConfigurationBuilder) *ClusterBuilder {
b.externalConfiguration = value
if value != nil {
b.bitmap_ |= 268435456
} else {
b.bitmap_ &^= 268435456
}
return b
}
// Flavour sets the value of the 'flavour' attribute to the given value.
//
// Set of predefined properties of a cluster. For example, a _huge_ flavour can be a cluster
// with 10 infra nodes and 1000 compute nodes.
func (b *ClusterBuilder) Flavour(value *FlavourBuilder) *ClusterBuilder {
b.flavour = value
if value != nil {
b.bitmap_ |= 536870912
} else {
b.bitmap_ &^= 536870912
}
return b
}
// Groups sets the value of the 'groups' attribute to the given values.
func (b *ClusterBuilder) Groups(value *GroupListBuilder) *ClusterBuilder {
b.groups = value
b.bitmap_ |= 1073741824
return b
}
// HealthState sets the value of the 'health_state' attribute to the given value.
//
// ClusterHealthState indicates the health of a cluster.
func (b *ClusterBuilder) HealthState(value ClusterHealthState) *ClusterBuilder {
b.healthState = value
b.bitmap_ |= 2147483648
return b
}
// Htpasswd sets the value of the 'htpasswd' attribute to the given value.
//
// Details for `htpasswd` identity providers.
func (b *ClusterBuilder) Htpasswd(value *HTPasswdIdentityProviderBuilder) *ClusterBuilder {
b.htpasswd = value
if value != nil {
b.bitmap_ |= 4294967296
} else {
b.bitmap_ &^= 4294967296
}
return b
}
// Hypershift sets the value of the 'hypershift' attribute to the given value.
//
// Hypershift configuration.
func (b *ClusterBuilder) Hypershift(value *HypershiftBuilder) *ClusterBuilder {
b.hypershift = value
if value != nil {
b.bitmap_ |= 8589934592
} else {
b.bitmap_ &^= 8589934592
}
return b
}
// IdentityProviders sets the value of the 'identity_providers' attribute to the given values.
func (b *ClusterBuilder) IdentityProviders(value *IdentityProviderListBuilder) *ClusterBuilder {
b.identityProviders = value
b.bitmap_ |= 17179869184
return b
}
// InflightChecks sets the value of the 'inflight_checks' attribute to the given values.
func (b *ClusterBuilder) InflightChecks(value *InflightCheckListBuilder) *ClusterBuilder {
b.inflightChecks = value
b.bitmap_ |= 34359738368
return b
}
// InfraID sets the value of the 'infra_ID' attribute to the given value.
func (b *ClusterBuilder) InfraID(value string) *ClusterBuilder {
b.infraID = value
b.bitmap_ |= 68719476736
return b
}
// Ingresses sets the value of the 'ingresses' attribute to the given values.
func (b *ClusterBuilder) Ingresses(value *IngressListBuilder) *ClusterBuilder {
b.ingresses = value
b.bitmap_ |= 137438953472
return b
}
// KubeletConfig sets the value of the 'kubelet_config' attribute to the given value.
//
// OCM representation of KubeletConfig, exposing the fields of Kubernetes
// KubeletConfig that can be managed by users
func (b *ClusterBuilder) KubeletConfig(value *KubeletConfigBuilder) *ClusterBuilder {
b.kubeletConfig = value
if value != nil {
b.bitmap_ |= 274877906944
} else {
b.bitmap_ &^= 274877906944
}
return b
}
// LoadBalancerQuota sets the value of the 'load_balancer_quota' attribute to the given value.
func (b *ClusterBuilder) LoadBalancerQuota(value int) *ClusterBuilder {
b.loadBalancerQuota = value
b.bitmap_ |= 549755813888
return b
}
// MachinePools sets the value of the 'machine_pools' attribute to the given values.
func (b *ClusterBuilder) MachinePools(value *MachinePoolListBuilder) *ClusterBuilder {
b.machinePools = value
b.bitmap_ |= 1099511627776
return b
}
// Managed sets the value of the 'managed' attribute to the given value.
func (b *ClusterBuilder) Managed(value bool) *ClusterBuilder {
b.managed = value
b.bitmap_ |= 2199023255552
return b
}
// ManagedService sets the value of the 'managed_service' attribute to the given value.
//
// Contains the necessary attributes to support role-based authentication on AWS.
func (b *ClusterBuilder) ManagedService(value *ManagedServiceBuilder) *ClusterBuilder {
b.managedService = value
if value != nil {
b.bitmap_ |= 4398046511104
} else {
b.bitmap_ &^= 4398046511104
}
return b
}
// MultiAZ sets the value of the 'multi_AZ' attribute to the given value.
func (b *ClusterBuilder) MultiAZ(value bool) *ClusterBuilder {
b.multiAZ = value
b.bitmap_ |= 8796093022208
return b
}
// Name sets the value of the 'name' attribute to the given value.
func (b *ClusterBuilder) Name(value string) *ClusterBuilder {
b.name = value
b.bitmap_ |= 17592186044416
return b
}
// Network sets the value of the 'network' attribute to the given value.
//
// Network configuration of a cluster.
func (b *ClusterBuilder) Network(value *NetworkBuilder) *ClusterBuilder {
b.network = value
if value != nil {
b.bitmap_ |= 35184372088832
} else {
b.bitmap_ &^= 35184372088832
}
return b
}
// NodeDrainGracePeriod sets the value of the 'node_drain_grace_period' attribute to the given value.
//
// Numeric value and the unit used to measure it.
//
// Units are not mandatory, and they're not specified for some resources. For
// resources that use bytes, the accepted units are:
//
// - 1 B = 1 byte
// - 1 KB = 10^3 bytes
// - 1 MB = 10^6 bytes
// - 1 GB = 10^9 bytes
// - 1 TB = 10^12 bytes
// - 1 PB = 10^15 bytes
//
// - 1 B = 1 byte
// - 1 KiB = 2^10 bytes
// - 1 MiB = 2^20 bytes
// - 1 GiB = 2^30 bytes
// - 1 TiB = 2^40 bytes
// - 1 PiB = 2^50 bytes
func (b *ClusterBuilder) NodeDrainGracePeriod(value *ValueBuilder) *ClusterBuilder {
b.nodeDrainGracePeriod = value
if value != nil {
b.bitmap_ |= 70368744177664
} else {
b.bitmap_ &^= 70368744177664
}
return b
}
// NodePools sets the value of the 'node_pools' attribute to the given values.
func (b *ClusterBuilder) NodePools(value *NodePoolListBuilder) *ClusterBuilder {
b.nodePools = value
b.bitmap_ |= 140737488355328
return b
}
// Nodes sets the value of the 'nodes' attribute to the given value.
//
// Counts of different classes of nodes inside a cluster.
func (b *ClusterBuilder) Nodes(value *ClusterNodesBuilder) *ClusterBuilder {
b.nodes = value
if value != nil {
b.bitmap_ |= 281474976710656
} else {
b.bitmap_ &^= 281474976710656
}
return b
}
// OpenshiftVersion sets the value of the 'openshift_version' attribute to the given value.
func (b *ClusterBuilder) OpenshiftVersion(value string) *ClusterBuilder {
b.openshiftVersion = value
b.bitmap_ |= 562949953421312
return b
}
// Product sets the value of the 'product' attribute to the given value.
//
// Representation of an product that can be selected as a cluster type.
func (b *ClusterBuilder) Product(value *ProductBuilder) *ClusterBuilder {
b.product = value
if value != nil {
b.bitmap_ |= 1125899906842624
} else {
b.bitmap_ &^= 1125899906842624
}
return b
}
// Properties sets the value of the 'properties' attribute to the given value.
func (b *ClusterBuilder) Properties(value map[string]string) *ClusterBuilder {
b.properties = value
if value != nil {
b.bitmap_ |= 2251799813685248
} else {
b.bitmap_ &^= 2251799813685248
}
return b
}
// ProvisionShard sets the value of the 'provision_shard' attribute to the given value.
//
// Contains the properties of the provision shard, including AWS and GCP related configurations
func (b *ClusterBuilder) ProvisionShard(value *ProvisionShardBuilder) *ClusterBuilder {
b.provisionShard = value
if value != nil {
b.bitmap_ |= 4503599627370496
} else {
b.bitmap_ &^= 4503599627370496
}
return b
}
// Proxy sets the value of the 'proxy' attribute to the given value.
//
// Proxy configuration of a cluster.
func (b *ClusterBuilder) Proxy(value *ProxyBuilder) *ClusterBuilder {
b.proxy = value
if value != nil {
b.bitmap_ |= 9007199254740992
} else {
b.bitmap_ &^= 9007199254740992
}
return b
}
// Region sets the value of the 'region' attribute to the given value.
//
// Description of a region of a cloud provider.
func (b *ClusterBuilder) Region(value *CloudRegionBuilder) *ClusterBuilder {
b.region = value
if value != nil {
b.bitmap_ |= 18014398509481984
} else {
b.bitmap_ &^= 18014398509481984
}
return b
}
// State sets the value of the 'state' attribute to the given value.
//
// Overall state of a cluster.
func (b *ClusterBuilder) State(value ClusterState) *ClusterBuilder {
b.state = value
b.bitmap_ |= 36028797018963968
return b
}
// Status sets the value of the 'status' attribute to the given value.
//
// Detailed status of a cluster.
func (b *ClusterBuilder) Status(value *ClusterStatusBuilder) *ClusterBuilder {
b.status = value
if value != nil {
b.bitmap_ |= 72057594037927936
} else {
b.bitmap_ &^= 72057594037927936
}
return b
}
// StorageQuota sets the value of the 'storage_quota' attribute to the given value.
//
// Numeric value and the unit used to measure it.
//
// Units are not mandatory, and they're not specified for some resources. For
// resources that use bytes, the accepted units are:
//
// - 1 B = 1 byte
// - 1 KB = 10^3 bytes
// - 1 MB = 10^6 bytes
// - 1 GB = 10^9 bytes
// - 1 TB = 10^12 bytes
// - 1 PB = 10^15 bytes
//
// - 1 B = 1 byte
// - 1 KiB = 2^10 bytes
// - 1 MiB = 2^20 bytes
// - 1 GiB = 2^30 bytes
// - 1 TiB = 2^40 bytes
// - 1 PiB = 2^50 bytes
func (b *ClusterBuilder) StorageQuota(value *ValueBuilder) *ClusterBuilder {
b.storageQuota = value
if value != nil {
b.bitmap_ |= 144115188075855872
} else {
b.bitmap_ &^= 144115188075855872
}
return b
}
// Subscription sets the value of the 'subscription' attribute to the given value.
//
// Definition of a subscription.
func (b *ClusterBuilder) Subscription(value *SubscriptionBuilder) *ClusterBuilder {
b.subscription = value
if value != nil {
b.bitmap_ |= 288230376151711744
} else {
b.bitmap_ &^= 288230376151711744
}
return b
}
// Version sets the value of the 'version' attribute to the given value.
//
// Representation of an _OpenShift_ version.
func (b *ClusterBuilder) Version(value *VersionBuilder) *ClusterBuilder {
b.version = value
if value != nil {
b.bitmap_ |= 576460752303423488
} else {
b.bitmap_ &^= 576460752303423488
}
return b
}
// Copy copies the attributes of the given object into this builder, discarding any previous values.
func (b *ClusterBuilder) Copy(object *Cluster) *ClusterBuilder {
if object == nil {
return b
}
b.bitmap_ = object.bitmap_
b.id = object.id
b.href = object.href
if object.api != nil {
b.api = NewClusterAPI().Copy(object.api)
} else {
b.api = nil
}
if object.aws != nil {
b.aws = NewAWS().Copy(object.aws)
} else {
b.aws = nil
}
if object.awsInfrastructureAccessRoleGrants != nil {
b.awsInfrastructureAccessRoleGrants = NewAWSInfrastructureAccessRoleGrantList().Copy(object.awsInfrastructureAccessRoleGrants)
} else {
b.awsInfrastructureAccessRoleGrants = nil
}
if object.ccs != nil {
b.ccs = NewCCS().Copy(object.ccs)
} else {
b.ccs = nil
}
if object.dns != nil {
b.dns = NewDNS().Copy(object.dns)
} else {
b.dns = nil
}
b.fips = object.fips
if object.gcp != nil {
b.gcp = NewGCP().Copy(object.gcp)
} else {
b.gcp = nil
}
if object.gcpEncryptionKey != nil {
b.gcpEncryptionKey = NewGCPEncryptionKey().Copy(object.gcpEncryptionKey)
} else {
b.gcpEncryptionKey = nil
}
if object.gcpNetwork != nil {
b.gcpNetwork = NewGCPNetwork().Copy(object.gcpNetwork)
} else {
b.gcpNetwork = nil
}
b.additionalTrustBundle = object.additionalTrustBundle
if object.addons != nil {
b.addons = NewAddOnInstallationList().Copy(object.addons)
} else {
b.addons = nil
}
if object.autoscaler != nil {
b.autoscaler = NewClusterAutoscaler().Copy(object.autoscaler)
} else {
b.autoscaler = nil
}
if object.azure != nil {
b.azure = NewAzure().Copy(object.azure)
} else {
b.azure = nil
}
b.billingModel = object.billingModel
if object.byoOidc != nil {
b.byoOidc = NewByoOidc().Copy(object.byoOidc)
} else {
b.byoOidc = nil
}
if object.cloudProvider != nil {
b.cloudProvider = NewCloudProvider().Copy(object.cloudProvider)
} else {
b.cloudProvider = nil
}
if object.console != nil {
b.console = NewClusterConsole().Copy(object.console)
} else {
b.console = nil
}
b.creationTimestamp = object.creationTimestamp
if object.deleteProtection != nil {
b.deleteProtection = NewDeleteProtection().Copy(object.deleteProtection)
} else {
b.deleteProtection = nil
}
b.disableUserWorkloadMonitoring = object.disableUserWorkloadMonitoring
b.domainPrefix = object.domainPrefix
b.etcdEncryption = object.etcdEncryption
b.expirationTimestamp = object.expirationTimestamp
b.externalID = object.externalID
if object.externalAuthConfig != nil {
b.externalAuthConfig = NewExternalAuthConfig().Copy(object.externalAuthConfig)
} else {
b.externalAuthConfig = nil
}
if object.externalConfiguration != nil {
b.externalConfiguration = NewExternalConfiguration().Copy(object.externalConfiguration)
} else {
b.externalConfiguration = nil
}
if object.flavour != nil {
b.flavour = NewFlavour().Copy(object.flavour)
} else {
b.flavour = nil
}
if object.groups != nil {
b.groups = NewGroupList().Copy(object.groups)
} else {
b.groups = nil
}
b.healthState = object.healthState
if object.htpasswd != nil {
b.htpasswd = NewHTPasswdIdentityProvider().Copy(object.htpasswd)
} else {
b.htpasswd = nil
}
if object.hypershift != nil {
b.hypershift = NewHypershift().Copy(object.hypershift)
} else {
b.hypershift = nil
}
if object.identityProviders != nil {
b.identityProviders = NewIdentityProviderList().Copy(object.identityProviders)
} else {
b.identityProviders = nil
}
if object.inflightChecks != nil {
b.inflightChecks = NewInflightCheckList().Copy(object.inflightChecks)
} else {
b.inflightChecks = nil
}
b.infraID = object.infraID
if object.ingresses != nil {
b.ingresses = NewIngressList().Copy(object.ingresses)
} else {
b.ingresses = nil
}
if object.kubeletConfig != nil {
b.kubeletConfig = NewKubeletConfig().Copy(object.kubeletConfig)
} else {
b.kubeletConfig = nil
}
b.loadBalancerQuota = object.loadBalancerQuota
if object.machinePools != nil {
b.machinePools = NewMachinePoolList().Copy(object.machinePools)
} else {
b.machinePools = nil
}
b.managed = object.managed
if object.managedService != nil {
b.managedService = NewManagedService().Copy(object.managedService)
} else {
b.managedService = nil
}
b.multiAZ = object.multiAZ
b.name = object.name
if object.network != nil {
b.network = NewNetwork().Copy(object.network)
} else {
b.network = nil
}
if object.nodeDrainGracePeriod != nil {
b.nodeDrainGracePeriod = NewValue().Copy(object.nodeDrainGracePeriod)
} else {
b.nodeDrainGracePeriod = nil
}
if object.nodePools != nil {
b.nodePools = NewNodePoolList().Copy(object.nodePools)
} else {
b.nodePools = nil
}
if object.nodes != nil {
b.nodes = NewClusterNodes().Copy(object.nodes)
} else {
b.nodes = nil
}
b.openshiftVersion = object.openshiftVersion
if object.product != nil {
b.product = NewProduct().Copy(object.product)
} else {
b.product = nil
}
if len(object.properties) > 0 {
b.properties = map[string]string{}
for k, v := range object.properties {
b.properties[k] = v
}
} else {
b.properties = nil
}
if object.provisionShard != nil {
b.provisionShard = NewProvisionShard().Copy(object.provisionShard)
} else {
b.provisionShard = nil
}
if object.proxy != nil {
b.proxy = NewProxy().Copy(object.proxy)
} else {
b.proxy = nil
}
if object.region != nil {
b.region = NewCloudRegion().Copy(object.region)
} else {
b.region = nil
}
b.state = object.state
if object.status != nil {
b.status = NewClusterStatus().Copy(object.status)
} else {
b.status = nil