Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 84 additions & 7 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65653,6 +65653,8 @@ components:
properties:
frequency:
$ref: "#/components/schemas/TeamSyncAttributesFrequency"
selection_state:
$ref: "#/components/schemas/TeamSyncAttributesSelectionState"
source:
$ref: "#/components/schemas/TeamSyncAttributesSource"
sync_membership:
Expand All @@ -65675,6 +65677,14 @@ components:
- ONCE
- CONTINUOUSLY
- PAUSED
TeamSyncAttributesSelectionState:
description: |-
Specifies which teams or organizations to sync. When
provided, synchronization is limited to the specified
items and their subtrees.
items:
$ref: "#/components/schemas/TeamSyncSelectionStateItem"
type: array
TeamSyncAttributesSource:
description: The external source platform for team synchronization. Only "github" is supported.
enum:
Expand All @@ -65684,6 +65694,7 @@ components:
x-enum-varnames:
- GITHUB
TeamSyncAttributesSyncMembership:
default: false
description: Whether to sync members from the external team to the Datadog team. Defaults to `false` when not provided.
example: true
type: boolean
Expand Down Expand Up @@ -65743,6 +65754,72 @@ components:
$ref: "#/components/schemas/TeamSyncData"
type: array
type: object
TeamSyncSelectionStateExternalId:
description: The external identifier for a team or organization in the source platform.
properties:
type:
$ref: "#/components/schemas/TeamSyncSelectionStateExternalIdType"
value:
$ref: "#/components/schemas/TeamSyncSelectionStateExternalIdValue"
required:
- type
- value
type: object
TeamSyncSelectionStateExternalIdType:
description: |-
The type of external identifier for the selection state item.
For GitHub synchronization, the allowed values are `team` and
`organization`.
enum:
- team
- organization
example: team
type: string
x-enum-varnames:
- TEAM
- ORGANIZATION
TeamSyncSelectionStateExternalIdValue:
description: |-
The external identifier value from the source
platform. For GitHub, this is the string
representation of a GitHub organization ID or team
ID.
example: "1"
type: string
TeamSyncSelectionStateItem:
description: Identifies a team or organization hierarchy to include in synchronization.
properties:
external_id:
$ref: "#/components/schemas/TeamSyncSelectionStateExternalId"
operation:
$ref: "#/components/schemas/TeamSyncSelectionStateOperation"
scope:
$ref: "#/components/schemas/TeamSyncSelectionStateScope"
required:
- external_id
type: object
TeamSyncSelectionStateOperation:
description: |-
The operation to perform on the selected hierarchy.
When set to `include`, synchronization covers the
referenced teams or organizations.
enum:
- include
example: include
type: string
x-enum-varnames:
- INCLUDE
TeamSyncSelectionStateScope:
description: |-
The scope of the selection. When set to `subtree`,
synchronization includes the referenced team or
organization and everything nested under it.
enum:
- subtree
example: subtree
type: string
x-enum-varnames:
- SUBTREE
TeamTarget:
description: "Represents a team target for an escalation policy step, including the team's ID and resource type."
properties:
Expand Down Expand Up @@ -105047,12 +105124,6 @@ paths:
description: OK
"403":
$ref: "#/components/responses/ForbiddenResponse"
"404":
content:
application/json:
schema:
$ref: "#/components/schemas/APIErrorResponse"
description: Team sync configurations not found
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
Expand All @@ -105069,13 +105140,17 @@ paths:
- teams_read
post:
description: |-
This endpoint attempts to link your existing Datadog teams with GitHub teams by matching their names.
This endpoint configures synchronization between your existing Datadog teams and GitHub teams by matching their names.
It evaluates all current Datadog teams and compares them against teams in the GitHub organization
connected to your Datadog account, based on Datadog Team handle and GitHub Team slug
(lowercased and kebab-cased).

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

Optionally, provide `selection_state` to limit synchronization
to specific teams or organizations and their subtrees, instead
of syncing all teams.

