Skip to content

Commit fe63da7

Browse files
authored
Merge pull request #969 from lucasponce/chore_bump_ocm_api_0_0_380
chore: bump to ocm-api-model 0.0.380
2 parents 434c622 + f96ca20 commit fe63da7

21 files changed

+4679
-3326
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export PATH := $(LOCAL_BIN_PATH):$(PATH)
2727
export CGO_ENABLED=0
2828

2929
# Details of the model to use:
30-
model_version:=v0.0.379
30+
model_version:=v0.0.380
3131
model_url:=https://github.com/openshift-online/ocm-api-model.git
3232

3333
# Details of the metamodel to use:

clustersmgmt/v1/machine_type_builder.go

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ type MachineTypeBuilder struct {
2727
id string
2828
href string
2929
cpu *ValueBuilder
30+
architecture ProcessorType
3031
category MachineTypeCategory
3132
cloudProvider *CloudProviderBuilder
3233
genericName string
@@ -103,12 +104,21 @@ func (b *MachineTypeBuilder) CPU(value *ValueBuilder) *MachineTypeBuilder {
103104
return b
104105
}
105106

107+
// Architecture sets the value of the 'architecture' attribute to the given value.
108+
//
109+
// Processor type category.
110+
func (b *MachineTypeBuilder) Architecture(value ProcessorType) *MachineTypeBuilder {
111+
b.architecture = value
112+
b.bitmap_ |= 32
113+
return b
114+
}
115+
106116
// Category sets the value of the 'category' attribute to the given value.
107117
//
108118
// Machine type category.
109119
func (b *MachineTypeBuilder) Category(value MachineTypeCategory) *MachineTypeBuilder {
110120
b.category = value
111-
b.bitmap_ |= 32
121+
b.bitmap_ |= 64
112122
return b
113123
}
114124

@@ -118,17 +128,17 @@ func (b *MachineTypeBuilder) Category(value MachineTypeCategory) *MachineTypeBui
118128
func (b *MachineTypeBuilder) CloudProvider(value *CloudProviderBuilder) *MachineTypeBuilder {
119129
b.cloudProvider = value
120130
if value != nil {
121-
b.bitmap_ |= 64
131+
b.bitmap_ |= 128
122132
} else {
123-
b.bitmap_ &^= 64
133+
b.bitmap_ &^= 128
124134
}
125135
return b
126136
}
127137

128138
// GenericName sets the value of the 'generic_name' attribute to the given value.
129139
func (b *MachineTypeBuilder) GenericName(value string) *MachineTypeBuilder {
130140
b.genericName = value
131-
b.bitmap_ |= 128
141+
b.bitmap_ |= 256
132142
return b
133143
}
134144

@@ -155,17 +165,17 @@ func (b *MachineTypeBuilder) GenericName(value string) *MachineTypeBuilder {
155165
func (b *MachineTypeBuilder) Memory(value *ValueBuilder) *MachineTypeBuilder {
156166
b.memory = value
157167
if value != nil {
158-
b.bitmap_ |= 256
168+
b.bitmap_ |= 512
159169
} else {
160-
b.bitmap_ &^= 256
170+
b.bitmap_ &^= 512
161171
}
162172
return b
163173
}
164174

165175
// Name sets the value of the 'name' attribute to the given value.
166176
func (b *MachineTypeBuilder) Name(value string) *MachineTypeBuilder {
167177
b.name = value
168-
b.bitmap_ |= 512
178+
b.bitmap_ |= 1024
169179
return b
170180
}
171181

@@ -174,7 +184,7 @@ func (b *MachineTypeBuilder) Name(value string) *MachineTypeBuilder {
174184
// Machine type size.
175185
func (b *MachineTypeBuilder) Size(value MachineTypeSize) *MachineTypeBuilder {
176186
b.size = value
177-
b.bitmap_ |= 1024
187+
b.bitmap_ |= 2048
178188
return b
179189
}
180190

@@ -192,6 +202,7 @@ func (b *MachineTypeBuilder) Copy(object *MachineType) *MachineTypeBuilder {
192202
} else {
193203
b.cpu = nil
194204
}
205+
b.architecture = object.architecture
195206
b.category = object.category
196207
if object.cloudProvider != nil {
197208
b.cloudProvider = NewCloudProvider().Copy(object.cloudProvider)
@@ -222,6 +233,7 @@ func (b *MachineTypeBuilder) Build() (object *MachineType, err error) {
222233
return
223234
}
224235
}
236+
object.architecture = b.architecture
225237
object.category = b.category
226238
if b.cloudProvider != nil {
227239
object.cloudProvider, err = b.cloudProvider.Build()

clustersmgmt/v1/machine_type_type.go

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ type MachineType struct {
3939
id string
4040
href string
4141
cpu *Value
42+
architecture ProcessorType
4243
category MachineTypeCategory
4344
cloudProvider *CloudProvider
4445
genericName string
@@ -151,12 +152,35 @@ func (o *MachineType) GetCPU() (value *Value, ok bool) {
151152
return
152153
}
153154

155+
// Architecture returns the value of the 'architecture' attribute, or
156+
// the zero value of the type if the attribute doesn't have a value.
157+
//
158+
// The architecture of the machine type.
159+
func (o *MachineType) Architecture() ProcessorType {
160+
if o != nil && o.bitmap_&32 != 0 {
161+
return o.architecture
162+
}
163+
return ProcessorType("")
164+
}
165+
166+
// GetArchitecture returns the value of the 'architecture' attribute and
167+
// a flag indicating if the attribute has a value.
168+
//
169+
// The architecture of the machine type.
170+
func (o *MachineType) GetArchitecture() (value ProcessorType, ok bool) {
171+
ok = o != nil && o.bitmap_&32 != 0
172+
if ok {
173+
value = o.architecture
174+
}
175+
return
176+
}
177+
154178
// Category returns the value of the 'category' attribute, or
155179
// the zero value of the type if the attribute doesn't have a value.
156180
//
157181
// The category which the machine type is suitable for.
158182
func (o *MachineType) Category() MachineTypeCategory {
159-
if o != nil && o.bitmap_&32 != 0 {
183+
if o != nil && o.bitmap_&64 != 0 {
160184
return o.category
161185
}
162186
return MachineTypeCategory("")
@@ -167,7 +191,7 @@ func (o *MachineType) Category() MachineTypeCategory {
167191
//
168192
// The category which the machine type is suitable for.
169193
func (o *MachineType) GetCategory() (value MachineTypeCategory, ok bool) {
170-
ok = o != nil && o.bitmap_&32 != 0
194+
ok = o != nil && o.bitmap_&64 != 0
171195
if ok {
172196
value = o.category
173197
}
@@ -179,7 +203,7 @@ func (o *MachineType) GetCategory() (value MachineTypeCategory, ok bool) {
179203
//
180204
// Link to the cloud provider that the machine type belongs to.
181205
func (o *MachineType) CloudProvider() *CloudProvider {
182-
if o != nil && o.bitmap_&64 != 0 {
206+
if o != nil && o.bitmap_&128 != 0 {
183207
return o.cloudProvider
184208
}
185209
return nil
@@ -190,7 +214,7 @@ func (o *MachineType) CloudProvider() *CloudProvider {
190214
//
191215
// Link to the cloud provider that the machine type belongs to.
192216
func (o *MachineType) GetCloudProvider() (value *CloudProvider, ok bool) {
193-
ok = o != nil && o.bitmap_&64 != 0
217+
ok = o != nil && o.bitmap_&128 != 0
194218
if ok {
195219
value = o.cloudProvider
196220
}
@@ -205,7 +229,7 @@ func (o *MachineType) GetCloudProvider() (value *CloudProvider, ok bool) {
205229
// machine types on different providers.
206230
// Corresponds to `resource_name` values in "compute.node" quota cost data.
207231
func (o *MachineType) GenericName() string {
208-
if o != nil && o.bitmap_&128 != 0 {
232+
if o != nil && o.bitmap_&256 != 0 {
209233
return o.genericName
210234
}
211235
return ""
@@ -219,7 +243,7 @@ func (o *MachineType) GenericName() string {
219243
// machine types on different providers.
220244
// Corresponds to `resource_name` values in "compute.node" quota cost data.
221245
func (o *MachineType) GetGenericName() (value string, ok bool) {
222-
ok = o != nil && o.bitmap_&128 != 0
246+
ok = o != nil && o.bitmap_&256 != 0
223247
if ok {
224248
value = o.genericName
225249
}
@@ -231,7 +255,7 @@ func (o *MachineType) GetGenericName() (value string, ok bool) {
231255
//
232256
// The amount of memory of the machine type.
233257
func (o *MachineType) Memory() *Value {
234-
if o != nil && o.bitmap_&256 != 0 {
258+
if o != nil && o.bitmap_&512 != 0 {
235259
return o.memory
236260
}
237261
return nil
@@ -242,7 +266,7 @@ func (o *MachineType) Memory() *Value {
242266
//
243267
// The amount of memory of the machine type.
244268
func (o *MachineType) GetMemory() (value *Value, ok bool) {
245-
ok = o != nil && o.bitmap_&256 != 0
269+
ok = o != nil && o.bitmap_&512 != 0
246270
if ok {
247271
value = o.memory
248272
}
@@ -254,7 +278,7 @@ func (o *MachineType) GetMemory() (value *Value, ok bool) {
254278
//
255279
// Human friendly identifier of the machine type, for example `r5.xlarge - Memory Optimized`.
256280
func (o *MachineType) Name() string {
257-
if o != nil && o.bitmap_&512 != 0 {
281+
if o != nil && o.bitmap_&1024 != 0 {
258282
return o.name
259283
}
260284
return ""
@@ -265,7 +289,7 @@ func (o *MachineType) Name() string {
265289
//
266290
// Human friendly identifier of the machine type, for example `r5.xlarge - Memory Optimized`.
267291
func (o *MachineType) GetName() (value string, ok bool) {
268-
ok = o != nil && o.bitmap_&512 != 0
292+
ok = o != nil && o.bitmap_&1024 != 0
269293
if ok {
270294
value = o.name
271295
}
@@ -277,7 +301,7 @@ func (o *MachineType) GetName() (value string, ok bool) {
277301
//
278302
// The size of the machine type.
279303
func (o *MachineType) Size() MachineTypeSize {
280-
if o != nil && o.bitmap_&1024 != 0 {
304+
if o != nil && o.bitmap_&2048 != 0 {
281305
return o.size
282306
}
283307
return MachineTypeSize("")
@@ -288,7 +312,7 @@ func (o *MachineType) Size() MachineTypeSize {
288312
//
289313
// The size of the machine type.
290314
func (o *MachineType) GetSize() (value MachineTypeSize, ok bool) {
291-
ok = o != nil && o.bitmap_&1024 != 0
315+
ok = o != nil && o.bitmap_&2048 != 0
292316
if ok {
293317
value = o.size
294318
}

clustersmgmt/v1/machine_type_type_json.go

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,15 @@ func writeMachineType(object *MachineType, stream *jsoniter.Stream) {
8484
count++
8585
}
8686
present_ = object.bitmap_&32 != 0
87+
if present_ {
88+
if count > 0 {
89+
stream.WriteMore()
90+
}
91+
stream.WriteObjectField("architecture")
92+
stream.WriteString(string(object.architecture))
93+
count++
94+
}
95+
present_ = object.bitmap_&64 != 0
8796
if present_ {
8897
if count > 0 {
8998
stream.WriteMore()
@@ -92,7 +101,7 @@ func writeMachineType(object *MachineType, stream *jsoniter.Stream) {
92101
stream.WriteString(string(object.category))
93102
count++
94103
}
95-
present_ = object.bitmap_&64 != 0 && object.cloudProvider != nil
104+
present_ = object.bitmap_&128 != 0 && object.cloudProvider != nil
96105
if present_ {
97106
if count > 0 {
98107
stream.WriteMore()
@@ -101,7 +110,7 @@ func writeMachineType(object *MachineType, stream *jsoniter.Stream) {
101110
writeCloudProvider(object.cloudProvider, stream)
102111
count++
103112
}
104-
present_ = object.bitmap_&128 != 0
113+
present_ = object.bitmap_&256 != 0
105114
if present_ {
106115
if count > 0 {
107116
stream.WriteMore()
@@ -110,7 +119,7 @@ func writeMachineType(object *MachineType, stream *jsoniter.Stream) {
110119
stream.WriteString(object.genericName)
111120
count++
112121
}
113-
present_ = object.bitmap_&256 != 0 && object.memory != nil
122+
present_ = object.bitmap_&512 != 0 && object.memory != nil
114123
if present_ {
115124
if count > 0 {
116125
stream.WriteMore()
@@ -119,7 +128,7 @@ func writeMachineType(object *MachineType, stream *jsoniter.Stream) {
119128
writeValue(object.memory, stream)
120129
count++
121130
}
122-
present_ = object.bitmap_&512 != 0
131+
present_ = object.bitmap_&1024 != 0
123132
if present_ {
124133
if count > 0 {
125134
stream.WriteMore()
@@ -128,7 +137,7 @@ func writeMachineType(object *MachineType, stream *jsoniter.Stream) {
128137
stream.WriteString(object.name)
129138
count++
130139
}
131-
present_ = object.bitmap_&1024 != 0
140+
present_ = object.bitmap_&2048 != 0
132141
if present_ {
133142
if count > 0 {
134143
stream.WriteMore()
@@ -179,32 +188,37 @@ func readMachineType(iterator *jsoniter.Iterator) *MachineType {
179188
value := readValue(iterator)
180189
object.cpu = value
181190
object.bitmap_ |= 16
191+
case "architecture":
192+
text := iterator.ReadString()
193+
value := ProcessorType(text)
194+
object.architecture = value
195+
object.bitmap_ |= 32
182196
case "category":
183197
text := iterator.ReadString()
184198
value := MachineTypeCategory(text)
185199
object.category = value
186-
object.bitmap_ |= 32
200+
object.bitmap_ |= 64
187201
case "cloud_provider":
188202
value := readCloudProvider(iterator)
189203
object.cloudProvider = value
190-
object.bitmap_ |= 64
204+
object.bitmap_ |= 128
191205
case "generic_name":
192206
value := iterator.ReadString()
193207
object.genericName = value
194-
object.bitmap_ |= 128
208+
object.bitmap_ |= 256
195209
case "memory":
196210
value := readValue(iterator)
197211
object.memory = value
198-
object.bitmap_ |= 256
212+
object.bitmap_ |= 512
199213
case "name":
200214
value := iterator.ReadString()
201215
object.name = value
202-
object.bitmap_ |= 512
216+
object.bitmap_ |= 1024
203217
case "size":
204218
text := iterator.ReadString()
205219
value := MachineTypeSize(text)
206220
object.size = value
207-
object.bitmap_ |= 1024
221+
object.bitmap_ |= 2048
208222
default:
209223
iterator.ReadAny()
210224
}

0 commit comments

Comments
 (0)