Skip to content

Commit

Permalink
Add DisplayName and Description to BillingModelItem (#831)
Browse files Browse the repository at this point in the history
  • Loading branch information
tirthct authored Sep 5, 2023
1 parent 484a6ab commit ecd552c
Show file tree
Hide file tree
Showing 6 changed files with 2,545 additions and 2,423 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.314
model_version:=v0.0.315
model_url:=https://github.com/openshift-online/ocm-api-model.git

# Details of the metamodel to use:
Expand Down
26 changes: 23 additions & 3 deletions accountsmgmt/v1/billing_model_item_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ package v1 // github.com/openshift-online/ocm-sdk-go/accountsmgmt/v1
type BillingModelItemBuilder struct {
bitmap_ uint32
href string
description string
displayName string
id string
marketplace string
model string
Expand All @@ -47,24 +49,38 @@ func (b *BillingModelItemBuilder) HREF(value string) *BillingModelItemBuilder {
return b
}

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

// DisplayName sets the value of the 'display_name' attribute to the given value.
func (b *BillingModelItemBuilder) DisplayName(value string) *BillingModelItemBuilder {
b.displayName = value
b.bitmap_ |= 4
return b
}

// Id sets the value of the 'id' attribute to the given value.
func (b *BillingModelItemBuilder) Id(value string) *BillingModelItemBuilder {
b.id = value
b.bitmap_ |= 2
b.bitmap_ |= 8
return b
}

// Marketplace sets the value of the 'marketplace' attribute to the given value.
func (b *BillingModelItemBuilder) Marketplace(value string) *BillingModelItemBuilder {
b.marketplace = value
b.bitmap_ |= 4
b.bitmap_ |= 16
return b
}

// Model sets the value of the 'model' attribute to the given value.
func (b *BillingModelItemBuilder) Model(value string) *BillingModelItemBuilder {
b.model = value
b.bitmap_ |= 8
b.bitmap_ |= 32
return b
}

Expand All @@ -75,6 +91,8 @@ func (b *BillingModelItemBuilder) Copy(object *BillingModelItem) *BillingModelIt
}
b.bitmap_ = object.bitmap_
b.href = object.href
b.description = object.description
b.displayName = object.displayName
b.id = object.id
b.marketplace = object.marketplace
b.model = object.model
Expand All @@ -86,6 +104,8 @@ func (b *BillingModelItemBuilder) Build() (object *BillingModelItem, err error)
object = new(BillingModelItem)
object.bitmap_ = b.bitmap_
object.href = b.href
object.description = b.description
object.displayName = b.displayName
object.id = b.id
object.marketplace = b.marketplace
object.model = b.model
Expand Down
60 changes: 54 additions & 6 deletions accountsmgmt/v1/billing_model_item_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ package v1 // github.com/openshift-online/ocm-sdk-go/accountsmgmt/v1
type BillingModelItem struct {
bitmap_ uint32
href string
description string
displayName string
id string
marketplace string
model string
Expand Down Expand Up @@ -58,12 +60,58 @@ func (o *BillingModelItem) GetHREF() (value string, ok bool) {
return
}

// Description returns the value of the 'description' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// Single line description of the billing model for better understanding.
func (o *BillingModelItem) Description() string {
if o != nil && o.bitmap_&2 != 0 {
return o.description
}
return ""
}

// GetDescription returns the value of the 'description' attribute and
// a flag indicating if the attribute has a value.
//
// Single line description of the billing model for better understanding.
func (o *BillingModelItem) GetDescription() (value string, ok bool) {
ok = o != nil && o.bitmap_&2 != 0
if ok {
value = o.description
}
return
}

// DisplayName returns the value of the 'display_name' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// User friendly display name of the billing model.
func (o *BillingModelItem) DisplayName() string {
if o != nil && o.bitmap_&4 != 0 {
return o.displayName
}
return ""
}

// GetDisplayName returns the value of the 'display_name' attribute and
// a flag indicating if the attribute has a value.
//
// User friendly display name of the billing model.
func (o *BillingModelItem) GetDisplayName() (value string, ok bool) {
ok = o != nil && o.bitmap_&4 != 0
if ok {
value = o.displayName
}
return
}

// Id returns the value of the 'id' attribute, or
// the zero value of the type if the attribute doesn't have a value.
//
// Id for the BillingModel.
func (o *BillingModelItem) Id() string {
if o != nil && o.bitmap_&2 != 0 {
if o != nil && o.bitmap_&8 != 0 {
return o.id
}
return ""
Expand All @@ -74,7 +122,7 @@ func (o *BillingModelItem) Id() string {
//
// Id for the BillingModel.
func (o *BillingModelItem) GetId() (value string, ok bool) {
ok = o != nil && o.bitmap_&2 != 0
ok = o != nil && o.bitmap_&8 != 0
if ok {
value = o.id
}
Expand All @@ -86,7 +134,7 @@ func (o *BillingModelItem) GetId() (value string, ok bool) {
//
// Indicates the marketplace of the billing model. e.g. gcp, aws, etc.
func (o *BillingModelItem) Marketplace() string {
if o != nil && o.bitmap_&4 != 0 {
if o != nil && o.bitmap_&16 != 0 {
return o.marketplace
}
return ""
Expand All @@ -97,7 +145,7 @@ func (o *BillingModelItem) Marketplace() string {
//
// Indicates the marketplace of the billing model. e.g. gcp, aws, etc.
func (o *BillingModelItem) GetMarketplace() (value string, ok bool) {
ok = o != nil && o.bitmap_&4 != 0
ok = o != nil && o.bitmap_&16 != 0
if ok {
value = o.marketplace
}
Expand All @@ -109,7 +157,7 @@ func (o *BillingModelItem) GetMarketplace() (value string, ok bool) {
//
// Model type of the BillingModel. e.g. standard, marketplace, marketplace-aws, etc.
func (o *BillingModelItem) Model() string {
if o != nil && o.bitmap_&8 != 0 {
if o != nil && o.bitmap_&32 != 0 {
return o.model
}
return ""
Expand All @@ -120,7 +168,7 @@ func (o *BillingModelItem) Model() string {
//
// Model type of the BillingModel. e.g. standard, marketplace, marketplace-aws, etc.
func (o *BillingModelItem) GetModel() (value string, ok bool) {
ok = o != nil && o.bitmap_&8 != 0
ok = o != nil && o.bitmap_&32 != 0
if ok {
value = o.model
}
Expand Down
36 changes: 31 additions & 5 deletions accountsmgmt/v1/billing_model_item_type_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,24 @@ func writeBillingModelItem(object *BillingModelItem, stream *jsoniter.Stream) {
count++
}
present_ = object.bitmap_&2 != 0
if present_ {
if count > 0 {
stream.WriteMore()
}
stream.WriteObjectField("description")
stream.WriteString(object.description)
count++
}
present_ = object.bitmap_&4 != 0
if present_ {
if count > 0 {
stream.WriteMore()
}
stream.WriteObjectField("display_name")
stream.WriteString(object.displayName)
count++
}
present_ = object.bitmap_&8 != 0
if present_ {
if count > 0 {
stream.WriteMore()
Expand All @@ -60,7 +78,7 @@ func writeBillingModelItem(object *BillingModelItem, stream *jsoniter.Stream) {
stream.WriteString(object.id)
count++
}
present_ = object.bitmap_&4 != 0
present_ = object.bitmap_&16 != 0
if present_ {
if count > 0 {
stream.WriteMore()
Expand All @@ -69,7 +87,7 @@ func writeBillingModelItem(object *BillingModelItem, stream *jsoniter.Stream) {
stream.WriteString(object.marketplace)
count++
}
present_ = object.bitmap_&8 != 0
present_ = object.bitmap_&32 != 0
if present_ {
if count > 0 {
stream.WriteMore()
Expand Down Expand Up @@ -105,18 +123,26 @@ func readBillingModelItem(iterator *jsoniter.Iterator) *BillingModelItem {
value := iterator.ReadString()
object.href = value
object.bitmap_ |= 1
case "description":
value := iterator.ReadString()
object.description = value
object.bitmap_ |= 2
case "display_name":
value := iterator.ReadString()
object.displayName = value
object.bitmap_ |= 4
case "id":
value := iterator.ReadString()
object.id = value
object.bitmap_ |= 2
object.bitmap_ |= 8
case "marketplace":
value := iterator.ReadString()
object.marketplace = value
object.bitmap_ |= 4
object.bitmap_ |= 16
case "model":
value := iterator.ReadString()
object.model = value
object.bitmap_ |= 8
object.bitmap_ |= 32
default:
iterator.ReadAny()
}
Expand Down
Loading

0 comments on commit ecd552c

Please sign in to comment.