Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OCM-1791] OCM SDK: Release SDK with updated API #824

Merged
merged 1 commit into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.311
model_version:=v0.0.312
model_url:=https://github.com/openshift-online/ocm-api-model.git

# Details of the metamodel to use:
Expand Down
105 changes: 105 additions & 0 deletions addonsmgmt/v1/addon_installation_billing_builder.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
/*
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/addonsmgmt/v1

// AddonInstallationBillingBuilder contains the data and logic needed to build 'addon_installation_billing' objects.
//
// Representation of an add-on installation billing.
type AddonInstallationBillingBuilder struct {
bitmap_ uint32
billingMarketplaceAccount string
billingModel BillingModel
href string
id string
kind string
}

// NewAddonInstallationBilling creates a new builder of 'addon_installation_billing' objects.
func NewAddonInstallationBilling() *AddonInstallationBillingBuilder {
return &AddonInstallationBillingBuilder{}
}

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

// BillingMarketplaceAccount sets the value of the 'billing_marketplace_account' attribute to the given value.
func (b *AddonInstallationBillingBuilder) BillingMarketplaceAccount(value string) *AddonInstallationBillingBuilder {
b.billingMarketplaceAccount = value
b.bitmap_ |= 1
return b
}

// BillingModel sets the value of the 'billing_model' attribute to the given value.
//
// Representation of an billing model field.
func (b *AddonInstallationBillingBuilder) BillingModel(value BillingModel) *AddonInstallationBillingBuilder {
b.billingModel = value
b.bitmap_ |= 2
return b
}

// Href sets the value of the 'href' attribute to the given value.
func (b *AddonInstallationBillingBuilder) Href(value string) *AddonInstallationBillingBuilder {
b.href = value
b.bitmap_ |= 4
return b
}

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

// Kind sets the value of the 'kind' attribute to the given value.
func (b *AddonInstallationBillingBuilder) Kind(value string) *AddonInstallationBillingBuilder {
b.kind = value
b.bitmap_ |= 16
return b
}

// Copy copies the attributes of the given object into this builder, discarding any previous values.
func (b *AddonInstallationBillingBuilder) Copy(object *AddonInstallationBilling) *AddonInstallationBillingBuilder {
if object == nil {
return b
}
b.bitmap_ = object.bitmap_
b.billingMarketplaceAccount = object.billingMarketplaceAccount
b.billingModel = object.billingModel
b.href = object.href
b.id = object.id
b.kind = object.kind
return b
}

// Build creates a 'addon_installation_billing' object using the configuration stored in the builder.
func (b *AddonInstallationBillingBuilder) Build() (object *AddonInstallationBilling, err error) {
object = new(AddonInstallationBilling)
object.bitmap_ = b.bitmap_
object.billingMarketplaceAccount = b.billingMarketplaceAccount
object.billingModel = b.billingModel
object.href = b.href
object.id = b.id
object.kind = b.kind
return
}
71 changes: 71 additions & 0 deletions addonsmgmt/v1/addon_installation_billing_list_builder.go
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/addonsmgmt/v1

// AddonInstallationBillingListBuilder contains the data and logic needed to build
// 'addon_installation_billing' objects.
type AddonInstallationBillingListBuilder struct {
items []*AddonInstallationBillingBuilder
}

// NewAddonInstallationBillingList creates a new builder of 'addon_installation_billing' objects.
func NewAddonInstallationBillingList() *AddonInstallationBillingListBuilder {
return new(AddonInstallationBillingListBuilder)
}

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

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

// Build creates a list of 'addon_installation_billing' objects using the
// configuration stored in the builder.
func (b *AddonInstallationBillingListBuilder) Build() (list *AddonInstallationBillingList, err error) {
items := make([]*AddonInstallationBilling, len(b.items))
for i, item := range b.items {
items[i], err = item.Build()
if err != nil {
return
}
}
list = new(AddonInstallationBillingList)
list.items = items
return
}
75 changes: 75 additions & 0 deletions addonsmgmt/v1/addon_installation_billing_list_type_json.go
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/addonsmgmt/v1

import (
"io"

jsoniter "github.com/json-iterator/go"
"github.com/openshift-online/ocm-sdk-go/helpers"
)

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

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

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

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