[A GitHub organization must be connected to your Datadog account](https://docs.datadoghq.com/integrations/github/),
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
using a normalized exact match; case is ignored and spaces are removed. No modifications are made
Expand All @@ -105090,6 +105165,8 @@ paths:
responses:
"200":
description: OK
"204":
description: No Content
"403":
$ref: "#/components/responses/ForbiddenResponse"
"429":
Expand Down
38 changes: 0 additions & 38 deletions examples/v2/teams/SyncTeams_3215592344.java

This file was deleted.

13 changes: 8 additions & 5 deletions src/main/java/com/datadog/api/client/v2/api/TeamsApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -3211,7 +3211,6 @@ public CompletableFuture<TeamSyncResponse> getTeamSyncAsync(
* <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> Team sync configurations not found </td><td> - </td></tr>
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
* </table>
*/
Expand Down Expand Up @@ -5019,13 +5018,16 @@ public CompletableFuture<Void> syncTeamsAsync(TeamSyncRequest body) {
}

/**
* This endpoint attempts to link your existing Datadog teams with GitHub teams by matching their
* names. It evaluates all current Datadog teams and compares them against teams in the GitHub
* organization connected to your Datadog account, based on Datadog Team handle and GitHub Team
* slug (lowercased and kebab-cased).
* This endpoint configures synchronization between your existing Datadog teams and GitHub teams
* by matching their names. It evaluates all current Datadog teams and compares them against teams
* in the GitHub organization connected to your Datadog account, based on Datadog Team handle and
* GitHub Team slug (lowercased and kebab-cased).
*
* <p>This operation is read-only on the GitHub side, no teams will be modified or created.
*
* <p>Optionally, provide <code>selection_state</code> to limit synchronization to specific teams
* or organizations and their subtrees, instead of syncing all teams.
*
* <p><a href="https://docs.datadoghq.com/integrations/github/">A GitHub organization must be
* connected to your Datadog account</a>, and the GitHub App integrated with Datadog must have the
* <code>Members Read</code> permission. Matching is performed by comparing the Datadog team
Expand All @@ -5041,6 +5043,7 @@ public CompletableFuture<Void> syncTeamsAsync(TeamSyncRequest body) {
* <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> 204 </td><td> No Content </td><td> - </td></tr>
* <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr>
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
* <tr><td> 500 </td><td> Internal Server Error - Unexpected error during linking. </td><td> - </td></tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;

/** Team sync attributes. */
@JsonPropertyOrder({
TeamSyncAttributes.JSON_PROPERTY_FREQUENCY,
TeamSyncAttributes.JSON_PROPERTY_SELECTION_STATE,
TeamSyncAttributes.JSON_PROPERTY_SOURCE,
TeamSyncAttributes.JSON_PROPERTY_SYNC_MEMBERSHIP,
TeamSyncAttributes.JSON_PROPERTY_TYPE
Expand All @@ -31,11 +34,14 @@ public class TeamSyncAttributes {
public static final String JSON_PROPERTY_FREQUENCY = "frequency";
private TeamSyncAttributesFrequency frequency;

public static final String JSON_PROPERTY_SELECTION_STATE = "selection_state";
private List<TeamSyncSelectionStateItem> selectionState = null;

public static final String JSON_PROPERTY_SOURCE = "source";
private TeamSyncAttributesSource source;

public static final String JSON_PROPERTY_SYNC_MEMBERSHIP = "sync_membership";
private Boolean syncMembership;
private Boolean syncMembership = false;

public static final String JSON_PROPERTY_TYPE = "type";
private TeamSyncAttributesType type;
Expand Down Expand Up @@ -77,6 +83,40 @@ public void setFrequency(TeamSyncAttributesFrequency frequency) {
this.frequency = frequency;
}

public TeamSyncAttributes selectionState(List<TeamSyncSelectionStateItem> selectionState) {
this.selectionState = selectionState;
for (TeamSyncSelectionStateItem item : selectionState) {
this.unparsed |= item.unparsed;
}
return this;
}

public TeamSyncAttributes addSelectionStateItem(TeamSyncSelectionStateItem selectionStateItem) {
if (this.selectionState == null) {
this.selectionState = new ArrayList<>();
}
this.selectionState.add(selectionStateItem);
this.unparsed |= selectionStateItem.unparsed;
return this;
}

/**
* Specifies which teams or organizations to sync. When provided, synchronization is limited to
* the specified items and their subtrees.
*
* @return selectionState
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SELECTION_STATE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List<TeamSyncSelectionStateItem> getSelectionState() {
return selectionState;
}

public void setSelectionState(List<TeamSyncSelectionStateItem> selectionState) {
this.selectionState = selectionState;
}

public TeamSyncAttributes source(TeamSyncAttributesSource source) {
this.source = source;
this.unparsed |= !source.isValid();
Expand Down Expand Up @@ -205,6 +245,7 @@ public boolean equals(Object o) {
}
TeamSyncAttributes teamSyncAttributes = (TeamSyncAttributes) o;
return Objects.equals(this.frequency, teamSyncAttributes.frequency)
&& Objects.equals(this.selectionState, teamSyncAttributes.selectionState)
&& Objects.equals(this.source, teamSyncAttributes.source)
&& Objects.equals(this.syncMembership, teamSyncAttributes.syncMembership)
&& Objects.equals(this.type, teamSyncAttributes.type)
Expand All @@ -213,14 +254,16 @@ public boolean equals(Object o) {

@Override
public int hashCode() {
return Objects.hash(frequency, source, syncMembership, type, additionalProperties);
return Objects.hash(
frequency, selectionState, source, syncMembership, type, additionalProperties);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class TeamSyncAttributes {\n");
sb.append(" frequency: ").append(toIndentedString(frequency)).append("\n");
sb.append(" selectionState: ").append(toIndentedString(selectionState)).append("\n");
sb.append(" source: ").append(toIndentedString(source)).append("\n");
sb.append(" syncMembership: ").append(toIndentedString(syncMembership)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
Expand Down
Loading
Loading