Skip to content

Commit 3a4077b

Browse files
committed
Update sdk to reflect new field in network_verification_type resource
1 parent 00a501c commit 3a4077b

7 files changed

+2566
-2505
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export PATH := $(LOCAL_BIN_PATH):$(PATH)
2727
export CGO_ENABLED=0
2828

2929
# Details of the model to use:
30-
model_version:=v0.0.328
30+
model_version:=v0.0.329
3131
model_url:=https://github.com/openshift-online/ocm-api-model.git
3232

3333
# Details of the metamodel to use:

clustersmgmt/v1/network_verification_builder.go

+12-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ package v1 // github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1
2323
type NetworkVerificationBuilder struct {
2424
bitmap_ uint32
2525
cloudProviderData *CloudProviderDataBuilder
26+
clusterId string
2627
items []*SubnetNetworkVerificationBuilder
2728
total int
2829
}
@@ -50,18 +51,25 @@ func (b *NetworkVerificationBuilder) CloudProviderData(value *CloudProviderDataB
5051
return b
5152
}
5253

54+
// ClusterId sets the value of the 'cluster_id' attribute to the given value.
55+
func (b *NetworkVerificationBuilder) ClusterId(value string) *NetworkVerificationBuilder {
56+
b.clusterId = value
57+
b.bitmap_ |= 2
58+
return b
59+
}
60+
5361
// Items sets the value of the 'items' attribute to the given values.
5462
func (b *NetworkVerificationBuilder) Items(values ...*SubnetNetworkVerificationBuilder) *NetworkVerificationBuilder {
5563
b.items = make([]*SubnetNetworkVerificationBuilder, len(values))
5664
copy(b.items, values)
57-
b.bitmap_ |= 2
65+
b.bitmap_ |= 4
5866
return b
5967
}
6068

6169
// Total sets the value of the 'total' attribute to the given value.
6270
func (b *NetworkVerificationBuilder) Total(value int) *NetworkVerificationBuilder {
6371
b.total = value
64-
b.bitmap_ |= 4
72+
b.bitmap_ |= 8
6573
return b
6674
}
6775

