Skip to content

Commit

Permalink
Merge pull request #485 from vkareh/release_v0.1.212
Browse files Browse the repository at this point in the history
Release v0.1.212
  • Loading branch information
vkareh authored Oct 12, 2021
2 parents 25d3791 + 34fff9a commit d0cf6b0
Show file tree
Hide file tree
Showing 26 changed files with 18,937 additions and 14,963 deletions.
9 changes: 9 additions & 0 deletions CHANGES.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
This document describes the relevant changes between releases of the OCM API
SDK.

== 0.1.212 Oct 12 2021

- Fix typo in HTTP internal server error message
- Copy data package from CLI
- Add support for digging inside maps
- Replace expired CA certs for windows
- Update model to 0.0.149
** Add Addon Versions

== 0.1.211 Oct 05 2021

- Update to model 0.0.148:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export GOPROXY=https://proxy.golang.org
export CGO_ENABLED=0

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

# Details of the metamodel to use:
Expand Down
25 changes: 25 additions & 0 deletions clustersmgmt/v1/add_on_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ type AddOnBuilder struct {
resourceName string
subOperators []*AddOnSubOperatorBuilder
targetNamespace string
version *AddOnVersionBuilder
enabled bool
hasExternalResources bool
hidden bool
Expand Down Expand Up @@ -215,6 +216,19 @@ func (b *AddOnBuilder) TargetNamespace(value string) *AddOnBuilder {
return b
}

// Version sets the value of the 'version' attribute to the given value.
//
// Representation of an add-on version.
func (b *AddOnBuilder) Version(value *AddOnVersionBuilder) *AddOnBuilder {
b.version = value
if value != nil {
b.bitmap_ |= 524288
} else {
b.bitmap_ &^= 524288
}
return b
}

// Copy copies the attributes of the given object into this builder, discarding any previous values.
func (b *AddOnBuilder) Copy(object *AddOn) *AddOnBuilder {
if object == nil {
Expand Down Expand Up @@ -257,6 +271,11 @@ func (b *AddOnBuilder) Copy(object *AddOn) *AddOnBuilder {
b.subOperators = nil
}
b.targetNamespace = object.targetNamespace
if object.version != nil {
b.version = NewAddOnVersion().Copy(object.version)
} else {
b.version = nil
}
return b
}

Expand Down Expand Up @@ -303,5 +322,11 @@ func (b *AddOnBuilder) Build() (object *AddOn, err error) {
}
}
object.targetNamespace = b.targetNamespace
if b.version != nil {
object.version, err = b.version.Build()
if err != nil {
return
}
}
return
}
11 changes: 11 additions & 0 deletions clustersmgmt/v1/add_on_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"io/ioutil"
"net/http"
"net/url"
"path"
"time"

jsoniter "github.com/json-iterator/go"
Expand Down Expand Up @@ -81,6 +82,16 @@ func (c *AddOnClient) Update() *AddOnUpdateRequest {
}
}

// Versions returns the target 'add_on_versions' resource.
//
// Reference to the resource that manages the collection of addon versions.
func (c *AddOnClient) Versions() *AddOnVersionsClient {
return NewAddOnVersionsClient(
c.transport,
path.Join(c.path, "versions"),
)
}

// AddOnPollRequest is the request for the Poll method.
type AddOnPollRequest struct {
request *AddOnGetRequest
Expand Down
25 changes: 25 additions & 0 deletions clustersmgmt/v1/add_on_installation_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ type AddOnInstallationBuilder struct {
state AddOnInstallationState
stateDescription string
updatedTimestamp time.Time
version *AddOnVersionBuilder
}

// NewAddOnInstallation creates a new builder of 'add_on_installation' objects.
Expand Down Expand Up @@ -181,6 +182,19 @@ func (b *AddOnInstallationBuilder) UpdatedTimestamp(value time.Time) *AddOnInsta
return b
}

// Version sets the value of the 'version' attribute to the given value.
//
// Representation of an add-on version.
func (b *AddOnInstallationBuilder) Version(value *AddOnVersionBuilder) *AddOnInstallationBuilder {
b.version = value
if value != nil {
b.bitmap_ |= 2048
} else {
b.bitmap_ &^= 2048
}
return b
}

