Skip to content

Commit 5744272

Browse files
committed
OCM-6454 | feat: bump model to .360 and example
1 parent 55ff0cd commit 5744272

14 files changed

+6318
-5267
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export PATH := $(LOCAL_BIN_PATH):$(PATH)
2727
export CGO_ENABLED=0
2828

2929
# Details of the model to use:
30-
model_version:=v0.0.359
30+
model_version:=v0.0.360
3131
model_url:=https://github.com/openshift-online/ocm-api-model.git
3232

3333
# Details of the metamodel to use:
+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
/*
2+
Copyright (c) 2020 Red Hat, Inc.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// IMPORTANT: This file has been generated automatically, refrain from modifying it manually as all
18+
// your changes will be lost when the file is generated again.
19+
20+
package v1 // github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1
21+
22+
// ComponentRouteBuilder contains the data and logic needed to build 'component_route' objects.
23+
//
24+
// Representation of a Component Route.
25+
type ComponentRouteBuilder struct {
26+
bitmap_ uint32
27+
id string
28+
href string
29+
hostname string
30+
tlsSecretRef string
31+
}
32+
33+
// NewComponentRoute creates a new builder of 'component_route' objects.
34+
func NewComponentRoute() *ComponentRouteBuilder {
35+
return &ComponentRouteBuilder{}
36+
}
37+
38+
// Link sets the flag that indicates if this is a link.
39+
func (b *ComponentRouteBuilder) Link(value bool) *ComponentRouteBuilder {
40+
b.bitmap_ |= 1
41+
return b
42+
}
43+
44+
// ID sets the identifier of the object.
45+
func (b *ComponentRouteBuilder) ID(value string) *ComponentRouteBuilder {
46+
b.id = value
47+
b.bitmap_ |= 2
48+
return b
49+
}
50+
51+
// HREF sets the link to the object.
52+
func (b *ComponentRouteBuilder) HREF(value string) *ComponentRouteBuilder {
53+
b.href = value
54+
b.bitmap_ |= 4
55+
return b
56+
}
57+
58+
// Empty returns true if the builder is empty, i.e. no attribute has a value.
59+
func (b *ComponentRouteBuilder) Empty() bool {
60+
return b == nil || b.bitmap_&^1 == 0
61+
}
62+
63+
// Hostname sets the value of the 'hostname' attribute to the given value.
64+
func (b *ComponentRouteBuilder) Hostname(value string) *ComponentRouteBuilder {
65+
b.hostname = value
66+
b.bitmap_ |= 8
67+
return b
68+
}
69+
70+
// TlsSecretRef sets the value of the 'tls_secret_ref' attribute to the given value.
71+
func (b *ComponentRouteBuilder) TlsSecretRef(value string) *ComponentRouteBuilder {
72+
b.tlsSecretRef = value
73+
b.bitmap_ |= 16
74+
return b
75+
}
76+
77+
// Copy copies the attributes of the given object into this builder, discarding any previous values.
78+
func (b *ComponentRouteBuilder) Copy(object *ComponentRoute) *ComponentRouteBuilder {
79+
if object == nil {
80+
return b
81+
}
82+
b.bitmap_ = object.bitmap_
83+
b.id = object.id
84+
b.href = object.href
85+
b.hostname = object.hostname
86+
b.tlsSecretRef = object.tlsSecretRef
87+
return b
88+
}
89+
90+
// Build creates a 'component_route' object using the configuration stored in the builder.
91+
func (b *ComponentRouteBuilder) Build() (object *ComponentRoute, err error) {
92+
object = new(ComponentRoute)
93+
object.id = b.id
94+
object.href = b.href
95+
object.bitmap_ = b.bitmap_
96+
object.hostname = b.hostname
97+
object.tlsSecretRef = b.tlsSecretRef
98+
return
99+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/*
2+
Copyright (c) 2020 Red Hat, Inc.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// IMPORTANT: This file has been generated automatically, refrain from modifying it manually as all
18+
// your changes will be lost when the file is generated again.
19+
20+
package v1 // github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1
21+
22+
// ComponentRouteListBuilder contains the data and logic needed to build
23+
// 'component_route' objects.
24+
type ComponentRouteListBuilder struct {
25+
items []*ComponentRouteBuilder
26+
}
27+
28+
// NewComponentRouteList creates a new builder of 'component_route' objects.
29+
func NewComponentRouteList() *ComponentRouteListBuilder {
30+
return new(ComponentRouteListBuilder)
31+
}
32+
33+
// Items sets the items of the list.
34+
func (b *ComponentRouteListBuilder) Items(values ...*ComponentRouteBuilder) *ComponentRouteListBuilder {
35+
b.items = make([]*ComponentRouteBuilder, len(values))
36+
copy(b.items, values)
37+
return b
38+
}
39+
40+
// Empty returns true if the list is empty.
41+
func (b *ComponentRouteListBuilder) Empty() bool {
42+
return b == nil || len(b.items) == 0
43+
}
44+
45+
// Copy copies the items of the given list into this builder, discarding any previous items.
46+
func (b *ComponentRouteListBuilder) Copy(list *ComponentRouteList) *ComponentRouteListBuilder {
47+
if list == nil || list.items == nil {
48+
b.items = nil
49+
} else {
50+
b.items = make([]*ComponentRouteBuilder, len(list.items))
51+
for i, v := range list.items {
52+
b.items[i] = NewComponentRoute().Copy(v)
53+
}
54+
}
55+
return b
56+
}
57+
58+
// Build creates a list of 'component_route' objects using the
59+
// configuration stored in the builder.
60+
func (b *ComponentRouteListBuilder) Build() (list *ComponentRouteList, err error) {
61+
items := make([]*ComponentRoute, len(b.items))
62+
for i, item := range b.items {
63+
items[i], err = item.Build()
64+
if err != nil {
65+
return
66+
}
67+
}
68+
list = new(ComponentRouteList)
69+
list.items = items
70+
return
71+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/*
2+
Copyright (c) 2020 Red Hat, Inc.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// IMPORTANT: This file has been generated automatically, refrain from modifying it manually as all
18+
// your changes will be lost when the file is generated again.
19+
20+
package v1 // github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1
21+
22+
import (
23+
"io"
24+
25+
jsoniter "github.com/json-iterator/go"
26+
"github.com/openshift-online/ocm-sdk-go/helpers"
27+
)
28+
29+
// MarshalComponentRouteList writes a list of values of the 'component_route' type to
30+
// the given writer.
31+
func MarshalComponentRouteList(list []*ComponentRoute, writer io.Writer) error {
32+
stream := helpers.NewStream(writer)
33+
writeComponentRouteList(list, stream)
34+
err := stream.Flush()
35+
if err != nil {
36+
return err
37+
}
38+
return stream.Error
39+
}
40+
41+
// writeComponentRouteList writes a list of value of the 'component_route' type to
42+
// the given stream.
43+
func writeComponentRouteList(list []*ComponentRoute, stream *jsoniter.Stream) {
44+
stream.WriteArrayStart()
45+
for i, value := range list {
46+
if i > 0 {
47+
stream.WriteMore()
48+
}
49+
writeComponentRoute(value, stream)
50+
}
51+
stream.WriteArrayEnd()
52+
}
53+
54+
// UnmarshalComponentRouteList reads a list of values of the 'component_route' type
55+
// from the given source, which can be a slice of bytes, a string or a reader.
56+
func UnmarshalComponentRouteList(source interface{}) (items []*ComponentRoute, err error) {
57+
iterator, err := helpers.NewIterator(source)
58+
if err != nil {
59+
return
60+
}
61+
items = readComponentRouteList(iterator)
62+
err = iterator.Error
63+
return
64+
}
65+
66+
// readComponentRouteList reads list of values of the ”component_route' type from
67+
// the given iterator.
68+
func readComponentRouteList(iterator *jsoniter.Iterator) []*ComponentRoute {
69+
list := []*ComponentRoute{}
70+
for iterator.ReadArray() {
71+
item := readComponentRoute(iterator)
72+
list = append(list, item)
73+
}
74+
return list
75+
}

0 commit comments

Comments
 (0)