Skip to content

Commit

Permalink
Merge pull request #1004 from miguelsorianod/add-arohcp-azure-mis-api…
Browse files Browse the repository at this point in the history
…types-changes

chore: synchronise to ocm-api-model 0.0.399
  • Loading branch information
miguelsorianod authored Oct 22, 2024
2 parents 0cea5de + 7c51ce4 commit e4d09b7
Show file tree
Hide file tree
Showing 31 changed files with 12,596 additions and 9,193 deletions.
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.398
model_version:=v0.0.399
model_url:=https://github.com/openshift-online/ocm-api-model.git

# Details of the metamodel to use:
Expand Down
36 changes: 31 additions & 5 deletions clustersmgmt/v1/azure_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type AzureBuilder struct {
bitmap_ uint32
managedResourceGroupName string
networkSecurityGroupResourceID string
operatorsAuthentication *AzureOperatorsAuthenticationBuilder
resourceGroupName string
resourceName string
subnetResourceID string
Expand Down Expand Up @@ -57,38 +58,52 @@ func (b *AzureBuilder) NetworkSecurityGroupResourceID(value string) *AzureBuilde
return b
}

// OperatorsAuthentication sets the value of the 'operators_authentication' attribute to the given value.
//
// The configuration that the operators of the
// cluster have to authenticate to Azure.
func (b *AzureBuilder) OperatorsAuthentication(value *AzureOperatorsAuthenticationBuilder) *AzureBuilder {
b.operatorsAuthentication = value
if value != nil {
b.bitmap_ |= 4
} else {
b.bitmap_ &^= 4
}
return b
}

// ResourceGroupName sets the value of the 'resource_group_name' attribute to the given value.
func (b *AzureBuilder) ResourceGroupName(value string) *AzureBuilder {
b.resourceGroupName = value
b.bitmap_ |= 4
b.bitmap_ |= 8
return b
}

// ResourceName sets the value of the 'resource_name' attribute to the given value.
func (b *AzureBuilder) ResourceName(value string) *AzureBuilder {
b.resourceName = value
b.bitmap_ |= 8
b.bitmap_ |= 16
return b
}

// SubnetResourceID sets the value of the 'subnet_resource_ID' attribute to the given value.
func (b *AzureBuilder) SubnetResourceID(value string) *AzureBuilder {
b.subnetResourceID = value
b.bitmap_ |= 16
b.bitmap_ |= 32
return b
}

// SubscriptionID sets the value of the 'subscription_ID' attribute to the given value.
func (b *AzureBuilder) SubscriptionID(value string) *AzureBuilder {
b.subscriptionID = value
b.bitmap_ |= 32
b.bitmap_ |= 64
return b
}

// TenantID sets the value of the 'tenant_ID' attribute to the given value.
func (b *AzureBuilder) TenantID(value string) *AzureBuilder {
b.tenantID = value
b.bitmap_ |= 64
b.bitmap_ |= 128
return b
}

