Skip to content
Open
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
98 changes: 92 additions & 6 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68031,6 +68031,8 @@ components:
properties:
frequency:
$ref: '#/components/schemas/TeamSyncAttributesFrequency'
selection_state:
$ref: '#/components/schemas/TeamSyncAttributesSelectionState'
source:
$ref: '#/components/schemas/TeamSyncAttributesSource'
sync_membership:
Expand All @@ -68054,6 +68056,15 @@ 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.
Expand Down Expand Up @@ -68126,6 +68137,78 @@ 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.
Expand Down Expand Up @@ -107597,12 +107680,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 Down Expand Up @@ -107634,6 +107711,13 @@ paths:
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.
Expand All @@ -107655,6 +107739,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.

5 changes: 4 additions & 1 deletion 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 @@ -5026,6 +5025,9 @@ public CompletableFuture<Void> syncTeamsAsync(TeamSyncRequest body) {
*
* <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,6 +34,9 @@ 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;

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