Skip to content

Commit

Permalink
Merge pull request #770 from leseb/bump-to-0.0.281
Browse files Browse the repository at this point in the history
Bump model version to v0.0.281
  • Loading branch information
tzvatot authored May 15, 2023
2 parents f06dec5 + 7620be3 commit 8d32b13
Show file tree
Hide file tree
Showing 11 changed files with 2,830 additions and 2,200 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
export CGO_ENABLED=0

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

# Details of the metamodel to use:
Expand Down
27 changes: 26 additions & 1 deletion clustersmgmt/v1/machine_type_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type MachineTypeBuilder struct {
genericName string
memory *ValueBuilder
name string
rootVolume *MachineTypeRootVolumeBuilder
size MachineTypeSize
ccsOnly bool
}
Expand Down Expand Up @@ -169,12 +170,25 @@ func (b *MachineTypeBuilder) Name(value string) *MachineTypeBuilder {
return b
}

// RootVolume sets the value of the 'root_volume' attribute to the given value.
//
// Machine type root volume.
func (b *MachineTypeBuilder) RootVolume(value *MachineTypeRootVolumeBuilder) *MachineTypeBuilder {
b.rootVolume = value
if value != nil {
b.bitmap_ |= 1024
} else {
b.bitmap_ &^= 1024
}
return b
}

// Size sets the value of the 'size' attribute to the given value.
//
// Machine type size.
func (b *MachineTypeBuilder) Size(value MachineTypeSize) *MachineTypeBuilder {
b.size = value
b.bitmap_ |= 1024
b.bitmap_ |= 2048
return b
}

Expand Down Expand Up @@ -205,6 +219,11 @@ func (b *MachineTypeBuilder) Copy(object *MachineType) *MachineTypeBuilder {
b.memory = nil
}
b.name = object.name
if object.rootVolume != nil {
b.rootVolume = NewMachineTypeRootVolume().Copy(object.rootVolume)
} else {
b.rootVolume = nil
}
b.size = object.size
return b
}
Expand Down Expand Up @@ -237,6 +256,12 @@ func (b *MachineTypeBuilder) Build() (object *MachineType, err error) {
}
}
object.name = b.name
if b.rootVolume != nil {
object.rootVolume, err = b.rootVolume.Build()
if err != nil {
return
}
}
object.size = b.size
return
}
103 changes: 103 additions & 0 deletions clustersmgmt/v1/machine_type_root_volume_builder.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/*
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

// MachineTypeRootVolumeBuilder contains the data and logic needed to build 'machine_type_root_volume' objects.
//
// Machine type root volume.
type MachineTypeRootVolumeBuilder struct {
bitmap_ uint32
aws *AWSVolumeBuilder
gcp *GCPVolumeBuilder
}

// NewMachineTypeRootVolume creates a new builder of 'machine_type_root_volume' objects.
func NewMachineTypeRootVolume() *MachineTypeRootVolumeBuilder {
return &MachineTypeRootVolumeBuilder{}
}

// Empty returns true if the builder is empty, i.e. no attribute has a value.
func (b *MachineTypeRootVolumeBuilder) Empty() bool {
return b == nil || b.bitmap_ == 0
}

// AWS sets the value of the 'AWS' attribute to the given value.
//
// Holds settings for an AWS storage volume.
func (b *MachineTypeRootVolumeBuilder) AWS(value *AWSVolumeBuilder) *MachineTypeRootVolumeBuilder {
b.aws = value
if value != nil {
b.bitmap_ |= 1
} else {
b.bitmap_ &^= 1
}
return b
}

// GCP sets the value of the 'GCP' attribute to the given value.
//
// Holds settings for an GCP storage volume.
func (b *MachineTypeRootVolumeBuilder) GCP(value *GCPVolumeBuilder) *MachineTypeRootVolumeBuilder {
b.gcp = value
if value != nil {
b.bitmap_ |= 2
} else {
b.bitmap_ &^= 2
}
return b
}

// Copy copies the attributes of the given object into this builder, discarding any previous values.
func (b *MachineTypeRootVolumeBuilder) Copy(object *MachineTypeRootVolume) *MachineTypeRootVolumeBuilder {
if object == nil {
return b
}
b.bitmap_ = object.bitmap_
if object.aws != nil {
b.aws = NewAWSVolume().Copy(object.aws)
} else {
b.aws = nil
}
if object.gcp != nil {
b.gcp = NewGCPVolume().Copy(object.gcp)
} else {
b.gcp = nil
}
return b
}

// Build creates a 'machine_type_root_volume' object using the configuration stored in the builder.
func (b *MachineTypeRootVolumeBuilder) Build() (object *MachineTypeRootVolume, err error) {
object = new(MachineTypeRootVolume)
object.bitmap_ = b.bitmap_
if b.aws != nil {
object.aws, err = b.aws.Build()
if err != nil {
return
}
}
if b.gcp != nil {
object.gcp, err = b.gcp.Build()
if err != nil {
return
}
}
return
}
71 changes: 71 additions & 0 deletions clustersmgmt/v1/machine_type_root_volume_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

// MachineTypeRootVolumeListBuilder contains the data and logic needed to build
// 'machine_type_root_volume' objects.
type MachineTypeRootVolumeListBuilder struct {
items []*MachineTypeRootVolumeBuilder
}

// NewMachineTypeRootVolumeList creates a new builder of 'machine_type_root_volume' objects.
func NewMachineTypeRootVolumeList() *MachineTypeRootVolumeListBuilder {
return new(MachineTypeRootVolumeListBuilder)
}

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

// Empty returns true if the list is empty.
func (b *MachineTypeRootVolumeListBuilder) 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 *MachineTypeRootVolumeListBuilder) Copy(list *MachineTypeRootVolumeList) *MachineTypeRootVolumeListBuilder {
if list == nil || list.items == nil {
b.items = nil
} else {
b.items = make([]*MachineTypeRootVolumeBuilder, len(list.items))
for i, v := range list.items {
b.items[i] = NewMachineTypeRootVolume().Copy(v)
}
}
return b
}

// Build creates a list of 'machine_type_root_volume' objects using the
// configuration stored in the builder.
func (b *MachineTypeRootVolumeListBuilder) Build() (list *MachineTypeRootVolumeList, err error) {
items := make([]*MachineTypeRootVolume, len(b.items))
for i, item := range b.items {
items[i], err = item.Build()
if err != nil {
return
}
}
list = new(MachineTypeRootVolumeList)
list.items = items
return
}
75 changes: 75 additions & 0 deletions clustersmgmt/v1/machine_type_root_volume_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"
)

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

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

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

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

0 comments on commit 8d32b13

Please sign in to comment.