-
Notifications
You must be signed in to change notification settings - Fork 5
/
model_group_alerts_config.go
449 lines (377 loc) · 15.2 KB
/
model_group_alerts_config.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
// Code based on the AtlasAPI V2 OpenAPI file
package admin
import (
"encoding/json"
"time"
)
// GroupAlertsConfig struct for GroupAlertsConfig
type GroupAlertsConfig struct {
// Date and time when MongoDB Cloud created the alert configuration. This parameter expresses its value in the <a href=\"https://en.wikipedia.org/wiki/ISO_8601\" target=\"_blank\" rel=\"noopener noreferrer\">ISO 8601</a> timestamp format in UTC.
// Read only field.
Created *time.Time `json:"created,omitempty"`
// Flag that indicates whether someone enabled this alert configuration for the specified project.
Enabled *bool `json:"enabled,omitempty"`
// Event type that triggers an alert.
EventTypeName *string `json:"eventTypeName,omitempty"`
// Unique 24-hexadecimal digit string that identifies the project that owns this alert configuration.
// Read only field.
GroupId *string `json:"groupId,omitempty"`
// Unique 24-hexadecimal digit string that identifies this alert configuration.
// Read only field.
Id *string `json:"id,omitempty"`
// List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships.
// Read only field.
Links *[]Link `json:"links,omitempty"`
// No matchers are available for these alert types. The list is always empty. Alternatively: List of rules that determine whether MongoDB Cloud checks an object for the alert configuration. You can filter using the matchers array if the **eventTypeName** specifies an event for a host, replica set, or sharded cluster. Alternatively: List of rules that determine whether MongoDB Cloud checks an object for the alert configuration. You can filter using the matchers array if the **eventTypeName** specifies an event for a host, replica set, or sharded cluster. Alternatively: No matchers are available for these alert types. The list is always empty. Alternatively: List of rules that determine whether MongoDB Cloud checks an object for the alert configuration. You can filter using the matchers array if the **eventTypeName** specifies an event for a host, replica set, or sharded cluster. Alternatively: No matchers are available for these alert types. The list is always empty. Alternatively: No matchers are available for these alert types. The list is always empty. Alternatively: List of rules that determine whether MongoDB Cloud checks an object for the alert configuration. You can filter using the matchers array if the **eventTypeName** specifies an event for a host, replica set, or sharded cluster. Alternatively: List of rules that determine whether MongoDB Cloud checks an object for the alert configuration. You can filter using the matchers array if the **eventTypeName** specifies an event for a host, replica set, or sharded cluster. Alternatively: No matchers are available for these alert types. The list is always empty. Alternatively: List of rules that determine whether MongoDB Cloud checks an object for the alert configuration. You can filter using the matchers array if the **eventTypeName** specifies an event for a host, replica set, or sharded cluster. Alternatively: List of rules that determine whether MongoDB Cloud checks an object for the alert configuration. You can filter using the matchers array if the **eventTypeName** specifies an event for a host, replica set, or sharded cluster. Alternatively: No matchers are available for these alert types. The list is always empty.
// Read only field.
Matchers *[]map[string]interface{} `json:"matchers,omitempty"`
// List that contains the targets that MongoDB Cloud sends notifications.
Notifications *[]AlertsNotificationRootForGroup `json:"notifications,omitempty"`
// Date and time when someone last updated this alert configuration. This parameter expresses its value in the <a href=\"https://en.wikipedia.org/wiki/ISO_8601\" target=\"_blank\" rel=\"noopener noreferrer\">ISO 8601</a> timestamp format in UTC.
// Read only field.
Updated *time.Time `json:"updated,omitempty"`
MetricThreshold *ServerlessMetricThreshold `json:"metricThreshold,omitempty"`
Threshold *GreaterThanRawThreshold `json:"threshold,omitempty"`
}
// NewGroupAlertsConfig instantiates a new GroupAlertsConfig 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 NewGroupAlertsConfig() *GroupAlertsConfig {
this := GroupAlertsConfig{}
var enabled bool = false
this.Enabled = &enabled
return &this
}
// NewGroupAlertsConfigWithDefaults instantiates a new GroupAlertsConfig 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 NewGroupAlertsConfigWithDefaults() *GroupAlertsConfig {
this := GroupAlertsConfig{}
var enabled bool = false
this.Enabled = &enabled
return &this
}
// GetCreated returns the Created field value if set, zero value otherwise
func (o *GroupAlertsConfig) GetCreated() time.Time {
if o == nil || IsNil(o.Created) {
var ret time.Time
return ret
}
return *o.Created
}
// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GroupAlertsConfig) GetCreatedOk() (*time.Time, bool) {
if o == nil || IsNil(o.Created) {
return nil, false
}
return o.Created, true
}
// HasCreated returns a boolean if a field has been set.
func (o *GroupAlertsConfig) HasCreated() bool {
if o != nil && !IsNil(o.Created) {
return true
}
return false
}
// SetCreated gets a reference to the given time.Time and assigns it to the Created field.
func (o *GroupAlertsConfig) SetCreated(v time.Time) {
o.Created = &v
}
// GetEnabled returns the Enabled field value if set, zero value otherwise
func (o *GroupAlertsConfig) GetEnabled() bool {
if o == nil || IsNil(o.Enabled) {
var ret bool
return ret
}
return *o.Enabled
}
// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GroupAlertsConfig) GetEnabledOk() (*bool, bool) {
if o == nil || IsNil(o.Enabled) {
return nil, false
}
return o.Enabled, true
}
// HasEnabled returns a boolean if a field has been set.
func (o *GroupAlertsConfig) HasEnabled() bool {
if o != nil && !IsNil(o.Enabled) {
return true
}
return false
}
// SetEnabled gets a reference to the given bool and assigns it to the Enabled field.
func (o *GroupAlertsConfig) SetEnabled(v bool) {
o.Enabled = &v
}
// GetEventTypeName returns the EventTypeName field value if set, zero value otherwise
func (o *GroupAlertsConfig) GetEventTypeName() string {
if o == nil || IsNil(o.EventTypeName) {
var ret string
return ret
}
return *o.EventTypeName
}
// GetEventTypeNameOk returns a tuple with the EventTypeName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GroupAlertsConfig) GetEventTypeNameOk() (*string, bool) {
if o == nil || IsNil(o.EventTypeName) {
return nil, false
}
return o.EventTypeName, true
}
// HasEventTypeName returns a boolean if a field has been set.
func (o *GroupAlertsConfig) HasEventTypeName() bool {
if o != nil && !IsNil(o.EventTypeName) {
return true
}
return false
}
// SetEventTypeName gets a reference to the given string and assigns it to the EventTypeName field.
func (o *GroupAlertsConfig) SetEventTypeName(v string) {
o.EventTypeName = &v
}
// GetGroupId returns the GroupId field value if set, zero value otherwise
func (o *GroupAlertsConfig) GetGroupId() string {
if o == nil || IsNil(o.GroupId) {
var ret string
return ret
}
return *o.GroupId
}
// GetGroupIdOk returns a tuple with the GroupId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GroupAlertsConfig) GetGroupIdOk() (*string, bool) {
if o == nil || IsNil(o.GroupId) {
return nil, false
}
return o.GroupId, true
}
// HasGroupId returns a boolean if a field has been set.
func (o *GroupAlertsConfig) HasGroupId() bool {
if o != nil && !IsNil(o.GroupId) {
return true
}
return false
}
// SetGroupId gets a reference to the given string and assigns it to the GroupId field.
func (o *GroupAlertsConfig) SetGroupId(v string) {
o.GroupId = &v
}
// GetId returns the Id field value if set, zero value otherwise
func (o *GroupAlertsConfig) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GroupAlertsConfig) GetIdOk() (*string, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *GroupAlertsConfig) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *GroupAlertsConfig) SetId(v string) {
o.Id = &v
}
// GetLinks returns the Links field value if set, zero value otherwise
func (o *GroupAlertsConfig) GetLinks() []Link {
if o == nil || IsNil(o.Links) {
var ret []Link
return ret
}
return *o.Links
}
// GetLinksOk returns a tuple with the Links field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GroupAlertsConfig) GetLinksOk() (*[]Link, bool) {
if o == nil || IsNil(o.Links) {
return nil, false
}
return o.Links, true
}
// HasLinks returns a boolean if a field has been set.
func (o *GroupAlertsConfig) HasLinks() bool {
if o != nil && !IsNil(o.Links) {
return true
}
return false
}
// SetLinks gets a reference to the given []Link and assigns it to the Links field.
func (o *GroupAlertsConfig) SetLinks(v []Link) {
o.Links = &v
}
// GetMatchers returns the Matchers field value if set, zero value otherwise
func (o *GroupAlertsConfig) GetMatchers() []map[string]interface{} {
if o == nil || IsNil(o.Matchers) {
var ret []map[string]interface{}
return ret
}
return *o.Matchers
}
// GetMatchersOk returns a tuple with the Matchers field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GroupAlertsConfig) GetMatchersOk() (*[]map[string]interface{}, bool) {
if o == nil || IsNil(o.Matchers) {
return nil, false
}
return o.Matchers, true
}
// HasMatchers returns a boolean if a field has been set.
func (o *GroupAlertsConfig) HasMatchers() bool {
if o != nil && !IsNil(o.Matchers) {
return true
}
return false
}
// SetMatchers gets a reference to the given []map[string]interface{} and assigns it to the Matchers field.
func (o *GroupAlertsConfig) SetMatchers(v []map[string]interface{}) {
o.Matchers = &v
}
// GetNotifications returns the Notifications field value if set, zero value otherwise
func (o *GroupAlertsConfig) GetNotifications() []AlertsNotificationRootForGroup {
if o == nil || IsNil(o.Notifications) {
var ret []AlertsNotificationRootForGroup
return ret
}
return *o.Notifications
}
// GetNotificationsOk returns a tuple with the Notifications field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GroupAlertsConfig) GetNotificationsOk() (*[]AlertsNotificationRootForGroup, bool) {
if o == nil || IsNil(o.Notifications) {
return nil, false
}
return o.Notifications, true
}
// HasNotifications returns a boolean if a field has been set.
func (o *GroupAlertsConfig) HasNotifications() bool {
if o != nil && !IsNil(o.Notifications) {
return true
}
return false
}
// SetNotifications gets a reference to the given []AlertsNotificationRootForGroup and assigns it to the Notifications field.
func (o *GroupAlertsConfig) SetNotifications(v []AlertsNotificationRootForGroup) {
o.Notifications = &v
}
// GetUpdated returns the Updated field value if set, zero value otherwise
func (o *GroupAlertsConfig) GetUpdated() time.Time {
if o == nil || IsNil(o.Updated) {
var ret time.Time
return ret
}
return *o.Updated
}
// GetUpdatedOk returns a tuple with the Updated field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GroupAlertsConfig) GetUpdatedOk() (*time.Time, bool) {
if o == nil || IsNil(o.Updated) {
return nil, false
}
return o.Updated, true
}
// HasUpdated returns a boolean if a field has been set.
func (o *GroupAlertsConfig) HasUpdated() bool {
if o != nil && !IsNil(o.Updated) {
return true
}
return false
}
// SetUpdated gets a reference to the given time.Time and assigns it to the Updated field.
func (o *GroupAlertsConfig) SetUpdated(v time.Time) {
o.Updated = &v
}
// GetMetricThreshold returns the MetricThreshold field value if set, zero value otherwise
func (o *GroupAlertsConfig) GetMetricThreshold() ServerlessMetricThreshold {
if o == nil || IsNil(o.MetricThreshold) {
var ret ServerlessMetricThreshold
return ret
}
return *o.MetricThreshold
}
// GetMetricThresholdOk returns a tuple with the MetricThreshold field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GroupAlertsConfig) GetMetricThresholdOk() (*ServerlessMetricThreshold, bool) {
if o == nil || IsNil(o.MetricThreshold) {
return nil, false
}
return o.MetricThreshold, true
}
// HasMetricThreshold returns a boolean if a field has been set.
func (o *GroupAlertsConfig) HasMetricThreshold() bool {
if o != nil && !IsNil(o.MetricThreshold) {
return true
}
return false
}
// SetMetricThreshold gets a reference to the given ServerlessMetricThreshold and assigns it to the MetricThreshold field.
func (o *GroupAlertsConfig) SetMetricThreshold(v ServerlessMetricThreshold) {
o.MetricThreshold = &v
}
// GetThreshold returns the Threshold field value if set, zero value otherwise
func (o *GroupAlertsConfig) GetThreshold() GreaterThanRawThreshold {
if o == nil || IsNil(o.Threshold) {
var ret GreaterThanRawThreshold
return ret
}
return *o.Threshold
}
// GetThresholdOk returns a tuple with the Threshold field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GroupAlertsConfig) GetThresholdOk() (*GreaterThanRawThreshold, bool) {
if o == nil || IsNil(o.Threshold) {
return nil, false
}
return o.Threshold, true
}
// HasThreshold returns a boolean if a field has been set.
func (o *GroupAlertsConfig) HasThreshold() bool {
if o != nil && !IsNil(o.Threshold) {
return true
}
return false
}
// SetThreshold gets a reference to the given GreaterThanRawThreshold and assigns it to the Threshold field.
func (o *GroupAlertsConfig) SetThreshold(v GreaterThanRawThreshold) {
o.Threshold = &v
}
func (o GroupAlertsConfig) MarshalJSONWithoutReadOnly() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GroupAlertsConfig) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Enabled) {
toSerialize["enabled"] = o.Enabled
}
if !IsNil(o.EventTypeName) {
toSerialize["eventTypeName"] = o.EventTypeName
}
if !IsNil(o.Notifications) {
toSerialize["notifications"] = o.Notifications
}
if !IsNil(o.MetricThreshold) {
toSerialize["metricThreshold"] = o.MetricThreshold
}
if !IsNil(o.Threshold) {
toSerialize["threshold"] = o.Threshold
}
return toSerialize, nil
}