Expand All @@ -100,6 +115,11 @@ func (b *AzureBuilder) Copy(object *Azure) *AzureBuilder {
b.bitmap_ = object.bitmap_
b.managedResourceGroupName = object.managedResourceGroupName
b.networkSecurityGroupResourceID = object.networkSecurityGroupResourceID
if object.operatorsAuthentication != nil {
b.operatorsAuthentication = NewAzureOperatorsAuthentication().Copy(object.operatorsAuthentication)
} else {
b.operatorsAuthentication = nil
}
b.resourceGroupName = object.resourceGroupName
b.resourceName = object.resourceName
b.subnetResourceID = object.subnetResourceID
Expand All @@ -114,6 +134,12 @@ func (b *AzureBuilder) Build() (object *Azure, err error) {
object.bitmap_ = b.bitmap_
object.managedResourceGroupName = b.managedResourceGroupName
object.networkSecurityGroupResourceID = b.networkSecurityGroupResourceID
if b.operatorsAuthentication != nil {
object.operatorsAuthentication, err = b.operatorsAuthentication.Build()
if err != nil {
return
}
}
object.resourceGroupName = b.resourceGroupName
object.resourceName = b.resourceName
object.subnetResourceID = b.subnetResourceID
Expand Down
84 changes: 84 additions & 0 deletions clustersmgmt/v1/azure_control_plane_managed_identity_builder.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/*
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

// AzureControlPlaneManagedIdentityBuilder contains the data and logic needed to build 'azure_control_plane_managed_identity' objects.
//
// Represents the information associated to an Azure User-Assigned
// Managed Identity belonging to the Control Plane of the cluster.
type AzureControlPlaneManagedIdentityBuilder struct {
bitmap_ uint32
clientID string
principalID string
resourceID string
}

// NewAzureControlPlaneManagedIdentity creates a new builder of 'azure_control_plane_managed_identity' objects.
func NewAzureControlPlaneManagedIdentity() *AzureControlPlaneManagedIdentityBuilder {
return &AzureControlPlaneManagedIdentityBuilder{}
}

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

// ClientID sets the value of the 'client_ID' attribute to the given value.
func (b *AzureControlPlaneManagedIdentityBuilder) ClientID(value string) *AzureControlPlaneManagedIdentityBuilder {
b.clientID = value
b.bitmap_ |= 1
return b
}

// PrincipalID sets the value of the 'principal_ID' attribute to the given value.
func (b *AzureControlPlaneManagedIdentityBuilder) PrincipalID(value string) *AzureControlPlaneManagedIdentityBuilder {
b.principalID = value
b.bitmap_ |= 2
return b
}

// ResourceID sets the value of the 'resource_ID' attribute to the given value.
func (b *AzureControlPlaneManagedIdentityBuilder) ResourceID(value string) *AzureControlPlaneManagedIdentityBuilder {
b.resourceID = value
b.bitmap_ |= 4
return b
}

// Copy copies the attributes of the given object into this builder, discarding any previous values.
func (b *AzureControlPlaneManagedIdentityBuilder) Copy(object *AzureControlPlaneManagedIdentity) *AzureControlPlaneManagedIdentityBuilder {
if object == nil {
return b
}
b.bitmap_ = object.bitmap_
b.clientID = object.clientID
b.principalID = object.principalID
b.resourceID = object.resourceID
return b
}

// Build creates a 'azure_control_plane_managed_identity' object using the configuration stored in the builder.
func (b *AzureControlPlaneManagedIdentityBuilder) Build() (object *AzureControlPlaneManagedIdentity, err error) {
object = new(AzureControlPlaneManagedIdentity)
object.bitmap_ = b.bitmap_
object.clientID = b.clientID
object.principalID = b.principalID
object.resourceID = b.resourceID
return
}
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

// AzureControlPlaneManagedIdentityListBuilder contains the data and logic needed to build
// 'azure_control_plane_managed_identity' objects.
type AzureControlPlaneManagedIdentityListBuilder struct {
items []*AzureControlPlaneManagedIdentityBuilder
}

// NewAzureControlPlaneManagedIdentityList creates a new builder of 'azure_control_plane_managed_identity' objects.
func NewAzureControlPlaneManagedIdentityList() *AzureControlPlaneManagedIdentityListBuilder {
return new(AzureControlPlaneManagedIdentityListBuilder)
}

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

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

// Build creates a list of 'azure_control_plane_managed_identity' objects using the
// configuration stored in the builder.
func (b *AzureControlPlaneManagedIdentityListBuilder) Build() (list *AzureControlPlaneManagedIdentityList, err error) {
items := make([]*AzureControlPlaneManagedIdentity, len(b.items))
for i, item := range b.items {
items[i], err = item.Build()
if err != nil {
return
}
}
list = new(AzureControlPlaneManagedIdentityList)
list.items = items
return
}
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"
)

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

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

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

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

0 comments on commit e4d09b7

Please sign in to comment.