Skip to content

Commit

Permalink
Merge pull request #586 from samira-barouti/update-to-0.0.180
Browse files Browse the repository at this point in the history
Update to model 0.0.180
  • Loading branch information
jhernand authored Mar 9, 2022
2 parents 48dd4fc + 9261d73 commit 936ceb5
Show file tree
Hide file tree
Showing 6 changed files with 970 additions and 894 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.179
model_version:=v0.0.180
model_url:=https://github.com/openshift-online/ocm-api-model.git

# Details of the metamodel to use:
Expand Down
1,772 changes: 891 additions & 881 deletions clustersmgmt/v1/openapi.go

Large diffs are not rendered by default.

33 changes: 29 additions & 4 deletions clustersmgmt/v1/provision_shard_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ type ProvisionShardBuilder struct {
awsBaseDomain string
gcpBaseDomain string
gcpProjectOperator *ServerConfigBuilder
cloudProvider *CloudProviderBuilder
hiveConfig *ServerConfigBuilder
region *CloudRegionBuilder
}
Expand Down Expand Up @@ -108,15 +109,28 @@ func (b *ProvisionShardBuilder) GCPProjectOperator(value *ServerConfigBuilder) *
return b
}

// CloudProvider sets the value of the 'cloud_provider' attribute to the given value.
//
// Cloud provider.
func (b *ProvisionShardBuilder) CloudProvider(value *CloudProviderBuilder) *ProvisionShardBuilder {
b.cloudProvider = value
if value != nil {
b.bitmap_ |= 128
} else {
b.bitmap_ &^= 128
}
return b
}

