Skip to content

Commit b94f08d

Browse files
authored
Merge pull request #993 from renan-campos/wif
Release v0.1.439
2 parents 16f4c21 + 75f3861 commit b94f08d

25 files changed

+1664
-465
lines changed

CHANGES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
This document describes the relevant changes between releases of the OCM API
44
SDK.
55

6+
## 0.1.439
7+
- Update model version v0.0.392
8+
- Add `vm` WIF access type
9+
- Add `support` field to WifConfig resource
10+
611
## 0.1.438
712
- Update model version v0.0.391
813
- Add `RegistryConfig` attribute to `Cluster` model

Makefile

Lines changed: 1 addition & 1 deletion
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.391
30+
model_version:=v0.0.392
3131
model_url:=https://github.com/openshift-online/ocm-api-model.git
3232

3333
# Details of the metamodel to use:

clustersmgmt/v1/openapi.go

Lines changed: 254 additions & 225 deletions
Large diffs are not rendered by default.

clustersmgmt/v1/wif_access_method_type.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,7 @@ const (
2626
//
2727
WifAccessMethodImpersonate WifAccessMethod = "impersonate"
2828
//
29+
WifAccessMethodVm WifAccessMethod = "vm"
30+
//
2931
WifAccessMethodWif WifAccessMethod = "wif"
3032
)

clustersmgmt/v1/wif_gcp_builder.go

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ type WifGcpBuilder struct {
2727
projectNumber string
2828
rolePrefix string
2929
serviceAccounts []*WifServiceAccountBuilder
30+
support *WifSupportBuilder
3031
workloadIdentityPool *WifPoolBuilder
3132
}
3233

@@ -76,13 +77,24 @@ func (b *WifGcpBuilder) ServiceAccounts(values ...*WifServiceAccountBuilder) *Wi
7677
return b
7778
}
7879

