Skip to content

Commit

Permalink
Merge pull request #815 from marcolan018/ocm-200
Browse files Browse the repository at this point in the history
move PrivateHostedZoneID and PrivateHostedZoneRoleARN to AWS res
  • Loading branch information
gdbranco authored Aug 1, 2023
2 parents 4e5675c + 1b6c66a commit b97ef18
Show file tree
Hide file tree
Showing 11 changed files with 4,307 additions and 4,303 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.360
- Update model version v0.0.307
- Move `PrivateHostedZoneID` and `PrivateHostedZoneRoleARN` to `aws_type` resource

## 0.1.359
- Update model version v0.0.306
- Fix upgrade related constants JSON output to align with existing values
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.306
model_version:=v0.0.307
model_url:=https://github.com/openshift-online/ocm-api-model.git

# Details of the metamodel to use:
Expand Down
34 changes: 27 additions & 7 deletions clustersmgmt/v1/aws_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ type AWSBuilder struct {
billingAccountID string
ec2MetadataHttpTokens Ec2MetadataHttpTokens
etcdEncryption *AwsEtcdEncryptionBuilder
privateHostedZoneID string
privateHostedZoneRoleARN string
privateLinkConfiguration *PrivateLinkClusterConfigurationBuilder
secretAccessKey string
subnetIDs []string
Expand Down Expand Up @@ -125,10 +127,24 @@ func (b *AWSBuilder) EtcdEncryption(value *AwsEtcdEncryptionBuilder) *AWSBuilder
return b
}

// PrivateHostedZoneID sets the value of the 'private_hosted_zone_ID' attribute to the given value.
func (b *AWSBuilder) PrivateHostedZoneID(value string) *AWSBuilder {
b.privateHostedZoneID = value
b.bitmap_ |= 256
return b
}

// PrivateHostedZoneRoleARN sets the value of the 'private_hosted_zone_role_ARN' attribute to the given value.
func (b *AWSBuilder) PrivateHostedZoneRoleARN(value string) *AWSBuilder {
b.privateHostedZoneRoleARN = value
b.bitmap_ |= 512
return b
}

// PrivateLink sets the value of the 'private_link' attribute to the given value.
func (b *AWSBuilder) PrivateLink(value bool) *AWSBuilder {
b.privateLink = value
b.bitmap_ |= 256
b.bitmap_ |= 1024
return b
}