@@ -76,6 +84,7 @@ func (b *NetworkVerificationBuilder) Copy(object *NetworkVerification) *NetworkV
7684
} else {
7785
b.cloudProviderData = nil
7886
}
87+
b.clusterId = object.clusterId
7988
if object.items != nil {
8089
b.items = make([]*SubnetNetworkVerificationBuilder, len(object.items))
8190
for i, v := range object.items {
@@ -98,6 +107,7 @@ func (b *NetworkVerificationBuilder) Build() (object *NetworkVerification, err e
98107
return
99108
}
100109
}
110+
object.clusterId = b.clusterId
101111
if b.items != nil {
102112
object.items = make([]*SubnetNetworkVerification, len(b.items))
103113
for i, v := range b.items {

clustersmgmt/v1/network_verification_type.go

+28-4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ package v1 // github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1
2323
type NetworkVerification struct {
2424
bitmap_ uint32
2525
cloudProviderData *CloudProviderData
26+
clusterId string
2627
items []*SubnetNetworkVerification
2728
total int
2829
}
@@ -55,12 +56,35 @@ func (o *NetworkVerification) GetCloudProviderData() (value *CloudProviderData,
5556
return
5657
}
5758

59+
// ClusterId returns the value of the 'cluster_id' attribute, or
60+
// the zero value of the type if the attribute doesn't have a value.
61+
//
62+
// Cluster ID needed to execute the network verification.
63+
func (o *NetworkVerification) ClusterId() string {
64+
if o != nil && o.bitmap_&2 != 0 {
65+
return o.clusterId
66+
}
67+
return ""
68+
}
69+
70+
// GetClusterId returns the value of the 'cluster_id' attribute and
71+
// a flag indicating if the attribute has a value.
72+
//
73+
// Cluster ID needed to execute the network verification.
74+
func (o *NetworkVerification) GetClusterId() (value string, ok bool) {
75+
ok = o != nil && o.bitmap_&2 != 0
76+
if ok {
77+
value = o.clusterId
78+
}
79+
return
80+
}
81+
5882
// Items returns the value of the 'items' attribute, or
5983
// the zero value of the type if the attribute doesn't have a value.
6084
//
6185
// Details about each subnet network verification.
6286
func (o *NetworkVerification) Items() []*SubnetNetworkVerification {
63-
if o != nil && o.bitmap_&2 != 0 {
87+
if o != nil && o.bitmap_&4 != 0 {
6488
return o.items
6589
}
6690
return nil
@@ -71,7 +95,7 @@ func (o *NetworkVerification) Items() []*SubnetNetworkVerification {
7195
//
7296
// Details about each subnet network verification.
7397
func (o *NetworkVerification) GetItems() (value []*SubnetNetworkVerification, ok bool) {
74-
ok = o != nil && o.bitmap_&2 != 0
98+
ok = o != nil && o.bitmap_&4 != 0
7599
if ok {
76100
value = o.items
77101
}
@@ -83,7 +107,7 @@ func (o *NetworkVerification) GetItems() (value []*SubnetNetworkVerification, ok
83107
//
84108
// Amount of network verifier executions started.
85109
func (o *NetworkVerification) Total() int {
86-
if o != nil && o.bitmap_&4 != 0 {
110+
if o != nil && o.bitmap_&8 != 0 {
87111
return o.total
88112
}
89113
return 0
@@ -94,7 +118,7 @@ func (o *NetworkVerification) Total() int {
94118
//
95119
// Amount of network verifier executions started.
96120
func (o *NetworkVerification) GetTotal() (value int, ok bool) {
97-
ok = o != nil && o.bitmap_&4 != 0
121+
ok = o != nil && o.bitmap_&8 != 0
98122
if ok {
99123
value = o.total
100124
}

clustersmgmt/v1/network_verification_type_json.go

+17-4
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,16 @@ func writeNetworkVerification(object *NetworkVerification, stream *jsoniter.Stre
5151
writeCloudProviderData(object.cloudProviderData, stream)
5252
count++
5353
}
54-
present_ = object.bitmap_&2 != 0 && object.items != nil
54+
present_ = object.bitmap_&2 != 0
55+
if present_ {
56+
if count > 0 {
57+
stream.WriteMore()
58+
}
59+
stream.WriteObjectField("cluster_id")
60+
stream.WriteString(object.clusterId)
61+
count++
62+
}
63+
present_ = object.bitmap_&4 != 0 && object.items != nil
5564
if present_ {
5665
if count > 0 {
5766
stream.WriteMore()
@@ -60,7 +69,7 @@ func writeNetworkVerification(object *NetworkVerification, stream *jsoniter.Stre
6069
writeSubnetNetworkVerificationList(object.items, stream)
6170
count++
6271
}
63-
present_ = object.bitmap_&4 != 0
72+
present_ = object.bitmap_&8 != 0
6473
if present_ {
6574
if count > 0 {
6675
stream.WriteMore()
@@ -96,14 +105,18 @@ func readNetworkVerification(iterator *jsoniter.Iterator) *NetworkVerification {
96105
value := readCloudProviderData(iterator)
97106
object.cloudProviderData = value
98107
object.bitmap_ |= 1
108+
case "cluster_id":
109+
value := iterator.ReadString()
110+
object.clusterId = value
111+
object.bitmap_ |= 2
99112
case "items":
100113
value := readSubnetNetworkVerificationList(iterator)
101114
object.items = value
102-
object.bitmap_ |= 2
115+
object.bitmap_ |= 4
103116
case "total":
104117
value := iterator.ReadInt()
105118
object.total = value
106-
object.bitmap_ |= 4
119+
object.bitmap_ |= 8
107120
default:
108121
iterator.ReadAny()
109122
}

0 commit comments

Comments
 (0)