From bb71822c00607af3694551424c0ebcfa6e1fb0c8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 09:38:27 +0000 Subject: [PATCH] fix(deps): bump github.com/openshift-online/ocm-sdk-go Bumps [github.com/openshift-online/ocm-sdk-go](https://github.com/openshift-online/ocm-sdk-go) from 0.1.455 to 0.1.456. - [Release notes](https://github.com/openshift-online/ocm-sdk-go/releases) - [Changelog](https://github.com/openshift-online/ocm-sdk-go/blob/main/CHANGES.md) - [Commits](https://github.com/openshift-online/ocm-sdk-go/compare/v0.1.455...v0.1.456) --- updated-dependencies: - dependency-name: github.com/openshift-online/ocm-sdk-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 +- .../openshift-online/ocm-sdk-go/CHANGES.md | 4 + .../openshift-online/ocm-sdk-go/Makefile | 2 +- .../v1/cluster_migration_builder.go | 25 ++- .../v1/cluster_migration_state_builder.go | 75 ++++++++ .../cluster_migration_state_list_builder.go | 71 +++++++ .../cluster_migration_state_list_type_json.go | 15 +- .../v1/cluster_migration_state_type.go | 179 ++++++++++++++++-- .../v1/cluster_migration_state_type_json.go | 100 ++++++++++ ...er_migration_state_value_list_type_json.go | 76 ++++++++ .../v1/cluster_migration_state_value_type.go | 32 ++++ .../clustersmgmt/v1/cluster_migration_type.go | 8 +- .../v1/cluster_migration_type_json.go | 7 +- .../ocm-sdk-go/clustersmgmt/v1/openapi.go | 31 +++ .../openshift-online/ocm-sdk-go/version.go | 2 +- vendor/modules.txt | 2 +- 17 files changed, 596 insertions(+), 39 deletions(-) create mode 100644 vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_state_builder.go create mode 100644 vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_state_list_builder.go create mode 100644 vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_state_type_json.go create mode 100644 vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_state_value_list_type_json.go create mode 100644 vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_state_value_type.go diff --git a/go.mod b/go.mod index c90d5cf..83cc4fa 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/onsi/ginkgo/v2 v2.22.2 github.com/onsi/gomega v1.36.2 github.com/openshift-online/ocm-cli v1.0.3 - github.com/openshift-online/ocm-sdk-go v0.1.455 + github.com/openshift-online/ocm-sdk-go v0.1.456 github.com/pterm/pterm v0.12.80 github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 diff --git a/go.sum b/go.sum index ac211c5..c3ced5c 100644 --- a/go.sum +++ b/go.sum @@ -369,8 +369,8 @@ github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8= github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY= github.com/openshift-online/ocm-cli v1.0.3 h1:njnXJ2M6GsQqTQYZrqkEfMBjJEsh+ke0sRdYXDH0AXc= github.com/openshift-online/ocm-cli v1.0.3/go.mod h1:PtVS4FmTHL7l7LYX6VdbeZ+0c4DiI0Y8O4YeohLTbs8= -github.com/openshift-online/ocm-sdk-go v0.1.455 h1:rn2451frlJswFkSzKb+NyZeJbhTdWhiXtajq1PwknaA= -github.com/openshift-online/ocm-sdk-go v0.1.455/go.mod h1:CiAu2jwl3ITKOxkeV0Qnhzv4gs35AmpIzVABQLtcI2Y= +github.com/openshift-online/ocm-sdk-go v0.1.456 h1:N9AmVv8H+FSlld88iCsafy+8Lhykz/1XUrmVhww/BYM= +github.com/openshift-online/ocm-sdk-go v0.1.456/go.mod h1:CiAu2jwl3ITKOxkeV0Qnhzv4gs35AmpIzVABQLtcI2Y= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= diff --git a/vendor/github.com/openshift-online/ocm-sdk-go/CHANGES.md b/vendor/github.com/openshift-online/ocm-sdk-go/CHANGES.md index 4fc4f18..baf6a60 100644 --- a/vendor/github.com/openshift-online/ocm-sdk-go/CHANGES.md +++ b/vendor/github.com/openshift-online/ocm-sdk-go/CHANGES.md @@ -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 diff --git a/vendor/github.com/openshift-online/ocm-sdk-go/Makefile b/vendor/github.com/openshift-online/ocm-sdk-go/Makefile index a3fe213..a687870 100644 --- a/vendor/github.com/openshift-online/ocm-sdk-go/Makefile +++ b/vendor/github.com/openshift-online/ocm-sdk-go/Makefile @@ -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: diff --git a/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_builder.go b/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_builder.go index 95abc77..a302dd4 100644 --- a/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_builder.go +++ b/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_builder.go @@ -33,7 +33,7 @@ type ClusterMigrationBuilder struct { clusterID string creationTimestamp time.Time sdnToOvn *SdnToOvnClusterMigrationBuilder - state ClusterMigrationState + state *ClusterMigrationStateBuilder type_ ClusterMigrationType updatedTimestamp time.Time } @@ -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 } @@ -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 @@ -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 diff --git a/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_state_builder.go b/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_state_builder.go new file mode 100644 index 0000000..b7b833e --- /dev/null +++ b/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_state_builder.go @@ -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 +} diff --git a/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_state_list_builder.go b/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_state_list_builder.go new file mode 100644 index 0000000..a9bfc8b --- /dev/null +++ b/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_state_list_builder.go @@ -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 +} diff --git a/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_state_list_type_json.go b/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_state_list_type_json.go index 8d07abc..d91ef08 100644 --- a/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_state_list_type_json.go +++ b/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_state_list_type_json.go @@ -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() @@ -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 @@ -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 diff --git a/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_state_type.go b/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_state_type.go index 0e0fc9d..d2a812f 100644 --- a/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_state_type.go +++ b/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_state_type.go @@ -19,14 +19,171 @@ limitations under the License. package v1 // github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1 -// ClusterMigrationState represents the values of the 'cluster_migration_state' enumerated type. -type ClusterMigrationState string - -const ( - // - ClusterMigrationStateCompleted ClusterMigrationState = "completed" - // - ClusterMigrationStateInProgress ClusterMigrationState = "in progress" - // - ClusterMigrationStateScheduled ClusterMigrationState = "scheduled" -) +// ClusterMigrationState represents the values of the 'cluster_migration_state' type. +// +// Representation of a cluster migration state. +type ClusterMigrationState struct { + bitmap_ uint32 + description string + value ClusterMigrationStateValue +} + +// Empty returns true if the object is empty, i.e. no attribute has a value. +func (o *ClusterMigrationState) Empty() bool { + return o == nil || o.bitmap_ == 0 +} + +// Description returns the value of the 'description' attribute, or +// the zero value of the type if the attribute doesn't have a value. +// +// A longer description of the current state of the cluster migration. +func (o *ClusterMigrationState) Description() string { + if o != nil && o.bitmap_&1 != 0 { + return o.description + } + return "" +} + +// GetDescription returns the value of the 'description' attribute and +// a flag indicating if the attribute has a value. +// +// A longer description of the current state of the cluster migration. +func (o *ClusterMigrationState) GetDescription() (value string, ok bool) { + ok = o != nil && o.bitmap_&1 != 0 + if ok { + value = o.description + } + return +} + +// Value returns the value of the 'value' attribute, or +// the zero value of the type if the attribute doesn't have a value. +// +// The current state of the cluster migration. +func (o *ClusterMigrationState) Value() ClusterMigrationStateValue { + if o != nil && o.bitmap_&2 != 0 { + return o.value + } + return ClusterMigrationStateValue("") +} + +// GetValue returns the value of the 'value' attribute and +// a flag indicating if the attribute has a value. +// +// The current state of the cluster migration. +func (o *ClusterMigrationState) GetValue() (value ClusterMigrationStateValue, ok bool) { + ok = o != nil && o.bitmap_&2 != 0 + if ok { + value = o.value + } + return +} + +// ClusterMigrationStateListKind is the name of the type used to represent list of objects of +// type 'cluster_migration_state'. +const ClusterMigrationStateListKind = "ClusterMigrationStateList" + +// ClusterMigrationStateListLinkKind is the name of the type used to represent links to list +// of objects of type 'cluster_migration_state'. +const ClusterMigrationStateListLinkKind = "ClusterMigrationStateListLink" + +// ClusterMigrationStateNilKind is the name of the type used to nil lists of objects of +// type 'cluster_migration_state'. +const ClusterMigrationStateListNilKind = "ClusterMigrationStateListNil" + +// ClusterMigrationStateList is a list of values of the 'cluster_migration_state' type. +type ClusterMigrationStateList struct { + href string + link bool + items []*ClusterMigrationState +} + +// Len returns the length of the list. +func (l *ClusterMigrationStateList) Len() int { + if l == nil { + return 0 + } + return len(l.items) +} + +// Items sets the items of the list. +func (l *ClusterMigrationStateList) SetLink(link bool) { + l.link = link +} + +// Items sets the items of the list. +func (l *ClusterMigrationStateList) SetHREF(href string) { + l.href = href +} + +// Items sets the items of the list. +func (l *ClusterMigrationStateList) SetItems(items []*ClusterMigrationState) { + l.items = items +} + +// Items returns the items of the list. +func (l *ClusterMigrationStateList) Items() []*ClusterMigrationState { + if l == nil { + return nil + } + return l.items +} + +// Empty returns true if the list is empty. +func (l *ClusterMigrationStateList) Empty() bool { + return l == nil || len(l.items) == 0 +} + +// Get returns the item of the list with the given index. If there is no item with +// that index it returns nil. +func (l *ClusterMigrationStateList) Get(i int) *ClusterMigrationState { + if l == nil || i < 0 || i >= len(l.items) { + return nil + } + return l.items[i] +} + +// Slice returns an slice containing the items of the list. The returned slice is a +// copy of the one used internally, so it can be modified without affecting the +// internal representation. +// +// If you don't need to modify the returned slice consider using the Each or Range +// functions, as they don't need to allocate a new slice. +func (l *ClusterMigrationStateList) Slice() []*ClusterMigrationState { + var slice []*ClusterMigrationState + if l == nil { + slice = make([]*ClusterMigrationState, 0) + } else { + slice = make([]*ClusterMigrationState, len(l.items)) + copy(slice, l.items) + } + return slice +} + +// Each runs the given function for each item of the list, in order. If the function +// returns false the iteration stops, otherwise it continues till all the elements +// of the list have been processed. +func (l *ClusterMigrationStateList) Each(f func(item *ClusterMigrationState) bool) { + if l == nil { + return + } + for _, item := range l.items { + if !f(item) { + break + } + } +} + +// Range runs the given function for each index and item of the list, in order. If +// the function returns false the iteration stops, otherwise it continues till all +// the elements of the list have been processed. +func (l *ClusterMigrationStateList) Range(f func(index int, item *ClusterMigrationState) bool) { + if l == nil { + return + } + for index, item := range l.items { + if !f(index, item) { + break + } + } +} diff --git a/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_state_type_json.go b/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_state_type_json.go new file mode 100644 index 0000000..e0546e5 --- /dev/null +++ b/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_state_type_json.go @@ -0,0 +1,100 @@ +/* +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" +) + +// MarshalClusterMigrationState writes a value of the 'cluster_migration_state' type to the given writer. +func MarshalClusterMigrationState(object *ClusterMigrationState, writer io.Writer) error { + stream := helpers.NewStream(writer) + WriteClusterMigrationState(object, stream) + err := stream.Flush() + if err != nil { + return err + } + return stream.Error +} + +// WriteClusterMigrationState writes a value of the 'cluster_migration_state' type to the given stream. +func WriteClusterMigrationState(object *ClusterMigrationState, stream *jsoniter.Stream) { + count := 0 + stream.WriteObjectStart() + var present_ bool + present_ = object.bitmap_&1 != 0 + if present_ { + if count > 0 { + stream.WriteMore() + } + stream.WriteObjectField("description") + stream.WriteString(object.description) + count++ + } + present_ = object.bitmap_&2 != 0 + if present_ { + if count > 0 { + stream.WriteMore() + } + stream.WriteObjectField("value") + stream.WriteString(string(object.value)) + } + stream.WriteObjectEnd() +} + +// UnmarshalClusterMigrationState reads a value of the 'cluster_migration_state' type from the given +// source, which can be an slice of bytes, a string or a reader. +func UnmarshalClusterMigrationState(source interface{}) (object *ClusterMigrationState, err error) { + iterator, err := helpers.NewIterator(source) + if err != nil { + return + } + object = ReadClusterMigrationState(iterator) + err = iterator.Error + return +} + +// ReadClusterMigrationState reads a value of the 'cluster_migration_state' type from the given iterator. +func ReadClusterMigrationState(iterator *jsoniter.Iterator) *ClusterMigrationState { + object := &ClusterMigrationState{} + for { + field := iterator.ReadObject() + if field == "" { + break + } + switch field { + case "description": + value := iterator.ReadString() + object.description = value + object.bitmap_ |= 1 + case "value": + text := iterator.ReadString() + value := ClusterMigrationStateValue(text) + object.value = value + object.bitmap_ |= 2 + default: + iterator.ReadAny() + } + } + return object +} diff --git a/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_state_value_list_type_json.go b/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_state_value_list_type_json.go new file mode 100644 index 0000000..cb08c48 --- /dev/null +++ b/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_state_value_list_type_json.go @@ -0,0 +1,76 @@ +/* +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" +) + +// MarshalClusterMigrationStateValueList writes a list of values of the 'cluster_migration_state_value' type to +// the given writer. +func MarshalClusterMigrationStateValueList(list []ClusterMigrationStateValue, writer io.Writer) error { + stream := helpers.NewStream(writer) + WriteClusterMigrationStateValueList(list, stream) + err := stream.Flush() + if err != nil { + return err + } + return stream.Error +} + +// WriteClusterMigrationStateValueList writes a list of value of the 'cluster_migration_state_value' type to +// the given stream. +func WriteClusterMigrationStateValueList(list []ClusterMigrationStateValue, stream *jsoniter.Stream) { + stream.WriteArrayStart() + for i, value := range list { + if i > 0 { + stream.WriteMore() + } + stream.WriteString(string(value)) + } + stream.WriteArrayEnd() +} + +// UnmarshalClusterMigrationStateValueList reads a list of values of the 'cluster_migration_state_value' type +// from the given source, which can be a slice of bytes, a string or a reader. +func UnmarshalClusterMigrationStateValueList(source interface{}) (items []ClusterMigrationStateValue, err error) { + iterator, err := helpers.NewIterator(source) + if err != nil { + return + } + items = ReadClusterMigrationStateValueList(iterator) + err = iterator.Error + return +} + +// ReadClusterMigrationStateValueList reads list of values of the ”cluster_migration_state_value' type from +// the given iterator. +func ReadClusterMigrationStateValueList(iterator *jsoniter.Iterator) []ClusterMigrationStateValue { + list := []ClusterMigrationStateValue{} + for iterator.ReadArray() { + text := iterator.ReadString() + item := ClusterMigrationStateValue(text) + list = append(list, item) + } + return list +} diff --git a/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_state_value_type.go b/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_state_value_type.go new file mode 100644 index 0000000..337c476 --- /dev/null +++ b/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_state_value_type.go @@ -0,0 +1,32 @@ +/* +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 + +// ClusterMigrationStateValue represents the values of the 'cluster_migration_state_value' enumerated type. +type ClusterMigrationStateValue string + +const ( + // + ClusterMigrationStateValueCompleted ClusterMigrationStateValue = "completed" + // + ClusterMigrationStateValueInProgress ClusterMigrationStateValue = "in progress" + // + ClusterMigrationStateValueScheduled ClusterMigrationStateValue = "scheduled" +) diff --git a/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_type.go b/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_type.go index 9c51057..163967a 100644 --- a/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_type.go +++ b/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_type.go @@ -45,7 +45,7 @@ type ClusterMigration struct { clusterID string creationTimestamp time.Time sdnToOvn *SdnToOvnClusterMigration - state ClusterMigrationState + state *ClusterMigrationState type_ ClusterMigrationType updatedTimestamp time.Time } @@ -182,18 +182,18 @@ func (o *ClusterMigration) GetSdnToOvn() (value *SdnToOvnClusterMigration, ok bo // the zero value of the type if the attribute doesn't have a value. // // The state of the cluster migration. -func (o *ClusterMigration) State() ClusterMigrationState { +func (o *ClusterMigration) State() *ClusterMigrationState { if o != nil && o.bitmap_&64 != 0 { return o.state } - return ClusterMigrationState("") + return nil } // GetState returns the value of the 'state' attribute and // a flag indicating if the attribute has a value. // // The state of the cluster migration. -func (o *ClusterMigration) GetState() (value ClusterMigrationState, ok bool) { +func (o *ClusterMigration) GetState() (value *ClusterMigrationState, ok bool) { ok = o != nil && o.bitmap_&64 != 0 if ok { value = o.state diff --git a/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_type_json.go b/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_type_json.go index 97f398a..4aa08df 100644 --- a/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_type_json.go +++ b/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/cluster_migration_type_json.go @@ -93,13 +93,13 @@ func WriteClusterMigration(object *ClusterMigration, stream *jsoniter.Stream) { WriteSdnToOvnClusterMigration(object.sdnToOvn, stream) count++ } - present_ = object.bitmap_&64 != 0 + present_ = object.bitmap_&64 != 0 && object.state != nil if present_ { if count > 0 { stream.WriteMore() } stream.WriteObjectField("state") - stream.WriteString(string(object.state)) + WriteClusterMigrationState(object.state, stream) count++ } present_ = object.bitmap_&128 != 0 @@ -171,8 +171,7 @@ func ReadClusterMigration(iterator *jsoniter.Iterator) *ClusterMigration { object.sdnToOvn = value object.bitmap_ |= 32 case "state": - text := iterator.ReadString() - value := ClusterMigrationState(text) + value := ReadClusterMigrationState(iterator) object.state = value object.bitmap_ |= 64 case "type": diff --git a/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/openapi.go b/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/openapi.go index 7e8666e..8e07ef9 100644 --- a/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/openapi.go +++ b/vendor/github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1/openapi.go @@ -31948,6 +31948,37 @@ var OpenAPI = []byte{ 0x20, 0x20, 0x20, 0x22, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x22, 0x3a, 0x20, 0x7b, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x22, 0x3a, 0x20, 0x22, 0x52, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, + 0x72, 0x20, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x2e, 0x22, 0x2c, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x70, 0x72, + 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0x3a, 0x20, 0x7b, 0xa, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x22, 0x3a, 0x20, 0x7b, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x22, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x22, 0x3a, 0x20, 0x22, 0x41, 0x20, 0x6c, 0x6f, 0x6e, 0x67, 0x65, 0x72, 0x20, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, + 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x20, 0x6f, 0x66, + 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x20, 0x6d, 0x69, 0x67, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x22, 0x2c, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x73, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x7d, 0x2c, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x22, 0x3a, 0x20, 0x7b, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x22, 0x3a, 0x20, 0x22, 0x54, 0x68, 0x65, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, + 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x20, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x22, 0x2c, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, + 0x24, 0x72, 0x65, 0x66, 0x22, 0x3a, 0x20, 0x22, 0x23, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, + 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x2f, 0x43, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x7d, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0xa, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0xa, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x43, + 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x3a, 0x20, 0x7b, 0xa, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3a, 0x20, 0x22, 0x54, 0x68, 0x65, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x20, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x22, 0x2c, 0xa, 0x20, 0x20, 0x20, 0x20, diff --git a/vendor/github.com/openshift-online/ocm-sdk-go/version.go b/vendor/github.com/openshift-online/ocm-sdk-go/version.go index ef46b66..ed626af 100644 --- a/vendor/github.com/openshift-online/ocm-sdk-go/version.go +++ b/vendor/github.com/openshift-online/ocm-sdk-go/version.go @@ -18,4 +18,4 @@ limitations under the License. package sdk -const Version = "0.1.455" +const Version = "0.1.456" diff --git a/vendor/modules.txt b/vendor/modules.txt index 484a22a..1f3dd5d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -258,7 +258,7 @@ github.com/openshift-online/ocm-cli/pkg/info github.com/openshift-online/ocm-cli/pkg/ocm github.com/openshift-online/ocm-cli/pkg/ocm/connection-builder github.com/openshift-online/ocm-cli/pkg/properties -# github.com/openshift-online/ocm-sdk-go v0.1.455 +# github.com/openshift-online/ocm-sdk-go v0.1.456 ## explicit; go 1.21 github.com/openshift-online/ocm-sdk-go github.com/openshift-online/ocm-sdk-go/accesstransparency