Expand All @@ -138,35 +154,35 @@ func (b *AWSBuilder) PrivateLink(value bool) *AWSBuilder {
func (b *AWSBuilder) PrivateLinkConfiguration(value *PrivateLinkClusterConfigurationBuilder) *AWSBuilder {
b.privateLinkConfiguration = value
if value != nil {
b.bitmap_ |= 512
b.bitmap_ |= 2048
} else {
b.bitmap_ &^= 512
b.bitmap_ &^= 2048
}
return b
}

// SecretAccessKey sets the value of the 'secret_access_key' attribute to the given value.
func (b *AWSBuilder) SecretAccessKey(value string) *AWSBuilder {
b.secretAccessKey = value
b.bitmap_ |= 1024
b.bitmap_ |= 4096
return b
}

// SubnetIDs sets the value of the 'subnet_IDs' attribute to the given values.
func (b *AWSBuilder) SubnetIDs(values ...string) *AWSBuilder {
b.subnetIDs = make([]string, len(values))
copy(b.subnetIDs, values)
b.bitmap_ |= 2048
b.bitmap_ |= 8192
return b
}

// Tags sets the value of the 'tags' attribute to the given value.
func (b *AWSBuilder) Tags(value map[string]string) *AWSBuilder {
b.tags = value
if value != nil {
b.bitmap_ |= 4096
b.bitmap_ |= 16384
} else {
b.bitmap_ &^= 4096
b.bitmap_ &^= 16384
}
return b
}
Expand Down Expand Up @@ -197,6 +213,8 @@ func (b *AWSBuilder) Copy(object *AWS) *AWSBuilder {
} else {
b.etcdEncryption = nil
}
b.privateHostedZoneID = object.privateHostedZoneID
b.privateHostedZoneRoleARN = object.privateHostedZoneRoleARN
b.privateLink = object.privateLink
if object.privateLinkConfiguration != nil {
b.privateLinkConfiguration = NewPrivateLinkClusterConfiguration().Copy(object.privateLinkConfiguration)
Expand Down Expand Up @@ -248,6 +266,8 @@ func (b *AWSBuilder) Build() (object *AWS, err error) {
return
}
}
object.privateHostedZoneID = b.privateHostedZoneID
object.privateHostedZoneRoleARN = b.privateHostedZoneRoleARN
object.privateLink = b.privateLink
if b.privateLinkConfiguration != nil {
object.privateLinkConfiguration, err = b.privateLinkConfiguration.Build()
Expand Down
68 changes: 58 additions & 10 deletions clustersmgmt/v1/aws_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ type AWS struct {
billingAccountID string
ec2MetadataHttpTokens Ec2MetadataHttpTokens
etcdEncryption *AwsEtcdEncryption
privateHostedZoneID string
privateHostedZoneRoleARN string
privateLinkConfiguration *PrivateLinkClusterConfiguration
secretAccessKey string
subnetIDs []string
Expand Down Expand Up @@ -228,12 +230,58 @@ func (o *AWS) GetEtcdEncryption() (value *AwsEtcdEncryption, ok bool) {
return
}

// PrivateHostedZoneID returns the value of the 'private_hosted_zone_ID' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// ID of private hosted zone.
func (o *AWS) PrivateHostedZoneID() string {
if o != nil && o.bitmap_&256 != 0 {
return o.privateHostedZoneID
}
return ""
}

// GetPrivateHostedZoneID returns the value of the 'private_hosted_zone_ID' attribute and
// a flag indicating if the attribute has a value.
//
// ID of private hosted zone.
func (o *AWS) GetPrivateHostedZoneID() (value string, ok bool) {
ok = o != nil && o.bitmap_&256 != 0
if ok {
value = o.privateHostedZoneID
}
return
}

// PrivateHostedZoneRoleARN returns the value of the 'private_hosted_zone_role_ARN' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// Role ARN for private hosted zone.
func (o *AWS) PrivateHostedZoneRoleARN() string {
if o != nil && o.bitmap_&512 != 0 {
return o.privateHostedZoneRoleARN
}
return ""
}

// GetPrivateHostedZoneRoleARN returns the value of the 'private_hosted_zone_role_ARN' attribute and
// a flag indicating if the attribute has a value.
//
// Role ARN for private hosted zone.
func (o *AWS) GetPrivateHostedZoneRoleARN() (value string, ok bool) {
ok = o != nil && o.bitmap_&512 != 0
if ok {
value = o.privateHostedZoneRoleARN
}
return
}

// PrivateLink returns the value of the 'private_link' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// Sets cluster to be inaccessible externally.
func (o *AWS) PrivateLink() bool {
if o != nil && o.bitmap_&256 != 0 {
if o != nil && o.bitmap_&1024 != 0 {
return o.privateLink
}
return false
Expand All @@ -244,7 +292,7 @@ func (o *AWS) PrivateLink() bool {
//
// Sets cluster to be inaccessible externally.
func (o *AWS) GetPrivateLink() (value bool, ok bool) {
ok = o != nil && o.bitmap_&256 != 0
ok = o != nil && o.bitmap_&1024 != 0
if ok {
value = o.privateLink
}
Expand All @@ -256,7 +304,7 @@ func (o *AWS) GetPrivateLink() (value bool, ok bool) {
//
// Manages additional configuration for Private Links.
func (o *AWS) PrivateLinkConfiguration() *PrivateLinkClusterConfiguration {
if o != nil && o.bitmap_&512 != 0 {
if o != nil && o.bitmap_&2048 != 0 {
return o.privateLinkConfiguration
}
return nil
Expand All @@ -267,7 +315,7 @@ func (o *AWS) PrivateLinkConfiguration() *PrivateLinkClusterConfiguration {
//
// Manages additional configuration for Private Links.
func (o *AWS) GetPrivateLinkConfiguration() (value *PrivateLinkClusterConfiguration, ok bool) {
ok = o != nil && o.bitmap_&512 != 0
ok = o != nil && o.bitmap_&2048 != 0
if ok {
value = o.privateLinkConfiguration
}
Expand All @@ -279,7 +327,7 @@ func (o *AWS) GetPrivateLinkConfiguration() (value *PrivateLinkClusterConfigurat
//
// AWS secret access key.
func (o *AWS) SecretAccessKey() string {
if o != nil && o.bitmap_&1024 != 0 {
if o != nil && o.bitmap_&4096 != 0 {
return o.secretAccessKey
}
return ""
Expand All @@ -290,7 +338,7 @@ func (o *AWS) SecretAccessKey() string {
//
// AWS secret access key.
func (o *AWS) GetSecretAccessKey() (value string, ok bool) {
ok = o != nil && o.bitmap_&1024 != 0
ok = o != nil && o.bitmap_&4096 != 0
if ok {
value = o.secretAccessKey
}
Expand All @@ -302,7 +350,7 @@ func (o *AWS) GetSecretAccessKey() (value string, ok bool) {
//
// The subnet ids to be used when installing the cluster.
func (o *AWS) SubnetIDs() []string {
if o != nil && o.bitmap_&2048 != 0 {
if o != nil && o.bitmap_&8192 != 0 {
return o.subnetIDs
}
return nil
Expand All @@ -313,7 +361,7 @@ func (o *AWS) SubnetIDs() []string {
//
// The subnet ids to be used when installing the cluster.
func (o *AWS) GetSubnetIDs() (value []string, ok bool) {
ok = o != nil && o.bitmap_&2048 != 0
ok = o != nil && o.bitmap_&8192 != 0
if ok {
value = o.subnetIDs
}
Expand All @@ -325,7 +373,7 @@ func (o *AWS) GetSubnetIDs() (value []string, ok bool) {
//
// Optional keys and values that the installer will add as tags to all AWS resources it creates
func (o *AWS) Tags() map[string]string {
if o != nil && o.bitmap_&4096 != 0 {
if o != nil && o.bitmap_&16384 != 0 {
return o.tags
}
return nil
Expand All @@ -336,7 +384,7 @@ func (o *AWS) Tags() map[string]string {
//
// Optional keys and values that the installer will add as tags to all AWS resources it creates
func (o *AWS) GetTags() (value map[string]string, ok bool) {
ok = o != nil && o.bitmap_&4096 != 0
ok = o != nil && o.bitmap_&16384 != 0
if ok {
value = o.tags
}
Expand Down
44 changes: 35 additions & 9 deletions clustersmgmt/v1/aws_type_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,24 @@ func writeAWS(object *AWS, stream *jsoniter.Stream) {
count++
}
present_ = object.bitmap_&256 != 0
if present_ {
if count > 0 {
stream.WriteMore()
}
stream.WriteObjectField("private_hosted_zone_id")
stream.WriteString(object.privateHostedZoneID)
count++
}
present_ = object.bitmap_&512 != 0
if present_ {
if count > 0 {
stream.WriteMore()
}
stream.WriteObjectField("private_hosted_zone_role_arn")
stream.WriteString(object.privateHostedZoneRoleARN)
count++
}
present_ = object.bitmap_&1024 != 0
if present_ {
if count > 0 {
stream.WriteMore()
Expand All @@ -124,7 +142,7 @@ func writeAWS(object *AWS, stream *jsoniter.Stream) {
stream.WriteBool(object.privateLink)
count++
}
present_ = object.bitmap_&512 != 0 && object.privateLinkConfiguration != nil
present_ = object.bitmap_&2048 != 0 && object.privateLinkConfiguration != nil
if present_ {
if count > 0 {
stream.WriteMore()
Expand All @@ -133,7 +151,7 @@ func writeAWS(object *AWS, stream *jsoniter.Stream) {
writePrivateLinkClusterConfiguration(object.privateLinkConfiguration, stream)
count++
}
present_ = object.bitmap_&1024 != 0
present_ = object.bitmap_&4096 != 0
if present_ {
if count > 0 {
stream.WriteMore()
Expand All @@ -142,7 +160,7 @@ func writeAWS(object *AWS, stream *jsoniter.Stream) {
stream.WriteString(object.secretAccessKey)
count++
}
present_ = object.bitmap_&2048 != 0 && object.subnetIDs != nil
present_ = object.bitmap_&8192 != 0 && object.subnetIDs != nil
if present_ {
if count > 0 {
stream.WriteMore()
Expand All @@ -151,7 +169,7 @@ func writeAWS(object *AWS, stream *jsoniter.Stream) {
writeStringList(object.subnetIDs, stream)
count++
}
present_ = object.bitmap_&4096 != 0 && object.tags != nil
present_ = object.bitmap_&16384 != 0 && object.tags != nil
if present_ {
if count > 0 {
stream.WriteMore()
Expand Down Expand Up @@ -236,22 +254,30 @@ func readAWS(iterator *jsoniter.Iterator) *AWS {
value := readAwsEtcdEncryption(iterator)
object.etcdEncryption = value
object.bitmap_ |= 128
case "private_hosted_zone_id":
value := iterator.ReadString()
object.privateHostedZoneID = value
object.bitmap_ |= 256
case "private_hosted_zone_role_arn":
value := iterator.ReadString()
object.privateHostedZoneRoleARN = value
object.bitmap_ |= 512
case "private_link":
value := iterator.ReadBool()
object.privateLink = value
object.bitmap_ |= 256
object.bitmap_ |= 1024
case "private_link_configuration":
value := readPrivateLinkClusterConfiguration(iterator)
object.privateLinkConfiguration = value
object.bitmap_ |= 512
object.bitmap_ |= 2048
case "secret_access_key":
value := iterator.ReadString()
object.secretAccessKey = value
object.bitmap_ |= 1024
object.bitmap_ |= 4096
case "subnet_ids":
value := readStringList(iterator)
object.subnetIDs = value
object.bitmap_ |= 2048
object.bitmap_ |= 8192
case "tags":
value := map[string]string{}
for {
Expand All @@ -263,7 +289,7 @@ func readAWS(iterator *jsoniter.Iterator) *AWS {
value[key] = item
}
object.tags = value
object.bitmap_ |= 4096
object.bitmap_ |= 16384
default:
iterator.ReadAny()
}
Expand Down
Loading

0 comments on commit b97ef18

Please sign in to comment.