Skip to content

Commit 324bbd3

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 01dbcc9 of spec repo
1 parent 09fe883 commit 324bbd3

15 files changed

+78
-766
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 7 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -65885,8 +65885,6 @@ components:
6588565885
properties:
6588665886
frequency:
6588765887
$ref: "#/components/schemas/TeamSyncAttributesFrequency"
65888-
selection_state:
65889-
$ref: "#/components/schemas/TeamSyncAttributesSelectionState"
6589065888
source:
6589165889
$ref: "#/components/schemas/TeamSyncAttributesSource"
6589265890
sync_membership:
@@ -65909,14 +65907,6 @@ components:
6590965907
- ONCE
6591065908
- CONTINUOUSLY
6591165909
- PAUSED
65912-
TeamSyncAttributesSelectionState:
65913-
description: |-
65914-
Specifies which teams or organizations to sync. When
65915-
provided, synchronization is limited to the specified
65916-
items and their subtrees.
65917-
items:
65918-
$ref: "#/components/schemas/TeamSyncSelectionStateItem"
65919-
type: array
6592065910
TeamSyncAttributesSource:
6592165911
description: The external source platform for team synchronization. Only "github" is supported.
6592265912
enum:
@@ -65926,7 +65916,6 @@ components:
6592665916
x-enum-varnames:
6592765917
- GITHUB
6592865918
TeamSyncAttributesSyncMembership:
65929-
default: false
6593065919
description: Whether to sync members from the external team to the Datadog team. Defaults to `false` when not provided.
6593165920
example: true
6593265921
type: boolean
@@ -65986,72 +65975,6 @@ components:
6598665975
$ref: "#/components/schemas/TeamSyncData"
6598765976
type: array
6598865977
type: object
65989-
TeamSyncSelectionStateExternalId:
65990-
description: The external identifier for a team or organization in the source platform.
65991-
properties:
65992-
type:
65993-
$ref: "#/components/schemas/TeamSyncSelectionStateExternalIdType"
65994-
value:
65995-
$ref: "#/components/schemas/TeamSyncSelectionStateExternalIdValue"
65996-
required:
65997-
- type
65998-
- value
65999-
type: object
66000-
TeamSyncSelectionStateExternalIdType:
66001-
description: |-
66002-
The type of external identifier for the selection state item.
66003-
For GitHub synchronization, the allowed values are `team` and
66004-
`organization`.
66005-
enum:
66006-
- team
66007-
- organization
66008-
example: team
66009-
type: string
66010-
x-enum-varnames:
66011-
- TEAM
66012-
- ORGANIZATION
66013-
TeamSyncSelectionStateExternalIdValue:
66014-
description: |-
66015-
The external identifier value from the source
66016-
platform. For GitHub, this is the string
66017-
representation of a GitHub organization ID or team
66018-
ID.
66019-
example: "1"
66020-
type: string
66021-
TeamSyncSelectionStateItem:
66022-
description: Identifies a team or organization hierarchy to include in synchronization.
66023-
properties:
66024-
external_id:
66025-
$ref: "#/components/schemas/TeamSyncSelectionStateExternalId"
66026-
operation:
66027-
$ref: "#/components/schemas/TeamSyncSelectionStateOperation"
66028-
scope:
66029-
$ref: "#/components/schemas/TeamSyncSelectionStateScope"
66030-
required:
66031-
- external_id
66032-
type: object
66033-
TeamSyncSelectionStateOperation:
66034-
description: |-
66035-
The operation to perform on the selected hierarchy.
66036-
When set to `include`, synchronization covers the
66037-
referenced teams or organizations.
66038-
enum:
66039-
- include
66040-
example: include
66041-
type: string
66042-
x-enum-varnames:
66043-
- INCLUDE
66044-
TeamSyncSelectionStateScope:
66045-
description: |-
66046-
The scope of the selection. When set to `subtree`,
66047-
synchronization includes the referenced team or
66048-
organization and everything nested under it.
66049-
enum:
66050-
- subtree
66051-
example: subtree
66052-
type: string
66053-
x-enum-varnames:
66054-
- SUBTREE
6605565978
TeamTarget:
6605665979
description: "Represents a team target for an escalation policy step, including the team's ID and resource type."
6605765980
properties:
@@ -105511,6 +105434,12 @@ paths:
105511105434
description: OK
105512105435
"403":
105513105436
$ref: "#/components/responses/ForbiddenResponse"
105437+
"404":
105438+
content:
105439+
application/json:
105440+
schema:
105441+
$ref: "#/components/schemas/APIErrorResponse"
105442+
description: Team sync configurations not found
105514105443
"429":
105515105444
$ref: "#/components/responses/TooManyRequestsResponse"
105516105445
security:
@@ -105527,17 +105456,13 @@ paths:
105527105456
- teams_read
105528105457
post:
105529105458
description: |-
105530-
This endpoint configures synchronization between your existing Datadog teams and GitHub teams by matching their names.
105459+
This endpoint attempts to link your existing Datadog teams with GitHub teams by matching their names.
105531105460
It evaluates all current Datadog teams and compares them against teams in the GitHub organization
105532105461
connected to your Datadog account, based on Datadog Team handle and GitHub Team slug
105533105462
(lowercased and kebab-cased).
105534105463

