-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathTeamsApi.java
More file actions
6014 lines (5555 loc) · 208 KB
/
TeamsApi.java
File metadata and controls
6014 lines (5555 loc) · 208 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
package com.datadog.api.client.v2.api;
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.ApiResponse;
import com.datadog.api.client.PaginationIterable;
import com.datadog.api.client.Pair;
import com.datadog.api.client.v2.model.AddMemberTeamRequest;
import com.datadog.api.client.v2.model.GetTeamMembershipsSort;
import com.datadog.api.client.v2.model.ListTeamsInclude;
import com.datadog.api.client.v2.model.ListTeamsSort;
import com.datadog.api.client.v2.model.Team;
import com.datadog.api.client.v2.model.TeamConnection;
import com.datadog.api.client.v2.model.TeamConnectionCreateRequest;
import com.datadog.api.client.v2.model.TeamConnectionDeleteRequest;
import com.datadog.api.client.v2.model.TeamConnectionsResponse;
import com.datadog.api.client.v2.model.TeamCreateRequest;
import com.datadog.api.client.v2.model.TeamHierarchyLink;
import com.datadog.api.client.v2.model.TeamHierarchyLinkCreateRequest;
import com.datadog.api.client.v2.model.TeamHierarchyLinkResponse;
import com.datadog.api.client.v2.model.TeamHierarchyLinksResponse;
import com.datadog.api.client.v2.model.TeamLinkCreateRequest;
import com.datadog.api.client.v2.model.TeamLinkResponse;
import com.datadog.api.client.v2.model.TeamLinksResponse;
import com.datadog.api.client.v2.model.TeamNotificationRuleRequest;
import com.datadog.api.client.v2.model.TeamNotificationRuleResponse;
import com.datadog.api.client.v2.model.TeamNotificationRulesResponse;
import com.datadog.api.client.v2.model.TeamPermissionSettingResponse;
import com.datadog.api.client.v2.model.TeamPermissionSettingUpdateRequest;
import com.datadog.api.client.v2.model.TeamPermissionSettingsResponse;
import com.datadog.api.client.v2.model.TeamResponse;
import com.datadog.api.client.v2.model.TeamSyncAttributesSource;
import com.datadog.api.client.v2.model.TeamSyncRequest;
import com.datadog.api.client.v2.model.TeamSyncResponse;
import com.datadog.api.client.v2.model.TeamUpdateRequest;
import com.datadog.api.client.v2.model.TeamsField;
import com.datadog.api.client.v2.model.TeamsResponse;
import com.datadog.api.client.v2.model.UserTeam;
import com.datadog.api.client.v2.model.UserTeamRequest;
import com.datadog.api.client.v2.model.UserTeamResponse;
import com.datadog.api.client.v2.model.UserTeamUpdateRequest;
import com.datadog.api.client.v2.model.UserTeamsResponse;
import jakarta.ws.rs.client.Invocation;
import jakarta.ws.rs.core.GenericType;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
@jakarta.annotation.Generated(
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
public class TeamsApi {
private ApiClient apiClient;
public TeamsApi() {
this(ApiClient.getDefaultApiClient());
}
public TeamsApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Get the API client.
*
* @return API client
*/
public ApiClient getApiClient() {
return apiClient;
}
/**
* Set the API client.
*
* @param apiClient an instance of API client
*/
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Add a member team.
*
* <p>See {@link #addMemberTeamWithHttpInfo}.
*
* @param superTeamId None (required)
* @param body (required)
* @throws ApiException if fails to make API call
* @deprecated
*/
@Deprecated
public void addMemberTeam(String superTeamId, AddMemberTeamRequest body) throws ApiException {
addMemberTeamWithHttpInfo(superTeamId, body);
}
/**
* Add a member team.
*
* <p>See {@link #addMemberTeamWithHttpInfoAsync}.
*
* @param superTeamId None (required)
* @param body (required)
* @return CompletableFuture
* @deprecated
*/
@Deprecated
public CompletableFuture<Void> addMemberTeamAsync(String superTeamId, AddMemberTeamRequest body) {
return addMemberTeamWithHttpInfoAsync(superTeamId, body)
.thenApply(
response -> {
return response.getData();
});
}
/**
* Add a member team. Adds the team given by the <code>id</code> in the body as a member team of
* the super team.
*
* <p><strong>Note</strong>: This API is deprecated. For creating team hierarchy links, use the
* team hierarchy links API: <code>POST /api/v2/team-hierarchy-links</code>.
*
* @param superTeamId None (required)
* @param body (required)
* @return ApiResponse<Void>
* @throws ApiException if fails to make API call
* @http.response.details
* <table border="1">
* <caption>Response details</caption>
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
* <tr><td> 204 </td><td> Added </td><td> - </td></tr>
* <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr>
* <tr><td> 409 </td><td> API error response. </td><td> - </td></tr>
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
* </table>
*
* @deprecated
*/
@Deprecated
public ApiResponse<Void> addMemberTeamWithHttpInfo(String superTeamId, AddMemberTeamRequest body)
throws ApiException {
// Check if unstable operation is enabled
String operationId = "addMemberTeam";
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
} else {
throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
}
Object localVarPostBody = body;
// verify the required parameter 'superTeamId' is set
if (superTeamId == null) {
throw new ApiException(
400, "Missing the required parameter 'superTeamId' when calling addMemberTeam");
}
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(
400, "Missing the required parameter 'body' when calling addMemberTeam");
}
// create path and map variables
String localVarPath =
"/api/v2/team/{super_team_id}/member_teams"
.replaceAll(
"\\{" + "super_team_id" + "\\}", apiClient.escapeString(superTeamId.toString()));
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Invocation.Builder builder =
apiClient.createBuilder(
"v2.TeamsApi.addMemberTeam",
localVarPath,
new ArrayList<Pair>(),
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"*/*"},
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
return apiClient.invokeAPI(
"POST",
builder,
localVarHeaderParams,
new String[] {"application/json"},
localVarPostBody,
new HashMap<String, Object>(),
false,
null);
}
/**
* Add a member team.
*
* <p>See {@link #addMemberTeamWithHttpInfo}.
*
* @param superTeamId None (required)
* @param body (required)
* @return CompletableFuture<ApiResponse<Void>>
* @deprecated
*/
@Deprecated
public CompletableFuture<ApiResponse<Void>> addMemberTeamWithHttpInfoAsync(
String superTeamId, AddMemberTeamRequest body) {
// Check if unstable operation is enabled
String operationId = "addMemberTeam";
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
} else {
CompletableFuture<ApiResponse<Void>> result = new CompletableFuture<>();
result.completeExceptionally(
new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
return result;
}
Object localVarPostBody = body;
// verify the required parameter 'superTeamId' is set
if (superTeamId == null) {
CompletableFuture<ApiResponse<Void>> result = new CompletableFuture<>();
result.completeExceptionally(
new ApiException(
400, "Missing the required parameter 'superTeamId' when calling addMemberTeam"));
return result;
}
// verify the required parameter 'body' is set
if (body == null) {
CompletableFuture<ApiResponse<Void>> result = new CompletableFuture<>();
result.completeExceptionally(
new ApiException(
400, "Missing the required parameter 'body' when calling addMemberTeam"));
return result;
}
// create path and map variables
String localVarPath =
"/api/v2/team/{super_team_id}/member_teams"
.replaceAll(
"\\{" + "super_team_id" + "\\}", apiClient.escapeString(superTeamId.toString()));
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Invocation.Builder builder;
try {
builder =
apiClient.createBuilder(
"v2.TeamsApi.addMemberTeam",
localVarPath,
new ArrayList<Pair>(),
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"*/*"},
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
} catch (ApiException ex) {
CompletableFuture<ApiResponse<Void>> result = new CompletableFuture<>();
result.completeExceptionally(ex);
return result;
}
return apiClient.invokeAPIAsync(
"POST",
builder,
localVarHeaderParams,
new String[] {"application/json"},
localVarPostBody,
new HashMap<String, Object>(),
false,
null);
}
/**
* Create a team hierarchy link.
*
* <p>See {@link #addTeamHierarchyLinkWithHttpInfo}.
*
* @param body (required)
* @return TeamHierarchyLinkResponse
* @throws ApiException if fails to make API call
*/
public TeamHierarchyLinkResponse addTeamHierarchyLink(TeamHierarchyLinkCreateRequest body)
throws ApiException {
return addTeamHierarchyLinkWithHttpInfo(body).getData();
}
/**
* Create a team hierarchy link.
*
* <p>See {@link #addTeamHierarchyLinkWithHttpInfoAsync}.
*
* @param body (required)
* @return CompletableFuture<TeamHierarchyLinkResponse>
*/
public CompletableFuture<TeamHierarchyLinkResponse> addTeamHierarchyLinkAsync(
TeamHierarchyLinkCreateRequest body) {
return addTeamHierarchyLinkWithHttpInfoAsync(body)
.thenApply(
response -> {
return response.getData();
});
}
/**
* Create a new team hierarchy link between a parent team and a sub team.
*
* @param body (required)
* @return ApiResponse<TeamHierarchyLinkResponse>
* @throws ApiException if fails to make API call
* @http.response.details
* <table border="1">
* <caption>Response details</caption>
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
* <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr>
* <tr><td> 409 </td><td> Conflict </td><td> - </td></tr>
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
* </table>
*/
public ApiResponse<TeamHierarchyLinkResponse> addTeamHierarchyLinkWithHttpInfo(
TeamHierarchyLinkCreateRequest body) throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(
400, "Missing the required parameter 'body' when calling addTeamHierarchyLink");
}
// create path and map variables
String localVarPath = "/api/v2/team-hierarchy-links";
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Invocation.Builder builder =
apiClient.createBuilder(
"v2.TeamsApi.addTeamHierarchyLink",
localVarPath,
new ArrayList<Pair>(),
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
return apiClient.invokeAPI(
"POST",
builder,
localVarHeaderParams,
new String[] {"application/json"},
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<TeamHierarchyLinkResponse>() {});
}
/**
* Create a team hierarchy link.
*
* <p>See {@link #addTeamHierarchyLinkWithHttpInfo}.
*
* @param body (required)
* @return CompletableFuture<ApiResponse<TeamHierarchyLinkResponse>>
*/
public CompletableFuture<ApiResponse<TeamHierarchyLinkResponse>>
addTeamHierarchyLinkWithHttpInfoAsync(TeamHierarchyLinkCreateRequest body) {
Object localVarPostBody = body;
// verify the required parameter 'body' is set
if (body == null) {
CompletableFuture<ApiResponse<TeamHierarchyLinkResponse>> result = new CompletableFuture<>();
result.completeExceptionally(
new ApiException(
400, "Missing the required parameter 'body' when calling addTeamHierarchyLink"));
return result;
}
// create path and map variables
String localVarPath = "/api/v2/team-hierarchy-links";
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Invocation.Builder builder;
try {
builder =
apiClient.createBuilder(
"v2.TeamsApi.addTeamHierarchyLink",
localVarPath,
new ArrayList<Pair>(),
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
} catch (ApiException ex) {
CompletableFuture<ApiResponse<TeamHierarchyLinkResponse>> result = new CompletableFuture<>();
result.completeExceptionally(ex);
return result;
}
return apiClient.invokeAPIAsync(
"POST",
builder,
localVarHeaderParams,
new String[] {"application/json"},
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<TeamHierarchyLinkResponse>() {});
}
/**
* Create a team.
*
* <p>See {@link #createTeamWithHttpInfo}.
*
* @param body (required)
* @return TeamResponse
* @throws ApiException if fails to make API call
*/
public TeamResponse createTeam(TeamCreateRequest body) throws ApiException {
return createTeamWithHttpInfo(body).getData();
}
/**
* Create a team.
*
* <p>See {@link #createTeamWithHttpInfoAsync}.
*
* @param body (required)
* @return CompletableFuture<TeamResponse>
*/
public CompletableFuture<TeamResponse> createTeamAsync(TeamCreateRequest body) {
return createTeamWithHttpInfoAsync(body)
.thenApply(
response -> {
return response.getData();
});
}
/**
* Create a new team. User IDs passed through the <code>users</code> relationship field are added
* to the team.
*
* @param body (required)
* @return ApiResponse<TeamResponse>
* @throws ApiException if fails to make API call
* @http.response.details
* <table border="1">
* <caption>Response details</caption>
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
* <tr><td> 201 </td><td> CREATED </td><td> - </td></tr>
* <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr>
* <tr><td> 409 </td><td> API error response. </td><td> - </td></tr>
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
* </table>
*/
public ApiResponse<TeamResponse> createTeamWithHttpInfo(TeamCreateRequest body)
throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(400, "Missing the required parameter 'body' when calling createTeam");
}
// create path and map variables
String localVarPath = "/api/v2/team";
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Invocation.Builder builder =
apiClient.createBuilder(
"v2.TeamsApi.createTeam",
localVarPath,
new ArrayList<Pair>(),
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
return apiClient.invokeAPI(
"POST",
builder,
localVarHeaderParams,
new String[] {"application/json"},
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<TeamResponse>() {});
}
/**
* Create a team.
*
* <p>See {@link #createTeamWithHttpInfo}.
*
* @param body (required)
* @return CompletableFuture<ApiResponse<TeamResponse>>
*/
public CompletableFuture<ApiResponse<TeamResponse>> createTeamWithHttpInfoAsync(
TeamCreateRequest body) {
Object localVarPostBody = body;
// verify the required parameter 'body' is set
if (body == null) {
CompletableFuture<ApiResponse<TeamResponse>> result = new CompletableFuture<>();
result.completeExceptionally(
new ApiException(400, "Missing the required parameter 'body' when calling createTeam"));
return result;
}
// create path and map variables
String localVarPath = "/api/v2/team";
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Invocation.Builder builder;
try {
builder =
apiClient.createBuilder(
"v2.TeamsApi.createTeam",
localVarPath,
new ArrayList<Pair>(),
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
} catch (ApiException ex) {
CompletableFuture<ApiResponse<TeamResponse>> result = new CompletableFuture<>();
result.completeExceptionally(ex);
return result;
}
return apiClient.invokeAPIAsync(
"POST",
builder,
localVarHeaderParams,
new String[] {"application/json"},
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<TeamResponse>() {});
}
/**
* Create team connections.
*
* <p>See {@link #createTeamConnectionsWithHttpInfo}.
*
* @param body (required)
* @return TeamConnectionsResponse
* @throws ApiException if fails to make API call
*/
public TeamConnectionsResponse createTeamConnections(TeamConnectionCreateRequest body)
throws ApiException {
return createTeamConnectionsWithHttpInfo(body).getData();
}
/**
* Create team connections.
*
* <p>See {@link #createTeamConnectionsWithHttpInfoAsync}.
*
* @param body (required)
* @return CompletableFuture<TeamConnectionsResponse>
*/
public CompletableFuture<TeamConnectionsResponse> createTeamConnectionsAsync(
TeamConnectionCreateRequest body) {
return createTeamConnectionsWithHttpInfoAsync(body)
.thenApply(
response -> {
return response.getData();
});
}
/**
* Create multiple team connections.
*
* @param body (required)
* @return ApiResponse<TeamConnectionsResponse>
* @throws ApiException if fails to make API call
* @http.response.details
* <table border="1">
* <caption>Response details</caption>
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
* <tr><td> 201 </td><td> Created </td><td> - </td></tr>
* <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
* <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr>
* <tr><td> 409 </td><td> Conflict </td><td> - </td></tr>
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
* </table>
*/
public ApiResponse<TeamConnectionsResponse> createTeamConnectionsWithHttpInfo(
TeamConnectionCreateRequest body) throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(
400, "Missing the required parameter 'body' when calling createTeamConnections");
}
// create path and map variables
String localVarPath = "/api/v2/team/connections";
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Invocation.Builder builder =
apiClient.createBuilder(
"v2.TeamsApi.createTeamConnections",
localVarPath,
new ArrayList<Pair>(),
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
return apiClient.invokeAPI(
"POST",
builder,
localVarHeaderParams,
new String[] {"application/json"},
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<TeamConnectionsResponse>() {});
}
/**
* Create team connections.
*
* <p>See {@link #createTeamConnectionsWithHttpInfo}.
*
* @param body (required)
* @return CompletableFuture<ApiResponse<TeamConnectionsResponse>>
*/
public CompletableFuture<ApiResponse<TeamConnectionsResponse>>
createTeamConnectionsWithHttpInfoAsync(TeamConnectionCreateRequest body) {
Object localVarPostBody = body;
// verify the required parameter 'body' is set
if (body == null) {
CompletableFuture<ApiResponse<TeamConnectionsResponse>> result = new CompletableFuture<>();
result.completeExceptionally(
new ApiException(
400, "Missing the required parameter 'body' when calling createTeamConnections"));
return result;
}
// create path and map variables
String localVarPath = "/api/v2/team/connections";
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Invocation.Builder builder;
try {
builder =
apiClient.createBuilder(
"v2.TeamsApi.createTeamConnections",
localVarPath,
new ArrayList<Pair>(),
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
} catch (ApiException ex) {
CompletableFuture<ApiResponse<TeamConnectionsResponse>> result = new CompletableFuture<>();
result.completeExceptionally(ex);
return result;
}
return apiClient.invokeAPIAsync(
"POST",
builder,
localVarHeaderParams,
new String[] {"application/json"},
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<TeamConnectionsResponse>() {});
}
/**
* Create a team link.
*
* <p>See {@link #createTeamLinkWithHttpInfo}.
*
* @param teamId None (required)
* @param body (required)
* @return TeamLinkResponse
* @throws ApiException if fails to make API call
*/
public TeamLinkResponse createTeamLink(String teamId, TeamLinkCreateRequest body)
throws ApiException {
return createTeamLinkWithHttpInfo(teamId, body).getData();
}
/**
* Create a team link.
*
* <p>See {@link #createTeamLinkWithHttpInfoAsync}.
*
* @param teamId None (required)
* @param body (required)
* @return CompletableFuture<TeamLinkResponse>
*/
public CompletableFuture<TeamLinkResponse> createTeamLinkAsync(
String teamId, TeamLinkCreateRequest body) {
return createTeamLinkWithHttpInfoAsync(teamId, body)
.thenApply(
response -> {
return response.getData();
});
}
/**
* Add a new link to a team.
*
* @param teamId None (required)
* @param body (required)
* @return ApiResponse<TeamLinkResponse>
* @throws ApiException if fails to make API call
* @http.response.details
* <table border="1">
* <caption>Response details</caption>
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
* <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr>
* <tr><td> 404 </td><td> API error response. </td><td> - </td></tr>
* <tr><td> 422 </td><td> API error response. </td><td> - </td></tr>
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
* </table>
*/
public ApiResponse<TeamLinkResponse> createTeamLinkWithHttpInfo(
String teamId, TeamLinkCreateRequest body) throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'teamId' is set
if (teamId == null) {
throw new ApiException(
400, "Missing the required parameter 'teamId' when calling createTeamLink");
}
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(
400, "Missing the required parameter 'body' when calling createTeamLink");
}
// create path and map variables
String localVarPath =
"/api/v2/team/{team_id}/links"
.replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString()));
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Invocation.Builder builder =
apiClient.createBuilder(
"v2.TeamsApi.createTeamLink",
localVarPath,
new ArrayList<Pair>(),
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
return apiClient.invokeAPI(
"POST",
builder,
localVarHeaderParams,
new String[] {"application/json"},
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<TeamLinkResponse>() {});
}
/**
* Create a team link.
*
* <p>See {@link #createTeamLinkWithHttpInfo}.
*
* @param teamId None (required)
* @param body (required)
* @return CompletableFuture<ApiResponse<TeamLinkResponse>>
*/
public CompletableFuture<ApiResponse<TeamLinkResponse>> createTeamLinkWithHttpInfoAsync(
String teamId, TeamLinkCreateRequest body) {
Object localVarPostBody = body;
// verify the required parameter 'teamId' is set
if (teamId == null) {
CompletableFuture<ApiResponse<TeamLinkResponse>> result = new CompletableFuture<>();
result.completeExceptionally(
new ApiException(
400, "Missing the required parameter 'teamId' when calling createTeamLink"));
return result;
}
// verify the required parameter 'body' is set
if (body == null) {
CompletableFuture<ApiResponse<TeamLinkResponse>> result = new CompletableFuture<>();
result.completeExceptionally(
new ApiException(
400, "Missing the required parameter 'body' when calling createTeamLink"));
return result;
}
// create path and map variables
String localVarPath =
"/api/v2/team/{team_id}/links"
.replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString()));
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Invocation.Builder builder;
try {
builder =
apiClient.createBuilder(
"v2.TeamsApi.createTeamLink",
localVarPath,
new ArrayList<Pair>(),
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
} catch (ApiException ex) {
CompletableFuture<ApiResponse<TeamLinkResponse>> result = new CompletableFuture<>();
result.completeExceptionally(ex);
return result;
}
return apiClient.invokeAPIAsync(
"POST",
builder,
localVarHeaderParams,
new String[] {"application/json"},
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<TeamLinkResponse>() {});
}
/**
* Add a user to a team.
*
* <p>See {@link #createTeamMembershipWithHttpInfo}.
*
* @param teamId None (required)
* @param body (required)
* @return UserTeamResponse
* @throws ApiException if fails to make API call
*/
public UserTeamResponse createTeamMembership(String teamId, UserTeamRequest body)
throws ApiException {
return createTeamMembershipWithHttpInfo(teamId, body).getData();
}
/**
* Add a user to a team.
*
* <p>See {@link #createTeamMembershipWithHttpInfoAsync}.
*
* @param teamId None (required)
* @param body (required)
* @return CompletableFuture<UserTeamResponse>
*/
public CompletableFuture<UserTeamResponse> createTeamMembershipAsync(
String teamId, UserTeamRequest body) {
return createTeamMembershipWithHttpInfoAsync(teamId, body)
.thenApply(
response -> {
return response.getData();
});
}
/**
* Add a user to a team.
*
* <p><strong>Note</strong>: Each team has a setting that determines who is allowed to modify
* membership of the team. The <code>user_access_manage</code> permission generally grants access
* to modify membership of any team. To get the full picture, see <a
* href="https://docs.datadoghq.com/account_management/teams/manage/#team-membership">Team
* Membership documentation</a>.
*
* @param teamId None (required)
* @param body (required)
* @return ApiResponse<UserTeamResponse>
* @throws ApiException if fails to make API call
* @http.response.details
* <table border="1">
* <caption>Response details</caption>
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
* <tr><td> 200 </td><td> Represents a user's association to a team </td><td> - </td></tr>
* <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr>
* <tr><td> 404 </td><td> API error response. </td><td> - </td></tr>
* <tr><td> 409 </td><td> API error response. </td><td> - </td></tr>
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
* </table>
*/
public ApiResponse<UserTeamResponse> createTeamMembershipWithHttpInfo(
String teamId, UserTeamRequest body) throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'teamId' is set
if (teamId == null) {
throw new ApiException(
400, "Missing the required parameter 'teamId' when calling createTeamMembership");
}
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(
400, "Missing the required parameter 'body' when calling createTeamMembership");
}
// create path and map variables
String localVarPath =
"/api/v2/team/{team_id}/memberships"
.replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString()));
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Invocation.Builder builder =
apiClient.createBuilder(
"v2.TeamsApi.createTeamMembership",
localVarPath,
new ArrayList<Pair>(),
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
return apiClient.invokeAPI(
"POST",
builder,
localVarHeaderParams,
new String[] {"application/json"},
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<UserTeamResponse>() {});
}
/**
* Add a user to a team.
*
* <p>See {@link #createTeamMembershipWithHttpInfo}.
*
* @param teamId None (required)
* @param body (required)
* @return CompletableFuture<ApiResponse<UserTeamResponse>>
*/
public CompletableFuture<ApiResponse<UserTeamResponse>> createTeamMembershipWithHttpInfoAsync(
String teamId, UserTeamRequest body) {
Object localVarPostBody = body;
// verify the required parameter 'teamId' is set
if (teamId == null) {
CompletableFuture<ApiResponse<UserTeamResponse>> result = new CompletableFuture<>();
result.completeExceptionally(
new ApiException(
400, "Missing the required parameter 'teamId' when calling createTeamMembership"));
return result;
}
// verify the required parameter 'body' is set
if (body == null) {
CompletableFuture<ApiResponse<UserTeamResponse>> result = new CompletableFuture<>();
result.completeExceptionally(
new ApiException(
400, "Missing the required parameter 'body' when calling createTeamMembership"));
return result;
}
// create path and map variables
String localVarPath =
"/api/v2/team/{team_id}/memberships"
.replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString()));
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Invocation.Builder builder;
try {
builder =
apiClient.createBuilder(
"v2.TeamsApi.createTeamMembership",
localVarPath,
new ArrayList<Pair>(),
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
} catch (ApiException ex) {
CompletableFuture<ApiResponse<UserTeamResponse>> result = new CompletableFuture<>();
result.completeExceptionally(ex);
return result;
}
return apiClient.invokeAPIAsync(
"POST",
builder,
localVarHeaderParams,
new String[] {"application/json"},
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<UserTeamResponse>() {});
}
/**
* Create team notification rule.
*
* <p>See {@link #createTeamNotificationRuleWithHttpInfo}.
*
* @param teamId None (required)
* @param body (required)
* @return TeamNotificationRuleResponse
* @throws ApiException if fails to make API call
*/
public TeamNotificationRuleResponse createTeamNotificationRule(
String teamId, TeamNotificationRuleRequest body) throws ApiException {
return createTeamNotificationRuleWithHttpInfo(teamId, body).getData();
}
/**