Skip to content

Commit

Permalink
Added cluster_status and node_pool to aro_hcp
Browse files Browse the repository at this point in the history
Signed-off-by: Alba Hita Catala <ahitacat@redhat.com>
  • Loading branch information
ahitacat committed Jan 30, 2025
1 parent 3e36cfd commit dd9ac34
Show file tree
Hide file tree
Showing 77 changed files with 17,788 additions and 3,965 deletions.
143 changes: 143 additions & 0 deletions arohcp/v1alpha1/ami_override_builder.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
/*
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 v1alpha1 // github.com/openshift-online/ocm-sdk-go/arohcp/v1alpha1

import (
v1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1"
)

// AMIOverrideBuilder contains the data and logic needed to build 'AMI_override' objects.
//
// AMIOverride specifies what Amazon Machine Image should be used for a particular product and region.
type AMIOverrideBuilder struct {
bitmap_ uint32
id string
href string
ami string
product *v1.ProductBuilder
region *v1.CloudRegionBuilder
}

// NewAMIOverride creates a new builder of 'AMI_override' objects.
func NewAMIOverride() *AMIOverrideBuilder {
return &AMIOverrideBuilder{}
}

// Link sets the flag that indicates if this is a link.
func (b *AMIOverrideBuilder) Link(value bool) *AMIOverrideBuilder {
b.bitmap_ |= 1
return b
}

// ID sets the identifier of the object.
func (b *AMIOverrideBuilder) ID(value string) *AMIOverrideBuilder {
b.id = value
b.bitmap_ |= 2
return b
}

// HREF sets the link to the object.
func (b *AMIOverrideBuilder) HREF(value string) *AMIOverrideBuilder {
b.href = value
b.bitmap_ |= 4
return b
}

// Empty returns true if the builder is empty, i.e. no attribute has a value.
func (b *AMIOverrideBuilder) Empty() bool {
return b == nil || b.bitmap_&^1 == 0
}

// AMI sets the value of the 'AMI' attribute to the given value.
func (b *AMIOverrideBuilder) AMI(value string) *AMIOverrideBuilder {
b.ami = value
b.bitmap_ |= 8
return b
}

// Product sets the value of the 'product' attribute to the given value.
//
// Representation of an product that can be selected as a cluster type.
func (b *AMIOverrideBuilder) Product(value *v1.ProductBuilder) *AMIOverrideBuilder {
b.product = value
if value != nil {
b.bitmap_ |= 16
} else {
b.bitmap_ &^= 16
}
return b
}

// Region sets the value of the 'region' attribute to the given value.
//
// Description of a region of a cloud provider.
func (b *AMIOverrideBuilder) Region(value *v1.CloudRegionBuilder) *AMIOverrideBuilder {
b.region = value
if value != nil {
b.bitmap_ |= 32
} else {
b.bitmap_ &^= 32
}
return b
}

// Copy copies the attributes of the given object into this builder, discarding any previous values.
func (b *AMIOverrideBuilder) Copy(object *AMIOverride) *AMIOverrideBuilder {
if object == nil {
return b
}
b.bitmap_ = object.bitmap_
b.id = object.id
b.href = object.href
b.ami = object.ami
if object.product != nil {
b.product = v1.NewProduct().Copy(object.product)
} else {
b.product = nil
}
if object.region != nil {
b.region = v1.NewCloudRegion().Copy(object.region)
} else {
b.region = nil
}
return b
}

// Build creates a 'AMI_override' object using the configuration stored in the builder.
func (b *AMIOverrideBuilder) Build() (object *AMIOverride, err error) {
object = new(AMIOverride)
object.id = b.id
object.href = b.href
object.bitmap_ = b.bitmap_
object.ami = b.ami
if b.product != nil {
object.product, err = b.product.Build()
if err != nil {
return
}
}
if b.region != nil {
object.region, err = b.region.Build()
if err != nil {
return
}
}
return
}
71 changes: 71 additions & 0 deletions arohcp/v1alpha1/ami_override_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 v1alpha1 // github.com/openshift-online/ocm-sdk-go/arohcp/v1alpha1

// AMIOverrideListBuilder contains the data and logic needed to build
// 'AMI_override' objects.
type AMIOverrideListBuilder struct {
items []*AMIOverrideBuilder
}

// NewAMIOverrideList creates a new builder of 'AMI_override' objects.
func NewAMIOverrideList() *AMIOverrideListBuilder {
return new(AMIOverrideListBuilder)
}

// Items sets the items of the list.
func (b *AMIOverrideListBuilder) Items(values ...*AMIOverrideBuilder) *AMIOverrideListBuilder {
b.items = make([]*AMIOverrideBuilder, len(values))
copy(b.items, values)
return b
}

// Empty returns true if the list is empty.
func (b *AMIOverrideListBuilder) 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 *AMIOverrideListBuilder) Copy(list *AMIOverrideList) *AMIOverrideListBuilder {
if list == nil || list.items == nil {
b.items = nil
} else {
b.items = make([]*AMIOverrideBuilder, len(list.items))
for i, v := range list.items {
b.items[i] = NewAMIOverride().Copy(v)
}
}
return b
}

// Build creates a list of 'AMI_override' objects using the
// configuration stored in the builder.
func (b *AMIOverrideListBuilder) Build() (list *AMIOverrideList, err error) {
items := make([]*AMIOverride, len(b.items))
for i, item := range b.items {
items[i], err = item.Build()
if err != nil {
return
}
}
list = new(AMIOverrideList)
list.items = items
return
}
75 changes: 75 additions & 0 deletions arohcp/v1alpha1/ami_override_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 v1alpha1 // github.com/openshift-online/ocm-sdk-go/arohcp/v1alpha1

import (
"io"

jsoniter "github.com/json-iterator/go"
"github.com/openshift-online/ocm-sdk-go/helpers"
)

// MarshalAMIOverrideList writes a list of values of the 'AMI_override' type to
// the given writer.
func MarshalAMIOverrideList(list []*AMIOverride, writer io.Writer) error {
stream := helpers.NewStream(writer)
WriteAMIOverrideList(list, stream)
err := stream.Flush()
if err != nil {
return err
}
return stream.Error
}

// WriteAMIOverrideList writes a list of value of the 'AMI_override' type to
// the given stream.
func WriteAMIOverrideList(list []*AMIOverride, stream *jsoniter.Stream) {
stream.WriteArrayStart()
for i, value := range list {
if i > 0 {
stream.WriteMore()
}
WriteAMIOverride(value, stream)
}
stream.WriteArrayEnd()
}

// UnmarshalAMIOverrideList reads a list of values of the 'AMI_override' type
// from the given source, which can be a slice of bytes, a string or a reader.
func UnmarshalAMIOverrideList(source interface{}) (items []*AMIOverride, err error) {
iterator, err := helpers.NewIterator(source)
if err != nil {
return
}
items = ReadAMIOverrideList(iterator)
err = iterator.Error
return
}

// ReadAMIOverrideList reads list of values of the ”AMI_override' type from
// the given iterator.
func ReadAMIOverrideList(iterator *jsoniter.Iterator) []*AMIOverride {
list := []*AMIOverride{}
for iterator.ReadArray() {
item := ReadAMIOverride(iterator)
list = append(list, item)
}
return list
}
Loading

0 comments on commit dd9ac34

Please # to comment.