80+
// Support sets the value of the 'support' attribute to the given value.
81+
func (b *WifGcpBuilder) Support(value *WifSupportBuilder) *WifGcpBuilder {
82+
b.support = value
83+
if value != nil {
84+
b.bitmap_ |= 32
85+
} else {
86+
b.bitmap_ &^= 32
87+
}
88+
return b
89+
}
90+
7991
// WorkloadIdentityPool sets the value of the 'workload_identity_pool' attribute to the given value.
8092
func (b *WifGcpBuilder) WorkloadIdentityPool(value *WifPoolBuilder) *WifGcpBuilder {
8193
b.workloadIdentityPool = value
8294
if value != nil {
83-
b.bitmap_ |= 32
95+
b.bitmap_ |= 64
8496
} else {
85-
b.bitmap_ &^= 32
97+
b.bitmap_ &^= 64
8698
}
8799
return b
88100
}
@@ -105,6 +117,11 @@ func (b *WifGcpBuilder) Copy(object *WifGcp) *WifGcpBuilder {
105117
} else {
106118
b.serviceAccounts = nil
107119
}
120+
if object.support != nil {
121+
b.support = NewWifSupport().Copy(object.support)
122+
} else {
123+
b.support = nil
124+
}
108125
if object.workloadIdentityPool != nil {
109126
b.workloadIdentityPool = NewWifPool().Copy(object.workloadIdentityPool)
110127
} else {
@@ -130,6 +147,12 @@ func (b *WifGcpBuilder) Build() (object *WifGcp, err error) {
130147
}
131148
}
132149
}
150+
if b.support != nil {
151+
object.support, err = b.support.Build()
152+
if err != nil {
153+
return
154+
}
155+
}
133156
if b.workloadIdentityPool != nil {
134157
object.workloadIdentityPool, err = b.workloadIdentityPool.Build()
135158
if err != nil {

clustersmgmt/v1/wif_gcp_type.go

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ type WifGcp struct {
2727
projectNumber string
2828
rolePrefix string
2929
serviceAccounts []*WifServiceAccount
30+
support *WifSupport
3031
workloadIdentityPool *WifPool
3132
}
3233

@@ -152,13 +153,36 @@ func (o *WifGcp) GetServiceAccounts() (value []*WifServiceAccount, ok bool) {
152153
return
153154
}
154155

156+
// Support returns the value of the 'support' attribute, or
157+
// the zero value of the type if the attribute doesn't have a value.
158+
//
159+
// Defines the access configuration for support.
160+
func (o *WifGcp) Support() *WifSupport {
161+
if o != nil && o.bitmap_&32 != 0 {
162+
return o.support
163+
}
164+
return nil
165+
}
166+
167+
// GetSupport returns the value of the 'support' attribute and
168+
// a flag indicating if the attribute has a value.
169+
//
170+
// Defines the access configuration for support.
171+
func (o *WifGcp) GetSupport() (value *WifSupport, ok bool) {
172+
ok = o != nil && o.bitmap_&32 != 0
173+
if ok {
174+
value = o.support
175+
}
176+
return
177+
}
178+
155179
// WorkloadIdentityPool returns the value of the 'workload_identity_pool' attribute, or
156180
// the zero value of the type if the attribute doesn't have a value.
157181
//
158182
// The workload identity configuration data that will be used to create the
159183
// workload identity pool on the user's account.
160184
func (o *WifGcp) WorkloadIdentityPool() *WifPool {
161-
if o != nil && o.bitmap_&32 != 0 {
185+
if o != nil && o.bitmap_&64 != 0 {
162186
return o.workloadIdentityPool
163187
}
164188
return nil
@@ -170,7 +194,7 @@ func (o *WifGcp) WorkloadIdentityPool() *WifPool {
170194
// The workload identity configuration data that will be used to create the
171195
// workload identity pool on the user's account.
172196
func (o *WifGcp) GetWorkloadIdentityPool() (value *WifPool, ok bool) {
173-
ok = o != nil && o.bitmap_&32 != 0
197+
ok = o != nil && o.bitmap_&64 != 0
174198
if ok {
175199
value = o.workloadIdentityPool
176200
}

clustersmgmt/v1/wif_gcp_type_json.go

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,16 @@ func writeWifGcp(object *WifGcp, stream *jsoniter.Stream) {
8787
writeWifServiceAccountList(object.serviceAccounts, stream)
8888
count++
8989
}
90-
present_ = object.bitmap_&32 != 0 && object.workloadIdentityPool != nil
90+
present_ = object.bitmap_&32 != 0 && object.support != nil
91+
if present_ {
92+
if count > 0 {
93+
stream.WriteMore()
94+
}
95+
stream.WriteObjectField("support")
96+
writeWifSupport(object.support, stream)
97+
count++
98+
}
99+
present_ = object.bitmap_&64 != 0 && object.workloadIdentityPool != nil
91100
if present_ {
92101
if count > 0 {
93102
stream.WriteMore()
@@ -139,10 +148,14 @@ func readWifGcp(iterator *jsoniter.Iterator) *WifGcp {
139148
value := readWifServiceAccountList(iterator)
140149
object.serviceAccounts = value
141150
object.bitmap_ |= 16
151+
case "support":
152+
value := readWifSupport(iterator)
153+
object.support = value
154+
object.bitmap_ |= 32
142155
case "workload_identity_pool":
143156
value := readWifPool(iterator)
144157
object.workloadIdentityPool = value
145-
object.bitmap_ |= 32
158+
object.bitmap_ |= 64
146159
default:
147160
iterator.ReadAny()
148161
}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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+
// WifSupportBuilder contains the data and logic needed to build 'wif_support' objects.
23+
type WifSupportBuilder struct {
24+
bitmap_ uint32
25+
principal string
26+
roles []*WifRoleBuilder
27+
}
28+
29+
// NewWifSupport creates a new builder of 'wif_support' objects.
30+
func NewWifSupport() *WifSupportBuilder {
31+
return &WifSupportBuilder{}
32+
}
33+
34+
// Empty returns true if the builder is empty, i.e. no attribute has a value.
35+
func (b *WifSupportBuilder) Empty() bool {
36+
return b == nil || b.bitmap_ == 0
37+
}
38+
39+
// Principal sets the value of the 'principal' attribute to the given value.
40+
func (b *WifSupportBuilder) Principal(value string) *WifSupportBuilder {
41+
b.principal = value
42+
b.bitmap_ |= 1
43+
return b
44+
}
45+
46+
// Roles sets the value of the 'roles' attribute to the given values.
47+
func (b *WifSupportBuilder) Roles(values ...*WifRoleBuilder) *WifSupportBuilder {
48+
b.roles = make([]*WifRoleBuilder, len(values))
49+
copy(b.roles, values)
50+
b.bitmap_ |= 2
51+
return b
52+
}
53+
54+
// Copy copies the attributes of the given object into this builder, discarding any previous values.
55+
func (b *WifSupportBuilder) Copy(object *WifSupport) *WifSupportBuilder {
56+
if object == nil {
57+
return b
58+
}
59+
b.bitmap_ = object.bitmap_
60+
b.principal = object.principal
61+
if object.roles != nil {
62+
b.roles = make([]*WifRoleBuilder, len(object.roles))
63+
for i, v := range object.roles {
64+
b.roles[i] = NewWifRole().Copy(v)
65+
}
66+
} else {
67+
b.roles = nil
68+
}
69+
return b
70+
}
71+
72+
// Build creates a 'wif_support' object using the configuration stored in the builder.
73+
func (b *WifSupportBuilder) Build() (object *WifSupport, err error) {
74+
object = new(WifSupport)
75+
object.bitmap_ = b.bitmap_
76+
object.principal = b.principal
77+
if b.roles != nil {
78+
object.roles = make([]*WifRole, len(b.roles))
79+
for i, v := range b.roles {
80+
object.roles[i], err = v.Build()
81+
if err != nil {
82+
return
83+
}
84+
}
85+
}
86+
return
87+
}
Lines changed: 71 additions & 0 deletions
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+
// WifSupportListBuilder contains the data and logic needed to build
23+
// 'wif_support' objects.
24+
type WifSupportListBuilder struct {
25+
items []*WifSupportBuilder
26+
}
27+
28+
// NewWifSupportList creates a new builder of 'wif_support' objects.
29+
func NewWifSupportList() *WifSupportListBuilder {
30+
return new(WifSupportListBuilder)
31+
}
32+
33+
// Items sets the items of the list.
34+
func (b *WifSupportListBuilder) Items(values ...*WifSupportBuilder) *WifSupportListBuilder {
35+
b.items = make([]*WifSupportBuilder, len(values))
36+
copy(b.items, values)
37+
return b
38+
}
39+
40+
// Empty returns true if the list is empty.
41+
func (b *WifSupportListBuilder) 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 *WifSupportListBuilder) Copy(list *WifSupportList) *WifSupportListBuilder {
47+
if list == nil || list.items == nil {
48+
b.items = nil
49+
} else {
50+
b.items = make([]*WifSupportBuilder, len(list.items))
51+
for i, v := range list.items {
52+
b.items[i] = NewWifSupport().Copy(v)
53+
}
54+
}
55+
return b
56+
}
57+
58+
// Build creates a list of 'wif_support' objects using the
59+
// configuration stored in the builder.
60+
func (b *WifSupportListBuilder) Build() (list *WifSupportList, err error) {
61+
items := make([]*WifSupport, 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(WifSupportList)
69+
list.items = items
70+
return
71+
}

0 commit comments

Comments
 (0)