Skip to content

Commit

Permalink
OCM-7288 | feat: bump model to v0.0.375
Browse files Browse the repository at this point in the history
  • Loading branch information
philipwu08 committed May 27, 2024
1 parent 44af134 commit ae6428a
Show file tree
Hide file tree
Showing 14 changed files with 2,661 additions and 1,660 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.422
- Update model version v0.0.375
- Add `ManagementUpgrade` parameters to the `NodePool` model to support additional upgrade configuration.

## 0.1.420
- Update model version v0.0.373
- Add `subnet_resource_id` to `Azure` resource
Expand Down
45 changes: 35 additions & 10 deletions clustersmgmt/v1/node_pool_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type NodePoolBuilder struct {
availabilityZone string
kubeletConfigs []string
labels map[string]string
managementUpgrade *NodePoolManagementUpgradeBuilder
nodeDrainGracePeriod *ValueBuilder
replicas int
status *NodePoolStatusBuilder
Expand Down Expand Up @@ -130,6 +131,19 @@ func (b *NodePoolBuilder) Labels(value map[string]string) *NodePoolBuilder {
return b
}

// ManagementUpgrade sets the value of the 'management_upgrade' attribute to the given value.
//
// Representation of node pool management.
func (b *NodePoolBuilder) ManagementUpgrade(value *NodePoolManagementUpgradeBuilder) *NodePoolBuilder {
b.managementUpgrade = value
if value != nil {
b.bitmap_ |= 512
} else {
b.bitmap_ &^= 512
}
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.
Expand All @@ -153,17 +167,17 @@ func (b *NodePoolBuilder) Labels(value map[string]string) *NodePoolBuilder {
func (b *NodePoolBuilder) NodeDrainGracePeriod(value *ValueBuilder) *NodePoolBuilder {
b.nodeDrainGracePeriod = value
if value != nil {
b.bitmap_ |= 512
b.bitmap_ |= 1024
} else {
b.bitmap_ &^= 512
b.bitmap_ &^= 1024
}
return b
}

// Replicas sets the value of the 'replicas' attribute to the given value.
func (b *NodePoolBuilder) Replicas(value int) *NodePoolBuilder {
b.replicas = value
b.bitmap_ |= 1024
b.bitmap_ |= 2048
return b
}

Expand All @@ -173,33 +187,33 @@ func (b *NodePoolBuilder) Replicas(value int) *NodePoolBuilder {
func (b *NodePoolBuilder) Status(value *NodePoolStatusBuilder) *NodePoolBuilder {
b.status = value
if value != nil {
b.bitmap_ |= 2048
b.bitmap_ |= 4096
} else {
b.bitmap_ &^= 2048
b.bitmap_ &^= 4096
}
return b
}

// Subnet sets the value of the 'subnet' attribute to the given value.
func (b *NodePoolBuilder) Subnet(value string) *NodePoolBuilder {
b.subnet = value
b.bitmap_ |= 4096
b.bitmap_ |= 8192
return b
}

// Taints sets the value of the 'taints' attribute to the given values.
func (b *NodePoolBuilder) Taints(values ...*TaintBuilder) *NodePoolBuilder {
b.taints = make([]*TaintBuilder, len(values))
copy(b.taints, values)
b.bitmap_ |= 8192
b.bitmap_ |= 16384
return b
}

// TuningConfigs sets the value of the 'tuning_configs' attribute to the given values.
func (b *NodePoolBuilder) TuningConfigs(values ...string) *NodePoolBuilder {
b.tuningConfigs = make([]string, len(values))
copy(b.tuningConfigs, values)
b.bitmap_ |= 16384
b.bitmap_ |= 32768
return b
}

Expand All @@ -209,9 +223,9 @@ func (b *NodePoolBuilder) TuningConfigs(values ...string) *NodePoolBuilder {
func (b *NodePoolBuilder) Version(value *VersionBuilder) *NodePoolBuilder {
b.version = value
if value != nil {
b.bitmap_ |= 32768
b.bitmap_ |= 65536
} else {
b.bitmap_ &^= 32768
b.bitmap_ &^= 65536
}
return b
}
Expand Down Expand Up @@ -250,6 +264,11 @@ func (b *NodePoolBuilder) Copy(object *NodePool) *NodePoolBuilder {
} else {
b.labels = nil
}
if object.managementUpgrade != nil {
b.managementUpgrade = NewNodePoolManagementUpgrade().Copy(object.managementUpgrade)
} else {
b.managementUpgrade = nil
}
if object.nodeDrainGracePeriod != nil {
b.nodeDrainGracePeriod = NewValue().Copy(object.nodeDrainGracePeriod)
} else {
Expand Down Expand Up @@ -314,6 +333,12 @@ func (b *NodePoolBuilder) Build() (object *NodePool, err error) {
object.labels[k] = v
}
}
if b.managementUpgrade != nil {
object.managementUpgrade, err = b.managementUpgrade.Build()
if err != nil {
return
}
}
if b.nodeDrainGracePeriod != nil {
object.nodeDrainGracePeriod, err = b.nodeDrainGracePeriod.Build()
if err != nil {
Expand Down
109 changes: 109 additions & 0 deletions clustersmgmt/v1/node_pool_management_upgrade_builder.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
/*
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

// NodePoolManagementUpgradeBuilder contains the data and logic needed to build 'node_pool_management_upgrade' objects.
//
// Representation of node pool management.
type NodePoolManagementUpgradeBuilder struct {
bitmap_ uint32
id string
href string
maxSurge string
maxUnavailable string
type_ string
}

// NewNodePoolManagementUpgrade creates a new builder of 'node_pool_management_upgrade' objects.
func NewNodePoolManagementUpgrade() *NodePoolManagementUpgradeBuilder {
return &NodePoolManagementUpgradeBuilder{}
}

// Link sets the flag that indicates if this is a link.
func (b *NodePoolManagementUpgradeBuilder) Link(value bool) *NodePoolManagementUpgradeBuilder {
b.bitmap_ |= 1
return b
}

// ID sets the identifier of the object.
func (b *NodePoolManagementUpgradeBuilder) ID(value string) *NodePoolManagementUpgradeBuilder {
b.id = value
b.bitmap_ |= 2
return b
}

// HREF sets the link to the object.
func (b *NodePoolManagementUpgradeBuilder) HREF(value string) *NodePoolManagementUpgradeBuilder {
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 *NodePoolManagementUpgradeBuilder) Empty() bool {
return b == nil || b.bitmap_&^1 == 0
}

// MaxSurge sets the value of the 'max_surge' attribute to the given value.
func (b *NodePoolManagementUpgradeBuilder) MaxSurge(value string) *NodePoolManagementUpgradeBuilder {
b.maxSurge = value
b.bitmap_ |= 8
return b
}

// MaxUnavailable sets the value of the 'max_unavailable' attribute to the given value.
func (b *NodePoolManagementUpgradeBuilder) MaxUnavailable(value string) *NodePoolManagementUpgradeBuilder {
b.maxUnavailable = value
b.bitmap_ |= 16
return b
}

// Type sets the value of the 'type' attribute to the given value.
func (b *NodePoolManagementUpgradeBuilder) Type(value string) *NodePoolManagementUpgradeBuilder {
b.type_ = value
b.bitmap_ |= 32
return b
}

// Copy copies the attributes of the given object into this builder, discarding any previous values.
func (b *NodePoolManagementUpgradeBuilder) Copy(object *NodePoolManagementUpgrade) *NodePoolManagementUpgradeBuilder {
if object == nil {
return b
}
b.bitmap_ = object.bitmap_
b.id = object.id
b.href = object.href
b.maxSurge = object.maxSurge
b.maxUnavailable = object.maxUnavailable
b.type_ = object.type_
return b
}

// Build creates a 'node_pool_management_upgrade' object using the configuration stored in the builder.
func (b *NodePoolManagementUpgradeBuilder) Build() (object *NodePoolManagementUpgrade, err error) {
object = new(NodePoolManagementUpgrade)
object.id = b.id
object.href = b.href
object.bitmap_ = b.bitmap_
object.maxSurge = b.maxSurge
object.maxUnavailable = b.maxUnavailable
object.type_ = b.type_
return
}
71 changes: 71 additions & 0 deletions clustersmgmt/v1/node_pool_management_upgrade_list_builder.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
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

// NodePoolManagementUpgradeListBuilder contains the data and logic needed to build
// 'node_pool_management_upgrade' objects.
type NodePoolManagementUpgradeListBuilder struct {
items []*NodePoolManagementUpgradeBuilder
}

// NewNodePoolManagementUpgradeList creates a new builder of 'node_pool_management_upgrade' objects.
func NewNodePoolManagementUpgradeList() *NodePoolManagementUpgradeListBuilder {
return new(NodePoolManagementUpgradeListBuilder)
}

// Items sets the items of the list.
func (b *NodePoolManagementUpgradeListBuilder) Items(values ...*NodePoolManagementUpgradeBuilder) *NodePoolManagementUpgradeListBuilder {
b.items = make([]*NodePoolManagementUpgradeBuilder, len(values))
copy(b.items, values)
return b
}

// Empty returns true if the list is empty.
func (b *NodePoolManagementUpgradeListBuilder) Empty() bool {
return b == nil || len(b.items) == 0
}

// Copy copies the items of the given list into this builder, discarding any previous items.
func (b *NodePoolManagementUpgradeListBuilder) Copy(list *NodePoolManagementUpgradeList) *NodePoolManagementUpgradeListBuilder {
if list == nil || list.items == nil {
b.items = nil
} else {
b.items = make([]*NodePoolManagementUpgradeBuilder, len(list.items))
for i, v := range list.items {
b.items[i] = NewNodePoolManagementUpgrade().Copy(v)
}
}
return b
}

// Build creates a list of 'node_pool_management_upgrade' objects using the
// configuration stored in the builder.
func (b *NodePoolManagementUpgradeListBuilder) Build() (list *NodePoolManagementUpgradeList, err error) {
items := make([]*NodePoolManagementUpgrade, len(b.items))
for i, item := range b.items {
items[i], err = item.Build()
if err != nil {
return
}
}
list = new(NodePoolManagementUpgradeList)
list.items = items
return
}
75 changes: 75 additions & 0 deletions clustersmgmt/v1/node_pool_management_upgrade_list_type_json.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
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 (
"io"

jsoniter "github.com/json-iterator/go"
"github.com/openshift-online/ocm-sdk-go/helpers"
)

// MarshalNodePoolManagementUpgradeList writes a list of values of the 'node_pool_management_upgrade' type to
// the given writer.
func MarshalNodePoolManagementUpgradeList(list []*NodePoolManagementUpgrade, writer io.Writer) error {
stream := helpers.NewStream(writer)
writeNodePoolManagementUpgradeList(list, stream)
err := stream.Flush()
if err != nil {
return err
}
return stream.Error
}

// writeNodePoolManagementUpgradeList writes a list of value of the 'node_pool_management_upgrade' type to
// the given stream.
func writeNodePoolManagementUpgradeList(list []*NodePoolManagementUpgrade, stream *jsoniter.Stream) {
stream.WriteArrayStart()
for i, value := range list {
if i > 0 {
stream.WriteMore()
}
writeNodePoolManagementUpgrade(value, stream)
}
stream.WriteArrayEnd()
}

// UnmarshalNodePoolManagementUpgradeList reads a list of values of the 'node_pool_management_upgrade' type
// from the given source, which can be a slice of bytes, a string or a reader.
func UnmarshalNodePoolManagementUpgradeList(source interface{}) (items []*NodePoolManagementUpgrade, err error) {
iterator, err := helpers.NewIterator(source)
if err != nil {
return
}
items = readNodePoolManagementUpgradeList(iterator)
err = iterator.Error
return
}

// readNodePoolManagementUpgradeList reads list of values of the ”node_pool_management_upgrade' type from
// the given iterator.
func readNodePoolManagementUpgradeList(iterator *jsoniter.Iterator) []*NodePoolManagementUpgrade {
list := []*NodePoolManagementUpgrade{}
for iterator.ReadArray() {
item := readNodePoolManagementUpgrade(iterator)
list = append(list, item)
}
return list
}
Loading

0 comments on commit ae6428a

Please sign in to comment.