Skip to content

Commit

Permalink
Merge pull request #857 from davidleerh/OCM-4450-sdk
Browse files Browse the repository at this point in the history
OCM-4450 | Add ClusterId to network_verification_type
  • Loading branch information
gdbranco authored Oct 23, 2023
2 parents 00a501c + 3f2548f commit d363500
Show file tree
Hide file tree
Showing 9 changed files with 2,641 additions and 2,505 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
This document describes the relevant changes between releases of the OCM API
SDK.

## 0.1.377
- Update model version v0.0.329
- Add get `ClusterId` to `network_verification_type` resource

## 0.1.376
- Update model version v0.0.328
- Add get `VPC` to `Cluster` resource
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export PATH := $(LOCAL_BIN_PATH):$(PATH)
export CGO_ENABLED=0

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

# Details of the metamodel to use:
Expand Down
14 changes: 12 additions & 2 deletions clustersmgmt/v1/network_verification_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ package v1 // github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1
type NetworkVerificationBuilder struct {
bitmap_ uint32
cloudProviderData *CloudProviderDataBuilder
clusterId string
items []*SubnetNetworkVerificationBuilder
total int
}
Expand Down Expand Up @@ -50,18 +51,25 @@ func (b *NetworkVerificationBuilder) CloudProviderData(value *CloudProviderDataB
return b
}

// ClusterId sets the value of the 'cluster_id' attribute to the given value.
func (b *NetworkVerificationBuilder) ClusterId(value string) *NetworkVerificationBuilder {
b.clusterId = value
b.bitmap_ |= 2
return b
}

// Items sets the value of the 'items' attribute to the given values.
func (b *NetworkVerificationBuilder) Items(values ...*SubnetNetworkVerificationBuilder) *NetworkVerificationBuilder {
b.items = make([]*SubnetNetworkVerificationBuilder, len(values))
copy(b.items, values)
b.bitmap_ |= 2
b.bitmap_ |= 4
return b
}

// Total sets the value of the 'total' attribute to the given value.
func (b *NetworkVerificationBuilder) Total(value int) *NetworkVerificationBuilder {
b.total = value
b.bitmap_ |= 4
b.bitmap_ |= 8
return b
}

Expand All @@ -76,6 +84,7 @@ func (b *NetworkVerificationBuilder) Copy(object *NetworkVerification) *NetworkV
} else {
b.cloudProviderData = nil
}
b.clusterId = object.clusterId
if object.items != nil {
b.items = make([]*SubnetNetworkVerificationBuilder, len(object.items))
for i, v := range object.items {
Expand All @@ -98,6 +107,7 @@ func (b *NetworkVerificationBuilder) Build() (object *NetworkVerification, err e
return
}
}
object.clusterId = b.clusterId
if b.items != nil {
object.items = make([]*SubnetNetworkVerification, len(b.items))
for i, v := range b.items {
Expand Down
32 changes: 28 additions & 4 deletions clustersmgmt/v1/network_verification_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ package v1 // github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1
type NetworkVerification struct {
bitmap_ uint32
cloudProviderData *CloudProviderData
clusterId string
items []*SubnetNetworkVerification
total int
}
Expand Down Expand Up @@ -55,12 +56,35 @@ func (o *NetworkVerification) GetCloudProviderData() (value *CloudProviderData,
return
}

// ClusterId returns the value of the 'cluster_id' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// Cluster ID needed to execute the network verification.
func (o *NetworkVerification) ClusterId() string {
if o != nil && o.bitmap_&2 != 0 {
return o.clusterId
}
return ""
}

// GetClusterId returns the value of the 'cluster_id' attribute and
// a flag indicating if the attribute has a value.
//
// Cluster ID needed to execute the network verification.
func (o *NetworkVerification) GetClusterId() (value string, ok bool) {
ok = o != nil && o.bitmap_&2 != 0
if ok {
value = o.clusterId
}
return
}

// Items returns the value of the 'items' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// Details about each subnet network verification.
func (o *NetworkVerification) Items() []*SubnetNetworkVerification {
if o != nil && o.bitmap_&2 != 0 {
if o != nil && o.bitmap_&4 != 0 {
return o.items
}
return nil
Expand All @@ -71,7 +95,7 @@ func (o *NetworkVerification) Items() []*SubnetNetworkVerification {
//
// Details about each subnet network verification.
func (o *NetworkVerification) GetItems() (value []*SubnetNetworkVerification, ok bool) {
ok = o != nil && o.bitmap_&2 != 0
ok = o != nil && o.bitmap_&4 != 0
if ok {
value = o.items
}
Expand All @@ -83,7 +107,7 @@ func (o *NetworkVerification) GetItems() (value []*SubnetNetworkVerification, ok
//
// Amount of network verifier executions started.
func (o *NetworkVerification) Total() int {
if o != nil && o.bitmap_&4 != 0 {
if o != nil && o.bitmap_&8 != 0 {
return o.total
}
return 0
Expand All @@ -94,7 +118,7 @@ func (o *NetworkVerification) Total() int {
//
// Amount of network verifier executions started.
func (o *NetworkVerification) GetTotal() (value int, ok bool) {
ok = o != nil && o.bitmap_&4 != 0
ok = o != nil && o.bitmap_&8 != 0
if ok {
value = o.total
}
Expand Down
21 changes: 17 additions & 4 deletions clustersmgmt/v1/network_verification_type_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,16 @@ func writeNetworkVerification(object *NetworkVerification, stream *jsoniter.Stre
writeCloudProviderData(object.cloudProviderData, stream)
count++
}
present_ = object.bitmap_&2 != 0 && object.items != nil
present_ = object.bitmap_&2 != 0
if present_ {
if count > 0 {
stream.WriteMore()
}
stream.WriteObjectField("cluster_id")
stream.WriteString(object.clusterId)
count++
}
present_ = object.bitmap_&4 != 0 && object.items != nil
if present_ {
if count > 0 {
stream.WriteMore()
Expand All @@ -60,7 +69,7 @@ func writeNetworkVerification(object *NetworkVerification, stream *jsoniter.Stre
writeSubnetNetworkVerificationList(object.items, stream)
count++
}
present_ = object.bitmap_&4 != 0
present_ = object.bitmap_&8 != 0
if present_ {
if count > 0 {
stream.WriteMore()
Expand Down Expand Up @@ -96,14 +105,18 @@ func readNetworkVerification(iterator *jsoniter.Iterator) *NetworkVerification {
value := readCloudProviderData(iterator)
object.cloudProviderData = value
object.bitmap_ |= 1
case "cluster_id":
value := iterator.ReadString()
object.clusterId = value
object.bitmap_ |= 2
case "items":
value := readSubnetNetworkVerificationList(iterator)
object.items = value
object.bitmap_ |= 2
object.bitmap_ |= 4
case "total":
value := iterator.ReadInt()
object.total = value
object.bitmap_ |= 4
object.bitmap_ |= 8
default:
iterator.ReadAny()
}
Expand Down
Loading

0 comments on commit d363500

Please sign in to comment.