-
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.
OCM-6535 | feat: changes to support sts arbitrary policies
- Loading branch information
1 parent
7d2bcd1
commit 430f6c2
Showing
22 changed files
with
27,893 additions
and
25,552 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
Large diffs are not rendered by default.
Oops, something went wrong.
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,130 @@ | ||
/* | ||
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 | ||
|
||
// RolePolicyBindingBuilder contains the data and logic needed to build 'role_policy_binding' objects. | ||
type RolePolicyBindingBuilder struct { | ||
bitmap_ uint32 | ||
arn string | ||
name string | ||
policies []*RolePolicyBuilder | ||
status *RolePolicyBindingStatusBuilder | ||
type_ string | ||
} | ||
|
||
// NewRolePolicyBinding creates a new builder of 'role_policy_binding' objects. | ||
func NewRolePolicyBinding() *RolePolicyBindingBuilder { | ||
return &RolePolicyBindingBuilder{} | ||
} | ||
|
||
// Empty returns true if the builder is empty, i.e. no attribute has a value. | ||
func (b *RolePolicyBindingBuilder) Empty() bool { | ||
return b == nil || b.bitmap_ == 0 | ||
} | ||
|
||
// Arn sets the value of the 'arn' attribute to the given value. | ||
func (b *RolePolicyBindingBuilder) Arn(value string) *RolePolicyBindingBuilder { | ||
b.arn = value | ||
b.bitmap_ |= 1 | ||
return b | ||
} | ||
|
||
// Name sets the value of the 'name' attribute to the given value. | ||
func (b *RolePolicyBindingBuilder) Name(value string) *RolePolicyBindingBuilder { | ||
b.name = value | ||
b.bitmap_ |= 2 | ||
return b | ||
} | ||
|
||
// Policies sets the value of the 'policies' attribute to the given values. | ||
func (b *RolePolicyBindingBuilder) Policies(values ...*RolePolicyBuilder) *RolePolicyBindingBuilder { | ||
b.policies = make([]*RolePolicyBuilder, len(values)) | ||
copy(b.policies, values) | ||
b.bitmap_ |= 4 | ||
return b | ||
} | ||
|
||
// Status sets the value of the 'status' attribute to the given value. | ||
func (b *RolePolicyBindingBuilder) Status(value *RolePolicyBindingStatusBuilder) *RolePolicyBindingBuilder { | ||
b.status = value | ||
if value != nil { | ||
b.bitmap_ |= 8 | ||
} else { | ||
b.bitmap_ &^= 8 | ||
} | ||
return b | ||
} | ||
|
||
// Type sets the value of the 'type' attribute to the given value. | ||
func (b *RolePolicyBindingBuilder) Type(value string) *RolePolicyBindingBuilder { | ||
b.type_ = value | ||
b.bitmap_ |= 16 | ||
return b | ||
} | ||
|
||
// Copy copies the attributes of the given object into this builder, discarding any previous values. | ||
func (b *RolePolicyBindingBuilder) Copy(object *RolePolicyBinding) *RolePolicyBindingBuilder { | ||
if object == nil { | ||
return b | ||
} | ||
b.bitmap_ = object.bitmap_ | ||
b.arn = object.arn | ||
b.name = object.name | ||
if object.policies != nil { | ||
b.policies = make([]*RolePolicyBuilder, len(object.policies)) | ||
for i, v := range object.policies { | ||
b.policies[i] = NewRolePolicy().Copy(v) | ||
} | ||
} else { | ||
b.policies = nil | ||
} | ||
if object.status != nil { | ||
b.status = NewRolePolicyBindingStatus().Copy(object.status) | ||
} else { | ||
b.status = nil | ||
} | ||
b.type_ = object.type_ | ||
return b | ||
} | ||
|
||
// Build creates a 'role_policy_binding' object using the configuration stored in the builder. | ||
func (b *RolePolicyBindingBuilder) Build() (object *RolePolicyBinding, err error) { | ||
object = new(RolePolicyBinding) | ||
object.bitmap_ = b.bitmap_ | ||
object.arn = b.arn | ||
object.name = b.name | ||
if b.policies != nil { | ||
object.policies = make([]*RolePolicy, len(b.policies)) | ||
for i, v := range b.policies { | ||
object.policies[i], err = v.Build() | ||
if err != nil { | ||
return | ||
} | ||
} | ||
} | ||
if b.status != nil { | ||
object.status, err = b.status.Build() | ||
if err != nil { | ||
return | ||
} | ||
} | ||
object.type_ = b.type_ | ||
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 | ||
|
||
// RolePolicyBindingListBuilder contains the data and logic needed to build | ||
// 'role_policy_binding' objects. | ||
type RolePolicyBindingListBuilder struct { | ||
items []*RolePolicyBindingBuilder | ||
} | ||
|
||
// NewRolePolicyBindingList creates a new builder of 'role_policy_binding' objects. | ||
func NewRolePolicyBindingList() *RolePolicyBindingListBuilder { | ||
return new(RolePolicyBindingListBuilder) | ||
} | ||
|
||
// Items sets the items of the list. | ||
func (b *RolePolicyBindingListBuilder) Items(values ...*RolePolicyBindingBuilder) *RolePolicyBindingListBuilder { | ||
b.items = make([]*RolePolicyBindingBuilder, len(values)) | ||
copy(b.items, values) | ||
return b | ||
} | ||
|
||
// Empty returns true if the list is empty. | ||
func (b *RolePolicyBindingListBuilder) 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 *RolePolicyBindingListBuilder) Copy(list *RolePolicyBindingList) *RolePolicyBindingListBuilder { | ||
if list == nil || list.items == nil { | ||
b.items = nil | ||
} else { | ||
b.items = make([]*RolePolicyBindingBuilder, len(list.items)) | ||
for i, v := range list.items { | ||
b.items[i] = NewRolePolicyBinding().Copy(v) | ||
} | ||
} | ||
return b | ||
} | ||
|
||
// Build creates a list of 'role_policy_binding' objects using the | ||
// configuration stored in the builder. | ||
func (b *RolePolicyBindingListBuilder) Build() (list *RolePolicyBindingList, err error) { | ||
items := make([]*RolePolicyBinding, len(b.items)) | ||
for i, item := range b.items { | ||
items[i], err = item.Build() | ||
if err != nil { | ||
return | ||
} | ||
} | ||
list = new(RolePolicyBindingList) | ||
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" | ||
) | ||
|
||
// MarshalRolePolicyBindingList writes a list of values of the 'role_policy_binding' type to | ||
// the given writer. | ||
func MarshalRolePolicyBindingList(list []*RolePolicyBinding, writer io.Writer) error { | ||
stream := helpers.NewStream(writer) | ||
writeRolePolicyBindingList(list, stream) | ||
err := stream.Flush() | ||
if err != nil { | ||
return err | ||
} | ||
return stream.Error | ||
} | ||
|
||
// writeRolePolicyBindingList writes a list of value of the 'role_policy_binding' type to | ||
// the given stream. | ||
func writeRolePolicyBindingList(list []*RolePolicyBinding, stream *jsoniter.Stream) { | ||
stream.WriteArrayStart() | ||
for i, value := range list { | ||
if i > 0 { | ||
stream.WriteMore() | ||
} | ||
writeRolePolicyBinding(value, stream) | ||
} | ||
stream.WriteArrayEnd() | ||
} | ||
|
||
// UnmarshalRolePolicyBindingList reads a list of values of the 'role_policy_binding' type | ||
// from the given source, which can be a slice of bytes, a string or a reader. | ||
func UnmarshalRolePolicyBindingList(source interface{}) (items []*RolePolicyBinding, err error) { | ||
iterator, err := helpers.NewIterator(source) | ||
if err != nil { | ||
return | ||
} | ||
items = readRolePolicyBindingList(iterator) | ||
err = iterator.Error | ||
return | ||
} | ||
|
||
// readRolePolicyBindingList reads list of values of the ”role_policy_binding' type from | ||
// the given iterator. | ||
func readRolePolicyBindingList(iterator *jsoniter.Iterator) []*RolePolicyBinding { | ||
list := []*RolePolicyBinding{} | ||
for iterator.ReadArray() { | ||
item := readRolePolicyBinding(iterator) | ||
list = append(list, item) | ||
} | ||
return list | ||
} |
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 | ||
|
||
// RolePolicyBindingStatusBuilder contains the data and logic needed to build 'role_policy_binding_status' objects. | ||
type RolePolicyBindingStatusBuilder struct { | ||
bitmap_ uint32 | ||
description string | ||
value string | ||
} | ||
|
||
// NewRolePolicyBindingStatus creates a new builder of 'role_policy_binding_status' objects. | ||
func NewRolePolicyBindingStatus() *RolePolicyBindingStatusBuilder { | ||
return &RolePolicyBindingStatusBuilder{} | ||
} | ||
|
||
// Empty returns true if the builder is empty, i.e. no attribute has a value. | ||
func (b *RolePolicyBindingStatusBuilder) Empty() bool { | ||
return b == nil || b.bitmap_ == 0 | ||
} | ||
|
||
// Description sets the value of the 'description' attribute to the given value. | ||
func (b *RolePolicyBindingStatusBuilder) Description(value string) *RolePolicyBindingStatusBuilder { | ||
b.description = value | ||
b.bitmap_ |= 1 | ||
return b | ||
} | ||
|
||
// Value sets the value of the 'value' attribute to the given value. | ||
func (b *RolePolicyBindingStatusBuilder) Value(value string) *RolePolicyBindingStatusBuilder { | ||
b.value = value | ||
b.bitmap_ |= 2 | ||
return b | ||
} | ||
|
||
// Copy copies the attributes of the given object into this builder, discarding any previous values. | ||
func (b *RolePolicyBindingStatusBuilder) Copy(object *RolePolicyBindingStatus) *RolePolicyBindingStatusBuilder { | ||
if object == nil { | ||
return b | ||
} | ||
b.bitmap_ = object.bitmap_ | ||
b.description = object.description | ||
b.value = object.value | ||
return b | ||
} | ||
|
||
// Build creates a 'role_policy_binding_status' object using the configuration stored in the builder. | ||
func (b *RolePolicyBindingStatusBuilder) Build() (object *RolePolicyBindingStatus, err error) { | ||
object = new(RolePolicyBindingStatus) | ||
object.bitmap_ = b.bitmap_ | ||
object.description = b.description | ||
object.value = b.value | ||
return | ||
} |
Oops, something went wrong.