/
model_create_showback_rule_command.go
568 lines (484 loc) · 17.7 KB
/
model_create_showback_rule_command.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
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
/*
Taikun - Showback API
This Api will be responsible for overall data distribution and authorization.
API version: v1
Contact: noreply@taikun.cloud
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package taikunshowback
import (
"encoding/json"
)
// checks if the CreateShowbackRuleCommand type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CreateShowbackRuleCommand{}
// CreateShowbackRuleCommand struct for CreateShowbackRuleCommand
type CreateShowbackRuleCommand struct {
Name NullableString `json:"name,omitempty"`
MetricName NullableString `json:"metricName,omitempty"`
ByLabel NullableString `json:"byLabel,omitempty"`
Kind *EShowbackType `json:"kind,omitempty"`
Type *EPrometheusType `json:"type,omitempty"`
Price NullableFloat64 `json:"price,omitempty"`
ProjectAlertLimit NullableInt32 `json:"projectAlertLimit,omitempty"`
GlobalAlertLimit NullableInt32 `json:"globalAlertLimit,omitempty"`
OrganizationId NullableInt32 `json:"organizationId,omitempty"`
Labels []ShowbackLabelCreateDto `json:"labels,omitempty"`
ShowbackCredentialId NullableInt32 `json:"showbackCredentialId,omitempty"`
}
// NewCreateShowbackRuleCommand instantiates a new CreateShowbackRuleCommand 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 NewCreateShowbackRuleCommand() *CreateShowbackRuleCommand {
this := CreateShowbackRuleCommand{}
return &this
}
// NewCreateShowbackRuleCommandWithDefaults instantiates a new CreateShowbackRuleCommand 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 NewCreateShowbackRuleCommandWithDefaults() *CreateShowbackRuleCommand {
this := CreateShowbackRuleCommand{}
return &this
}
// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateShowbackRuleCommand) 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 *CreateShowbackRuleCommand) 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 *CreateShowbackRuleCommand) 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 *CreateShowbackRuleCommand) SetName(v string) {
o.Name.Set(&v)
}
// SetNameNil sets the value for Name to be an explicit nil
func (o *CreateShowbackRuleCommand) SetNameNil() {
o.Name.Set(nil)
}
// UnsetName ensures that no value is present for Name, not even an explicit nil
func (o *CreateShowbackRuleCommand) UnsetName() {
o.Name.Unset()
}
// GetMetricName returns the MetricName field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateShowbackRuleCommand) GetMetricName() string {
if o == nil || IsNil(o.MetricName.Get()) {
var ret string
return ret
}
return *o.MetricName.Get()
}
// GetMetricNameOk returns a tuple with the MetricName 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 *CreateShowbackRuleCommand) GetMetricNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.MetricName.Get(), o.MetricName.IsSet()
}
// HasMetricName returns a boolean if a field has been set.
func (o *CreateShowbackRuleCommand) HasMetricName() bool {
if o != nil && o.MetricName.IsSet() {
return true
}
return false
}
// SetMetricName gets a reference to the given NullableString and assigns it to the MetricName field.
func (o *CreateShowbackRuleCommand) SetMetricName(v string) {
o.MetricName.Set(&v)
}
// SetMetricNameNil sets the value for MetricName to be an explicit nil
func (o *CreateShowbackRuleCommand) SetMetricNameNil() {
o.MetricName.Set(nil)
}
// UnsetMetricName ensures that no value is present for MetricName, not even an explicit nil
func (o *CreateShowbackRuleCommand) UnsetMetricName() {
o.MetricName.Unset()
}
// GetByLabel returns the ByLabel field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateShowbackRuleCommand) GetByLabel() string {
if o == nil || IsNil(o.ByLabel.Get()) {
var ret string
return ret
}
return *o.ByLabel.Get()
}
// GetByLabelOk returns a tuple with the ByLabel 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 *CreateShowbackRuleCommand) GetByLabelOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.ByLabel.Get(), o.ByLabel.IsSet()
}
// HasByLabel returns a boolean if a field has been set.
func (o *CreateShowbackRuleCommand) HasByLabel() bool {
if o != nil && o.ByLabel.IsSet() {
return true
}
return false
}
// SetByLabel gets a reference to the given NullableString and assigns it to the ByLabel field.
func (o *CreateShowbackRuleCommand) SetByLabel(v string) {
o.ByLabel.Set(&v)
}
// SetByLabelNil sets the value for ByLabel to be an explicit nil
func (o *CreateShowbackRuleCommand) SetByLabelNil() {
o.ByLabel.Set(nil)
}
// UnsetByLabel ensures that no value is present for ByLabel, not even an explicit nil
func (o *CreateShowbackRuleCommand) UnsetByLabel() {
o.ByLabel.Unset()
}
// GetKind returns the Kind field value if set, zero value otherwise.
func (o *CreateShowbackRuleCommand) GetKind() EShowbackType {
if o == nil || IsNil(o.Kind) {
var ret EShowbackType
return ret
}
return *o.Kind
}
// GetKindOk returns a tuple with the Kind field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateShowbackRuleCommand) GetKindOk() (*EShowbackType, bool) {
if o == nil || IsNil(o.Kind) {
return nil, false
}
return o.Kind, true
}
// HasKind returns a boolean if a field has been set.
func (o *CreateShowbackRuleCommand) HasKind() bool {
if o != nil && !IsNil(o.Kind) {
return true
}
return false
}
// SetKind gets a reference to the given EShowbackType and assigns it to the Kind field.
func (o *CreateShowbackRuleCommand) SetKind(v EShowbackType) {
o.Kind = &v
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *CreateShowbackRuleCommand) GetType() EPrometheusType {
if o == nil || IsNil(o.Type) {
var ret EPrometheusType
return ret
}
return *o.Type
}
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateShowbackRuleCommand) GetTypeOk() (*EPrometheusType, bool) {
if o == nil || IsNil(o.Type) {
return nil, false
}
return o.Type, true
}
// HasType returns a boolean if a field has been set.
func (o *CreateShowbackRuleCommand) HasType() bool {
if o != nil && !IsNil(o.Type) {
return true
}
return false
}
// SetType gets a reference to the given EPrometheusType and assigns it to the Type field.
func (o *CreateShowbackRuleCommand) SetType(v EPrometheusType) {
o.Type = &v
}
// GetPrice returns the Price field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateShowbackRuleCommand) GetPrice() float64 {
if o == nil || IsNil(o.Price.Get()) {
var ret float64
return ret
}
return *o.Price.Get()
}
// GetPriceOk returns a tuple with the Price 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 *CreateShowbackRuleCommand) GetPriceOk() (*float64, bool) {
if o == nil {
return nil, false
}
return o.Price.Get(), o.Price.IsSet()
}
// HasPrice returns a boolean if a field has been set.
func (o *CreateShowbackRuleCommand) HasPrice() bool {
if o != nil && o.Price.IsSet() {
return true
}
return false
}
// SetPrice gets a reference to the given NullableFloat64 and assigns it to the Price field.
func (o *CreateShowbackRuleCommand) SetPrice(v float64) {
o.Price.Set(&v)
}
// SetPriceNil sets the value for Price to be an explicit nil
func (o *CreateShowbackRuleCommand) SetPriceNil() {
o.Price.Set(nil)
}
// UnsetPrice ensures that no value is present for Price, not even an explicit nil
func (o *CreateShowbackRuleCommand) UnsetPrice() {
o.Price.Unset()
}
// GetProjectAlertLimit returns the ProjectAlertLimit field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateShowbackRuleCommand) GetProjectAlertLimit() int32 {
if o == nil || IsNil(o.ProjectAlertLimit.Get()) {
var ret int32
return ret
}
return *o.ProjectAlertLimit.Get()
}
// GetProjectAlertLimitOk returns a tuple with the ProjectAlertLimit 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 *CreateShowbackRuleCommand) GetProjectAlertLimitOk() (*int32, bool) {
if o == nil {
return nil, false
}
return o.ProjectAlertLimit.Get(), o.ProjectAlertLimit.IsSet()
}
// HasProjectAlertLimit returns a boolean if a field has been set.
func (o *CreateShowbackRuleCommand) HasProjectAlertLimit() bool {
if o != nil && o.ProjectAlertLimit.IsSet() {
return true
}
return false
}
// SetProjectAlertLimit gets a reference to the given NullableInt32 and assigns it to the ProjectAlertLimit field.
func (o *CreateShowbackRuleCommand) SetProjectAlertLimit(v int32) {
o.ProjectAlertLimit.Set(&v)
}
// SetProjectAlertLimitNil sets the value for ProjectAlertLimit to be an explicit nil
func (o *CreateShowbackRuleCommand) SetProjectAlertLimitNil() {
o.ProjectAlertLimit.Set(nil)
}
// UnsetProjectAlertLimit ensures that no value is present for ProjectAlertLimit, not even an explicit nil
func (o *CreateShowbackRuleCommand) UnsetProjectAlertLimit() {
o.ProjectAlertLimit.Unset()
}
// GetGlobalAlertLimit returns the GlobalAlertLimit field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateShowbackRuleCommand) GetGlobalAlertLimit() int32 {
if o == nil || IsNil(o.GlobalAlertLimit.Get()) {
var ret int32
return ret
}
return *o.GlobalAlertLimit.Get()
}
// GetGlobalAlertLimitOk returns a tuple with the GlobalAlertLimit 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 *CreateShowbackRuleCommand) GetGlobalAlertLimitOk() (*int32, bool) {
if o == nil {
return nil, false
}
return o.GlobalAlertLimit.Get(), o.GlobalAlertLimit.IsSet()
}
// HasGlobalAlertLimit returns a boolean if a field has been set.
func (o *CreateShowbackRuleCommand) HasGlobalAlertLimit() bool {
if o != nil && o.GlobalAlertLimit.IsSet() {
return true
}
return false
}
// SetGlobalAlertLimit gets a reference to the given NullableInt32 and assigns it to the GlobalAlertLimit field.
func (o *CreateShowbackRuleCommand) SetGlobalAlertLimit(v int32) {
o.GlobalAlertLimit.Set(&v)
}
// SetGlobalAlertLimitNil sets the value for GlobalAlertLimit to be an explicit nil
func (o *CreateShowbackRuleCommand) SetGlobalAlertLimitNil() {
o.GlobalAlertLimit.Set(nil)
}
// UnsetGlobalAlertLimit ensures that no value is present for GlobalAlertLimit, not even an explicit nil
func (o *CreateShowbackRuleCommand) UnsetGlobalAlertLimit() {
o.GlobalAlertLimit.Unset()
}
// GetOrganizationId returns the OrganizationId field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateShowbackRuleCommand) GetOrganizationId() int32 {
if o == nil || IsNil(o.OrganizationId.Get()) {
var ret int32
return ret
}
return *o.OrganizationId.Get()
}
// GetOrganizationIdOk returns a tuple with the OrganizationId 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 *CreateShowbackRuleCommand) GetOrganizationIdOk() (*int32, bool) {
if o == nil {
return nil, false
}
return o.OrganizationId.Get(), o.OrganizationId.IsSet()
}
// HasOrganizationId returns a boolean if a field has been set.
func (o *CreateShowbackRuleCommand) HasOrganizationId() bool {
if o != nil && o.OrganizationId.IsSet() {
return true
}
return false
}
// SetOrganizationId gets a reference to the given NullableInt32 and assigns it to the OrganizationId field.
func (o *CreateShowbackRuleCommand) SetOrganizationId(v int32) {
o.OrganizationId.Set(&v)
}
// SetOrganizationIdNil sets the value for OrganizationId to be an explicit nil
func (o *CreateShowbackRuleCommand) SetOrganizationIdNil() {
o.OrganizationId.Set(nil)
}
// UnsetOrganizationId ensures that no value is present for OrganizationId, not even an explicit nil
func (o *CreateShowbackRuleCommand) UnsetOrganizationId() {
o.OrganizationId.Unset()
}
// GetLabels returns the Labels field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateShowbackRuleCommand) GetLabels() []ShowbackLabelCreateDto {
if o == nil {
var ret []ShowbackLabelCreateDto
return ret
}
return o.Labels
}
// GetLabelsOk returns a tuple with the Labels 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 *CreateShowbackRuleCommand) GetLabelsOk() ([]ShowbackLabelCreateDto, bool) {
if o == nil || IsNil(o.Labels) {
return nil, false
}
return o.Labels, true
}
// HasLabels returns a boolean if a field has been set.
func (o *CreateShowbackRuleCommand) HasLabels() bool {
if o != nil && IsNil(o.Labels) {
return true
}
return false
}
// SetLabels gets a reference to the given []ShowbackLabelCreateDto and assigns it to the Labels field.
func (o *CreateShowbackRuleCommand) SetLabels(v []ShowbackLabelCreateDto) {
o.Labels = v
}
// GetShowbackCredentialId returns the ShowbackCredentialId field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateShowbackRuleCommand) GetShowbackCredentialId() int32 {
if o == nil || IsNil(o.ShowbackCredentialId.Get()) {
var ret int32
return ret
}
return *o.ShowbackCredentialId.Get()
}
// GetShowbackCredentialIdOk returns a tuple with the ShowbackCredentialId 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 *CreateShowbackRuleCommand) GetShowbackCredentialIdOk() (*int32, bool) {
if o == nil {
return nil, false
}
return o.ShowbackCredentialId.Get(), o.ShowbackCredentialId.IsSet()
}
// HasShowbackCredentialId returns a boolean if a field has been set.
func (o *CreateShowbackRuleCommand) HasShowbackCredentialId() bool {
if o != nil && o.ShowbackCredentialId.IsSet() {
return true
}
return false
}
// SetShowbackCredentialId gets a reference to the given NullableInt32 and assigns it to the ShowbackCredentialId field.
func (o *CreateShowbackRuleCommand) SetShowbackCredentialId(v int32) {
o.ShowbackCredentialId.Set(&v)
}
// SetShowbackCredentialIdNil sets the value for ShowbackCredentialId to be an explicit nil
func (o *CreateShowbackRuleCommand) SetShowbackCredentialIdNil() {
o.ShowbackCredentialId.Set(nil)
}
// UnsetShowbackCredentialId ensures that no value is present for ShowbackCredentialId, not even an explicit nil
func (o *CreateShowbackRuleCommand) UnsetShowbackCredentialId() {
o.ShowbackCredentialId.Unset()
}
func (o CreateShowbackRuleCommand) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CreateShowbackRuleCommand) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if o.Name.IsSet() {
toSerialize["name"] = o.Name.Get()
}
if o.MetricName.IsSet() {
toSerialize["metricName"] = o.MetricName.Get()
}
if o.ByLabel.IsSet() {
toSerialize["byLabel"] = o.ByLabel.Get()
}
if !IsNil(o.Kind) {
toSerialize["kind"] = o.Kind
}
if !IsNil(o.Type) {
toSerialize["type"] = o.Type
}
if o.Price.IsSet() {
toSerialize["price"] = o.Price.Get()
}
if o.ProjectAlertLimit.IsSet() {
toSerialize["projectAlertLimit"] = o.ProjectAlertLimit.Get()
}
if o.GlobalAlertLimit.IsSet() {
toSerialize["globalAlertLimit"] = o.GlobalAlertLimit.Get()
}
if o.OrganizationId.IsSet() {
toSerialize["organizationId"] = o.OrganizationId.Get()
}
if o.Labels != nil {
toSerialize["labels"] = o.Labels
}
if o.ShowbackCredentialId.IsSet() {
toSerialize["showbackCredentialId"] = o.ShowbackCredentialId.Get()
}
return toSerialize, nil
}
type NullableCreateShowbackRuleCommand struct {
value *CreateShowbackRuleCommand
isSet bool
}
func (v NullableCreateShowbackRuleCommand) Get() *CreateShowbackRuleCommand {
return v.value
}
func (v *NullableCreateShowbackRuleCommand) Set(val *CreateShowbackRuleCommand) {
v.value = val
v.isSet = true
}
func (v NullableCreateShowbackRuleCommand) IsSet() bool {
return v.isSet
}
func (v *NullableCreateShowbackRuleCommand) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCreateShowbackRuleCommand(val *CreateShowbackRuleCommand) *NullableCreateShowbackRuleCommand {
return &NullableCreateShowbackRuleCommand{value: val, isSet: true}
}
func (v NullableCreateShowbackRuleCommand) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCreateShowbackRuleCommand) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}