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

Update model to 0.0.409 #1020

Merged
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.456
- Update model version to v0.0.409
- Update cluster migration state to match API object

## 0.1.455
- Update model version to v0.0.408
- Update cluster migration type constant
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.408
model_version:=v0.0.409
model_url:=https://github.com/openshift-online/ocm-api-model.git

# Details of the metamodel to use:
Expand Down
25 changes: 19 additions & 6 deletions clustersmgmt/v1/cluster_migration_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type ClusterMigrationBuilder struct {
clusterID string
creationTimestamp time.Time
sdnToOvn *SdnToOvnClusterMigrationBuilder
state ClusterMigrationState
state *ClusterMigrationStateBuilder
type_ ClusterMigrationType
updatedTimestamp time.Time
}
Expand Down Expand Up @@ -97,10 +97,14 @@ func (b *ClusterMigrationBuilder) SdnToOvn(value *SdnToOvnClusterMigrationBuilde

// State sets the value of the 'state' attribute to the given value.
//
// The state of the cluster migration.
func (b *ClusterMigrationBuilder) State(value ClusterMigrationState) *ClusterMigrationBuilder {
// Representation of a cluster migration state.
func (b *ClusterMigrationBuilder) State(value *ClusterMigrationStateBuilder) *ClusterMigrationBuilder {
b.state = value
b.bitmap_ |= 64
if value != nil {
b.bitmap_ |= 64
} else {
b.bitmap_ &^= 64
}
return b
}

Expand Down Expand Up @@ -135,7 +139,11 @@ func (b *ClusterMigrationBuilder) Copy(object *ClusterMigration) *ClusterMigrati
} else {
b.sdnToOvn = nil
}
b.state = object.state
if object.state != nil {
b.state = NewClusterMigrationState().Copy(object.state)
} else {
b.state = nil
}
b.type_ = object.type_
b.updatedTimestamp = object.updatedTimestamp
return b
Expand All @@ -155,7 +163,12 @@ func (b *ClusterMigrationBuilder) Build() (object *ClusterMigration, err error)
return
}
}
object.state = b.state
if b.state != nil {
object.state, err = b.state.Build()
if err != nil {
return
}
}
object.type_ = b.type_
object.updatedTimestamp = b.updatedTimestamp
return
Expand Down
75 changes: 75 additions & 0 deletions clustersmgmt/v1/cluster_migration_state_builder.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

// ClusterMigrationStateBuilder contains the data and logic needed to build 'cluster_migration_state' objects.
//
// Representation of a cluster migration state.
type ClusterMigrationStateBuilder struct {
bitmap_ uint32
description string
value ClusterMigrationStateValue
}

// NewClusterMigrationState creates a new builder of 'cluster_migration_state' objects.
func NewClusterMigrationState() *ClusterMigrationStateBuilder {
return &ClusterMigrationStateBuilder{}
}

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

// Description sets the value of the 'description' attribute to the given value.
func (b *ClusterMigrationStateBuilder) Description(value string) *ClusterMigrationStateBuilder {
b.description = value
b.bitmap_ |= 1
return b
}

// Value sets the value of the 'value' attribute to the given value.
//
// The state of the cluster migration.
func (b *ClusterMigrationStateBuilder) Value(value ClusterMigrationStateValue) *ClusterMigrationStateBuilder {
b.value = value
b.bitmap_ |= 2
return b
}

// Copy copies the attributes of the given object into this builder, discarding any previous values.
func (b *ClusterMigrationStateBuilder) Copy(object *ClusterMigrationState) *ClusterMigrationStateBuilder {
if object == nil {
return b
}
b.bitmap_ = object.bitmap_
b.description = object.description
b.value = object.value
return b
}

// Build creates a 'cluster_migration_state' object using the configuration stored in the builder.
func (b *ClusterMigrationStateBuilder) Build() (object *ClusterMigrationState, err error) {
object = new(ClusterMigrationState)
object.bitmap_ = b.bitmap_
object.description = b.description
object.value = b.value
return
}
71 changes: 71 additions & 0 deletions clustersmgmt/v1/cluster_migration_state_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

// ClusterMigrationStateListBuilder contains the data and logic needed to build
// 'cluster_migration_state' objects.
type ClusterMigrationStateListBuilder struct {
items []*ClusterMigrationStateBuilder
}

// NewClusterMigrationStateList creates a new builder of 'cluster_migration_state' objects.
func NewClusterMigrationStateList() *ClusterMigrationStateListBuilder {
return new(ClusterMigrationStateListBuilder)
}

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

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

// Build creates a list of 'cluster_migration_state' objects using the
// configuration stored in the builder.
func (b *ClusterMigrationStateListBuilder) Build() (list *ClusterMigrationStateList, err error) {
items := make([]*ClusterMigrationState, len(b.items))
for i, item := range b.items {
items[i], err = item.Build()
if err != nil {
return
}
}
list = new(ClusterMigrationStateList)
list.items = items
return
}
15 changes: 7 additions & 8 deletions clustersmgmt/v1/cluster_migration_state_list_type_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (

// MarshalClusterMigrationStateList writes a list of values of the 'cluster_migration_state' type to
// the given writer.
func MarshalClusterMigrationStateList(list []ClusterMigrationState, writer io.Writer) error {
func MarshalClusterMigrationStateList(list []*ClusterMigrationState, writer io.Writer) error {
stream := helpers.NewStream(writer)
WriteClusterMigrationStateList(list, stream)
err := stream.Flush()
Expand All @@ -40,20 +40,20 @@ func MarshalClusterMigrationStateList(list []ClusterMigrationState, writer io.Wr

// WriteClusterMigrationStateList writes a list of value of the 'cluster_migration_state' type to
// the given stream.
func WriteClusterMigrationStateList(list []ClusterMigrationState, stream *jsoniter.Stream) {
func WriteClusterMigrationStateList(list []*ClusterMigrationState, stream *jsoniter.Stream) {
stream.WriteArrayStart()
for i, value := range list {
if i > 0 {
stream.WriteMore()
}
stream.WriteString(string(value))
WriteClusterMigrationState(value, stream)
}
stream.WriteArrayEnd()
}

// UnmarshalClusterMigrationStateList reads a list of values of the 'cluster_migration_state' type
// from the given source, which can be a slice of bytes, a string or a reader.
func UnmarshalClusterMigrationStateList(source interface{}) (items []ClusterMigrationState, err error) {
func UnmarshalClusterMigrationStateList(source interface{}) (items []*ClusterMigrationState, err error) {
iterator, err := helpers.NewIterator(source)
if err != nil {
return
Expand All @@ -65,11 +65,10 @@ func UnmarshalClusterMigrationStateList(source interface{}) (items []ClusterMigr

// ReadClusterMigrationStateList reads list of values of the ”cluster_migration_state' type from
// the given iterator.
func ReadClusterMigrationStateList(iterator *jsoniter.Iterator) []ClusterMigrationState {
list := []ClusterMigrationState{}
func ReadClusterMigrationStateList(iterator *jsoniter.Iterator) []*ClusterMigrationState {
list := []*ClusterMigrationState{}
for iterator.ReadArray() {
text := iterator.ReadString()
item := ClusterMigrationState(text)
item := ReadClusterMigrationState(iterator)
list = append(list, item)
}
return list
Expand Down
Loading
Loading