Skip to content

Commit

Permalink
Merge pull request #570 from ciaranRoche/model_0_0_175
Browse files Browse the repository at this point in the history
Update model to v0.0.175
  • Loading branch information
jhernand authored Mar 2, 2022
2 parents 8f60597 + b1d7a36 commit 2f2486c
Show file tree
Hide file tree
Showing 28 changed files with 6,798 additions and 5,001 deletions.
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.174
model_version:=v0.0.175
model_url:=https://github.com/openshift-online/ocm-api-model.git

# Details of the metamodel to use:
Expand Down
66 changes: 46 additions & 20 deletions clustersmgmt/v1/add_on_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type AddOnBuilder struct {
bitmap_ uint32
id string
href string
config *AddOnConfigBuilder
description string
docsLink string
icon string
Expand Down Expand Up @@ -77,12 +78,26 @@ func (b *AddOnBuilder) Empty() bool {
return b == nil || b.bitmap_&^1 == 0
}

// Config sets the value of the 'config' attribute to the given value.
//
// Representation of an add-on config.
// The attributes under it are to be used by the addon once its installed in the cluster.
func (b *AddOnBuilder) Config(value *AddOnConfigBuilder) *AddOnBuilder {
b.config = value
if value != nil {
b.bitmap_ |= 8
} else {
b.bitmap_ &^= 8
}
return b
}

// Description sets the value of the 'description' attribute to the given value.
//
//
func (b *AddOnBuilder) Description(value string) *AddOnBuilder {
b.description = value
b.bitmap_ |= 8
b.bitmap_ |= 16
return b
}

Expand All @@ -91,7 +106,7 @@ func (b *AddOnBuilder) Description(value string) *AddOnBuilder {
//
func (b *AddOnBuilder) DocsLink(value string) *AddOnBuilder {
b.docsLink = value
b.bitmap_ |= 16
b.bitmap_ |= 32
return b
}

Expand All @@ -100,7 +115,7 @@ func (b *AddOnBuilder) DocsLink(value string) *AddOnBuilder {
//
func (b *AddOnBuilder) Enabled(value bool) *AddOnBuilder {
b.enabled = value
b.bitmap_ |= 32
b.bitmap_ |= 64
return b
}

Expand All @@ -109,7 +124,7 @@ func (b *AddOnBuilder) Enabled(value bool) *AddOnBuilder {
//
func (b *AddOnBuilder) HasExternalResources(value bool) *AddOnBuilder {
b.hasExternalResources = value
b.bitmap_ |= 64
b.bitmap_ |= 128
return b
}

Expand All @@ -118,7 +133,7 @@ func (b *AddOnBuilder) HasExternalResources(value bool) *AddOnBuilder {
//
func (b *AddOnBuilder) Hidden(value bool) *AddOnBuilder {
b.hidden = value
b.bitmap_ |= 128
b.bitmap_ |= 256
return b
}

Expand All @@ -127,7 +142,7 @@ func (b *AddOnBuilder) Hidden(value bool) *AddOnBuilder {
//
func (b *AddOnBuilder) Icon(value string) *AddOnBuilder {
b.icon = value
b.bitmap_ |= 256
b.bitmap_ |= 512
return b
}

Expand All @@ -136,7 +151,7 @@ func (b *AddOnBuilder) Icon(value string) *AddOnBuilder {
// Representation of an add-on InstallMode field.
func (b *AddOnBuilder) InstallMode(value AddOnInstallMode) *AddOnBuilder {
b.installMode = value
b.bitmap_ |= 512
b.bitmap_ |= 1024
return b
}

Expand All @@ -145,7 +160,7 @@ func (b *AddOnBuilder) InstallMode(value AddOnInstallMode) *AddOnBuilder {
//
func (b *AddOnBuilder) Label(value string) *AddOnBuilder {
b.label = value
b.bitmap_ |= 1024
b.bitmap_ |= 2048
return b
}

Expand All @@ -154,7 +169,7 @@ func (b *AddOnBuilder) Label(value string) *AddOnBuilder {
//
func (b *AddOnBuilder) Name(value string) *AddOnBuilder {
b.name = value
b.bitmap_ |= 2048
b.bitmap_ |= 4096
return b
}

Expand All @@ -163,7 +178,7 @@ func (b *AddOnBuilder) Name(value string) *AddOnBuilder {
//
func (b *AddOnBuilder) OperatorName(value string) *AddOnBuilder {
b.operatorName = value
b.bitmap_ |= 4096
b.bitmap_ |= 8192
return b
}

Expand All @@ -172,7 +187,7 @@ func (b *AddOnBuilder) OperatorName(value string) *AddOnBuilder {
//
func (b *AddOnBuilder) Parameters(value *AddOnParameterListBuilder) *AddOnBuilder {
b.parameters = value
b.bitmap_ |= 8192
b.bitmap_ |= 16384
return b
}

Expand All @@ -182,7 +197,7 @@ func (b *AddOnBuilder) Parameters(value *AddOnParameterListBuilder) *AddOnBuilde
func (b *AddOnBuilder) PolicyPermissions(values ...string) *AddOnBuilder {
b.policyPermissions = make([]string, len(values))
copy(b.policyPermissions, values)
b.bitmap_ |= 16384
b.bitmap_ |= 32768
return b
}

Expand All @@ -192,7 +207,7 @@ func (b *AddOnBuilder) PolicyPermissions(values ...string) *AddOnBuilder {
func (b *AddOnBuilder) Requirements(values ...*AddOnRequirementBuilder) *AddOnBuilder {
b.requirements = make([]*AddOnRequirementBuilder, len(values))
copy(b.requirements, values)
b.bitmap_ |= 32768
b.bitmap_ |= 65536
return b
}

Expand All @@ -201,7 +216,7 @@ func (b *AddOnBuilder) Requirements(values ...*AddOnRequirementBuilder) *AddOnBu
//
func (b *AddOnBuilder) ResourceCost(value float64) *AddOnBuilder {
b.resourceCost = value
b.bitmap_ |= 65536
b.bitmap_ |= 131072
return b
}

Expand All @@ -210,7 +225,7 @@ func (b *AddOnBuilder) ResourceCost(value float64) *AddOnBuilder {
//
func (b *AddOnBuilder) ResourceName(value string) *AddOnBuilder {
b.resourceName = value
b.bitmap_ |= 131072
b.bitmap_ |= 262144
return b
}

Expand All @@ -219,7 +234,7 @@ func (b *AddOnBuilder) ResourceName(value string) *AddOnBuilder {
//
func (b *AddOnBuilder) ServiceAccount(value string) *AddOnBuilder {
b.serviceAccount = value
b.bitmap_ |= 262144
b.bitmap_ |= 524288
return b
}

Expand All @@ -229,7 +244,7 @@ func (b *AddOnBuilder) ServiceAccount(value string) *AddOnBuilder {
func (b *AddOnBuilder) SubOperators(values ...*AddOnSubOperatorBuilder) *AddOnBuilder {
b.subOperators = make([]*AddOnSubOperatorBuilder, len(values))
copy(b.subOperators, values)
b.bitmap_ |= 524288
b.bitmap_ |= 1048576
return b
}

Expand All @@ -238,7 +253,7 @@ func (b *AddOnBuilder) SubOperators(values ...*AddOnSubOperatorBuilder) *AddOnBu
//
func (b *AddOnBuilder) TargetNamespace(value string) *AddOnBuilder {
b.targetNamespace = value
b.bitmap_ |= 1048576
b.bitmap_ |= 2097152
return b
}

Expand All @@ -248,9 +263,9 @@ func (b *AddOnBuilder) TargetNamespace(value string) *AddOnBuilder {
func (b *AddOnBuilder) Version(value *AddOnVersionBuilder) *AddOnBuilder {
b.version = value
if value != nil {
b.bitmap_ |= 2097152
b.bitmap_ |= 4194304
} else {
b.bitmap_ &^= 2097152
b.bitmap_ &^= 4194304
}
return b
}
Expand All @@ -263,6 +278,11 @@ func (b *AddOnBuilder) Copy(object *AddOn) *AddOnBuilder {
b.bitmap_ = object.bitmap_
b.id = object.id
b.href = object.href
if object.config != nil {
b.config = NewAddOnConfig().Copy(object.config)
} else {
b.config = nil
}
b.description = object.description
b.docsLink = object.docsLink
b.enabled = object.enabled
Expand Down Expand Up @@ -318,6 +338,12 @@ func (b *AddOnBuilder) Build() (object *AddOn, err error) {
object.id = b.id
object.href = b.href
object.bitmap_ = b.bitmap_
if b.config != nil {
object.config, err = b.config.Build()
if err != nil {
return
}
}
object.description = b.description
object.docsLink = b.docsLink
object.enabled = b.enabled
Expand Down
108 changes: 108 additions & 0 deletions clustersmgmt/v1/add_on_config_builder.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/*
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

// AddOnConfigBuilder contains the data and logic needed to build 'add_on_config' objects.
//
// Representation of an add-on config.
// The attributes under it are to be used by the addon once its installed in the cluster.
type AddOnConfigBuilder struct {
bitmap_ uint32
id string
href string
addOnEnvironmentVariables []*AddOnEnvironmentVariableBuilder
}

// NewAddOnConfig creates a new builder of 'add_on_config' objects.
func NewAddOnConfig() *AddOnConfigBuilder {
return &AddOnConfigBuilder{}
}

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

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

// HREF sets the link to the object.
func (b *AddOnConfigBuilder) HREF(value string) *AddOnConfigBuilder {
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 *AddOnConfigBuilder) Empty() bool {
return b == nil || b.bitmap_&^1 == 0
}

// AddOnEnvironmentVariables sets the value of the 'add_on_environment_variables' attribute to the given values.
//
//
func (b *AddOnConfigBuilder) AddOnEnvironmentVariables(values ...*AddOnEnvironmentVariableBuilder) *AddOnConfigBuilder {
b.addOnEnvironmentVariables = make([]*AddOnEnvironmentVariableBuilder, len(values))
copy(b.addOnEnvironmentVariables, values)
b.bitmap_ |= 8
return b
}

// Copy copies the attributes of the given object into this builder, discarding any previous values.
func (b *AddOnConfigBuilder) Copy(object *AddOnConfig) *AddOnConfigBuilder {
if object == nil {
return b
}
b.bitmap_ = object.bitmap_
b.id = object.id
b.href = object.href
if object.addOnEnvironmentVariables != nil {
b.addOnEnvironmentVariables = make([]*AddOnEnvironmentVariableBuilder, len(object.addOnEnvironmentVariables))
for i, v := range object.addOnEnvironmentVariables {
b.addOnEnvironmentVariables[i] = NewAddOnEnvironmentVariable().Copy(v)
}
} else {
b.addOnEnvironmentVariables = nil
}
return b
}

// Build creates a 'add_on_config' object using the configuration stored in the builder.
func (b *AddOnConfigBuilder) Build() (object *AddOnConfig, err error) {
object = new(AddOnConfig)
object.id = b.id
object.href = b.href
object.bitmap_ = b.bitmap_
if b.addOnEnvironmentVariables != nil {
object.addOnEnvironmentVariables = make([]*AddOnEnvironmentVariable, len(b.addOnEnvironmentVariables))
for i, v := range b.addOnEnvironmentVariables {
object.addOnEnvironmentVariables[i], err = v.Build()
if err != nil {
return
}
}
}
return
}
Loading

0 comments on commit 2f2486c

Please sign in to comment.