Skip to content

Commit

Permalink
Merge pull request #889 from chenz4027/OCM-5461
Browse files Browse the repository at this point in the history
OCM-5461 | feat: Prepare v0.1.394 release
  • Loading branch information
ciaranRoche authored Jan 26, 2024
2 parents 6a9b49f + f5300c2 commit 27331ff
Show file tree
Hide file tree
Showing 8 changed files with 409 additions and 333 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
This document describes the relevant changes between releases of the OCM API
SDK.

## 0.1.394
- Added Device Code flow to `authentication`
- Update model version v0.0.347
- Add `HostedControlPlaneDefault` boolean to `Version` Type model.

## 0.1.393
- Add authentication using OAuth2 and PCKE
- Add secure token storage
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.346
model_version:=v0.0.347
model_url:=https://github.com/openshift-online/ocm-api-model.git

# Details of the metamodel to use:
Expand Down
640 changes: 329 additions & 311 deletions clustersmgmt/v1/openapi.go

Large diffs are not rendered by default.

20 changes: 15 additions & 5 deletions clustersmgmt/v1/version_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ type VersionBuilder struct {
rosaEnabled bool
default_ bool
enabled bool
hostedControlPlaneDefault bool
hostedControlPlaneEnabled bool
}

Expand Down Expand Up @@ -123,10 +124,17 @@ func (b *VersionBuilder) EndOfLifeTimestamp(value time.Time) *VersionBuilder {
return b
}

// HostedControlPlaneDefault sets the value of the 'hosted_control_plane_default' attribute to the given value.
func (b *VersionBuilder) HostedControlPlaneDefault(value bool) *VersionBuilder {
b.hostedControlPlaneDefault = value
b.bitmap_ |= 1024
return b
}

// HostedControlPlaneEnabled sets the value of the 'hosted_control_plane_enabled' attribute to the given value.
func (b *VersionBuilder) HostedControlPlaneEnabled(value bool) *VersionBuilder {
b.hostedControlPlaneEnabled = value
b.bitmap_ |= 1024
b.bitmap_ |= 2048
return b
}

