Skip to content

Commit

Permalink
Merge pull request #997 from marcolan018/OCM-10734
Browse files Browse the repository at this point in the history
OCM-10734 | add WifEnabled to Version model
  • Loading branch information
gdbranco committed Sep 13, 2024
2 parents 70eea10 + b09a9a0 commit ece0040
Show file tree
Hide file tree
Showing 16 changed files with 12,794 additions and 12,171 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
This document describes the relevant changes between releases of the OCM API
SDK.

## 0.1.442
- Update model version v0.0.395
- Add `ASWShard` struct
- Add `WifEnabled` field to `Version` model

## 0.1.441
- Update model version v0.0.394
- Add `WifTemplates` field to `WifConfig` model
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export PATH := $(LOCAL_BIN_PATH):$(PATH)
export CGO_ENABLED=0

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

# Details of the metamodel to use:
Expand Down
72 changes: 72 additions & 0 deletions clustersmgmt/v1/aws_shard_builder.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*
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

// AWSShardBuilder contains the data and logic needed to build 'AWS_shard' objects.
//
// Config for AWS provision shards
type AWSShardBuilder struct {
bitmap_ uint32
ecrRepositoryURLs []string
}

// NewAWSShard creates a new builder of 'AWS_shard' objects.
func NewAWSShard() *AWSShardBuilder {
return &AWSShardBuilder{}
}

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

// ECRRepositoryURLs sets the value of the 'ECR_repository_URLs' attribute to the given values.
func (b *AWSShardBuilder) ECRRepositoryURLs(values ...string) *AWSShardBuilder {
b.ecrRepositoryURLs = make([]string, len(values))
copy(b.ecrRepositoryURLs, values)
b.bitmap_ |= 1
return b
}

// Copy copies the attributes of the given object into this builder, discarding any previous values.
func (b *AWSShardBuilder) Copy(object *AWSShard) *AWSShardBuilder {
if object == nil {
return b
}
b.bitmap_ = object.bitmap_
if object.ecrRepositoryURLs != nil {
b.ecrRepositoryURLs = make([]string, len(object.ecrRepositoryURLs))
copy(b.ecrRepositoryURLs, object.ecrRepositoryURLs)
} else {
b.ecrRepositoryURLs = nil
}
return b
}

// Build creates a 'AWS_shard' object using the configuration stored in the builder.
func (b *AWSShardBuilder) Build() (object *AWSShard, err error) {
object = new(AWSShard)
object.bitmap_ = b.bitmap_
if b.ecrRepositoryURLs != nil {
object.ecrRepositoryURLs = make([]string, len(b.ecrRepositoryURLs))
copy(object.ecrRepositoryURLs, b.ecrRepositoryURLs)
}
return
}
71 changes: 71 additions & 0 deletions clustersmgmt/v1/aws_shard_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

// AWSShardListBuilder contains the data and logic needed to build
// 'AWS_shard' objects.
type AWSShardListBuilder struct {
items []*AWSShardBuilder
}

// NewAWSShardList creates a new builder of 'AWS_shard' objects.
func NewAWSShardList() *AWSShardListBuilder {
return new(AWSShardListBuilder)
}

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

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

// Build creates a list of 'AWS_shard' objects using the
// configuration stored in the builder.
func (b *AWSShardListBuilder) Build() (list *AWSShardList, err error) {
items := make([]*AWSShard, len(b.items))
for i, item := range b.items {
items[i], err = item.Build()
if err != nil {
return
}
}
list = new(AWSShardList)
list.items = items
return
}
75 changes: 75 additions & 0 deletions clustersmgmt/v1/aws_shard_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"
)

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

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

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

// readAWSShardList reads list of values of the ”AWS_shard' type from
// the given iterator.
func readAWSShardList(iterator *jsoniter.Iterator) []*AWSShard {
list := []*AWSShard{}
for iterator.ReadArray() {
item := readAWSShard(iterator)
list = append(list, item)
}
return list
}
142 changes: 142 additions & 0 deletions clustersmgmt/v1/aws_shard_type.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
/*
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

// AWSShard represents the values of the 'AWS_shard' type.
//
// Config for AWS provision shards
type AWSShard struct {
bitmap_ uint32
ecrRepositoryURLs []string
}

// Empty returns true if the object is empty, i.e. no attribute has a value.
func (o *AWSShard) Empty() bool {
return o == nil || o.bitmap_ == 0
}

// ECRRepositoryURLs returns the value of the 'ECR_repository_URLs' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// ECR repository URLs of the provision shard
func (o *AWSShard) ECRRepositoryURLs() []string {
if o != nil && o.bitmap_&1 != 0 {
return o.ecrRepositoryURLs
}
return nil
}

// GetECRRepositoryURLs returns the value of the 'ECR_repository_URLs' attribute and
// a flag indicating if the attribute has a value.
//
// ECR repository URLs of the provision shard
func (o *AWSShard) GetECRRepositoryURLs() (value []string, ok bool) {
ok = o != nil && o.bitmap_&1 != 0
if ok {
value = o.ecrRepositoryURLs
}
return
}

// AWSShardListKind is the name of the type used to represent list of objects of
// type 'AWS_shard'.
const AWSShardListKind = "AWSShardList"

// AWSShardListLinkKind is the name of the type used to represent links to list
// of objects of type 'AWS_shard'.
const AWSShardListLinkKind = "AWSShardListLink"

// AWSShardNilKind is the name of the type used to nil lists of objects of
// type 'AWS_shard'.
const AWSShardListNilKind = "AWSShardListNil"

// AWSShardList is a list of values of the 'AWS_shard' type.
type AWSShardList struct {
href string
link bool
items []*AWSShard
}

// Len returns the length of the list.
func (l *AWSShardList) Len() int {
if l == nil {
return 0
}
return len(l.items)
}

// Empty returns true if the list is empty.
func (l *AWSShardList) Empty() bool {
return l == nil || len(l.items) == 0
}

// Get returns the item of the list with the given index. If there is no item with
// that index it returns nil.
func (l *AWSShardList) Get(i int) *AWSShard {
if l == nil || i < 0 || i >= len(l.items) {
return nil
}
return l.items[i]
}

// Slice returns an slice containing the items of the list. The returned slice is a
// copy of the one used internally, so it can be modified without affecting the
// internal representation.
//
// If you don't need to modify the returned slice consider using the Each or Range
// functions, as they don't need to allocate a new slice.
func (l *AWSShardList) Slice() []*AWSShard {
var slice []*AWSShard
if l == nil {
slice = make([]*AWSShard, 0)
} else {
slice = make([]*AWSShard, len(l.items))
copy(slice, l.items)
}
return slice
}

// Each runs the given function for each item of the list, in order. If the function
// returns false the iteration stops, otherwise it continues till all the elements
// of the list have been processed.
func (l *AWSShardList) Each(f func(item *AWSShard) bool) {
if l == nil {
return
}
for _, item := range l.items {
if !f(item) {
break
}
}
}

// Range runs the given function for each index and item of the list, in order. If
// the function returns false the iteration stops, otherwise it continues till all
// the elements of the list have been processed.
func (l *AWSShardList) Range(f func(index int, item *AWSShard) bool) {
if l == nil {
return
}
for index, item := range l.items {
if !f(index, item) {
break
}
}
}
Loading

0 comments on commit ece0040

Please sign in to comment.