-
Notifications
You must be signed in to change notification settings - Fork 125
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 #844 from robpblake/ocm-2437-add-aws-sts-account-r…
…oles OCM-2437 | feat: Added support for /api/clusters_mgmt/v1/aws_inquiries/sts_account_roles to the SDK
- Loading branch information
Showing
20 changed files
with
11,479 additions
and
9,371 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
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,89 @@ | ||
/* | ||
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 | ||
|
||
// AWSSTSAccountRoleBuilder contains the data and logic needed to build 'AWSSTS_account_role' objects. | ||
// | ||
// Representation of an sts account role for a rosa cluster | ||
type AWSSTSAccountRoleBuilder struct { | ||
bitmap_ uint32 | ||
items []*AWSSTSRoleBuilder | ||
prefix string | ||
} | ||
|
||
// NewAWSSTSAccountRole creates a new builder of 'AWSSTS_account_role' objects. | ||
func NewAWSSTSAccountRole() *AWSSTSAccountRoleBuilder { | ||
return &AWSSTSAccountRoleBuilder{} | ||
} | ||
|
||
// Empty returns true if the builder is empty, i.e. no attribute has a value. | ||
func (b *AWSSTSAccountRoleBuilder) Empty() bool { | ||
return b == nil || b.bitmap_ == 0 | ||
} | ||
|
||
// Items sets the value of the 'items' attribute to the given values. | ||
func (b *AWSSTSAccountRoleBuilder) Items(values ...*AWSSTSRoleBuilder) *AWSSTSAccountRoleBuilder { | ||
b.items = make([]*AWSSTSRoleBuilder, len(values)) | ||
copy(b.items, values) | ||
b.bitmap_ |= 1 | ||
return b | ||
} | ||
|
||
// Prefix sets the value of the 'prefix' attribute to the given value. | ||
func (b *AWSSTSAccountRoleBuilder) Prefix(value string) *AWSSTSAccountRoleBuilder { | ||
b.prefix = value | ||
b.bitmap_ |= 2 | ||
return b | ||
} | ||
|
||
// Copy copies the attributes of the given object into this builder, discarding any previous values. | ||
func (b *AWSSTSAccountRoleBuilder) Copy(object *AWSSTSAccountRole) *AWSSTSAccountRoleBuilder { | ||
if object == nil { | ||
return b | ||
} | ||
b.bitmap_ = object.bitmap_ | ||
if object.items != nil { | ||
b.items = make([]*AWSSTSRoleBuilder, len(object.items)) | ||
for i, v := range object.items { | ||
b.items[i] = NewAWSSTSRole().Copy(v) | ||
} | ||
} else { | ||
b.items = nil | ||
} | ||
b.prefix = object.prefix | ||
return b | ||
} | ||
|
||
// Build creates a 'AWSSTS_account_role' object using the configuration stored in the builder. | ||
func (b *AWSSTSAccountRoleBuilder) Build() (object *AWSSTSAccountRole, err error) { | ||
object = new(AWSSTSAccountRole) | ||
object.bitmap_ = b.bitmap_ | ||
if b.items != nil { | ||
object.items = make([]*AWSSTSRole, len(b.items)) | ||
for i, v := range b.items { | ||
object.items[i], err = v.Build() | ||
if err != nil { | ||
return | ||
} | ||
} | ||
} | ||
object.prefix = b.prefix | ||
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 | ||
|
||
// AWSSTSAccountRoleListBuilder contains the data and logic needed to build | ||
// 'AWSSTS_account_role' objects. | ||
type AWSSTSAccountRoleListBuilder struct { | ||
items []*AWSSTSAccountRoleBuilder | ||
} | ||
|
||
// NewAWSSTSAccountRoleList creates a new builder of 'AWSSTS_account_role' objects. | ||
func NewAWSSTSAccountRoleList() *AWSSTSAccountRoleListBuilder { | ||
return new(AWSSTSAccountRoleListBuilder) | ||
} | ||
|
||
// Items sets the items of the list. | ||
func (b *AWSSTSAccountRoleListBuilder) Items(values ...*AWSSTSAccountRoleBuilder) *AWSSTSAccountRoleListBuilder { | ||
b.items = make([]*AWSSTSAccountRoleBuilder, len(values)) | ||
copy(b.items, values) | ||
return b | ||
} | ||
|
||
// Empty returns true if the list is empty. | ||
func (b *AWSSTSAccountRoleListBuilder) 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 *AWSSTSAccountRoleListBuilder) Copy(list *AWSSTSAccountRoleList) *AWSSTSAccountRoleListBuilder { | ||
if list == nil || list.items == nil { | ||
b.items = nil | ||
} else { | ||
b.items = make([]*AWSSTSAccountRoleBuilder, len(list.items)) | ||
for i, v := range list.items { | ||
b.items[i] = NewAWSSTSAccountRole().Copy(v) | ||
} | ||
} | ||
return b | ||
} | ||
|
||
// Build creates a list of 'AWSSTS_account_role' objects using the | ||
// configuration stored in the builder. | ||
func (b *AWSSTSAccountRoleListBuilder) Build() (list *AWSSTSAccountRoleList, err error) { | ||
items := make([]*AWSSTSAccountRole, len(b.items)) | ||
for i, item := range b.items { | ||
items[i], err = item.Build() | ||
if err != nil { | ||
return | ||
} | ||
} | ||
list = new(AWSSTSAccountRoleList) | ||
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" | ||
) | ||
|
||
// MarshalAWSSTSAccountRoleList writes a list of values of the 'AWSSTS_account_role' type to | ||
// the given writer. | ||
func MarshalAWSSTSAccountRoleList(list []*AWSSTSAccountRole, writer io.Writer) error { | ||
stream := helpers.NewStream(writer) | ||
writeAWSSTSAccountRoleList(list, stream) | ||
err := stream.Flush() | ||
if err != nil { | ||
return err | ||
} | ||
return stream.Error | ||
} | ||
|
||
// writeAWSSTSAccountRoleList writes a list of value of the 'AWSSTS_account_role' type to | ||
// the given stream. | ||
func writeAWSSTSAccountRoleList(list []*AWSSTSAccountRole, stream *jsoniter.Stream) { | ||
stream.WriteArrayStart() | ||
for i, value := range list { | ||
if i > 0 { | ||
stream.WriteMore() | ||
} | ||
writeAWSSTSAccountRole(value, stream) | ||
} | ||
stream.WriteArrayEnd() | ||
} | ||
|
||
// UnmarshalAWSSTSAccountRoleList reads a list of values of the 'AWSSTS_account_role' type | ||
// from the given source, which can be a slice of bytes, a string or a reader. | ||
func UnmarshalAWSSTSAccountRoleList(source interface{}) (items []*AWSSTSAccountRole, err error) { | ||
iterator, err := helpers.NewIterator(source) | ||
if err != nil { | ||
return | ||
} | ||
items = readAWSSTSAccountRoleList(iterator) | ||
err = iterator.Error | ||
return | ||
} | ||
|
||
// readAWSSTSAccountRoleList reads list of values of the ”AWSSTS_account_role' type from | ||
// the given iterator. | ||
func readAWSSTSAccountRoleList(iterator *jsoniter.Iterator) []*AWSSTSAccountRole { | ||
list := []*AWSSTSAccountRole{} | ||
for iterator.ReadArray() { | ||
item := readAWSSTSAccountRole(iterator) | ||
list = append(list, item) | ||
} | ||
return list | ||
} |
Oops, something went wrong.