-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #922 from gdbranco/feat/ocm-6454
OCM-6454 | feat: bump model to .360 and example
- Loading branch information
Showing
16 changed files
with
6,323 additions
and
5,268 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
/* | ||
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 | ||
|
||
// ComponentRouteBuilder contains the data and logic needed to build 'component_route' objects. | ||
// | ||
// Representation of a Component Route. | ||
type ComponentRouteBuilder struct { | ||
bitmap_ uint32 | ||
id string | ||
href string | ||
hostname string | ||
tlsSecretRef string | ||
} | ||
|
||
// NewComponentRoute creates a new builder of 'component_route' objects. | ||
func NewComponentRoute() *ComponentRouteBuilder { | ||
return &ComponentRouteBuilder{} | ||
} | ||
|
||
// Link sets the flag that indicates if this is a link. | ||
func (b *ComponentRouteBuilder) Link(value bool) *ComponentRouteBuilder { | ||
b.bitmap_ |= 1 | ||
return b | ||
} | ||
|
||
// ID sets the identifier of the object. | ||
func (b *ComponentRouteBuilder) ID(value string) *ComponentRouteBuilder { | ||
b.id = value | ||
b.bitmap_ |= 2 | ||
return b | ||
} | ||
|
||
// HREF sets the link to the object. | ||
func (b *ComponentRouteBuilder) HREF(value string) *ComponentRouteBuilder { | ||
b.href = value | ||
b.bitmap_ |= 4 | ||
return b | ||
} | ||
|
||
// Empty returns true if the builder is empty, i.e. no attribute has a value. | ||
func (b *ComponentRouteBuilder) Empty() bool { | ||
return b == nil || b.bitmap_&^1 == 0 | ||
} | ||
|
||
// Hostname sets the value of the 'hostname' attribute to the given value. | ||
func (b *ComponentRouteBuilder) Hostname(value string) *ComponentRouteBuilder { | ||
b.hostname = value | ||
b.bitmap_ |= 8 | ||
return b | ||
} | ||
|
||
// TlsSecretRef sets the value of the 'tls_secret_ref' attribute to the given value. | ||
func (b *ComponentRouteBuilder) TlsSecretRef(value string) *ComponentRouteBuilder { | ||
b.tlsSecretRef = value | ||
b.bitmap_ |= 16 | ||
return b | ||
} | ||
|
||
// Copy copies the attributes of the given object into this builder, discarding any previous values. | ||
func (b *ComponentRouteBuilder) Copy(object *ComponentRoute) *ComponentRouteBuilder { | ||
if object == nil { | ||
return b | ||
} | ||
b.bitmap_ = object.bitmap_ | ||
b.id = object.id | ||
b.href = object.href | ||
b.hostname = object.hostname | ||
b.tlsSecretRef = object.tlsSecretRef | ||
return b | ||
} | ||
|
||
// Build creates a 'component_route' object using the configuration stored in the builder. | ||
func (b *ComponentRouteBuilder) Build() (object *ComponentRoute, err error) { | ||
object = new(ComponentRoute) | ||
object.id = b.id | ||
object.href = b.href | ||
object.bitmap_ = b.bitmap_ | ||
object.hostname = b.hostname | ||
object.tlsSecretRef = b.tlsSecretRef | ||
return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
// ComponentRouteListBuilder contains the data and logic needed to build | ||
// 'component_route' objects. | ||
type ComponentRouteListBuilder struct { | ||
items []*ComponentRouteBuilder | ||
} | ||
|
||
// NewComponentRouteList creates a new builder of 'component_route' objects. | ||
func NewComponentRouteList() *ComponentRouteListBuilder { | ||
return new(ComponentRouteListBuilder) | ||
} | ||
|
||
// Items sets the items of the list. | ||
func (b *ComponentRouteListBuilder) Items(values ...*ComponentRouteBuilder) *ComponentRouteListBuilder { | ||
b.items = make([]*ComponentRouteBuilder, len(values)) | ||
copy(b.items, values) | ||
return b | ||
} | ||
|
||
// Empty returns true if the list is empty. | ||
func (b *ComponentRouteListBuilder) 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 *ComponentRouteListBuilder) Copy(list *ComponentRouteList) *ComponentRouteListBuilder { | ||
if list == nil || list.items == nil { | ||
b.items = nil | ||
} else { | ||
b.items = make([]*ComponentRouteBuilder, len(list.items)) | ||
for i, v := range list.items { | ||
b.items[i] = NewComponentRoute().Copy(v) | ||
} | ||
} | ||
return b | ||
} | ||
|
||
// Build creates a list of 'component_route' objects using the | ||
// configuration stored in the builder. | ||
func (b *ComponentRouteListBuilder) Build() (list *ComponentRouteList, err error) { | ||
items := make([]*ComponentRoute, len(b.items)) | ||
for i, item := range b.items { | ||
items[i], err = item.Build() | ||
if err != nil { | ||
return | ||
} | ||
} | ||
list = new(ComponentRouteList) | ||
list.items = items | ||
return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
import ( | ||
"io" | ||
|
||
jsoniter "github.com/json-iterator/go" | ||
"github.com/openshift-online/ocm-sdk-go/helpers" | ||
) | ||
|
||
// MarshalComponentRouteList writes a list of values of the 'component_route' type to | ||
// the given writer. | ||
func MarshalComponentRouteList(list []*ComponentRoute, writer io.Writer) error { | ||
stream := helpers.NewStream(writer) | ||
writeComponentRouteList(list, stream) | ||
err := stream.Flush() | ||
if err != nil { | ||
return err | ||
} | ||
return stream.Error | ||
} | ||
|
||
// writeComponentRouteList writes a list of value of the 'component_route' type to | ||
// the given stream. | ||
func writeComponentRouteList(list []*ComponentRoute, stream *jsoniter.Stream) { | ||
stream.WriteArrayStart() | ||
for i, value := range list { | ||
if i > 0 { | ||
stream.WriteMore() | ||
} | ||
writeComponentRoute(value, stream) | ||
} | ||
stream.WriteArrayEnd() | ||
} | ||
|
||
// UnmarshalComponentRouteList reads a list of values of the 'component_route' type | ||
// from the given source, which can be a slice of bytes, a string or a reader. | ||
func UnmarshalComponentRouteList(source interface{}) (items []*ComponentRoute, err error) { | ||
iterator, err := helpers.NewIterator(source) | ||
if err != nil { | ||
return | ||
} | ||
items = readComponentRouteList(iterator) | ||
err = iterator.Error | ||
return | ||
} | ||
|
||
// readComponentRouteList reads list of values of the ”component_route' type from | ||
// the given iterator. | ||
func readComponentRouteList(iterator *jsoniter.Iterator) []*ComponentRoute { | ||
list := []*ComponentRoute{} | ||
for iterator.ReadArray() { | ||
item := readComponentRoute(iterator) | ||
list = append(list, item) | ||
} | ||
return list | ||
} |
Oops, something went wrong.