// Copy copies the attributes of the given object into this builder, discarding any previous values.
func (b *AddOnInstallationBuilder) Copy(object *AddOnInstallation) *AddOnInstallationBuilder {
if object == nil {
Expand Down Expand Up @@ -209,6 +223,11 @@ func (b *AddOnInstallationBuilder) Copy(object *AddOnInstallation) *AddOnInstall
b.state = object.state
b.stateDescription = object.stateDescription
b.updatedTimestamp = object.updatedTimestamp
if object.version != nil {
b.version = NewAddOnVersion().Copy(object.version)
} else {
b.version = nil
}
return b
}

Expand Down Expand Up @@ -241,5 +260,11 @@ func (b *AddOnInstallationBuilder) Build() (object *AddOnInstallation, err error
object.state = b.state
object.stateDescription = b.stateDescription
object.updatedTimestamp = b.updatedTimestamp
if b.version != nil {
object.version, err = b.version.Build()
if err != nil {
return
}
}
return
}
24 changes: 24 additions & 0 deletions clustersmgmt/v1/add_on_installation_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ type AddOnInstallation struct {
state AddOnInstallationState
stateDescription string
updatedTimestamp time.Time
version *AddOnVersion
}

// Kind returns the name of the type of the object.
Expand Down Expand Up @@ -293,6 +294,29 @@ func (o *AddOnInstallation) GetUpdatedTimestamp() (value time.Time, ok bool) {
return
}

// Version returns the value of the 'version' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// Link to the installed version of this add-on.
func (o *AddOnInstallation) Version() *AddOnVersion {
if o != nil && o.bitmap_&2048 != 0 {
return o.version
}
return nil
}

// GetVersion returns the value of the 'version' attribute and
// a flag indicating if the attribute has a value.
//
// Link to the installed version of this add-on.
func (o *AddOnInstallation) GetVersion() (value *AddOnVersion, ok bool) {
ok = o != nil && o.bitmap_&2048 != 0
if ok {
value = o.version
}
return
}

// AddOnInstallationListKind is the name of the type used to represent list of objects of
// type 'add_on_installation'.
const AddOnInstallationListKind = "AddOnInstallationList"
Expand Down
13 changes: 13 additions & 0 deletions clustersmgmt/v1/add_on_installation_type_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,15 @@ func writeAddOnInstallation(object *AddOnInstallation, stream *jsoniter.Stream)
stream.WriteString((object.updatedTimestamp).Format(time.RFC3339))
count++
}
present_ = object.bitmap_&2048 != 0 && object.version != nil
if present_ {
if count > 0 {
stream.WriteMore()
}
stream.WriteObjectField("version")
writeAddOnVersion(object.version, stream)
count++
}
stream.WriteObjectEnd()
}

Expand Down Expand Up @@ -235,6 +244,10 @@ func readAddOnInstallation(iterator *jsoniter.Iterator) *AddOnInstallation {
}
object.updatedTimestamp = value
object.bitmap_ |= 1024
case "version":
value := readAddOnVersion(iterator)
object.version = value
object.bitmap_ |= 2048
default:
iterator.ReadAny()
}
Expand Down
12 changes: 12 additions & 0 deletions clustersmgmt/v1/add_on_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ type AddOnServer interface {
//
// Updates the add-on.
Update(ctx context.Context, request *AddOnUpdateServerRequest, response *AddOnUpdateServerResponse) error

// Versions returns the target 'add_on_versions' resource.
//
// Reference to the resource that manages the collection of addon versions.
Versions() AddOnVersionsServer
}

// AddOnDeleteServerRequest is the request for the 'delete' method.
Expand Down Expand Up @@ -156,6 +161,13 @@ func dispatchAddOn(w http.ResponseWriter, r *http.Request, server AddOnServer, s
}
}
switch segments[0] {
case "versions":
target := server.Versions()
if target == nil {
errors.SendNotFound(w, r)
return
}
dispatchAddOnVersions(w, r, target, segments[1:])
default:
errors.SendNotFound(w, r)
return
Expand Down
24 changes: 24 additions & 0 deletions clustersmgmt/v1/add_on_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ type AddOn struct {
resourceName string
subOperators []*AddOnSubOperator
targetNamespace string
version *AddOnVersion
enabled bool
hasExternalResources bool
hidden bool
Expand Down Expand Up @@ -481,6 +482,29 @@ func (o *AddOn) GetTargetNamespace() (value string, ok bool) {
return
}

// Version returns the value of the 'version' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// Link to the current default version of this add-on.
func (o *AddOn) Version() *AddOnVersion {
if o != nil && o.bitmap_&524288 != 0 {
return o.version
}
return nil
}

// GetVersion returns the value of the 'version' attribute and
// a flag indicating if the attribute has a value.
//
// Link to the current default version of this add-on.
func (o *AddOn) GetVersion() (value *AddOnVersion, ok bool) {
ok = o != nil && o.bitmap_&524288 != 0
if ok {
value = o.version
}
return
}

// AddOnListKind is the name of the type used to represent list of objects of
// type 'add_on'.
const AddOnListKind = "AddOnList"
Expand Down
13 changes: 13 additions & 0 deletions clustersmgmt/v1/add_on_type_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,15 @@ func writeAddOn(object *AddOn, stream *jsoniter.Stream) {
stream.WriteString(object.targetNamespace)
count++
}
present_ = object.bitmap_&524288 != 0 && object.version != nil
if present_ {
if count > 0 {
stream.WriteMore()
}
stream.WriteObjectField("version")
writeAddOnVersion(object.version, stream)
count++
}
stream.WriteObjectEnd()
}

Expand Down Expand Up @@ -330,6 +339,10 @@ func readAddOn(iterator *jsoniter.Iterator) *AddOn {
value := iterator.ReadString()
object.targetNamespace = value
object.bitmap_ |= 262144
case "version":
value := readAddOnVersion(iterator)
object.version = value
object.bitmap_ |= 524288
default:
iterator.ReadAny()
}
Expand Down
Loading

0 comments on commit d0cf6b0

Please sign in to comment.