-
Notifications
You must be signed in to change notification settings - Fork 1
/
model_power_time_scheme_request_model.go
433 lines (369 loc) · 15.2 KB
/
model_power_time_scheme_request_model.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
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
/*
Citrix Virtual Apps and Desktops Rest API for Developer Portal
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
API version: devportal-onprem-ga
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package citrixorchestration
import (
"encoding/json"
)
// checks if the PowerTimeSchemeRequestModel type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PowerTimeSchemeRequestModel{}
// PowerTimeSchemeRequestModel Request object for specifying a power time scheme.
type PowerTimeSchemeRequestModel struct {
// The pattern of days of the week that the power time scheme covers.
DaysOfWeek []TimeSchemeDays `json:"DaysOfWeek,omitempty"`
// The administrative name of the power time scheme.
Name NullableString `json:"Name,omitempty"`
// The name of the power time scheme as displayed in the Studio console.
DisplayName NullableString `json:"DisplayName,omitempty"`
// `DEPRECATED. Use <see cref='PeakTimeRanges'/> instead.` DEPRECATED. Use PeakTimeRanges instead. A set of 24 boolean flag values, one for each hour of the day. The first value in the array relates to midnight to 00:59, the next one to 1 AM to 01:59 and so on, with the last array element relating to 11 PM to 11:59. If the flag is `true` it means that the associated hour of the day is considered a peak time; if `false` it means that it is considered off-peak.
// Deprecated
PeakHours []bool `json:"PeakHours,omitempty"`
// List of peak time ranges during the day.
PeakTimeRanges []string `json:"PeakTimeRanges,omitempty"`
// `DEPRECATED. Use <see cref='PoolUsingPercentage'/> instead.` DEPRECATED. Use PoolSizeSchedule instead. A set of 24 integer values, one for each hour of the day. The first value in the array relates to midnight to 00:59, the next one to 1 AM to 01:59 and so on, with the last array element relating to 11 PM to 11:59. The value defines the number of machines (either as an absolute number or a percentage of the machines in the delivery group, depending on the value of ) that are to be maintained in a running state, whether they are in use or not. A value of `-1` has special meaning: pool size management does not apply during such hours.
// Deprecated
PoolSize []int32 `json:"PoolSize,omitempty"`
// List of pool size schedules during the day. Each is specified as a time range and an indicator of the number of machines that should be powered on during that time range.
PoolSizeSchedule []PoolSizeScheduleRequestModel `json:"PoolSizeSchedule,omitempty"`
// Indicates whether the integer values in the pool size array are to be treated as absolute values (if this value is `false`) or as percentages of the number of machines in the delivery group (if this value is `true`).
PoolUsingPercentage NullableBool `json:"PoolUsingPercentage,omitempty"`
}
// NewPowerTimeSchemeRequestModel instantiates a new PowerTimeSchemeRequestModel 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 NewPowerTimeSchemeRequestModel() *PowerTimeSchemeRequestModel {
this := PowerTimeSchemeRequestModel{}
var poolUsingPercentage bool = false
this.PoolUsingPercentage = *NewNullableBool(&poolUsingPercentage)
return &this
}
// NewPowerTimeSchemeRequestModelWithDefaults instantiates a new PowerTimeSchemeRequestModel 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 NewPowerTimeSchemeRequestModelWithDefaults() *PowerTimeSchemeRequestModel {
this := PowerTimeSchemeRequestModel{}
var poolUsingPercentage bool = false
this.PoolUsingPercentage = *NewNullableBool(&poolUsingPercentage)
return &this
}
// GetDaysOfWeek returns the DaysOfWeek field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *PowerTimeSchemeRequestModel) GetDaysOfWeek() []TimeSchemeDays {
if o == nil {
var ret []TimeSchemeDays
return ret
}
return o.DaysOfWeek
}
// GetDaysOfWeekOk returns a tuple with the DaysOfWeek field value if set, nil otherwise
// 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 *PowerTimeSchemeRequestModel) GetDaysOfWeekOk() ([]TimeSchemeDays, bool) {
if o == nil || IsNil(o.DaysOfWeek) {
return nil, false
}
return o.DaysOfWeek, true
}
// HasDaysOfWeek returns a boolean if a field has been set.
func (o *PowerTimeSchemeRequestModel) HasDaysOfWeek() bool {
if o != nil && IsNil(o.DaysOfWeek) {
return true
}
return false
}
// SetDaysOfWeek gets a reference to the given []TimeSchemeDays and assigns it to the DaysOfWeek field.
func (o *PowerTimeSchemeRequestModel) SetDaysOfWeek(v []TimeSchemeDays) {
o.DaysOfWeek = v
}
// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *PowerTimeSchemeRequestModel) GetName() string {
if o == nil || IsNil(o.Name.Get()) {
var ret string
return ret
}
return *o.Name.Get()
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// 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 *PowerTimeSchemeRequestModel) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Name.Get(), o.Name.IsSet()
}
// HasName returns a boolean if a field has been set.
func (o *PowerTimeSchemeRequestModel) HasName() bool {
if o != nil && o.Name.IsSet() {
return true
}
return false
}
// SetName gets a reference to the given NullableString and assigns it to the Name field.
func (o *PowerTimeSchemeRequestModel) SetName(v string) {
o.Name.Set(&v)
}
// SetNameNil sets the value for Name to be an explicit nil
func (o *PowerTimeSchemeRequestModel) SetNameNil() {
o.Name.Set(nil)
}
// UnsetName ensures that no value is present for Name, not even an explicit nil
func (o *PowerTimeSchemeRequestModel) UnsetName() {
o.Name.Unset()
}
// GetDisplayName returns the DisplayName field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *PowerTimeSchemeRequestModel) GetDisplayName() string {
if o == nil || IsNil(o.DisplayName.Get()) {
var ret string
return ret
}
return *o.DisplayName.Get()
}
// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise
// 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 *PowerTimeSchemeRequestModel) GetDisplayNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.DisplayName.Get(), o.DisplayName.IsSet()
}
// HasDisplayName returns a boolean if a field has been set.
func (o *PowerTimeSchemeRequestModel) HasDisplayName() bool {
if o != nil && o.DisplayName.IsSet() {
return true
}
return false
}
// SetDisplayName gets a reference to the given NullableString and assigns it to the DisplayName field.
func (o *PowerTimeSchemeRequestModel) SetDisplayName(v string) {
o.DisplayName.Set(&v)
}
// SetDisplayNameNil sets the value for DisplayName to be an explicit nil
func (o *PowerTimeSchemeRequestModel) SetDisplayNameNil() {
o.DisplayName.Set(nil)
}
// UnsetDisplayName ensures that no value is present for DisplayName, not even an explicit nil
func (o *PowerTimeSchemeRequestModel) UnsetDisplayName() {
o.DisplayName.Unset()
}
// GetPeakHours returns the PeakHours field value if set, zero value otherwise (both if not set or set to explicit null).
// Deprecated
func (o *PowerTimeSchemeRequestModel) GetPeakHours() []bool {
if o == nil {
var ret []bool
return ret
}
return o.PeakHours
}
// GetPeakHoursOk returns a tuple with the PeakHours field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
// Deprecated
func (o *PowerTimeSchemeRequestModel) GetPeakHoursOk() ([]bool, bool) {
if o == nil || IsNil(o.PeakHours) {
return nil, false
}
return o.PeakHours, true
}
// HasPeakHours returns a boolean if a field has been set.
func (o *PowerTimeSchemeRequestModel) HasPeakHours() bool {
if o != nil && IsNil(o.PeakHours) {
return true
}
return false
}
// SetPeakHours gets a reference to the given []bool and assigns it to the PeakHours field.
// Deprecated
func (o *PowerTimeSchemeRequestModel) SetPeakHours(v []bool) {
o.PeakHours = v
}
// GetPeakTimeRanges returns the PeakTimeRanges field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *PowerTimeSchemeRequestModel) GetPeakTimeRanges() []string {
if o == nil {
var ret []string
return ret
}
return o.PeakTimeRanges
}
// GetPeakTimeRangesOk returns a tuple with the PeakTimeRanges field value if set, nil otherwise
// 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 *PowerTimeSchemeRequestModel) GetPeakTimeRangesOk() ([]string, bool) {
if o == nil || IsNil(o.PeakTimeRanges) {
return nil, false
}
return o.PeakTimeRanges, true
}
// HasPeakTimeRanges returns a boolean if a field has been set.
func (o *PowerTimeSchemeRequestModel) HasPeakTimeRanges() bool {
if o != nil && IsNil(o.PeakTimeRanges) {
return true
}
return false
}
// SetPeakTimeRanges gets a reference to the given []string and assigns it to the PeakTimeRanges field.
func (o *PowerTimeSchemeRequestModel) SetPeakTimeRanges(v []string) {
o.PeakTimeRanges = v
}
// GetPoolSize returns the PoolSize field value if set, zero value otherwise (both if not set or set to explicit null).
// Deprecated
func (o *PowerTimeSchemeRequestModel) GetPoolSize() []int32 {
if o == nil {
var ret []int32
return ret
}
return o.PoolSize
}
// GetPoolSizeOk returns a tuple with the PoolSize field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
// Deprecated
func (o *PowerTimeSchemeRequestModel) GetPoolSizeOk() ([]int32, bool) {
if o == nil || IsNil(o.PoolSize) {
return nil, false
}
return o.PoolSize, true
}
// HasPoolSize returns a boolean if a field has been set.
func (o *PowerTimeSchemeRequestModel) HasPoolSize() bool {
if o != nil && IsNil(o.PoolSize) {
return true
}
return false
}
// SetPoolSize gets a reference to the given []int32 and assigns it to the PoolSize field.
// Deprecated
func (o *PowerTimeSchemeRequestModel) SetPoolSize(v []int32) {
o.PoolSize = v
}
// GetPoolSizeSchedule returns the PoolSizeSchedule field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *PowerTimeSchemeRequestModel) GetPoolSizeSchedule() []PoolSizeScheduleRequestModel {
if o == nil {
var ret []PoolSizeScheduleRequestModel
return ret
}
return o.PoolSizeSchedule
}
// GetPoolSizeScheduleOk returns a tuple with the PoolSizeSchedule field value if set, nil otherwise
// 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 *PowerTimeSchemeRequestModel) GetPoolSizeScheduleOk() ([]PoolSizeScheduleRequestModel, bool) {
if o == nil || IsNil(o.PoolSizeSchedule) {
return nil, false
}
return o.PoolSizeSchedule, true
}
// HasPoolSizeSchedule returns a boolean if a field has been set.
func (o *PowerTimeSchemeRequestModel) HasPoolSizeSchedule() bool {
if o != nil && IsNil(o.PoolSizeSchedule) {
return true
}
return false
}
// SetPoolSizeSchedule gets a reference to the given []PoolSizeScheduleRequestModel and assigns it to the PoolSizeSchedule field.
func (o *PowerTimeSchemeRequestModel) SetPoolSizeSchedule(v []PoolSizeScheduleRequestModel) {
o.PoolSizeSchedule = v
}
// GetPoolUsingPercentage returns the PoolUsingPercentage field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *PowerTimeSchemeRequestModel) GetPoolUsingPercentage() bool {
if o == nil || IsNil(o.PoolUsingPercentage.Get()) {
var ret bool
return ret
}
return *o.PoolUsingPercentage.Get()
}
// GetPoolUsingPercentageOk returns a tuple with the PoolUsingPercentage field value if set, nil otherwise
// 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 *PowerTimeSchemeRequestModel) GetPoolUsingPercentageOk() (*bool, bool) {
if o == nil {
return nil, false
}
return o.PoolUsingPercentage.Get(), o.PoolUsingPercentage.IsSet()
}
// HasPoolUsingPercentage returns a boolean if a field has been set.
func (o *PowerTimeSchemeRequestModel) HasPoolUsingPercentage() bool {
if o != nil && o.PoolUsingPercentage.IsSet() {
return true
}
return false
}
// SetPoolUsingPercentage gets a reference to the given NullableBool and assigns it to the PoolUsingPercentage field.
func (o *PowerTimeSchemeRequestModel) SetPoolUsingPercentage(v bool) {
o.PoolUsingPercentage.Set(&v)
}
// SetPoolUsingPercentageNil sets the value for PoolUsingPercentage to be an explicit nil
func (o *PowerTimeSchemeRequestModel) SetPoolUsingPercentageNil() {
o.PoolUsingPercentage.Set(nil)
}
// UnsetPoolUsingPercentage ensures that no value is present for PoolUsingPercentage, not even an explicit nil
func (o *PowerTimeSchemeRequestModel) UnsetPoolUsingPercentage() {
o.PoolUsingPercentage.Unset()
}
func (o PowerTimeSchemeRequestModel) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PowerTimeSchemeRequestModel) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if o.DaysOfWeek != nil {
toSerialize["DaysOfWeek"] = o.DaysOfWeek
}
if o.Name.IsSet() {
toSerialize["Name"] = o.Name.Get()
}
if o.DisplayName.IsSet() {
toSerialize["DisplayName"] = o.DisplayName.Get()
}
if o.PeakHours != nil {
toSerialize["PeakHours"] = o.PeakHours
}
if o.PeakTimeRanges != nil {
toSerialize["PeakTimeRanges"] = o.PeakTimeRanges
}
if o.PoolSize != nil {
toSerialize["PoolSize"] = o.PoolSize
}
if o.PoolSizeSchedule != nil {
toSerialize["PoolSizeSchedule"] = o.PoolSizeSchedule
}
if o.PoolUsingPercentage.IsSet() {
toSerialize["PoolUsingPercentage"] = o.PoolUsingPercentage.Get()
}
return toSerialize, nil
}
type NullablePowerTimeSchemeRequestModel struct {
value *PowerTimeSchemeRequestModel
isSet bool
}
func (v NullablePowerTimeSchemeRequestModel) Get() *PowerTimeSchemeRequestModel {
return v.value
}
func (v *NullablePowerTimeSchemeRequestModel) Set(val *PowerTimeSchemeRequestModel) {
v.value = val
v.isSet = true
}
func (v NullablePowerTimeSchemeRequestModel) IsSet() bool {
return v.isSet
}
func (v *NullablePowerTimeSchemeRequestModel) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePowerTimeSchemeRequestModel(val *PowerTimeSchemeRequestModel) *NullablePowerTimeSchemeRequestModel {
return &NullablePowerTimeSchemeRequestModel{value: val, isSet: true}
}
func (v NullablePowerTimeSchemeRequestModel) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePowerTimeSchemeRequestModel) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}