/
model_replica_properties_post.go
342 lines (259 loc) · 8.82 KB
/
model_replica_properties_post.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
/*
* VM Auto Scaling API
*
* The VM Auto Scaling Service enables IONOS clients to horizontally scale the number of VM replicas based on configured rules. You can use VM Auto Scaling to ensure that you have a sufficient number of replicas to handle your application loads at all times. For this purpose, create a VM Auto Scaling Group that contains the server replicas. The VM Auto Scaling Service ensures that the number of replicas in the group is always within the defined limits. When scaling policies are set, VM Auto Scaling creates or deletes replicas according to the requirements of your applications. For each policy, specified 'scale-in' and 'scale-out' actions are performed when the corresponding thresholds are reached.
*
* API version: 1-SDK.1
* Contact: support@cloud.ionos.com
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package ionoscloud
import (
"encoding/json"
)
// ReplicaPropertiesPost struct for ReplicaPropertiesPost
type ReplicaPropertiesPost struct {
AvailabilityZone *AvailabilityZone `json:"availabilityZone,omitempty"`
// The total number of cores for the VMs.
Cores *int32 `json:"cores"`
CpuFamily *CpuFamily `json:"cpuFamily,omitempty"`
// The list of NICs associated with this replica.
Nics *[]ReplicaNic `json:"nics,omitempty"`
// The size of the memory for the VMs in MB. The size must be in multiples of 256 MB, with a minimum of 256 MB; if you set 'ramHotPlug=TRUE', you must use at least 1024 MB. If you set the RAM size to more than 240 GB, 'ramHotPlug=FALSE' is fixed.
Ram *int32 `json:"ram"`
// List of volumes associated with this Replica.
Volumes *[]ReplicaVolumePost `json:"volumes,omitempty"`
}
// NewReplicaPropertiesPost instantiates a new ReplicaPropertiesPost object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewReplicaPropertiesPost(cores int32, ram int32) *ReplicaPropertiesPost {
this := ReplicaPropertiesPost{}
this.Cores = &cores
this.Ram = &ram
return &this
}
// NewReplicaPropertiesPostWithDefaults instantiates a new ReplicaPropertiesPost object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewReplicaPropertiesPostWithDefaults() *ReplicaPropertiesPost {
this := ReplicaPropertiesPost{}
return &this
}
// GetAvailabilityZone returns the AvailabilityZone field value
// If the value is explicit nil, the zero value for AvailabilityZone will be returned
func (o *ReplicaPropertiesPost) GetAvailabilityZone() *AvailabilityZone {
if o == nil {
return nil
}
return o.AvailabilityZone
}
// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ReplicaPropertiesPost) GetAvailabilityZoneOk() (*AvailabilityZone, bool) {
if o == nil {
return nil, false
}
return o.AvailabilityZone, true
}
// SetAvailabilityZone sets field value
func (o *ReplicaPropertiesPost) SetAvailabilityZone(v AvailabilityZone) {
o.AvailabilityZone = &v
}
// HasAvailabilityZone returns a boolean if a field has been set.
func (o *ReplicaPropertiesPost) HasAvailabilityZone() bool {
if o != nil && o.AvailabilityZone != nil {
return true
}
return false
}
// GetCores returns the Cores field value
// If the value is explicit nil, the zero value for int32 will be returned
func (o *ReplicaPropertiesPost) GetCores() *int32 {
if o == nil {
return nil
}
return o.Cores
}
// GetCoresOk returns a tuple with the Cores field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ReplicaPropertiesPost) GetCoresOk() (*int32, bool) {
if o == nil {
return nil, false
}
return o.Cores, true
}
// SetCores sets field value
func (o *ReplicaPropertiesPost) SetCores(v int32) {
o.Cores = &v
}
// HasCores returns a boolean if a field has been set.
func (o *ReplicaPropertiesPost) HasCores() bool {
if o != nil && o.Cores != nil {
return true
}
return false
}
// GetCpuFamily returns the CpuFamily field value
// If the value is explicit nil, the zero value for CpuFamily will be returned
func (o *ReplicaPropertiesPost) GetCpuFamily() *CpuFamily {
if o == nil {
return nil
}
return o.CpuFamily
}
// GetCpuFamilyOk returns a tuple with the CpuFamily field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ReplicaPropertiesPost) GetCpuFamilyOk() (*CpuFamily, bool) {
if o == nil {
return nil, false
}
return o.CpuFamily, true
}
// SetCpuFamily sets field value
func (o *ReplicaPropertiesPost) SetCpuFamily(v CpuFamily) {
o.CpuFamily = &v
}
// HasCpuFamily returns a boolean if a field has been set.
func (o *ReplicaPropertiesPost) HasCpuFamily() bool {
if o != nil && o.CpuFamily != nil {
return true
}
return false
}
// GetNics returns the Nics field value
// If the value is explicit nil, the zero value for []ReplicaNic will be returned
func (o *ReplicaPropertiesPost) GetNics() *[]ReplicaNic {
if o == nil {
return nil
}
return o.Nics
}
// GetNicsOk returns a tuple with the Nics field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ReplicaPropertiesPost) GetNicsOk() (*[]ReplicaNic, bool) {
if o == nil {
return nil, false
}
return o.Nics, true
}
// SetNics sets field value
func (o *ReplicaPropertiesPost) SetNics(v []ReplicaNic) {
o.Nics = &v
}
// HasNics returns a boolean if a field has been set.
func (o *ReplicaPropertiesPost) HasNics() bool {
if o != nil && o.Nics != nil {
return true
}
return false
}
// GetRam returns the Ram field value
// If the value is explicit nil, the zero value for int32 will be returned
func (o *ReplicaPropertiesPost) GetRam() *int32 {
if o == nil {
return nil
}
return o.Ram
}
// GetRamOk returns a tuple with the Ram field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ReplicaPropertiesPost) GetRamOk() (*int32, bool) {
if o == nil {
return nil, false
}
return o.Ram, true
}
// SetRam sets field value
func (o *ReplicaPropertiesPost) SetRam(v int32) {
o.Ram = &v
}
// HasRam returns a boolean if a field has been set.
func (o *ReplicaPropertiesPost) HasRam() bool {
if o != nil && o.Ram != nil {
return true
}
return false
}
// GetVolumes returns the Volumes field value
// If the value is explicit nil, the zero value for []ReplicaVolumePost will be returned
func (o *ReplicaPropertiesPost) GetVolumes() *[]ReplicaVolumePost {
if o == nil {
return nil
}
return o.Volumes
}
// GetVolumesOk returns a tuple with the Volumes field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *ReplicaPropertiesPost) GetVolumesOk() (*[]ReplicaVolumePost, bool) {
if o == nil {
return nil, false
}
return o.Volumes, true
}
// SetVolumes sets field value
func (o *ReplicaPropertiesPost) SetVolumes(v []ReplicaVolumePost) {
o.Volumes = &v
}
// HasVolumes returns a boolean if a field has been set.
func (o *ReplicaPropertiesPost) HasVolumes() bool {
if o != nil && o.Volumes != nil {
return true
}
return false
}
func (o ReplicaPropertiesPost) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
toSerialize["availabilityZone"] = o.AvailabilityZone
if o.Cores != nil {
toSerialize["cores"] = o.Cores
}
if o.CpuFamily != nil {
toSerialize["cpuFamily"] = o.CpuFamily
}
if o.Nics != nil {
toSerialize["nics"] = o.Nics
}
if o.Ram != nil {
toSerialize["ram"] = o.Ram
}
if o.Volumes != nil {
toSerialize["volumes"] = o.Volumes
}
return json.Marshal(toSerialize)
}
type NullableReplicaPropertiesPost struct {
value *ReplicaPropertiesPost
isSet bool
}
func (v NullableReplicaPropertiesPost) Get() *ReplicaPropertiesPost {
return v.value
}
func (v *NullableReplicaPropertiesPost) Set(val *ReplicaPropertiesPost) {
v.value = val
v.isSet = true
}
func (v NullableReplicaPropertiesPost) IsSet() bool {
return v.isSet
}
func (v *NullableReplicaPropertiesPost) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableReplicaPropertiesPost(val *ReplicaPropertiesPost) *NullableReplicaPropertiesPost {
return &NullableReplicaPropertiesPost{value: val, isSet: true}
}
func (v NullableReplicaPropertiesPost) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableReplicaPropertiesPost) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}