Skip to content

Commit

Permalink
Merge pull request #469 from zgalor/changes_v0.1.205
Browse files Browse the repository at this point in the history
Update model version to v0.0.142
  • Loading branch information
zgalor authored Sep 9, 2021
2 parents 64c432f + 60d0a1e commit 45fe3be
Show file tree
Hide file tree
Showing 40 changed files with 13,526 additions and 8,356 deletions.
5 changes: 5 additions & 0 deletions CHANGES.adoc
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.205 Sep 9 2021

- Update model to v0.0.142:
** Add Limited Support Reason API

== 0.1.204 Aug 25 2021

- Change level of token retry messages to `DEBUG`.
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.141
model_version:=v0.0.142
model_url:=https://github.com/openshift-online/ocm-api-model.git

# Details of the metamodel to use:
Expand Down
12 changes: 11 additions & 1 deletion clustersmgmt/v1/cluster_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,16 @@ func (c *ClusterClient) Ingresses() *IngressesClient {
)
}

// LimitedSupportReasons returns the target 'limited_support_reasons' resource.
//
// Reference to cluster limited support reasons.
func (c *ClusterClient) LimitedSupportReasons() *LimitedSupportReasonsClient {
return NewLimitedSupportReasonsClient(
c.transport,
path.Join(c.path, "limited_support_reasons"),
)
}

