|
| 1 | +/* |
| 2 | +Copyright (c) 2020 Red Hat, Inc. |
| 3 | +
|
| 4 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +you may not use this file except in compliance with the License. |
| 6 | +You may obtain a copy of the License at |
| 7 | +
|
| 8 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | +Unless required by applicable law or agreed to in writing, software |
| 11 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +See the License for the specific language governing permissions and |
| 14 | +limitations under the License. |
| 15 | +*/ |
| 16 | + |
| 17 | +// IMPORTANT: This file has been generated automatically, refrain from modifying it manually as all |
| 18 | +// your changes will be lost when the file is generated again. |
| 19 | + |
| 20 | +package v1 // github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1 |
| 21 | + |
| 22 | +import ( |
| 23 | + time "time" |
| 24 | +) |
| 25 | + |
| 26 | +// ProductMinimalVersionBuilder contains the data and logic needed to build 'product_minimal_version' objects. |
| 27 | +// |
| 28 | +// Representation of a product minimal version. |
| 29 | +type ProductMinimalVersionBuilder struct { |
| 30 | + bitmap_ uint32 |
| 31 | + id string |
| 32 | + href string |
| 33 | + rosaCli string |
| 34 | + startDate time.Time |
| 35 | +} |
| 36 | + |
| 37 | +// NewProductMinimalVersion creates a new builder of 'product_minimal_version' objects. |
| 38 | +func NewProductMinimalVersion() *ProductMinimalVersionBuilder { |
| 39 | + return &ProductMinimalVersionBuilder{} |
| 40 | +} |
| 41 | + |
| 42 | +// Link sets the flag that indicates if this is a link. |
| 43 | +func (b *ProductMinimalVersionBuilder) Link(value bool) *ProductMinimalVersionBuilder { |
| 44 | + b.bitmap_ |= 1 |
| 45 | + return b |
| 46 | +} |
| 47 | + |
| 48 | +// ID sets the identifier of the object. |
| 49 | +func (b *ProductMinimalVersionBuilder) ID(value string) *ProductMinimalVersionBuilder { |
| 50 | + b.id = value |
| 51 | + b.bitmap_ |= 2 |
| 52 | + return b |
| 53 | +} |
| 54 | + |
| 55 | +// HREF sets the link to the object. |
| 56 | +func (b *ProductMinimalVersionBuilder) HREF(value string) *ProductMinimalVersionBuilder { |
| 57 | + b.href = value |
| 58 | + b.bitmap_ |= 4 |
| 59 | + return b |
| 60 | +} |
| 61 | + |
| 62 | +// Empty returns true if the builder is empty, i.e. no attribute has a value. |
| 63 | +func (b *ProductMinimalVersionBuilder) Empty() bool { |
| 64 | + return b == nil || b.bitmap_&^1 == 0 |
| 65 | +} |
| 66 | + |
| 67 | +// RosaCli sets the value of the 'rosa_cli' attribute to the given value. |
| 68 | +func (b *ProductMinimalVersionBuilder) RosaCli(value string) *ProductMinimalVersionBuilder { |
| 69 | + b.rosaCli = value |
| 70 | + b.bitmap_ |= 8 |
| 71 | + return b |
| 72 | +} |
| 73 | + |
| 74 | +// StartDate sets the value of the 'start_date' attribute to the given value. |
| 75 | +func (b *ProductMinimalVersionBuilder) StartDate(value time.Time) *ProductMinimalVersionBuilder { |
| 76 | + b.startDate = value |
| 77 | + b.bitmap_ |= 16 |
| 78 | + return b |
| 79 | +} |
| 80 | + |
| 81 | +// Copy copies the attributes of the given object into this builder, discarding any previous values. |
| 82 | +func (b *ProductMinimalVersionBuilder) Copy(object *ProductMinimalVersion) *ProductMinimalVersionBuilder { |
| 83 | + if object == nil { |
| 84 | + return b |
| 85 | + } |
| 86 | + b.bitmap_ = object.bitmap_ |
| 87 | + b.id = object.id |
| 88 | + b.href = object.href |
| 89 | + b.rosaCli = object.rosaCli |
| 90 | + b.startDate = object.startDate |
| 91 | + return b |
| 92 | +} |
| 93 | + |
| 94 | +// Build creates a 'product_minimal_version' object using the configuration stored in the builder. |
| 95 | +func (b *ProductMinimalVersionBuilder) Build() (object *ProductMinimalVersion, err error) { |
| 96 | + object = new(ProductMinimalVersion) |
| 97 | + object.id = b.id |
| 98 | + object.href = b.href |
| 99 | + object.bitmap_ = b.bitmap_ |
| 100 | + object.rosaCli = b.rosaCli |
| 101 | + object.startDate = b.startDate |
| 102 | + return |
| 103 | +} |
0 commit comments