-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAlert.java
More file actions
1320 lines (1081 loc) · 46 KB
/
Copy pathAlert.java
File metadata and controls
1320 lines (1081 loc) · 46 KB
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
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Rootly API v1
* # How to generate an API Key? - **Organization dropdown** > **Organization Settings** > **API Keys** # JSON:API Specification Rootly is using **JSON:API** (https://jsonapi.org) specification: - JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests. - JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability. - JSON:API requires use of the JSON:API media type (**application/vnd.api+json**) for exchanging data. # Authentication and Requests We use standard HTTP Authentication over HTTPS to authorize your requests. ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents ``` <br/> # Rate limiting - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - There is a default limit of **3** **POST**, **PUT**, **PATCH** or **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit is calculated over a **0-hour sliding window** looking back from the current time. While the limit can be configured to support higher thresholds, you must first contact your **Rootly Customer Success Manager** to make any adjustments. - When rate limits are exceeded, the API will return a **429 Too Many Requests** HTTP status code with the response: `{\"error\": \"Rate limit exceeded. Try again later.\"}` - **X-RateLimit headers** are included in every API response, providing real-time rate limit information: - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., \"1000, 1000;window=3600\" for 1000 requests per hour) - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window - **X-RateLimit-Used** - The number of requests already made in the current window - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds # Pagination - Pagination is supported for all endpoints that return a collection of items. - Pagination is controlled by the **page** query parameter ## Example ``` curl --request GET \\ --header 'Content-Type: application/vnd.api+json' \\ --header 'Authorization: Bearer YOUR-TOKEN' \\ --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10 ```
*
* The version of the OpenAPI document: v1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.rootly.client.model;
import java.util.Objects;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import com.rootly.client.model.Environment;
import com.rootly.client.model.NewAlertDataAttributesAlertFieldValuesAttributesInner;
import com.rootly.client.model.NewAlertDataAttributesLabelsInner;
import com.rootly.client.model.Service;
import com.rootly.client.model.Team;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.rootly.client.JSON;
/**
* Alert
*/
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2026-01-20T18:42:42.907690594Z[Etc/UTC]", comments = "Generator version: 7.13.0")
public class Alert {
public static final String SERIALIZED_NAME_SHORT_ID = "short_id";
@SerializedName(SERIALIZED_NAME_SHORT_ID)
@jakarta.annotation.Nonnull
private String shortId;
/**
* Whether the alert is marked as noise
*/
@JsonAdapter(NoiseEnum.Adapter.class)
public enum NoiseEnum {
NOISE("noise"),
NOT_NOISE("not_noise");
private String value;
NoiseEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static NoiseEnum fromValue(String value) {
for (NoiseEnum b : NoiseEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter<NoiseEnum> {
@Override
public void write(final JsonWriter jsonWriter, final NoiseEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public NoiseEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return NoiseEnum.fromValue(value);
}
}
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
String value = jsonElement.getAsString();
NoiseEnum.fromValue(value);
}
}
public static final String SERIALIZED_NAME_NOISE = "noise";
@SerializedName(SERIALIZED_NAME_NOISE)
@jakarta.annotation.Nullable
private NoiseEnum noise;
/**
* The source of the alert
*/
@JsonAdapter(SourceEnum.Adapter.class)
public enum SourceEnum {
ROOTLY("rootly"),
MANUAL("manual"),
API("api"),
HEARTBEAT("heartbeat"),
WEB("web"),
SLACK("slack"),
EMAIL("email"),
WORKFLOW("workflow"),
LIVE_CALL_ROUTING("live_call_routing"),
MOBILE("mobile"),
PAGERDUTY("pagerduty"),
OPSGENIE("opsgenie"),
VICTOROPS("victorops"),
PAGERTREE("pagertree"),
DATADOG("datadog"),
NOBL9("nobl9"),
ZENDESK("zendesk"),
ASANA("asana"),
CLICKUP("clickup"),
SENTRY("sentry"),
ROLLBAR("rollbar"),
JIRA("jira"),
HONEYCOMB("honeycomb"),
SERVICE_NOW("service_now"),
LINEAR("linear"),
GRAFANA("grafana"),
ALERTMANAGER("alertmanager"),
GOOGLE_CLOUD("google_cloud"),
GENERIC_WEBHOOK("generic_webhook"),
CLOUD_WATCH("cloud_watch"),
AZURE("azure"),
SPLUNK("splunk"),
CHRONOSPHERE("chronosphere"),
APP_OPTICS("app_optics"),
BUG_SNAG("bug_snag"),
MONTE_CARLO("monte_carlo"),
NAGIOS("nagios"),
PRTG("prtg"),
CATCHPOINT("catchpoint"),
APP_DYNAMICS("app_dynamics"),
CHECKLY("checkly"),
NEW_RELIC("new_relic"),
GITLAB("gitlab");
private String value;
SourceEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static SourceEnum fromValue(String value) {
for (SourceEnum b : SourceEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<SourceEnum> {
@Override
public void write(final JsonWriter jsonWriter, final SourceEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public SourceEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return SourceEnum.fromValue(value);
}
}
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
String value = jsonElement.getAsString();
SourceEnum.fromValue(value);
}
}
public static final String SERIALIZED_NAME_SOURCE = "source";
@SerializedName(SERIALIZED_NAME_SOURCE)
@jakarta.annotation.Nonnull
private SourceEnum source;
/**
* The status of the alert
*/
@JsonAdapter(StatusEnum.Adapter.class)
public enum StatusEnum {
OPEN("open"),
TRIGGERED("triggered"),
ACKNOWLEDGED("acknowledged"),
RESOLVED("resolved");
private String value;
StatusEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static StatusEnum fromValue(String value) {
for (StatusEnum b : StatusEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<StatusEnum> {
@Override
public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public StatusEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return StatusEnum.fromValue(value);
}
}
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
String value = jsonElement.getAsString();
StatusEnum.fromValue(value);
}
}
public static final String SERIALIZED_NAME_STATUS = "status";
@SerializedName(SERIALIZED_NAME_STATUS)
@jakarta.annotation.Nullable
private StatusEnum status;
public static final String SERIALIZED_NAME_SUMMARY = "summary";
@SerializedName(SERIALIZED_NAME_SUMMARY)
@jakarta.annotation.Nonnull
private String summary;
public static final String SERIALIZED_NAME_DESCRIPTION = "description";
@SerializedName(SERIALIZED_NAME_DESCRIPTION)
@jakarta.annotation.Nullable
private String description;
public static final String SERIALIZED_NAME_SERVICES = "services";
@SerializedName(SERIALIZED_NAME_SERVICES)
@jakarta.annotation.Nullable
private List<Service> services = new ArrayList<>();
public static final String SERIALIZED_NAME_GROUPS = "groups";
@SerializedName(SERIALIZED_NAME_GROUPS)
@jakarta.annotation.Nullable
private List<Team> groups = new ArrayList<>();
public static final String SERIALIZED_NAME_ENVIRONMENTS = "environments";
@SerializedName(SERIALIZED_NAME_ENVIRONMENTS)
@jakarta.annotation.Nullable
private List<Environment> environments = new ArrayList<>();
public static final String SERIALIZED_NAME_SERVICE_IDS = "service_ids";
@SerializedName(SERIALIZED_NAME_SERVICE_IDS)
@jakarta.annotation.Nullable
private List<String> serviceIds;
public static final String SERIALIZED_NAME_GROUP_IDS = "group_ids";
@SerializedName(SERIALIZED_NAME_GROUP_IDS)
@jakarta.annotation.Nullable
private List<String> groupIds;
public static final String SERIALIZED_NAME_ENVIRONMENT_IDS = "environment_ids";
@SerializedName(SERIALIZED_NAME_ENVIRONMENT_IDS)
@jakarta.annotation.Nullable
private List<String> environmentIds;
public static final String SERIALIZED_NAME_EXTERNAL_ID = "external_id";
@SerializedName(SERIALIZED_NAME_EXTERNAL_ID)
@jakarta.annotation.Nullable
private String externalId;
public static final String SERIALIZED_NAME_EXTERNAL_URL = "external_url";
@SerializedName(SERIALIZED_NAME_EXTERNAL_URL)
@jakarta.annotation.Nullable
private String externalUrl;
public static final String SERIALIZED_NAME_ALERT_URGENCY_ID = "alert_urgency_id";
@SerializedName(SERIALIZED_NAME_ALERT_URGENCY_ID)
@jakarta.annotation.Nullable
private String alertUrgencyId;
public static final String SERIALIZED_NAME_GROUP_LEADER_ALERT_ID = "group_leader_alert_id";
@SerializedName(SERIALIZED_NAME_GROUP_LEADER_ALERT_ID)
@jakarta.annotation.Nullable
private String groupLeaderAlertId;
public static final String SERIALIZED_NAME_IS_GROUP_LEADER_ALERT = "is_group_leader_alert";
@SerializedName(SERIALIZED_NAME_IS_GROUP_LEADER_ALERT)
@jakarta.annotation.Nullable
private Boolean isGroupLeaderAlert;
public static final String SERIALIZED_NAME_LABELS = "labels";
@SerializedName(SERIALIZED_NAME_LABELS)
@jakarta.annotation.Nullable
private List<NewAlertDataAttributesLabelsInner> labels = new ArrayList<>();
public static final String SERIALIZED_NAME_DATA = "data";
@SerializedName(SERIALIZED_NAME_DATA)
@jakarta.annotation.Nullable
private Object data;
public static final String SERIALIZED_NAME_DEDUPLICATION_KEY = "deduplication_key";
@SerializedName(SERIALIZED_NAME_DEDUPLICATION_KEY)
@jakarta.annotation.Nullable
private String deduplicationKey;
public static final String SERIALIZED_NAME_ALERT_FIELD_VALUES_ATTRIBUTES = "alert_field_values_attributes";
@SerializedName(SERIALIZED_NAME_ALERT_FIELD_VALUES_ATTRIBUTES)
@jakarta.annotation.Nullable
private List<NewAlertDataAttributesAlertFieldValuesAttributesInner> alertFieldValuesAttributes = new ArrayList<>();
public static final String SERIALIZED_NAME_STARTED_AT = "started_at";
@SerializedName(SERIALIZED_NAME_STARTED_AT)
@jakarta.annotation.Nullable
private OffsetDateTime startedAt;
public static final String SERIALIZED_NAME_ENDED_AT = "ended_at";
@SerializedName(SERIALIZED_NAME_ENDED_AT)
@jakarta.annotation.Nullable
private OffsetDateTime endedAt;
public static final String SERIALIZED_NAME_CREATED_AT = "created_at";
@SerializedName(SERIALIZED_NAME_CREATED_AT)
@jakarta.annotation.Nonnull
private String createdAt;
public static final String SERIALIZED_NAME_UPDATED_AT = "updated_at";
@SerializedName(SERIALIZED_NAME_UPDATED_AT)
@jakarta.annotation.Nonnull
private String updatedAt;
public Alert() {
}
public Alert shortId(@jakarta.annotation.Nonnull String shortId) {
this.shortId = shortId;
return this;
}
/**
* Human-readable short identifier for the alert
* @return shortId
*/
@jakarta.annotation.Nonnull
public String getShortId() {
return shortId;
}
public void setShortId(@jakarta.annotation.Nonnull String shortId) {
this.shortId = shortId;
}
public Alert noise(@jakarta.annotation.Nullable NoiseEnum noise) {
this.noise = noise;
return this;
}
/**
* Whether the alert is marked as noise
* @return noise
*/
@jakarta.annotation.Nullable
public NoiseEnum getNoise() {
return noise;
}
public void setNoise(@jakarta.annotation.Nullable NoiseEnum noise) {
this.noise = noise;
}
public Alert source(@jakarta.annotation.Nonnull SourceEnum source) {
this.source = source;
return this;
}
/**
* The source of the alert
* @return source
*/
@jakarta.annotation.Nonnull
public SourceEnum getSource() {
return source;
}
public void setSource(@jakarta.annotation.Nonnull SourceEnum source) {
this.source = source;
}
public Alert status(@jakarta.annotation.Nullable StatusEnum status) {
this.status = status;
return this;
}
/**
* The status of the alert
* @return status
*/
@jakarta.annotation.Nullable
public StatusEnum getStatus() {
return status;
}
public void setStatus(@jakarta.annotation.Nullable StatusEnum status) {
this.status = status;
}
public Alert summary(@jakarta.annotation.Nonnull String summary) {
this.summary = summary;
return this;
}
/**
* The summary of the alert
* @return summary
*/
@jakarta.annotation.Nonnull
public String getSummary() {
return summary;
}
public void setSummary(@jakarta.annotation.Nonnull String summary) {
this.summary = summary;
}
public Alert description(@jakarta.annotation.Nullable String description) {
this.description = description;
return this;
}
/**
* The description of the alert
* @return description
*/
@jakarta.annotation.Nullable
public String getDescription() {
return description;
}
public void setDescription(@jakarta.annotation.Nullable String description) {
this.description = description;
}
public Alert services(@jakarta.annotation.Nullable List<Service> services) {
this.services = services;
return this;
}
public Alert addServicesItem(Service servicesItem) {
if (this.services == null) {
this.services = new ArrayList<>();
}
this.services.add(servicesItem);
return this;
}
/**
* Services attached to the alert
* @return services
*/
@jakarta.annotation.Nullable
public List<Service> getServices() {
return services;
}
public void setServices(@jakarta.annotation.Nullable List<Service> services) {
this.services = services;
}
public Alert groups(@jakarta.annotation.Nullable List<Team> groups) {
this.groups = groups;
return this;
}
public Alert addGroupsItem(Team groupsItem) {
if (this.groups == null) {
this.groups = new ArrayList<>();
}
this.groups.add(groupsItem);
return this;
}
/**
* Groups attached to the alert
* @return groups
*/
@jakarta.annotation.Nullable
public List<Team> getGroups() {
return groups;
}
public void setGroups(@jakarta.annotation.Nullable List<Team> groups) {
this.groups = groups;
}
public Alert environments(@jakarta.annotation.Nullable List<Environment> environments) {
this.environments = environments;
return this;
}
public Alert addEnvironmentsItem(Environment environmentsItem) {
if (this.environments == null) {
this.environments = new ArrayList<>();
}
this.environments.add(environmentsItem);
return this;
}
/**
* Environments attached to the alert
* @return environments
*/
@jakarta.annotation.Nullable
public List<Environment> getEnvironments() {
return environments;
}
public void setEnvironments(@jakarta.annotation.Nullable List<Environment> environments) {
this.environments = environments;
}
public Alert serviceIds(@jakarta.annotation.Nullable List<String> serviceIds) {
this.serviceIds = serviceIds;
return this;
}
public Alert addServiceIdsItem(String serviceIdsItem) {
if (this.serviceIds == null) {
this.serviceIds = new ArrayList<>();
}
this.serviceIds.add(serviceIdsItem);
return this;
}
/**
* The Service IDs to attach to the alert. If your organization has On-Call enabled and your notification target is a Service. This field will be automatically set for you.
* @return serviceIds
*/
@jakarta.annotation.Nullable
public List<String> getServiceIds() {
return serviceIds;
}
public void setServiceIds(@jakarta.annotation.Nullable List<String> serviceIds) {
this.serviceIds = serviceIds;
}
public Alert groupIds(@jakarta.annotation.Nullable List<String> groupIds) {
this.groupIds = groupIds;
return this;
}
public Alert addGroupIdsItem(String groupIdsItem) {
if (this.groupIds == null) {
this.groupIds = new ArrayList<>();
}
this.groupIds.add(groupIdsItem);
return this;
}
/**
* The Group IDs to attach to the alert. If your organization has On-Call enabled and your notification target is a Group. This field will be automatically set for you.
* @return groupIds
*/
@jakarta.annotation.Nullable
public List<String> getGroupIds() {
return groupIds;
}
public void setGroupIds(@jakarta.annotation.Nullable List<String> groupIds) {
this.groupIds = groupIds;
}
public Alert environmentIds(@jakarta.annotation.Nullable List<String> environmentIds) {
this.environmentIds = environmentIds;
return this;
}
public Alert addEnvironmentIdsItem(String environmentIdsItem) {
if (this.environmentIds == null) {
this.environmentIds = new ArrayList<>();
}
this.environmentIds.add(environmentIdsItem);
return this;
}
/**
* The Environment IDs to attach to the alert
* @return environmentIds
*/
@jakarta.annotation.Nullable
public List<String> getEnvironmentIds() {
return environmentIds;
}
public void setEnvironmentIds(@jakarta.annotation.Nullable List<String> environmentIds) {
this.environmentIds = environmentIds;
}
public Alert externalId(@jakarta.annotation.Nullable String externalId) {
this.externalId = externalId;
return this;
}
/**
* External ID
* @return externalId
*/
@jakarta.annotation.Nullable
public String getExternalId() {
return externalId;
}
public void setExternalId(@jakarta.annotation.Nullable String externalId) {
this.externalId = externalId;
}
public Alert externalUrl(@jakarta.annotation.Nullable String externalUrl) {
this.externalUrl = externalUrl;
return this;
}
/**
* External Url
* @return externalUrl
*/
@jakarta.annotation.Nullable
public String getExternalUrl() {
return externalUrl;
}
public void setExternalUrl(@jakarta.annotation.Nullable String externalUrl) {
this.externalUrl = externalUrl;
}
public Alert alertUrgencyId(@jakarta.annotation.Nullable String alertUrgencyId) {
this.alertUrgencyId = alertUrgencyId;
return this;
}
/**
* The ID of the alert urgency
* @return alertUrgencyId
*/
@jakarta.annotation.Nullable
public String getAlertUrgencyId() {
return alertUrgencyId;
}
public void setAlertUrgencyId(@jakarta.annotation.Nullable String alertUrgencyId) {
this.alertUrgencyId = alertUrgencyId;
}
public Alert groupLeaderAlertId(@jakarta.annotation.Nullable String groupLeaderAlertId) {
this.groupLeaderAlertId = groupLeaderAlertId;
return this;
}
/**
* The ID of the group leader alert
* @return groupLeaderAlertId
*/
@jakarta.annotation.Nullable
public String getGroupLeaderAlertId() {
return groupLeaderAlertId;
}
public void setGroupLeaderAlertId(@jakarta.annotation.Nullable String groupLeaderAlertId) {
this.groupLeaderAlertId = groupLeaderAlertId;
}
public Alert isGroupLeaderAlert(@jakarta.annotation.Nullable Boolean isGroupLeaderAlert) {
this.isGroupLeaderAlert = isGroupLeaderAlert;
return this;
}
/**
* Whether the alert is a group leader alert
* @return isGroupLeaderAlert
*/
@jakarta.annotation.Nullable
public Boolean getIsGroupLeaderAlert() {
return isGroupLeaderAlert;
}
public void setIsGroupLeaderAlert(@jakarta.annotation.Nullable Boolean isGroupLeaderAlert) {
this.isGroupLeaderAlert = isGroupLeaderAlert;
}
public Alert labels(@jakarta.annotation.Nullable List<NewAlertDataAttributesLabelsInner> labels) {
this.labels = labels;
return this;
}
public Alert addLabelsItem(NewAlertDataAttributesLabelsInner labelsItem) {
if (this.labels == null) {
this.labels = new ArrayList<>();
}
this.labels.add(labelsItem);
return this;
}
/**
* Get labels
* @return labels
*/
@jakarta.annotation.Nullable
public List<NewAlertDataAttributesLabelsInner> getLabels() {
return labels;
}
public void setLabels(@jakarta.annotation.Nullable List<NewAlertDataAttributesLabelsInner> labels) {
this.labels = labels;
}
public Alert data(@jakarta.annotation.Nullable Object data) {
this.data = data;
return this;
}
/**
* Additional data
* @return data
*/
@jakarta.annotation.Nullable
public Object getData() {
return data;
}
public void setData(@jakarta.annotation.Nullable Object data) {
this.data = data;
}
public Alert deduplicationKey(@jakarta.annotation.Nullable String deduplicationKey) {
this.deduplicationKey = deduplicationKey;
return this;
}
/**
* Alerts sharing the same deduplication key are treated as a single alert.
* @return deduplicationKey
*/
@jakarta.annotation.Nullable
public String getDeduplicationKey() {
return deduplicationKey;
}
public void setDeduplicationKey(@jakarta.annotation.Nullable String deduplicationKey) {
this.deduplicationKey = deduplicationKey;
}
public Alert alertFieldValuesAttributes(@jakarta.annotation.Nullable List<NewAlertDataAttributesAlertFieldValuesAttributesInner> alertFieldValuesAttributes) {
this.alertFieldValuesAttributes = alertFieldValuesAttributes;
return this;
}
public Alert addAlertFieldValuesAttributesItem(NewAlertDataAttributesAlertFieldValuesAttributesInner alertFieldValuesAttributesItem) {
if (this.alertFieldValuesAttributes == null) {
this.alertFieldValuesAttributes = new ArrayList<>();
}
this.alertFieldValuesAttributes.add(alertFieldValuesAttributesItem);
return this;
}
/**
* Custom alert field values to create with the alert
* @return alertFieldValuesAttributes
*/
@jakarta.annotation.Nullable
public List<NewAlertDataAttributesAlertFieldValuesAttributesInner> getAlertFieldValuesAttributes() {
return alertFieldValuesAttributes;
}
public void setAlertFieldValuesAttributes(@jakarta.annotation.Nullable List<NewAlertDataAttributesAlertFieldValuesAttributesInner> alertFieldValuesAttributes) {
this.alertFieldValuesAttributes = alertFieldValuesAttributes;
}
public Alert startedAt(@jakarta.annotation.Nullable OffsetDateTime startedAt) {
this.startedAt = startedAt;
return this;
}
/**
* When the alert started
* @return startedAt
*/
@jakarta.annotation.Nullable
public OffsetDateTime getStartedAt() {
return startedAt;
}
public void setStartedAt(@jakarta.annotation.Nullable OffsetDateTime startedAt) {
this.startedAt = startedAt;
}
public Alert endedAt(@jakarta.annotation.Nullable OffsetDateTime endedAt) {
this.endedAt = endedAt;
return this;
}
/**
* When the alert ended
* @return endedAt
*/
@jakarta.annotation.Nullable
public OffsetDateTime getEndedAt() {
return endedAt;
}
public void setEndedAt(@jakarta.annotation.Nullable OffsetDateTime endedAt) {
this.endedAt = endedAt;
}
public Alert createdAt(@jakarta.annotation.Nonnull String createdAt) {
this.createdAt = createdAt;
return this;
}
/**
* Date of creation
* @return createdAt
*/
@jakarta.annotation.Nonnull
public String getCreatedAt() {
return createdAt;
}
public void setCreatedAt(@jakarta.annotation.Nonnull String createdAt) {
this.createdAt = createdAt;
}
public Alert updatedAt(@jakarta.annotation.Nonnull String updatedAt) {
this.updatedAt = updatedAt;
return this;
}
/**
* Date of last update
* @return updatedAt
*/
@jakarta.annotation.Nonnull
public String getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(@jakarta.annotation.Nonnull String updatedAt) {
this.updatedAt = updatedAt;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Alert alert = (Alert) o;
return Objects.equals(this.shortId, alert.shortId) &&
Objects.equals(this.noise, alert.noise) &&
Objects.equals(this.source, alert.source) &&
Objects.equals(this.status, alert.status) &&
Objects.equals(this.summary, alert.summary) &&
Objects.equals(this.description, alert.description) &&
Objects.equals(this.services, alert.services) &&
Objects.equals(this.groups, alert.groups) &&
Objects.equals(this.environments, alert.environments) &&
Objects.equals(this.serviceIds, alert.serviceIds) &&
Objects.equals(this.groupIds, alert.groupIds) &&
Objects.equals(this.environmentIds, alert.environmentIds) &&
Objects.equals(this.externalId, alert.externalId) &&
Objects.equals(this.externalUrl, alert.externalUrl) &&
Objects.equals(this.alertUrgencyId, alert.alertUrgencyId) &&
Objects.equals(this.groupLeaderAlertId, alert.groupLeaderAlertId) &&
Objects.equals(this.isGroupLeaderAlert, alert.isGroupLeaderAlert) &&
Objects.equals(this.labels, alert.labels) &&
Objects.equals(this.data, alert.data) &&
Objects.equals(this.deduplicationKey, alert.deduplicationKey) &&