Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCM-5312 | Add Platform to subnet_network_verification_type #881

Merged
merged 2 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.390
- Update model version v0.0.343
- Add `Platform`to `subnet_network_verification_type` resource

## 0.1.389
- Update model version v0.0.342
- Add `Search` and `Order` methods to List `/api/clusters_mgmt/v1/clusters/{id}/node_pools`
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.342
model_version:=v0.0.343
model_url:=https://github.com/openshift-online/ocm-api-model.git

# Details of the metamodel to use:
Expand Down
3,508 changes: 1,761 additions & 1,747 deletions clustersmgmt/v1/openapi.go

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions clustersmgmt/v1/platform_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ const (
//
PlatformAws Platform = "aws"
//
PlatformAwsClassic Platform = "aws-classic"
//
PlatformAwsHostedCp Platform = "aws-hosted-cp"
//
PlatformGcp Platform = "gcp"
//
PlatformHostedCluster Platform = "hostedcluster"
Expand Down
30 changes: 21 additions & 9 deletions clustersmgmt/v1/subnet_network_verification_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ package v1 // github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1

// SubnetNetworkVerificationBuilder contains the data and logic needed to build 'subnet_network_verification' objects.
type SubnetNetworkVerificationBuilder struct {
bitmap_ uint32
id string
href string
details []string
state string
tags map[string]string
bitmap_ uint32
id string
href string
details []string
platform Platform
state string
tags map[string]string
}

// NewSubnetNetworkVerification creates a new builder of 'subnet_network_verification' objects.
Expand Down Expand Up @@ -67,20 +68,29 @@ func (b *SubnetNetworkVerificationBuilder) Details(values ...string) *SubnetNetw
return b
}

// Platform sets the value of the 'platform' attribute to the given value.
//
// Representation of an platform type field.
func (b *SubnetNetworkVerificationBuilder) Platform(value Platform) *SubnetNetworkVerificationBuilder {
b.platform = value
b.bitmap_ |= 16
return b
}

// State sets the value of the 'state' attribute to the given value.
func (b *SubnetNetworkVerificationBuilder) State(value string) *SubnetNetworkVerificationBuilder {
b.state = value
b.bitmap_ |= 16
b.bitmap_ |= 32
return b
}