Expand All @@ -136,24 +144,24 @@ func (b *VersionBuilder) HostedControlPlaneEnabled(value bool) *VersionBuilder {
func (b *VersionBuilder) ImageOverrides(value *ImageOverridesBuilder) *VersionBuilder {
b.imageOverrides = value
if value != nil {
b.bitmap_ |= 2048
b.bitmap_ |= 4096
} else {
b.bitmap_ &^= 2048
b.bitmap_ &^= 4096
}
return b
}

// RawID sets the value of the 'raw_ID' attribute to the given value.
func (b *VersionBuilder) RawID(value string) *VersionBuilder {
b.rawID = value
b.bitmap_ |= 4096
b.bitmap_ |= 8192
return b
}

// ReleaseImage sets the value of the 'release_image' attribute to the given value.
func (b *VersionBuilder) ReleaseImage(value string) *VersionBuilder {
b.releaseImage = value
b.bitmap_ |= 8192
b.bitmap_ |= 16384
return b
}

Expand All @@ -177,6 +185,7 @@ func (b *VersionBuilder) Copy(object *Version) *VersionBuilder {
b.default_ = object.default_
b.enabled = object.enabled
b.endOfLifeTimestamp = object.endOfLifeTimestamp
b.hostedControlPlaneDefault = object.hostedControlPlaneDefault
b.hostedControlPlaneEnabled = object.hostedControlPlaneEnabled
if object.imageOverrides != nil {
b.imageOverrides = NewImageOverrides().Copy(object.imageOverrides)
Expand Down Expand Up @@ -204,6 +213,7 @@ func (b *VersionBuilder) Build() (object *Version, err error) {
object.default_ = b.default_
object.enabled = b.enabled
object.endOfLifeTimestamp = b.endOfLifeTimestamp
object.hostedControlPlaneDefault = b.hostedControlPlaneDefault
object.hostedControlPlaneEnabled = b.hostedControlPlaneEnabled
if b.imageOverrides != nil {
object.imageOverrides, err = b.imageOverrides.Build()
Expand Down
42 changes: 34 additions & 8 deletions clustersmgmt/v1/version_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ type Version struct {
rosaEnabled bool
default_ bool
enabled bool
hostedControlPlaneDefault bool
hostedControlPlaneEnabled bool
}

Expand Down Expand Up @@ -281,12 +282,37 @@ func (o *Version) GetEndOfLifeTimestamp() (value time.Time, ok bool) {
return
}

// HostedControlPlaneDefault returns the value of the 'hosted_control_plane_default' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// HostedControlPlaneDefault is a flag that indicates if this should be selected as the default version when a
// HCP cluster is created without specifying explicitly the version.
func (o *Version) HostedControlPlaneDefault() bool {
if o != nil && o.bitmap_&1024 != 0 {
return o.hostedControlPlaneDefault
}
return false
}

// GetHostedControlPlaneDefault returns the value of the 'hosted_control_plane_default' attribute and
// a flag indicating if the attribute has a value.
//
// HostedControlPlaneDefault is a flag that indicates if this should be selected as the default version when a
// HCP cluster is created without specifying explicitly the version.
func (o *Version) GetHostedControlPlaneDefault() (value bool, ok bool) {
ok = o != nil && o.bitmap_&1024 != 0
if ok {
value = o.hostedControlPlaneDefault
}
return
}

// HostedControlPlaneEnabled returns the value of the 'hosted_control_plane_enabled' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// HostedControlPlaneEnabled indicates whether this version can be used to create HCP clusters.
func (o *Version) HostedControlPlaneEnabled() bool {
if o != nil && o.bitmap_&1024 != 0 {
if o != nil && o.bitmap_&2048 != 0 {
return o.hostedControlPlaneEnabled
}
return false
Expand All @@ -297,7 +323,7 @@ func (o *Version) HostedControlPlaneEnabled() bool {
//
// HostedControlPlaneEnabled indicates whether this version can be used to create HCP clusters.
func (o *Version) GetHostedControlPlaneEnabled() (value bool, ok bool) {
ok = o != nil && o.bitmap_&1024 != 0
ok = o != nil && o.bitmap_&2048 != 0
if ok {
value = o.hostedControlPlaneEnabled
}
Expand All @@ -309,7 +335,7 @@ func (o *Version) GetHostedControlPlaneEnabled() (value bool, ok bool) {
//
// ImageOverrides contains the lists of images per cloud provider.
func (o *Version) ImageOverrides() *ImageOverrides {
if o != nil && o.bitmap_&2048 != 0 {
if o != nil && o.bitmap_&4096 != 0 {
return o.imageOverrides
}
return nil
Expand All @@ -320,7 +346,7 @@ func (o *Version) ImageOverrides() *ImageOverrides {
//
// ImageOverrides contains the lists of images per cloud provider.
func (o *Version) GetImageOverrides() (value *ImageOverrides, ok bool) {
ok = o != nil && o.bitmap_&2048 != 0
ok = o != nil && o.bitmap_&4096 != 0
if ok {
value = o.imageOverrides
}
Expand All @@ -332,7 +358,7 @@ func (o *Version) GetImageOverrides() (value *ImageOverrides, ok bool) {
//
// RawID is the id of the version - without channel group and prefix.
func (o *Version) RawID() string {
if o != nil && o.bitmap_&4096 != 0 {
if o != nil && o.bitmap_&8192 != 0 {
return o.rawID
}
return ""
Expand All @@ -343,7 +369,7 @@ func (o *Version) RawID() string {
//
// RawID is the id of the version - without channel group and prefix.
func (o *Version) GetRawID() (value string, ok bool) {
ok = o != nil && o.bitmap_&4096 != 0
ok = o != nil && o.bitmap_&8192 != 0
if ok {
value = o.rawID
}
Expand All @@ -355,7 +381,7 @@ func (o *Version) GetRawID() (value string, ok bool) {
//
// ReleaseImage contains the URI of Openshift release image.
func (o *Version) ReleaseImage() string {
if o != nil && o.bitmap_&8192 != 0 {
if o != nil && o.bitmap_&16384 != 0 {
return o.releaseImage
}
return ""
Expand All @@ -366,7 +392,7 @@ func (o *Version) ReleaseImage() string {
//
// ReleaseImage contains the URI of Openshift release image.
func (o *Version) GetReleaseImage() (value string, ok bool) {
ok = o != nil && o.bitmap_&8192 != 0
ok = o != nil && o.bitmap_&16384 != 0
if ok {
value = o.releaseImage
}
Expand Down
27 changes: 20 additions & 7 deletions clustersmgmt/v1/version_type_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,15 @@ func writeVersion(object *Version, stream *jsoniter.Stream) {
count++
}
present_ = object.bitmap_&1024 != 0
if present_ {
if count > 0 {
stream.WriteMore()
}
stream.WriteObjectField("hosted_control_plane_default")
stream.WriteBool(object.hostedControlPlaneDefault)
count++
}
present_ = object.bitmap_&2048 != 0
if present_ {
if count > 0 {
stream.WriteMore()
Expand All @@ -138,7 +147,7 @@ func writeVersion(object *Version, stream *jsoniter.Stream) {
stream.WriteBool(object.hostedControlPlaneEnabled)
count++
}
present_ = object.bitmap_&2048 != 0 && object.imageOverrides != nil
present_ = object.bitmap_&4096 != 0 && object.imageOverrides != nil
if present_ {
if count > 0 {
stream.WriteMore()
Expand All @@ -147,7 +156,7 @@ func writeVersion(object *Version, stream *jsoniter.Stream) {
writeImageOverrides(object.imageOverrides, stream)
count++
}
present_ = object.bitmap_&4096 != 0
present_ = object.bitmap_&8192 != 0
if present_ {
if count > 0 {
stream.WriteMore()
Expand All @@ -156,7 +165,7 @@ func writeVersion(object *Version, stream *jsoniter.Stream) {
stream.WriteString(object.rawID)
count++
}
present_ = object.bitmap_&8192 != 0
present_ = object.bitmap_&16384 != 0
if present_ {
if count > 0 {
stream.WriteMore()
Expand Down Expand Up @@ -231,22 +240,26 @@ func readVersion(iterator *jsoniter.Iterator) *Version {
}
object.endOfLifeTimestamp = value
object.bitmap_ |= 512
case "hosted_control_plane_default":
value := iterator.ReadBool()
object.hostedControlPlaneDefault = value
object.bitmap_ |= 1024
case "hosted_control_plane_enabled":
value := iterator.ReadBool()
object.hostedControlPlaneEnabled = value
object.bitmap_ |= 1024
object.bitmap_ |= 2048
case "image_overrides":
value := readImageOverrides(iterator)
object.imageOverrides = value
object.bitmap_ |= 2048
object.bitmap_ |= 4096
case "raw_id":
value := iterator.ReadString()
object.rawID = value
object.bitmap_ |= 4096
object.bitmap_ |= 8192
case "release_image":
value := iterator.ReadString()
object.releaseImage = value
object.bitmap_ |= 8192
object.bitmap_ |= 16384
default:
iterator.ReadAny()
}
Expand Down
4 changes: 4 additions & 0 deletions openapi/clusters_mgmt/v1/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -16634,6 +16634,10 @@
"type": "string",
"format": "date-time"
},
"hosted_control_plane_default": {
"description": "HostedControlPlaneDefault is a flag that indicates if this should be selected as the default version when a\nHCP cluster is created without specifying explicitly the version.",
"type": "boolean"
},
"hosted_control_plane_enabled": {
"description": "HostedControlPlaneEnabled indicates whether this version can be used to create HCP clusters.",
"type": "boolean"
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.393"
const Version = "0.1.394"

0 comments on commit 27331ff

Please sign in to comment.