// Logs returns the target 'logs' resource.
//
// Reference to the resource that manages the collection of logs of the cluster.
Expand Down Expand Up @@ -246,7 +256,7 @@ func (c *ClusterClient) ProvisionShard() *ProvisionShardClient {

// Resources returns the target 'resources' resource.
//
// Reference to cluster resources
// Reference to cluster resources.
func (c *ClusterClient) Resources() *ResourcesClient {
return NewResourcesClient(
c.transport,
Expand Down
14 changes: 13 additions & 1 deletion clustersmgmt/v1/cluster_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ type ClusterServer interface {
// Reference to the resource that manages the collection of ingress resources.
Ingresses() IngressesServer

// LimitedSupportReasons returns the target 'limited_support_reasons' resource.
//
// Reference to cluster limited support reasons.
LimitedSupportReasons() LimitedSupportReasonsServer

// Logs returns the target 'logs' resource.
//
// Reference to the resource that manages the collection of logs of the cluster.
Expand Down Expand Up @@ -129,7 +134,7 @@ type ClusterServer interface {

// Resources returns the target 'resources' resource.
//
// Reference to cluster resources
// Reference to cluster resources.
Resources() ResourcesServer

// Status returns the target 'cluster_status' resource.
Expand Down Expand Up @@ -387,6 +392,13 @@ func dispatchCluster(w http.ResponseWriter, r *http.Request, server ClusterServe
return
}
dispatchIngresses(w, r, target, segments[1:])
case "limited_support_reasons":
target := server.LimitedSupportReasons()
if target == nil {
errors.SendNotFound(w, r)
return
}
dispatchLimitedSupportReasons(w, r, target, segments[1:])
case "logs":
target := server.Logs()
if target == nil {
Expand Down
73 changes: 73 additions & 0 deletions clustersmgmt/v1/detection_type_list_type_json.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
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"
)

// MarshalDetectionTypeList writes a list of values of the 'detection_type' type to
// the given writer.
func MarshalDetectionTypeList(list []DetectionType, writer io.Writer) error {
stream := helpers.NewStream(writer)
writeDetectionTypeList(list, stream)
stream.Flush()
return stream.Error
}

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

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

// readDetectionTypeList reads list of values of the ''detection_type' type from
// the given iterator.
func readDetectionTypeList(iterator *jsoniter.Iterator) []DetectionType {
list := []DetectionType{}
for iterator.ReadArray() {
text := iterator.ReadString()
item := DetectionType(text)
list = append(list, item)
}
return list
}
30 changes: 30 additions & 0 deletions clustersmgmt/v1/detection_type_type.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
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

// DetectionType represents the values of the 'detection_type' enumerated type.
type DetectionType string

const (
//
DetectionTypeAuto DetectionType = "auto"
//
DetectionTypeManual DetectionType = "manual"
)
151 changes: 151 additions & 0 deletions clustersmgmt/v1/limited_support_reason_builder.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
/*
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 (
time "time"
)

// LimitedSupportReasonBuilder contains the data and logic needed to build 'limited_support_reason' objects.
//
// A reason that a cluster is in limited support.
type LimitedSupportReasonBuilder struct {
bitmap_ uint32
id string
href string
creationTimestamp time.Time
details string
detectionType DetectionType
summary string
template *LimitedSupportReasonTemplateBuilder
}

// NewLimitedSupportReason creates a new builder of 'limited_support_reason' objects.
func NewLimitedSupportReason() *LimitedSupportReasonBuilder {
return &LimitedSupportReasonBuilder{}
}

// Link sets the flag that indicates if this is a link.
func (b *LimitedSupportReasonBuilder) Link(value bool) *LimitedSupportReasonBuilder {
b.bitmap_ |= 1
return b
}

// ID sets the identifier of the object.
func (b *LimitedSupportReasonBuilder) ID(value string) *LimitedSupportReasonBuilder {
b.id = value
b.bitmap_ |= 2
return b
}

// HREF sets the link to the object.
func (b *LimitedSupportReasonBuilder) HREF(value string) *LimitedSupportReasonBuilder {
b.href = value
b.bitmap_ |= 4
return b
}

// CreationTimestamp sets the value of the 'creation_timestamp' attribute to the given value.
//
//
func (b *LimitedSupportReasonBuilder) CreationTimestamp(value time.Time) *LimitedSupportReasonBuilder {
b.creationTimestamp = value
b.bitmap_ |= 8
return b
}

// Details sets the value of the 'details' attribute to the given value.
//
//
func (b *LimitedSupportReasonBuilder) Details(value string) *LimitedSupportReasonBuilder {
b.details = value
b.bitmap_ |= 16
return b
}

// DetectionType sets the value of the 'detection_type' attribute to the given value.
//
//
func (b *LimitedSupportReasonBuilder) DetectionType(value DetectionType) *LimitedSupportReasonBuilder {
b.detectionType = value
b.bitmap_ |= 32
return b
}

// Summary sets the value of the 'summary' attribute to the given value.
//
//
func (b *LimitedSupportReasonBuilder) Summary(value string) *LimitedSupportReasonBuilder {
b.summary = value
b.bitmap_ |= 64
return b
}

// Template sets the value of the 'template' attribute to the given value.
//
// A template for cluster limited support reason.
func (b *LimitedSupportReasonBuilder) Template(value *LimitedSupportReasonTemplateBuilder) *LimitedSupportReasonBuilder {
b.template = value
if value != nil {
b.bitmap_ |= 128
} else {
b.bitmap_ &^= 128
}
return b
}

// Copy copies the attributes of the given object into this builder, discarding any previous values.
func (b *LimitedSupportReasonBuilder) Copy(object *LimitedSupportReason) *LimitedSupportReasonBuilder {
if object == nil {
return b
}
b.bitmap_ = object.bitmap_
b.id = object.id
b.href = object.href
b.creationTimestamp = object.creationTimestamp
b.details = object.details
b.detectionType = object.detectionType
b.summary = object.summary
if object.template != nil {
b.template = NewLimitedSupportReasonTemplate().Copy(object.template)
} else {
b.template = nil
}
return b
}

// Build creates a 'limited_support_reason' object using the configuration stored in the builder.
func (b *LimitedSupportReasonBuilder) Build() (object *LimitedSupportReason, err error) {
object = new(LimitedSupportReason)
object.id = b.id
object.href = b.href
object.bitmap_ = b.bitmap_
object.creationTimestamp = b.creationTimestamp
object.details = b.details
object.detectionType = b.detectionType
object.summary = b.summary
if b.template != nil {
object.template, err = b.template.Build()
if err != nil {
return
}
}
return
}
Loading

0 comments on commit 45fe3be

Please sign in to comment.