// HiveConfig sets the value of the 'hive_config' attribute to the given value.
//
// Representation of a server config
func (b *ProvisionShardBuilder) HiveConfig(value *ServerConfigBuilder) *ProvisionShardBuilder {
b.hiveConfig = value
if value != nil {
b.bitmap_ |= 128
b.bitmap_ |= 256
} else {
b.bitmap_ &^= 128
b.bitmap_ &^= 256
}
return b
}
Expand All @@ -127,9 +141,9 @@ func (b *ProvisionShardBuilder) HiveConfig(value *ServerConfigBuilder) *Provisio
func (b *ProvisionShardBuilder) Region(value *CloudRegionBuilder) *ProvisionShardBuilder {
b.region = value
if value != nil {
b.bitmap_ |= 256
b.bitmap_ |= 512
} else {
b.bitmap_ &^= 256
b.bitmap_ &^= 512
}
return b
}
Expand All @@ -154,6 +168,11 @@ func (b *ProvisionShardBuilder) Copy(object *ProvisionShard) *ProvisionShardBuil
} else {
b.gcpProjectOperator = nil
}
if object.cloudProvider != nil {
b.cloudProvider = NewCloudProvider().Copy(object.cloudProvider)
} else {
b.cloudProvider = nil
}
if object.hiveConfig != nil {
b.hiveConfig = NewServerConfig().Copy(object.hiveConfig)
} else {
Expand Down Expand Up @@ -187,6 +206,12 @@ func (b *ProvisionShardBuilder) Build() (object *ProvisionShard, err error) {
return
}
}
if b.cloudProvider != nil {
object.cloudProvider, err = b.cloudProvider.Build()
if err != nil {
return
}
}
if b.hiveConfig != nil {
object.hiveConfig, err = b.hiveConfig.Build()
if err != nil {
Expand Down
32 changes: 28 additions & 4 deletions clustersmgmt/v1/provision_shard_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ type ProvisionShard struct {
awsBaseDomain string
gcpBaseDomain string
gcpProjectOperator *ServerConfig
cloudProvider *CloudProvider
hiveConfig *ServerConfig
region *CloudRegion
}
Expand Down Expand Up @@ -195,12 +196,35 @@ func (o *ProvisionShard) GetGCPProjectOperator() (value *ServerConfig, ok bool)
return
}

// CloudProvider returns the value of the 'cloud_provider' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// Contains the cloud provider name
func (o *ProvisionShard) CloudProvider() *CloudProvider {
if o != nil && o.bitmap_&128 != 0 {
return o.cloudProvider
}
return nil
}

// GetCloudProvider returns the value of the 'cloud_provider' attribute and
// a flag indicating if the attribute has a value.
//
// Contains the cloud provider name
func (o *ProvisionShard) GetCloudProvider() (value *CloudProvider, ok bool) {
ok = o != nil && o.bitmap_&128 != 0
if ok {
value = o.cloudProvider
}
return
}

// HiveConfig returns the value of the 'hive_config' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// Contains the configuration for Hive
func (o *ProvisionShard) HiveConfig() *ServerConfig {
if o != nil && o.bitmap_&128 != 0 {
if o != nil && o.bitmap_&256 != 0 {
return o.hiveConfig
}
return nil
Expand All @@ -211,7 +235,7 @@ func (o *ProvisionShard) HiveConfig() *ServerConfig {
//
// Contains the configuration for Hive
func (o *ProvisionShard) GetHiveConfig() (value *ServerConfig, ok bool) {
ok = o != nil && o.bitmap_&128 != 0
ok = o != nil && o.bitmap_&256 != 0
if ok {
value = o.hiveConfig
}
Expand All @@ -223,7 +247,7 @@ func (o *ProvisionShard) GetHiveConfig() (value *ServerConfig, ok bool) {
//
// Contains the cloud-provider region in which the provisioner spins up the cluster
func (o *ProvisionShard) Region() *CloudRegion {
if o != nil && o.bitmap_&256 != 0 {
if o != nil && o.bitmap_&512 != 0 {
return o.region
}
return nil
Expand All @@ -234,7 +258,7 @@ func (o *ProvisionShard) Region() *CloudRegion {
//
// Contains the cloud-provider region in which the provisioner spins up the cluster
func (o *ProvisionShard) GetRegion() (value *CloudRegion, ok bool) {
ok = o != nil && o.bitmap_&256 != 0
ok = o != nil && o.bitmap_&512 != 0
if ok {
value = o.region
}
Expand Down
21 changes: 17 additions & 4 deletions clustersmgmt/v1/provision_shard_type_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,16 @@ func writeProvisionShard(object *ProvisionShard, stream *jsoniter.Stream) {
writeServerConfig(object.gcpProjectOperator, stream)
count++
}
present_ = object.bitmap_&128 != 0 && object.hiveConfig != nil
present_ = object.bitmap_&128 != 0 && object.cloudProvider != nil
if present_ {
if count > 0 {
stream.WriteMore()
}
stream.WriteObjectField("cloud_provider")
writeCloudProvider(object.cloudProvider, stream)
count++
}
present_ = object.bitmap_&256 != 0 && object.hiveConfig != nil
if present_ {
if count > 0 {
stream.WriteMore()
Expand All @@ -110,7 +119,7 @@ func writeProvisionShard(object *ProvisionShard, stream *jsoniter.Stream) {
writeServerConfig(object.hiveConfig, stream)
count++
}
present_ = object.bitmap_&256 != 0 && object.region != nil
present_ = object.bitmap_&512 != 0 && object.region != nil
if present_ {
if count > 0 {
stream.WriteMore()
Expand Down Expand Up @@ -169,14 +178,18 @@ func readProvisionShard(iterator *jsoniter.Iterator) *ProvisionShard {
value := readServerConfig(iterator)
object.gcpProjectOperator = value
object.bitmap_ |= 64
case "cloud_provider":
value := readCloudProvider(iterator)
object.cloudProvider = value
object.bitmap_ |= 128
case "hive_config":
value := readServerConfig(iterator)
object.hiveConfig = value
object.bitmap_ |= 128
object.bitmap_ |= 256
case "region":
value := readCloudRegion(iterator)
object.region = value
object.bitmap_ |= 256
object.bitmap_ |= 512
default:
iterator.ReadAny()
}
Expand Down
4 changes: 4 additions & 0 deletions openapi/clusters_mgmt/v1/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -9411,6 +9411,10 @@
"description": "Contains the configuration for the GCP project operator",
"$ref": "#/components/schemas/ServerConfig"
},
"cloud_provider": {
"description": "Contains the cloud provider name",
"$ref": "#/components/schemas/CloudProvider"
},
"hive_config": {
"description": "Contains the configuration for Hive",
"$ref": "#/components/schemas/ServerConfig"
Expand Down

0 comments on commit 936ceb5

Please sign in to comment.