-
Notifications
You must be signed in to change notification settings - Fork 0
/
model_alerts_library_alert_export.go
701 lines (600 loc) · 31.4 KB
/
model_alerts_library_alert_export.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
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
/*
Sumo Logic API
# Getting Started Welcome to the Sumo Logic API reference. You can use these APIs to interact with the Sumo Logic platform. For information on the collector and search APIs see our [API home page](https://help.sumologic.com/APIs). ## API Endpoints Sumo Logic has several deployments in different geographic locations. You'll need to use the Sumo Logic API endpoint corresponding to your geographic location. See the table below for the different API endpoints by deployment. For details determining your account's deployment see [API endpoints](https://help.sumologic.com/?cid=3011). <table> <tr> <td> <strong>Deployment</strong> </td> <td> <strong>Endpoint</strong> </td> </tr> <tr> <td> AU </td> <td> https://api.au.sumologic.com/api/ </td> </tr> <tr> <td> CA </td> <td> https://api.ca.sumologic.com/api/ </td> </tr> <tr> <td> DE </td> <td> https://api.de.sumologic.com/api/ </td> </tr> <tr> <td> EU </td> <td> https://api.eu.sumologic.com/api/ </td> </tr> <tr> <td> FED </td> <td> https://api.fed.sumologic.com/api/ </td> </tr> <tr> <td> IN </td> <td> https://api.in.sumologic.com/api/ </td> </tr> <tr> <td> JP </td> <td> https://api.jp.sumologic.com/api/ </td> </tr> <tr> <td> US1 </td> <td> https://api.sumologic.com/api/ </td> </tr> <tr> <td> US2 </td> <td> https://api.us2.sumologic.com/api/ </td> </tr> </table> ## Authentication Sumo Logic supports the following options for API authentication: - Access ID and Access Key - Base64 encoded Access ID and Access Key See [Access Keys](https://help.sumologic.com/Manage/Security/Access-Keys) to generate an Access Key. Make sure to copy the key you create, because it is displayed only once. When you have an Access ID and Access Key you can execute requests such as the following: ```bash curl -u \"<accessId>:<accessKey>\" -X GET https://api.<deployment>.sumologic.com/api/v1/users ``` Where `deployment` is either `au`, `ca`, `de`, `eu`, `fed`, `in`, `jp`, `us1`, or `us2`. See [API endpoints](#section/API-Endpoints) for details. If you prefer to use basic access authentication, you can do a Base64 encoding of your `<accessId>:<accessKey>` to authenticate your HTTPS request. The following is an example request, replace the placeholder `<encoded>` with your encoded Access ID and Access Key string: ```bash curl -H \"Authorization: Basic <encoded>\" -X GET https://api.<deployment>.sumologic.com/api/v1/users ``` Refer to [API Authentication](https://help.sumologic.com/?cid=3012) for a Base64 example. ## Status Codes Generic status codes that apply to all our APIs. See the [HTTP status code registry](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml) for reference. <table> <tr> <td> <strong>HTTP Status Code</strong> </td> <td> <strong>Error Code</strong> </td> <td> <strong>Description</strong> </td> </tr> <tr> <td> 301 </td> <td> moved </td> <td> The requested resource SHOULD be accessed through returned URI in Location Header. See [troubleshooting](https://help.sumologic.com/APIs/Troubleshooting-APIs/API-301-Error-Moved) for details.</td> </tr> <tr> <td> 401 </td> <td> unauthorized </td> <td> Credential could not be verified.</td> </tr> <tr> <td> 403 </td> <td> forbidden </td> <td> This operation is not allowed for your account type or the user doesn't have the role capability to perform this action. See [troubleshooting](https://help.sumologic.com/APIs/Troubleshooting-APIs/API-403-Error-This-operation-is-not-allowed-for-your-account-type) for details.</td> </tr> <tr> <td> 404 </td> <td> notfound </td> <td> Requested resource could not be found. </td> </tr> <tr> <td> 405 </td> <td> method.unsupported </td> <td> Unsupported method for URL. </td> </tr> <tr> <td> 415 </td> <td> contenttype.invalid </td> <td> Invalid content type. </td> </tr> <tr> <td> 429 </td> <td> rate.limit.exceeded </td> <td> The API request rate is higher than 4 request per second or inflight API requests are higher than 10 request per second. </td> </tr> <tr> <td> 500 </td> <td> internal.error </td> <td> Internal server error. </td> </tr> <tr> <td> 503 </td> <td> service.unavailable </td> <td> Service is currently unavailable. </td> </tr> </table> ## Filtering Some API endpoints support filtering results on a specified set of fields. Each endpoint that supports filtering will list the fields that can be filtered. Multiple fields can be combined by using an ampersand `&` character. For example, to get 20 users whose `firstName` is `John` and `lastName` is `Doe`: ```bash api.sumologic.com/v1/users?limit=20&firstName=John&lastName=Doe ``` ## Sorting Some API endpoints support sorting fields by using the `sortBy` query parameter. The default sort order is ascending. Prefix the field with a minus sign `-` to sort in descending order. For example, to get 20 users sorted by their `email` in descending order: ```bash api.sumologic.com/v1/users?limit=20&sort=-email ``` ## Asynchronous Request Asynchronous requests do not wait for results, instead they immediately respond back with a job identifier while the job runs in the background. You can use the job identifier to track the status of the asynchronous job request. Here is a typical flow for an asynchronous request. 1. Start an asynchronous job. On success, a job identifier is returned. The job identifier uniquely identifies your asynchronous job. 2. Once started, use the job identifier from step 1 to track the status of your asynchronous job. An asynchronous request will typically provide an endpoint to poll for the status of asynchronous job. A successful response from the status endpoint will have the following structure: ```json { \"status\": \"Status of asynchronous request\", \"statusMessage\": \"Optional message with additional information in case request succeeds\", \"error\": \"Error object in case request fails\" } ``` The `status` field can have one of the following values: 1. `Success`: The job succeeded. The `statusMessage` field might have additional information. 2. `InProgress`: The job is still running. 3. `Failed`: The job failed. The `error` field in the response will have more information about the failure. 3. Some asynchronous APIs may provide a third endpoint (like [export result](#operation/getAsyncExportResult)) to fetch the result of an asynchronous job. ### Example Let's say we want to export a folder with the identifier `0000000006A2E86F`. We will use the [async export](#operation/beginAsyncExport) API to export all the content under the folder with `id=0000000006A2E86F`. 1. Start an export job for the folder ```bash curl -X POST -u \"<accessId>:<accessKey>\" https://api.<deployment>.sumologic.com/api/v2/content/0000000006A2E86F/export ``` See [authentication section](#section/Authentication) for more details about `accessId`, `accessKey`, and `deployment`. On success, you will get back a job identifier. In the response below, `C03E086C137F38B4` is the job identifier. ```bash { \"id\": \"C03E086C137F38B4\" } ``` 2. Now poll for the status of the asynchronous job with the [status](#operation/getAsyncExportStatus) endpoint. ```bash curl -X GET -u \"<accessId>:<accessKey>\" https://api.<deployment>.sumologic.com/api/v2/content/0000000006A2E86F/export/C03E086C137F38B4/status ``` You may get a response like ```json { \"status\": \"InProgress\", \"statusMessage\": null, \"error\": null } ``` It implies the job is still in progress. Keep polling till the status is either `Success` or `Failed`. 3. When the asynchronous job completes (`status != \"InProgress\"`), you can fetch the results with the [export result](#operation/getAsyncExportResult) endpoint. ```bash curl -X GET -u \"<accessId>:<accessKey>\" https://api.<deployment>.sumologic.com/api/v2/content/0000000006A2E86F/export/C03E086C137F38B4/result ``` The asynchronous job may fail (`status == \"Failed\"`). You can look at the `error` field for more details. ```json { \"status\": \"Failed\", \"errors\": { \"code\": \"content1:too_many_items\", \"message\": \"Too many objects: object count(1100) was greater than limit 1000\" } } ``` ## Rate Limiting * A rate limit of four API requests per second (240 requests per minute) applies to all API calls from a user. * A rate limit of 10 concurrent requests to any API endpoint applies to an access key. If a rate is exceeded, a rate limit exceeded 429 status code is returned. ## Generating Clients You can use [OpenAPI Generator](https://openapi-generator.tech) to generate clients from the YAML file to access the API. ### Using [NPM](https://www.npmjs.com/get-npm) 1. Install [NPM package wrapper](https://github.com/openapitools/openapi-generator-cli) globally, exposing the CLI on the command line: ```bash npm install @openapitools/openapi-generator-cli -g ``` You can see detailed instructions [here](https://openapi-generator.tech/docs/installation#npm). 2. Download the [YAML file](/docs/sumologic-api.yaml) and save it locally. Let's say the file is saved as `sumologic-api.yaml`. 3. Use the following command to generate `python` client inside the `sumo/client/python` directory: ```bash openapi-generator generate -i sumologic-api.yaml -g python -o sumo/client/python ``` ### Using [Homebrew](https://brew.sh/) 1. Install OpenAPI Generator ```bash brew install openapi-generator ``` 2. Download the [YAML file](/docs/sumologic-api.yaml) and save it locally. Let's say the file is saved as `sumologic-api.yaml`. 3. Use the following command to generate `python` client side code inside the `sumo/client/python` directory: ```bash openapi-generator generate -i sumologic-api.yaml -g python -o sumo/client/python ```
API version: 1.0.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
"time"
)
// AlertsLibraryAlertExport struct for AlertsLibraryAlertExport
type AlertsLibraryAlertExport struct {
AlertsLibraryBaseExport
// The Id of the associated monitor.
MonitorId *string `json:"monitorId,omitempty"`
// The time at which the alert was resolved.
ResolvedAt NullableTime `json:"resolvedAt,omitempty"`
// The time at which the incident started.
AbnormalityStartTime *time.Time `json:"abnormalityStartTime,omitempty"`
// The severity of the Alert. Valid values: 1. `Critical` 2. `Warning` 3. `MissingData`
AlertType *string `json:"alertType,omitempty"`
// The status of the Alert. Valid values: 1. `Triggered` 2. `Resolved`
Status *string `json:"status,omitempty"`
// All queries from the monitor relevant to the alert.
MonitorQueries *[]AlertMonitorQuery `json:"monitorQueries,omitempty"`
// All queries from the monitor relevant to the alert with triggered time series filters.
TriggerQueries *[]AlertMonitorQuery `json:"triggerQueries,omitempty"`
// URL for this monitor's view page
MonitorUrl *string `json:"monitorUrl,omitempty"`
// A link to search with the triggering data and time range
TriggerQueryUrl *string `json:"triggerQueryUrl,omitempty"`
// Trigger conditions which were breached to create this Alert.
TriggerConditions *[]TriggerCondition `json:"triggerConditions,omitempty"`
// The of the query result which breached the trigger condition.
TriggerValue *float64 `json:"triggerValue,omitempty"`
// The type of monitor. Valid values: 1. `Logs`: A logs query monitor. 2. `Metrics`: A metrics query monitor.
MonitorType *string `json:"monitorType,omitempty"`
// One or more entity identifiers involved in this Alert.
EntityIds *[]string `json:"entityIds,omitempty"`
Notes *string `json:"notes,omitempty"`
ExtraDetails *ExtraDetails `json:"extraDetails,omitempty"`
// The condition which triggered this alert.
AlertCondition NullableString `json:"alertCondition,omitempty"`
}
// NewAlertsLibraryAlertExport instantiates a new AlertsLibraryAlertExport 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 NewAlertsLibraryAlertExport(name string, type_ string) *AlertsLibraryAlertExport {
this := AlertsLibraryAlertExport{}
this.Name = name
this.Type = type_
return &this
}
// NewAlertsLibraryAlertExportWithDefaults instantiates a new AlertsLibraryAlertExport 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 NewAlertsLibraryAlertExportWithDefaults() *AlertsLibraryAlertExport {
this := AlertsLibraryAlertExport{}
return &this
}
// GetMonitorId returns the MonitorId field value if set, zero value otherwise.
func (o *AlertsLibraryAlertExport) GetMonitorId() string {
if o == nil || o.MonitorId == nil {
var ret string
return ret
}
return *o.MonitorId
}
// GetMonitorIdOk returns a tuple with the MonitorId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AlertsLibraryAlertExport) GetMonitorIdOk() (*string, bool) {
if o == nil || o.MonitorId == nil {
return nil, false
}
return o.MonitorId, true
}
// HasMonitorId returns a boolean if a field has been set.
func (o *AlertsLibraryAlertExport) HasMonitorId() bool {
if o != nil && o.MonitorId != nil {
return true
}
return false
}
// SetMonitorId gets a reference to the given string and assigns it to the MonitorId field.
func (o *AlertsLibraryAlertExport) SetMonitorId(v string) {
o.MonitorId = &v
}
// GetResolvedAt returns the ResolvedAt field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AlertsLibraryAlertExport) GetResolvedAt() time.Time {
if o == nil || o.ResolvedAt.Get() == nil {
var ret time.Time
return ret
}
return *o.ResolvedAt.Get()
}
// GetResolvedAtOk returns a tuple with the ResolvedAt 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 *AlertsLibraryAlertExport) GetResolvedAtOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return o.ResolvedAt.Get(), o.ResolvedAt.IsSet()
}
// HasResolvedAt returns a boolean if a field has been set.
func (o *AlertsLibraryAlertExport) HasResolvedAt() bool {
if o != nil && o.ResolvedAt.IsSet() {
return true
}
return false
}
// SetResolvedAt gets a reference to the given NullableTime and assigns it to the ResolvedAt field.
func (o *AlertsLibraryAlertExport) SetResolvedAt(v time.Time) {
o.ResolvedAt.Set(&v)
}
// SetResolvedAtNil sets the value for ResolvedAt to be an explicit nil
func (o *AlertsLibraryAlertExport) SetResolvedAtNil() {
o.ResolvedAt.Set(nil)
}
// UnsetResolvedAt ensures that no value is present for ResolvedAt, not even an explicit nil
func (o *AlertsLibraryAlertExport) UnsetResolvedAt() {
o.ResolvedAt.Unset()
}
// GetAbnormalityStartTime returns the AbnormalityStartTime field value if set, zero value otherwise.
func (o *AlertsLibraryAlertExport) GetAbnormalityStartTime() time.Time {
if o == nil || o.AbnormalityStartTime == nil {
var ret time.Time
return ret
}
return *o.AbnormalityStartTime
}
// GetAbnormalityStartTimeOk returns a tuple with the AbnormalityStartTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AlertsLibraryAlertExport) GetAbnormalityStartTimeOk() (*time.Time, bool) {
if o == nil || o.AbnormalityStartTime == nil {
return nil, false
}
return o.AbnormalityStartTime, true
}
// HasAbnormalityStartTime returns a boolean if a field has been set.
func (o *AlertsLibraryAlertExport) HasAbnormalityStartTime() bool {
if o != nil && o.AbnormalityStartTime != nil {
return true
}
return false
}
// SetAbnormalityStartTime gets a reference to the given time.Time and assigns it to the AbnormalityStartTime field.
func (o *AlertsLibraryAlertExport) SetAbnormalityStartTime(v time.Time) {
o.AbnormalityStartTime = &v
}
// GetAlertType returns the AlertType field value if set, zero value otherwise.
func (o *AlertsLibraryAlertExport) GetAlertType() string {
if o == nil || o.AlertType == nil {
var ret string
return ret
}
return *o.AlertType
}
// GetAlertTypeOk returns a tuple with the AlertType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AlertsLibraryAlertExport) GetAlertTypeOk() (*string, bool) {
if o == nil || o.AlertType == nil {
return nil, false
}
return o.AlertType, true
}
// HasAlertType returns a boolean if a field has been set.
func (o *AlertsLibraryAlertExport) HasAlertType() bool {
if o != nil && o.AlertType != nil {
return true
}
return false
}
// SetAlertType gets a reference to the given string and assigns it to the AlertType field.
func (o *AlertsLibraryAlertExport) SetAlertType(v string) {
o.AlertType = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *AlertsLibraryAlertExport) GetStatus() string {
if o == nil || o.Status == nil {
var ret string
return ret
}
return *o.Status
}
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AlertsLibraryAlertExport) GetStatusOk() (*string, bool) {
if o == nil || o.Status == nil {
return nil, false
}
return o.Status, true
}
// HasStatus returns a boolean if a field has been set.
func (o *AlertsLibraryAlertExport) HasStatus() bool {
if o != nil && o.Status != nil {
return true
}
return false
}
// SetStatus gets a reference to the given string and assigns it to the Status field.
func (o *AlertsLibraryAlertExport) SetStatus(v string) {
o.Status = &v
}
// GetMonitorQueries returns the MonitorQueries field value if set, zero value otherwise.
func (o *AlertsLibraryAlertExport) GetMonitorQueries() []AlertMonitorQuery {
if o == nil || o.MonitorQueries == nil {
var ret []AlertMonitorQuery
return ret
}
return *o.MonitorQueries
}
// GetMonitorQueriesOk returns a tuple with the MonitorQueries field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AlertsLibraryAlertExport) GetMonitorQueriesOk() (*[]AlertMonitorQuery, bool) {
if o == nil || o.MonitorQueries == nil {
return nil, false
}
return o.MonitorQueries, true
}
// HasMonitorQueries returns a boolean if a field has been set.
func (o *AlertsLibraryAlertExport) HasMonitorQueries() bool {
if o != nil && o.MonitorQueries != nil {
return true
}
return false
}
// SetMonitorQueries gets a reference to the given []AlertMonitorQuery and assigns it to the MonitorQueries field.
func (o *AlertsLibraryAlertExport) SetMonitorQueries(v []AlertMonitorQuery) {
o.MonitorQueries = &v
}
// GetTriggerQueries returns the TriggerQueries field value if set, zero value otherwise.
func (o *AlertsLibraryAlertExport) GetTriggerQueries() []AlertMonitorQuery {
if o == nil || o.TriggerQueries == nil {
var ret []AlertMonitorQuery
return ret
}
return *o.TriggerQueries
}
// GetTriggerQueriesOk returns a tuple with the TriggerQueries field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AlertsLibraryAlertExport) GetTriggerQueriesOk() (*[]AlertMonitorQuery, bool) {
if o == nil || o.TriggerQueries == nil {
return nil, false
}
return o.TriggerQueries, true
}
// HasTriggerQueries returns a boolean if a field has been set.
func (o *AlertsLibraryAlertExport) HasTriggerQueries() bool {
if o != nil && o.TriggerQueries != nil {
return true
}
return false
}
// SetTriggerQueries gets a reference to the given []AlertMonitorQuery and assigns it to the TriggerQueries field.
func (o *AlertsLibraryAlertExport) SetTriggerQueries(v []AlertMonitorQuery) {
o.TriggerQueries = &v
}
// GetMonitorUrl returns the MonitorUrl field value if set, zero value otherwise.
func (o *AlertsLibraryAlertExport) GetMonitorUrl() string {
if o == nil || o.MonitorUrl == nil {
var ret string
return ret
}
return *o.MonitorUrl
}
// GetMonitorUrlOk returns a tuple with the MonitorUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AlertsLibraryAlertExport) GetMonitorUrlOk() (*string, bool) {
if o == nil || o.MonitorUrl == nil {
return nil, false
}
return o.MonitorUrl, true
}
// HasMonitorUrl returns a boolean if a field has been set.
func (o *AlertsLibraryAlertExport) HasMonitorUrl() bool {
if o != nil && o.MonitorUrl != nil {
return true
}
return false
}
// SetMonitorUrl gets a reference to the given string and assigns it to the MonitorUrl field.
func (o *AlertsLibraryAlertExport) SetMonitorUrl(v string) {
o.MonitorUrl = &v
}
// GetTriggerQueryUrl returns the TriggerQueryUrl field value if set, zero value otherwise.
func (o *AlertsLibraryAlertExport) GetTriggerQueryUrl() string {
if o == nil || o.TriggerQueryUrl == nil {
var ret string
return ret
}
return *o.TriggerQueryUrl
}
// GetTriggerQueryUrlOk returns a tuple with the TriggerQueryUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AlertsLibraryAlertExport) GetTriggerQueryUrlOk() (*string, bool) {
if o == nil || o.TriggerQueryUrl == nil {
return nil, false
}
return o.TriggerQueryUrl, true
}
// HasTriggerQueryUrl returns a boolean if a field has been set.
func (o *AlertsLibraryAlertExport) HasTriggerQueryUrl() bool {
if o != nil && o.TriggerQueryUrl != nil {
return true
}
return false
}
// SetTriggerQueryUrl gets a reference to the given string and assigns it to the TriggerQueryUrl field.
func (o *AlertsLibraryAlertExport) SetTriggerQueryUrl(v string) {
o.TriggerQueryUrl = &v
}
// GetTriggerConditions returns the TriggerConditions field value if set, zero value otherwise.
func (o *AlertsLibraryAlertExport) GetTriggerConditions() []TriggerCondition {
if o == nil || o.TriggerConditions == nil {
var ret []TriggerCondition
return ret
}
return *o.TriggerConditions
}
// GetTriggerConditionsOk returns a tuple with the TriggerConditions field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AlertsLibraryAlertExport) GetTriggerConditionsOk() (*[]TriggerCondition, bool) {
if o == nil || o.TriggerConditions == nil {
return nil, false
}
return o.TriggerConditions, true
}
// HasTriggerConditions returns a boolean if a field has been set.
func (o *AlertsLibraryAlertExport) HasTriggerConditions() bool {
if o != nil && o.TriggerConditions != nil {
return true
}
return false
}
// SetTriggerConditions gets a reference to the given []TriggerCondition and assigns it to the TriggerConditions field.
func (o *AlertsLibraryAlertExport) SetTriggerConditions(v []TriggerCondition) {
o.TriggerConditions = &v
}
// GetTriggerValue returns the TriggerValue field value if set, zero value otherwise.
func (o *AlertsLibraryAlertExport) GetTriggerValue() float64 {
if o == nil || o.TriggerValue == nil {
var ret float64
return ret
}
return *o.TriggerValue
}
// GetTriggerValueOk returns a tuple with the TriggerValue field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AlertsLibraryAlertExport) GetTriggerValueOk() (*float64, bool) {
if o == nil || o.TriggerValue == nil {
return nil, false
}
return o.TriggerValue, true
}
// HasTriggerValue returns a boolean if a field has been set.
func (o *AlertsLibraryAlertExport) HasTriggerValue() bool {
if o != nil && o.TriggerValue != nil {
return true
}
return false
}
// SetTriggerValue gets a reference to the given float64 and assigns it to the TriggerValue field.
func (o *AlertsLibraryAlertExport) SetTriggerValue(v float64) {
o.TriggerValue = &v
}
// GetMonitorType returns the MonitorType field value if set, zero value otherwise.
func (o *AlertsLibraryAlertExport) GetMonitorType() string {
if o == nil || o.MonitorType == nil {
var ret string
return ret
}
return *o.MonitorType
}
// GetMonitorTypeOk returns a tuple with the MonitorType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AlertsLibraryAlertExport) GetMonitorTypeOk() (*string, bool) {
if o == nil || o.MonitorType == nil {
return nil, false
}
return o.MonitorType, true
}
// HasMonitorType returns a boolean if a field has been set.
func (o *AlertsLibraryAlertExport) HasMonitorType() bool {
if o != nil && o.MonitorType != nil {
return true
}
return false
}
// SetMonitorType gets a reference to the given string and assigns it to the MonitorType field.
func (o *AlertsLibraryAlertExport) SetMonitorType(v string) {
o.MonitorType = &v
}
// GetEntityIds returns the EntityIds field value if set, zero value otherwise.
func (o *AlertsLibraryAlertExport) GetEntityIds() []string {
if o == nil || o.EntityIds == nil {
var ret []string
return ret
}
return *o.EntityIds
}
// GetEntityIdsOk returns a tuple with the EntityIds field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AlertsLibraryAlertExport) GetEntityIdsOk() (*[]string, bool) {
if o == nil || o.EntityIds == nil {
return nil, false
}
return o.EntityIds, true
}
// HasEntityIds returns a boolean if a field has been set.
func (o *AlertsLibraryAlertExport) HasEntityIds() bool {
if o != nil && o.EntityIds != nil {
return true
}
return false
}
// SetEntityIds gets a reference to the given []string and assigns it to the EntityIds field.
func (o *AlertsLibraryAlertExport) SetEntityIds(v []string) {
o.EntityIds = &v
}
// GetNotes returns the Notes field value if set, zero value otherwise.
func (o *AlertsLibraryAlertExport) GetNotes() string {
if o == nil || o.Notes == nil {
var ret string
return ret
}
return *o.Notes
}
// GetNotesOk returns a tuple with the Notes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AlertsLibraryAlertExport) GetNotesOk() (*string, bool) {
if o == nil || o.Notes == nil {
return nil, false
}
return o.Notes, true
}
// HasNotes returns a boolean if a field has been set.
func (o *AlertsLibraryAlertExport) HasNotes() bool {
if o != nil && o.Notes != nil {
return true
}
return false
}
// SetNotes gets a reference to the given string and assigns it to the Notes field.
func (o *AlertsLibraryAlertExport) SetNotes(v string) {
o.Notes = &v
}
// GetExtraDetails returns the ExtraDetails field value if set, zero value otherwise.
func (o *AlertsLibraryAlertExport) GetExtraDetails() ExtraDetails {
if o == nil || o.ExtraDetails == nil {
var ret ExtraDetails
return ret
}
return *o.ExtraDetails
}
// GetExtraDetailsOk returns a tuple with the ExtraDetails field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AlertsLibraryAlertExport) GetExtraDetailsOk() (*ExtraDetails, bool) {
if o == nil || o.ExtraDetails == nil {
return nil, false
}
return o.ExtraDetails, true
}
// HasExtraDetails returns a boolean if a field has been set.
func (o *AlertsLibraryAlertExport) HasExtraDetails() bool {
if o != nil && o.ExtraDetails != nil {
return true
}
return false
}
// SetExtraDetails gets a reference to the given ExtraDetails and assigns it to the ExtraDetails field.
func (o *AlertsLibraryAlertExport) SetExtraDetails(v ExtraDetails) {
o.ExtraDetails = &v
}
// GetAlertCondition returns the AlertCondition field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AlertsLibraryAlertExport) GetAlertCondition() string {
if o == nil || o.AlertCondition.Get() == nil {
var ret string
return ret
}
return *o.AlertCondition.Get()
}
// GetAlertConditionOk returns a tuple with the AlertCondition 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 *AlertsLibraryAlertExport) GetAlertConditionOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.AlertCondition.Get(), o.AlertCondition.IsSet()
}
// HasAlertCondition returns a boolean if a field has been set.
func (o *AlertsLibraryAlertExport) HasAlertCondition() bool {
if o != nil && o.AlertCondition.IsSet() {
return true
}
return false
}
// SetAlertCondition gets a reference to the given NullableString and assigns it to the AlertCondition field.
func (o *AlertsLibraryAlertExport) SetAlertCondition(v string) {
o.AlertCondition.Set(&v)
}
// SetAlertConditionNil sets the value for AlertCondition to be an explicit nil
func (o *AlertsLibraryAlertExport) SetAlertConditionNil() {
o.AlertCondition.Set(nil)
}
// UnsetAlertCondition ensures that no value is present for AlertCondition, not even an explicit nil
func (o *AlertsLibraryAlertExport) UnsetAlertCondition() {
o.AlertCondition.Unset()
}
func (o AlertsLibraryAlertExport) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
serializedAlertsLibraryBaseExport, errAlertsLibraryBaseExport := json.Marshal(o.AlertsLibraryBaseExport)
if errAlertsLibraryBaseExport != nil {
return []byte{}, errAlertsLibraryBaseExport
}
errAlertsLibraryBaseExport = json.Unmarshal([]byte(serializedAlertsLibraryBaseExport), &toSerialize)
if errAlertsLibraryBaseExport != nil {
return []byte{}, errAlertsLibraryBaseExport
}
if o.MonitorId != nil {
toSerialize["monitorId"] = o.MonitorId
}
if o.ResolvedAt.IsSet() {
toSerialize["resolvedAt"] = o.ResolvedAt.Get()
}
if o.AbnormalityStartTime != nil {
toSerialize["abnormalityStartTime"] = o.AbnormalityStartTime
}
if o.AlertType != nil {
toSerialize["alertType"] = o.AlertType
}
if o.Status != nil {
toSerialize["status"] = o.Status
}
if o.MonitorQueries != nil {
toSerialize["monitorQueries"] = o.MonitorQueries
}
if o.TriggerQueries != nil {
toSerialize["triggerQueries"] = o.TriggerQueries
}
if o.MonitorUrl != nil {
toSerialize["monitorUrl"] = o.MonitorUrl
}
if o.TriggerQueryUrl != nil {
toSerialize["triggerQueryUrl"] = o.TriggerQueryUrl
}
if o.TriggerConditions != nil {
toSerialize["triggerConditions"] = o.TriggerConditions
}
if o.TriggerValue != nil {
toSerialize["triggerValue"] = o.TriggerValue
}
if o.MonitorType != nil {
toSerialize["monitorType"] = o.MonitorType
}
if o.EntityIds != nil {
toSerialize["entityIds"] = o.EntityIds
}
if o.Notes != nil {
toSerialize["notes"] = o.Notes
}
if o.ExtraDetails != nil {
toSerialize["extraDetails"] = o.ExtraDetails
}
if o.AlertCondition.IsSet() {
toSerialize["alertCondition"] = o.AlertCondition.Get()
}
return json.Marshal(toSerialize)
}
type NullableAlertsLibraryAlertExport struct {
value *AlertsLibraryAlertExport
isSet bool
}
func (v NullableAlertsLibraryAlertExport) Get() *AlertsLibraryAlertExport {
return v.value
}
func (v *NullableAlertsLibraryAlertExport) Set(val *AlertsLibraryAlertExport) {
v.value = val
v.isSet = true
}
func (v NullableAlertsLibraryAlertExport) IsSet() bool {
return v.isSet
}
func (v *NullableAlertsLibraryAlertExport) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAlertsLibraryAlertExport(val *AlertsLibraryAlertExport) *NullableAlertsLibraryAlertExport {
return &NullableAlertsLibraryAlertExport{value: val, isSet: true}
}
func (v NullableAlertsLibraryAlertExport) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAlertsLibraryAlertExport) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}