// Tags sets the value of the 'tags' attribute to the given value.
func (b *SubnetNetworkVerificationBuilder) Tags(value map[string]string) *SubnetNetworkVerificationBuilder {
b.tags = value
if value != nil {
b.bitmap_ |= 32
b.bitmap_ |= 64
} else {
b.bitmap_ &^= 32
b.bitmap_ &^= 64
}
return b
}
Expand All @@ -99,6 +109,7 @@ func (b *SubnetNetworkVerificationBuilder) Copy(object *SubnetNetworkVerificatio
} else {
b.details = nil
}
b.platform = object.platform
b.state = object.state
if len(object.tags) > 0 {
b.tags = map[string]string{}
Expand All @@ -121,6 +132,7 @@ func (b *SubnetNetworkVerificationBuilder) Build() (object *SubnetNetworkVerific
object.details = make([]string, len(b.details))
copy(object.details, b.details)
}
object.platform = b.platform
object.state = b.state
if b.tags != nil {
object.tags = make(map[string]string)
Expand Down
44 changes: 34 additions & 10 deletions clustersmgmt/v1/subnet_network_verification_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ const SubnetNetworkVerificationNilKind = "SubnetNetworkVerificationNil"

// SubnetNetworkVerification represents the values of the 'subnet_network_verification' type.
type SubnetNetworkVerification struct {
bitmap_ uint32
id string
href string
details []string
state string
tags map[string]string
bitmap_ uint32
id string
href string
details []string
platform Platform
state string
tags map[string]string
}

// Kind returns the name of the type of the object.
Expand Down Expand Up @@ -121,12 +122,35 @@ func (o *SubnetNetworkVerification) GetDetails() (value []string, ok bool) {
return
}

// Platform returns the value of the 'platform' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// Platform supplied to the network verifier for this subnet.
func (o *SubnetNetworkVerification) Platform() Platform {
if o != nil && o.bitmap_&16 != 0 {
return o.platform
}
return Platform("")
}

// GetPlatform returns the value of the 'platform' attribute and
// a flag indicating if the attribute has a value.
//
// Platform supplied to the network verifier for this subnet.
func (o *SubnetNetworkVerification) GetPlatform() (value Platform, ok bool) {
ok = o != nil && o.bitmap_&16 != 0
if ok {
value = o.platform
}
return
}

// State returns the value of the 'state' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// State of the subnet network verification.
func (o *SubnetNetworkVerification) State() string {
if o != nil && o.bitmap_&16 != 0 {
if o != nil && o.bitmap_&32 != 0 {
return o.state
}
return ""
Expand All @@ -137,7 +161,7 @@ func (o *SubnetNetworkVerification) State() string {
//
// State of the subnet network verification.
func (o *SubnetNetworkVerification) GetState() (value string, ok bool) {
ok = o != nil && o.bitmap_&16 != 0
ok = o != nil && o.bitmap_&32 != 0
if ok {
value = o.state
}
Expand All @@ -149,7 +173,7 @@ func (o *SubnetNetworkVerification) GetState() (value string, ok bool) {
//
// Tags supplied to the network verifier for this subnet.
func (o *SubnetNetworkVerification) Tags() map[string]string {
if o != nil && o.bitmap_&32 != 0 {
if o != nil && o.bitmap_&64 != 0 {
return o.tags
}
return nil
Expand All @@ -160,7 +184,7 @@ func (o *SubnetNetworkVerification) Tags() map[string]string {
//
// Tags supplied to the network verifier for this subnet.
func (o *SubnetNetworkVerification) GetTags() (value map[string]string, ok bool) {
ok = o != nil && o.bitmap_&32 != 0
ok = o != nil && o.bitmap_&64 != 0
if ok {
value = o.tags
}
Expand Down
20 changes: 17 additions & 3 deletions clustersmgmt/v1/subnet_network_verification_type_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ func writeSubnetNetworkVerification(object *SubnetNetworkVerification, stream *j
count++
}
present_ = object.bitmap_&16 != 0
if present_ {
if count > 0 {
stream.WriteMore()
}
stream.WriteObjectField("platform")
stream.WriteString(string(object.platform))
count++
}
present_ = object.bitmap_&32 != 0
if present_ {
if count > 0 {
stream.WriteMore()
Expand All @@ -84,7 +93,7 @@ func writeSubnetNetworkVerification(object *SubnetNetworkVerification, stream *j
stream.WriteString(object.state)
count++
}
present_ = object.bitmap_&32 != 0 && object.tags != nil
present_ = object.bitmap_&64 != 0 && object.tags != nil
if present_ {
if count > 0 {
stream.WriteMore()
Expand Down Expand Up @@ -151,10 +160,15 @@ func readSubnetNetworkVerification(iterator *jsoniter.Iterator) *SubnetNetworkVe
value := readStringList(iterator)
object.details = value
object.bitmap_ |= 8
case "platform":
text := iterator.ReadString()
value := Platform(text)
object.platform = value
object.bitmap_ |= 16
case "state":
value := iterator.ReadString()
object.state = value
object.bitmap_ |= 16
object.bitmap_ |= 32
case "tags":
value := map[string]string{}
for {
Expand All @@ -166,7 +180,7 @@ func readSubnetNetworkVerification(iterator *jsoniter.Iterator) *SubnetNetworkVe
value[key] = item
}
object.tags = value
object.bitmap_ |= 32
object.bitmap_ |= 64
default:
iterator.ReadAny()
}
Expand Down
6 changes: 6 additions & 0 deletions openapi/clusters_mgmt/v1/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -15892,6 +15892,8 @@
"type": "string",
"enum": [
"aws",
"aws-classic",
"aws-hosted-cp",
"gcp",
"hostedcluster"
]
Expand Down Expand Up @@ -16274,6 +16276,10 @@
"type": "string"
}
},
"platform": {
"description": "Platform supplied to the network verifier for this subnet.",
"$ref": "#/components/schemas/Platform"
},
"state": {
"description": "State of the subnet network verification.",
"type": "string"
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ limitations under the License.

package sdk

const Version = "0.1.389"
const Version = "0.1.390"
Loading