Skip to content

Commit

Permalink
Merge pull request #844 from robpblake/ocm-2437-add-aws-sts-account-r…
Browse files Browse the repository at this point in the history
…oles

OCM-2437 | feat: Added support for /api/clusters_mgmt/v1/aws_inquiries/sts_account_roles to the SDK
  • Loading branch information
oriAdler authored Sep 21, 2023
2 parents f455c86 + b7c0de2 commit ab713f1
Show file tree
Hide file tree
Showing 20 changed files with 11,479 additions and 9,371 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
This document describes the relevant changes between releases of the OCM API
SDK.

## 0.1.369
- Update model version to v0.0.321
- Exposes `/api/clusters_mgmt/v1/aws_inquiries/sts_account_roles` in the SDK

## 0.1.368
- Update model version v0.0.318
- Add `ImageOverrides` to `Version` type
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
export CGO_ENABLED=0

# Details of the model to use:
model_version:=v0.0.318
model_version:=v0.0.321
model_url:=https://github.com/openshift-online/ocm-api-model.git

# Details of the metamodel to use:
Expand Down
10 changes: 10 additions & 0 deletions clustersmgmt/v1/aws_inquiries_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ func NewAWSInquiriesClient(transport http.RoundTripper, path string) *AWSInquiri
}
}

// STSAccountRoles returns the target 'AWSSTS_account_roles_inquiry' resource.
//
// Reference to the resource that manages aws sts roles
func (c *AWSInquiriesClient) STSAccountRoles() *AWSSTSAccountRolesInquiryClient {
return NewAWSSTSAccountRolesInquiryClient(
c.transport,
path.Join(c.path, "sts_account_roles"),
)
}

// STSCredentialRequests returns the target 'STS_credential_requests_inquiry' resource.
//
// Reference to the resource that manages sts cred request.
Expand Down
89 changes: 89 additions & 0 deletions clustersmgmt/v1/awssts_account_role_builder.go
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
}
71 changes: 71 additions & 0 deletions clustersmgmt/v1/awssts_account_role_list_builder.go
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
}
75 changes: 75 additions & 0 deletions clustersmgmt/v1/awssts_account_role_list_type_json.go
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
}
Loading

0 comments on commit ab713f1

Please sign in to comment.