-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAddActionItemTaskParams.java
More file actions
861 lines (720 loc) · 33.2 KB
/
Copy pathAddActionItemTaskParams.java
File metadata and controls
861 lines (720 loc) · 33.2 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
/*
* 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.AddActionItemTaskParamsAssignedToUser;
import com.rootly.client.model.AddActionItemTaskParamsPostToSlackChannelsInner;
import java.io.IOException;
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;
/**
* AddActionItemTaskParams
*/
@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 AddActionItemTaskParams {
/**
* Gets or Sets taskType
*/
@JsonAdapter(TaskTypeEnum.Adapter.class)
public enum TaskTypeEnum {
ADD_ACTION_ITEM("add_action_item");
private String value;
TaskTypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static TaskTypeEnum fromValue(String value) {
for (TaskTypeEnum b : TaskTypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<TaskTypeEnum> {
@Override
public void write(final JsonWriter jsonWriter, final TaskTypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public TaskTypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return TaskTypeEnum.fromValue(value);
}
}
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
String value = jsonElement.getAsString();
TaskTypeEnum.fromValue(value);
}
}
public static final String SERIALIZED_NAME_TASK_TYPE = "task_type";
@SerializedName(SERIALIZED_NAME_TASK_TYPE)
@jakarta.annotation.Nullable
private TaskTypeEnum taskType;
/**
* Attribute of the Incident to match against
*/
@JsonAdapter(AttributeToQueryByEnum.Adapter.class)
public enum AttributeToQueryByEnum {
JIRA_ISSUE_ID("jira_issue_id");
private String value;
AttributeToQueryByEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static AttributeToQueryByEnum fromValue(String value) {
for (AttributeToQueryByEnum b : AttributeToQueryByEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter<AttributeToQueryByEnum> {
@Override
public void write(final JsonWriter jsonWriter, final AttributeToQueryByEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public AttributeToQueryByEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return AttributeToQueryByEnum.fromValue(value);
}
}
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
String value = jsonElement.getAsString();
AttributeToQueryByEnum.fromValue(value);
}
}
public static final String SERIALIZED_NAME_ATTRIBUTE_TO_QUERY_BY = "attribute_to_query_by";
@SerializedName(SERIALIZED_NAME_ATTRIBUTE_TO_QUERY_BY)
@jakarta.annotation.Nullable
private AttributeToQueryByEnum attributeToQueryBy;
public static final String SERIALIZED_NAME_QUERY_VALUE = "query_value";
@SerializedName(SERIALIZED_NAME_QUERY_VALUE)
@jakarta.annotation.Nullable
private String queryValue;
public static final String SERIALIZED_NAME_INCIDENT_ROLE_ID = "incident_role_id";
@SerializedName(SERIALIZED_NAME_INCIDENT_ROLE_ID)
@jakarta.annotation.Nullable
private String incidentRoleId;
public static final String SERIALIZED_NAME_ASSIGNED_TO_USER_ID = "assigned_to_user_id";
@SerializedName(SERIALIZED_NAME_ASSIGNED_TO_USER_ID)
@jakarta.annotation.Nullable
private String assignedToUserId;
public static final String SERIALIZED_NAME_ASSIGNED_TO_USER = "assigned_to_user";
@SerializedName(SERIALIZED_NAME_ASSIGNED_TO_USER)
@jakarta.annotation.Nullable
private AddActionItemTaskParamsAssignedToUser assignedToUser;
/**
* The action item priority
*/
@JsonAdapter(PriorityEnum.Adapter.class)
public enum PriorityEnum {
HIGH("high"),
MEDIUM("medium"),
LOW("low");
private String value;
PriorityEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static PriorityEnum fromValue(String value) {
for (PriorityEnum b : PriorityEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter<PriorityEnum> {
@Override
public void write(final JsonWriter jsonWriter, final PriorityEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public PriorityEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return PriorityEnum.fromValue(value);
}
}
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
String value = jsonElement.getAsString();
PriorityEnum.fromValue(value);
}
}
public static final String SERIALIZED_NAME_PRIORITY = "priority";
@SerializedName(SERIALIZED_NAME_PRIORITY)
@jakarta.annotation.Nonnull
private PriorityEnum priority;
public static final String SERIALIZED_NAME_KIND = "kind";
@SerializedName(SERIALIZED_NAME_KIND)
@jakarta.annotation.Nullable
private String kind;
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;
/**
* The action item status
*/
@JsonAdapter(StatusEnum.Adapter.class)
public enum StatusEnum {
OPEN("open"),
IN_PROGRESS("in_progress"),
CANCELLED("cancelled"),
DONE("done");
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.Nonnull
private StatusEnum status;
public static final String SERIALIZED_NAME_POST_TO_INCIDENT_TIMELINE = "post_to_incident_timeline";
@SerializedName(SERIALIZED_NAME_POST_TO_INCIDENT_TIMELINE)
@jakarta.annotation.Nullable
private Boolean postToIncidentTimeline;
public static final String SERIALIZED_NAME_CUSTOM_FIELDS_MAPPING = "custom_fields_mapping";
@SerializedName(SERIALIZED_NAME_CUSTOM_FIELDS_MAPPING)
@jakarta.annotation.Nullable
private String customFieldsMapping;
public static final String SERIALIZED_NAME_POST_TO_SLACK_CHANNELS = "post_to_slack_channels";
@SerializedName(SERIALIZED_NAME_POST_TO_SLACK_CHANNELS)
@jakarta.annotation.Nullable
private List<AddActionItemTaskParamsPostToSlackChannelsInner> postToSlackChannels = new ArrayList<>();
public AddActionItemTaskParams() {
}
public AddActionItemTaskParams taskType(@jakarta.annotation.Nullable TaskTypeEnum taskType) {
this.taskType = taskType;
return this;
}
/**
* Get taskType
* @return taskType
*/
@jakarta.annotation.Nullable
public TaskTypeEnum getTaskType() {
return taskType;
}
public void setTaskType(@jakarta.annotation.Nullable TaskTypeEnum taskType) {
this.taskType = taskType;
}
public AddActionItemTaskParams attributeToQueryBy(@jakarta.annotation.Nullable AttributeToQueryByEnum attributeToQueryBy) {
this.attributeToQueryBy = attributeToQueryBy;
return this;
}
/**
* Attribute of the Incident to match against
* @return attributeToQueryBy
*/
@jakarta.annotation.Nullable
public AttributeToQueryByEnum getAttributeToQueryBy() {
return attributeToQueryBy;
}
public void setAttributeToQueryBy(@jakarta.annotation.Nullable AttributeToQueryByEnum attributeToQueryBy) {
this.attributeToQueryBy = attributeToQueryBy;
}
public AddActionItemTaskParams queryValue(@jakarta.annotation.Nullable String queryValue) {
this.queryValue = queryValue;
return this;
}
/**
* Value that attribute_to_query_by to uses to match against
* @return queryValue
*/
@jakarta.annotation.Nullable
public String getQueryValue() {
return queryValue;
}
public void setQueryValue(@jakarta.annotation.Nullable String queryValue) {
this.queryValue = queryValue;
}
public AddActionItemTaskParams incidentRoleId(@jakarta.annotation.Nullable String incidentRoleId) {
this.incidentRoleId = incidentRoleId;
return this;
}
/**
* The role id this action item is associated with
* @return incidentRoleId
*/
@jakarta.annotation.Nullable
public String getIncidentRoleId() {
return incidentRoleId;
}
public void setIncidentRoleId(@jakarta.annotation.Nullable String incidentRoleId) {
this.incidentRoleId = incidentRoleId;
}
public AddActionItemTaskParams assignedToUserId(@jakarta.annotation.Nullable String assignedToUserId) {
this.assignedToUserId = assignedToUserId;
return this;
}
/**
* [DEPRECATED] Use assigned_to_user attribute instead. The user id this action item is assigned to
* @return assignedToUserId
*/
@jakarta.annotation.Nullable
public String getAssignedToUserId() {
return assignedToUserId;
}
public void setAssignedToUserId(@jakarta.annotation.Nullable String assignedToUserId) {
this.assignedToUserId = assignedToUserId;
}
public AddActionItemTaskParams assignedToUser(@jakarta.annotation.Nullable AddActionItemTaskParamsAssignedToUser assignedToUser) {
this.assignedToUser = assignedToUser;
return this;
}
/**
* Get assignedToUser
* @return assignedToUser
*/
@jakarta.annotation.Nullable
public AddActionItemTaskParamsAssignedToUser getAssignedToUser() {
return assignedToUser;
}
public void setAssignedToUser(@jakarta.annotation.Nullable AddActionItemTaskParamsAssignedToUser assignedToUser) {
this.assignedToUser = assignedToUser;
}
public AddActionItemTaskParams priority(@jakarta.annotation.Nonnull PriorityEnum priority) {
this.priority = priority;
return this;
}
/**
* The action item priority
* @return priority
*/
@jakarta.annotation.Nonnull
public PriorityEnum getPriority() {
return priority;
}
public void setPriority(@jakarta.annotation.Nonnull PriorityEnum priority) {
this.priority = priority;
}
public AddActionItemTaskParams kind(@jakarta.annotation.Nullable String kind) {
this.kind = kind;
return this;
}
/**
* The action item kind
* @return kind
*/
@jakarta.annotation.Nullable
public String getKind() {
return kind;
}
public void setKind(@jakarta.annotation.Nullable String kind) {
this.kind = kind;
}
public AddActionItemTaskParams summary(@jakarta.annotation.Nonnull String summary) {
this.summary = summary;
return this;
}
/**
* The action item summary
* @return summary
*/
@jakarta.annotation.Nonnull
public String getSummary() {
return summary;
}
public void setSummary(@jakarta.annotation.Nonnull String summary) {
this.summary = summary;
}
public AddActionItemTaskParams description(@jakarta.annotation.Nullable String description) {
this.description = description;
return this;
}
/**
* The action item description
* @return description
*/
@jakarta.annotation.Nullable
public String getDescription() {
return description;
}
public void setDescription(@jakarta.annotation.Nullable String description) {
this.description = description;
}
public AddActionItemTaskParams status(@jakarta.annotation.Nonnull StatusEnum status) {
this.status = status;
return this;
}
/**
* The action item status
* @return status
*/
@jakarta.annotation.Nonnull
public StatusEnum getStatus() {
return status;
}
public void setStatus(@jakarta.annotation.Nonnull StatusEnum status) {
this.status = status;
}
public AddActionItemTaskParams postToIncidentTimeline(@jakarta.annotation.Nullable Boolean postToIncidentTimeline) {
this.postToIncidentTimeline = postToIncidentTimeline;
return this;
}
/**
* Get postToIncidentTimeline
* @return postToIncidentTimeline
*/
@jakarta.annotation.Nullable
public Boolean getPostToIncidentTimeline() {
return postToIncidentTimeline;
}
public void setPostToIncidentTimeline(@jakarta.annotation.Nullable Boolean postToIncidentTimeline) {
this.postToIncidentTimeline = postToIncidentTimeline;
}
public AddActionItemTaskParams customFieldsMapping(@jakarta.annotation.Nullable String customFieldsMapping) {
this.customFieldsMapping = customFieldsMapping;
return this;
}
/**
* Custom field mappings. Can contain liquid markup and need to be valid JSON
* @return customFieldsMapping
*/
@jakarta.annotation.Nullable
public String getCustomFieldsMapping() {
return customFieldsMapping;
}
public void setCustomFieldsMapping(@jakarta.annotation.Nullable String customFieldsMapping) {
this.customFieldsMapping = customFieldsMapping;
}
public AddActionItemTaskParams postToSlackChannels(@jakarta.annotation.Nullable List<AddActionItemTaskParamsPostToSlackChannelsInner> postToSlackChannels) {
this.postToSlackChannels = postToSlackChannels;
return this;
}
public AddActionItemTaskParams addPostToSlackChannelsItem(AddActionItemTaskParamsPostToSlackChannelsInner postToSlackChannelsItem) {
if (this.postToSlackChannels == null) {
this.postToSlackChannels = new ArrayList<>();
}
this.postToSlackChannels.add(postToSlackChannelsItem);
return this;
}
/**
* Get postToSlackChannels
* @return postToSlackChannels
*/
@jakarta.annotation.Nullable
public List<AddActionItemTaskParamsPostToSlackChannelsInner> getPostToSlackChannels() {
return postToSlackChannels;
}
public void setPostToSlackChannels(@jakarta.annotation.Nullable List<AddActionItemTaskParamsPostToSlackChannelsInner> postToSlackChannels) {
this.postToSlackChannels = postToSlackChannels;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AddActionItemTaskParams addActionItemTaskParams = (AddActionItemTaskParams) o;
return Objects.equals(this.taskType, addActionItemTaskParams.taskType) &&
Objects.equals(this.attributeToQueryBy, addActionItemTaskParams.attributeToQueryBy) &&
Objects.equals(this.queryValue, addActionItemTaskParams.queryValue) &&
Objects.equals(this.incidentRoleId, addActionItemTaskParams.incidentRoleId) &&
Objects.equals(this.assignedToUserId, addActionItemTaskParams.assignedToUserId) &&
Objects.equals(this.assignedToUser, addActionItemTaskParams.assignedToUser) &&
Objects.equals(this.priority, addActionItemTaskParams.priority) &&
Objects.equals(this.kind, addActionItemTaskParams.kind) &&
Objects.equals(this.summary, addActionItemTaskParams.summary) &&
Objects.equals(this.description, addActionItemTaskParams.description) &&
Objects.equals(this.status, addActionItemTaskParams.status) &&
Objects.equals(this.postToIncidentTimeline, addActionItemTaskParams.postToIncidentTimeline) &&
Objects.equals(this.customFieldsMapping, addActionItemTaskParams.customFieldsMapping) &&
Objects.equals(this.postToSlackChannels, addActionItemTaskParams.postToSlackChannels);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(taskType, attributeToQueryBy, queryValue, incidentRoleId, assignedToUserId, assignedToUser, priority, kind, summary, description, status, postToIncidentTimeline, customFieldsMapping, postToSlackChannels);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AddActionItemTaskParams {\n");
sb.append(" taskType: ").append(toIndentedString(taskType)).append("\n");
sb.append(" attributeToQueryBy: ").append(toIndentedString(attributeToQueryBy)).append("\n");
sb.append(" queryValue: ").append(toIndentedString(queryValue)).append("\n");
sb.append(" incidentRoleId: ").append(toIndentedString(incidentRoleId)).append("\n");
sb.append(" assignedToUserId: ").append(toIndentedString(assignedToUserId)).append("\n");
sb.append(" assignedToUser: ").append(toIndentedString(assignedToUser)).append("\n");
sb.append(" priority: ").append(toIndentedString(priority)).append("\n");
sb.append(" kind: ").append(toIndentedString(kind)).append("\n");
sb.append(" summary: ").append(toIndentedString(summary)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" postToIncidentTimeline: ").append(toIndentedString(postToIncidentTimeline)).append("\n");
sb.append(" customFieldsMapping: ").append(toIndentedString(customFieldsMapping)).append("\n");
sb.append(" postToSlackChannels: ").append(toIndentedString(postToSlackChannels)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static HashSet<String> openapiFields;
public static HashSet<String> openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet<String>();
openapiFields.add("task_type");
openapiFields.add("attribute_to_query_by");
openapiFields.add("query_value");
openapiFields.add("incident_role_id");
openapiFields.add("assigned_to_user_id");
openapiFields.add("assigned_to_user");
openapiFields.add("priority");
openapiFields.add("kind");
openapiFields.add("summary");
openapiFields.add("description");
openapiFields.add("status");
openapiFields.add("post_to_incident_timeline");
openapiFields.add("custom_fields_mapping");
openapiFields.add("post_to_slack_channels");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>();
openapiRequiredFields.add("priority");
openapiRequiredFields.add("summary");
openapiRequiredFields.add("status");
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to AddActionItemTaskParams
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!AddActionItemTaskParams.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
throw new IllegalArgumentException(String.format("The required field(s) %s in AddActionItemTaskParams is not found in the empty JSON string", AddActionItemTaskParams.openapiRequiredFields.toString()));
}
}
Set<Map.Entry<String, JsonElement>> entries = jsonElement.getAsJsonObject().entrySet();
// check to see if the JSON string contains additional fields
for (Map.Entry<String, JsonElement> entry : entries) {
if (!AddActionItemTaskParams.openapiFields.contains(entry.getKey())) {
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AddActionItemTaskParams` properties. JSON: %s", entry.getKey(), jsonElement.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AddActionItemTaskParams.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("task_type") != null && !jsonObj.get("task_type").isJsonNull()) && !jsonObj.get("task_type").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `task_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("task_type").toString()));
}
// validate the optional field `task_type`
if (jsonObj.get("task_type") != null && !jsonObj.get("task_type").isJsonNull()) {
TaskTypeEnum.validateJsonElement(jsonObj.get("task_type"));
}
if ((jsonObj.get("attribute_to_query_by") != null && !jsonObj.get("attribute_to_query_by").isJsonNull()) && !jsonObj.get("attribute_to_query_by").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `attribute_to_query_by` to be a primitive type in the JSON string but got `%s`", jsonObj.get("attribute_to_query_by").toString()));
}
// validate the optional field `attribute_to_query_by`
if (jsonObj.get("attribute_to_query_by") != null && !jsonObj.get("attribute_to_query_by").isJsonNull()) {
AttributeToQueryByEnum.validateJsonElement(jsonObj.get("attribute_to_query_by"));
}
if ((jsonObj.get("query_value") != null && !jsonObj.get("query_value").isJsonNull()) && !jsonObj.get("query_value").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `query_value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("query_value").toString()));
}
if ((jsonObj.get("incident_role_id") != null && !jsonObj.get("incident_role_id").isJsonNull()) && !jsonObj.get("incident_role_id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `incident_role_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("incident_role_id").toString()));
}
if ((jsonObj.get("assigned_to_user_id") != null && !jsonObj.get("assigned_to_user_id").isJsonNull()) && !jsonObj.get("assigned_to_user_id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `assigned_to_user_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("assigned_to_user_id").toString()));
}
// validate the optional field `assigned_to_user`
if (jsonObj.get("assigned_to_user") != null && !jsonObj.get("assigned_to_user").isJsonNull()) {
AddActionItemTaskParamsAssignedToUser.validateJsonElement(jsonObj.get("assigned_to_user"));
}
if (!jsonObj.get("priority").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `priority` to be a primitive type in the JSON string but got `%s`", jsonObj.get("priority").toString()));
}
// validate the required field `priority`
PriorityEnum.validateJsonElement(jsonObj.get("priority"));
if ((jsonObj.get("kind") != null && !jsonObj.get("kind").isJsonNull()) && !jsonObj.get("kind").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `kind` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kind").toString()));
}
if (!jsonObj.get("summary").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `summary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("summary").toString()));
}
if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString()));
}
if (!jsonObj.get("status").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString()));
}
// validate the required field `status`
StatusEnum.validateJsonElement(jsonObj.get("status"));
if ((jsonObj.get("custom_fields_mapping") != null && !jsonObj.get("custom_fields_mapping").isJsonNull()) && !jsonObj.get("custom_fields_mapping").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `custom_fields_mapping` to be a primitive type in the JSON string but got `%s`", jsonObj.get("custom_fields_mapping").toString()));
}
if (jsonObj.get("post_to_slack_channels") != null && !jsonObj.get("post_to_slack_channels").isJsonNull()) {
JsonArray jsonArraypostToSlackChannels = jsonObj.getAsJsonArray("post_to_slack_channels");
if (jsonArraypostToSlackChannels != null) {
// ensure the json data is an array
if (!jsonObj.get("post_to_slack_channels").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `post_to_slack_channels` to be an array in the JSON string but got `%s`", jsonObj.get("post_to_slack_channels").toString()));
}
// validate the optional field `post_to_slack_channels` (array)
for (int i = 0; i < jsonArraypostToSlackChannels.size(); i++) {
AddActionItemTaskParamsPostToSlackChannelsInner.validateJsonElement(jsonArraypostToSlackChannels.get(i));
};
}
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
if (!AddActionItemTaskParams.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'AddActionItemTaskParams' and its subtypes
}
final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter<AddActionItemTaskParams> thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(AddActionItemTaskParams.class));
return (TypeAdapter<T>) new TypeAdapter<AddActionItemTaskParams>() {
@Override
public void write(JsonWriter out, AddActionItemTaskParams value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public AddActionItemTaskParams read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
return thisAdapter.fromJsonTree(jsonElement);
}
}.nullSafe();
}
}
/**
* Create an instance of AddActionItemTaskParams given an JSON string
*
* @param jsonString JSON string
* @return An instance of AddActionItemTaskParams
* @throws IOException if the JSON string is invalid with respect to AddActionItemTaskParams
*/
public static AddActionItemTaskParams fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, AddActionItemTaskParams.class);
}
/**
* Convert an instance of AddActionItemTaskParams to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}