105535105464
This operation is read-only on the GitHub side, no teams will be modified or created.
105536105465

105537-
Optionally, provide `selection_state` to limit synchronization
105538-
to specific teams or organizations and their subtrees, instead
105539-
of syncing all teams.
105540-
105541105466
[A GitHub organization must be connected to your Datadog account](https://docs.datadoghq.com/integrations/github/),
105542105467
and the GitHub App integrated with Datadog must have the `Members Read` permission. Matching is performed by comparing the Datadog team handle to the GitHub team slug
105543105468
using a normalized exact match; case is ignored and spaces are removed. No modifications are made
@@ -105552,8 +105477,6 @@ paths:
105552105477
responses:
105553105478
"200":
105554105479
description: OK
105555-
"204":
105556-
description: No Content
105557105480
"403":
105558105481
$ref: "#/components/responses/ForbiddenResponse"
105559105482
"429":
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Sync teams returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.TeamsApi;
6+
import com.datadog.api.client.v2.model.TeamSyncAttributes;
7+
import com.datadog.api.client.v2.model.TeamSyncAttributesSource;
8+
import com.datadog.api.client.v2.model.TeamSyncAttributesType;
9+
import com.datadog.api.client.v2.model.TeamSyncBulkType;
10+
import com.datadog.api.client.v2.model.TeamSyncData;
11+
import com.datadog.api.client.v2.model.TeamSyncRequest;
12+
13+
public class Example {
14+
public static void main(String[] args) {
15+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
16+
TeamsApi apiInstance = new TeamsApi(defaultClient);
17+
18+
TeamSyncRequest body =
19+
new TeamSyncRequest()
20+
.data(
21+
new TeamSyncData()
22+
.attributes(
23+
new TeamSyncAttributes()
24+
.source(TeamSyncAttributesSource.GITHUB)
25+
.type(TeamSyncAttributesType.LINK))
26+
.type(TeamSyncBulkType.TEAM_SYNC_BULK));
27+
28+
try {
29+
apiInstance.syncTeams(body);
30+
} catch (ApiException e) {
31+
System.err.println("Exception when calling TeamsApi#syncTeams");
32+
System.err.println("Status code: " + e.getCode());
33+
System.err.println("Reason: " + e.getResponseBody());
34+
System.err.println("Response headers: " + e.getResponseHeaders());
35+
e.printStackTrace();
36+
}
37+
}
38+
}

src/main/java/com/datadog/api/client/v2/api/TeamsApi.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3211,6 +3211,7 @@ public CompletableFuture<TeamSyncResponse> getTeamSyncAsync(
32113211
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
32123212
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
32133213
* <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr>
3214+
* <tr><td> 404 </td><td> Team sync configurations not found </td><td> - </td></tr>
32143215
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
32153216
* </table>
32163217
*/
@@ -5018,16 +5019,13 @@ public CompletableFuture<Void> syncTeamsAsync(TeamSyncRequest body) {
50185019
}
50195020

50205021
/**
5021-
* This endpoint configures synchronization between your existing Datadog teams and GitHub teams
5022-
* by matching their names. It evaluates all current Datadog teams and compares them against teams
5023-
* in the GitHub organization connected to your Datadog account, based on Datadog Team handle and
5024-
* GitHub Team slug (lowercased and kebab-cased).
5022+
* This endpoint attempts to link your existing Datadog teams with GitHub teams by matching their
5023+
* names. It evaluates all current Datadog teams and compares them against teams in the GitHub
5024+
* organization connected to your Datadog account, based on Datadog Team handle and GitHub Team
5025+
* slug (lowercased and kebab-cased).
50255026
*
50265027
* <p>This operation is read-only on the GitHub side, no teams will be modified or created.
50275028
*
5028-
* <p>Optionally, provide <code>selection_state</code> to limit synchronization to specific teams
5029-
* or organizations and their subtrees, instead of syncing all teams.
5030-
*
50315029
* <p><a href="https://docs.datadoghq.com/integrations/github/">A GitHub organization must be
50325030
* connected to your Datadog account</a>, and the GitHub App integrated with Datadog must have the
50335031
* <code>Members Read</code> permission. Matching is performed by comparing the Datadog team
@@ -5043,7 +5041,6 @@ public CompletableFuture<Void> syncTeamsAsync(TeamSyncRequest body) {
50435041
* <caption>Response details</caption>
50445042
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
50455043
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
5046-
* <tr><td> 204 </td><td> No Content </td><td> - </td></tr>
50475044
* <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr>
50485045
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
50495046
* <tr><td> 500 </td><td> Internal Server Error - Unexpected error during linking. </td><td> - </td></tr>

src/main/java/com/datadog/api/client/v2/model/TeamSyncAttributes.java

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,13 @@
1313
import com.fasterxml.jackson.annotation.JsonInclude;
1414
import com.fasterxml.jackson.annotation.JsonProperty;
1515
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
16-
import java.util.ArrayList;
1716
import java.util.HashMap;
18-
import java.util.List;
1917
import java.util.Map;
2018
import java.util.Objects;
2119

2220
/** Team sync attributes. */
2321
@JsonPropertyOrder({
2422
TeamSyncAttributes.JSON_PROPERTY_FREQUENCY,
25-
TeamSyncAttributes.JSON_PROPERTY_SELECTION_STATE,
2623
TeamSyncAttributes.JSON_PROPERTY_SOURCE,
2724
TeamSyncAttributes.JSON_PROPERTY_SYNC_MEMBERSHIP,
2825
TeamSyncAttributes.JSON_PROPERTY_TYPE
@@ -34,14 +31,11 @@ public class TeamSyncAttributes {
3431
public static final String JSON_PROPERTY_FREQUENCY = "frequency";
3532
private TeamSyncAttributesFrequency frequency;
3633

37-
public static final String JSON_PROPERTY_SELECTION_STATE = "selection_state";
38-
private List<TeamSyncSelectionStateItem> selectionState = null;
39-
4034
public static final String JSON_PROPERTY_SOURCE = "source";
4135
private TeamSyncAttributesSource source;
4236

4337
public static final String JSON_PROPERTY_SYNC_MEMBERSHIP = "sync_membership";
44-
private Boolean syncMembership = false;
38+
private Boolean syncMembership;
4539

4640
public static final String JSON_PROPERTY_TYPE = "type";
4741
private TeamSyncAttributesType type;
@@ -83,40 +77,6 @@ public void setFrequency(TeamSyncAttributesFrequency frequency) {
8377
this.frequency = frequency;
8478
}
8579

86-
public TeamSyncAttributes selectionState(List<TeamSyncSelectionStateItem> selectionState) {
87-
this.selectionState = selectionState;
88-
for (TeamSyncSelectionStateItem item : selectionState) {
89-
this.unparsed |= item.unparsed;
90-
}
91-
return this;
92-
}
93-
94-
public TeamSyncAttributes addSelectionStateItem(TeamSyncSelectionStateItem selectionStateItem) {
95-
if (this.selectionState == null) {
96-
this.selectionState = new ArrayList<>();
97-
}
98-
this.selectionState.add(selectionStateItem);
99-
this.unparsed |= selectionStateItem.unparsed;
100-
return this;
101-
}
102-
103-
/**
104-
* Specifies which teams or organizations to sync. When provided, synchronization is limited to
105-
* the specified items and their subtrees.
106-
*
107-
* @return selectionState
108-
*/
109-
@jakarta.annotation.Nullable
110-
@JsonProperty(JSON_PROPERTY_SELECTION_STATE)
111-
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
112-
public List<TeamSyncSelectionStateItem> getSelectionState() {
113-
return selectionState;
114-
}
115-
116-
public void setSelectionState(List<TeamSyncSelectionStateItem> selectionState) {
117-
this.selectionState = selectionState;
118-
}
119-
12080
public TeamSyncAttributes source(TeamSyncAttributesSource source) {
12181
this.source = source;
12282
this.unparsed |= !source.isValid();
@@ -245,7 +205,6 @@ public boolean equals(Object o) {
245205
}
246206
TeamSyncAttributes teamSyncAttributes = (TeamSyncAttributes) o;
247207
return Objects.equals(this.frequency, teamSyncAttributes.frequency)
248-
&& Objects.equals(this.selectionState, teamSyncAttributes.selectionState)
249208
&& Objects.equals(this.source, teamSyncAttributes.source)
250209
&& Objects.equals(this.syncMembership, teamSyncAttributes.syncMembership)
251210
&& Objects.equals(this.type, teamSyncAttributes.type)
@@ -254,16 +213,14 @@ public boolean equals(Object o) {
254213

255214
@Override
256215
public int hashCode() {
257-
return Objects.hash(
258-
frequency, selectionState, source, syncMembership, type, additionalProperties);
216+
return Objects.hash(frequency, source, syncMembership, type, additionalProperties);
259217
}
260218

261219
@Override
262220
public String toString() {
263221
StringBuilder sb = new StringBuilder();
264222
sb.append("class TeamSyncAttributes {\n");
265223
sb.append(" frequency: ").append(toIndentedString(frequency)).append("\n");
266-
sb.append(" selectionState: ").append(toIndentedString(selectionState)).append("\n");
267224
sb.append(" source: ").append(toIndentedString(source)).append("\n");
268225
sb.append(" syncMembership: ").append(toIndentedString(syncMembership)).append("\n");
269226
sb.append(" type: ").append(toIndentedString(type)).append("\n");

0 commit comments

Comments
 (0)