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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2026-03-04T16:01:00.945Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2026-03-04T16:01:34.366Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

15 changes: 0 additions & 15 deletions examples/v2/teams/SyncTeams_3215592344.rb

This file was deleted.

25 changes: 9 additions & 16 deletions features/v2/teams.feature
Original file line number Diff line number Diff line change
Expand Up @@ -431,20 +431,13 @@ Feature: Teams
Then the response status is 200 OK
And the response "data" has length 1

@generated @skip @team:DataDog/aaa-omg
@team:DataDog/aaa-omg
Scenario: Get team sync configurations returns "OK" response
Given new "GetTeamSync" request
And request contains "filter[source]" parameter from "REPLACE.ME"
And request contains "filter[source]" parameter with value "github"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/aaa-omg
Scenario: Get team sync configurations returns "Team sync configurations not found" response
Given new "GetTeamSync" request
And request contains "filter[source]" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Team sync configurations not found

@generated @skip @team:DataDog/aaa-omg
Scenario: Get user memberships returns "API error response." response
Given new "GetUserMemberships" request
Expand All @@ -461,6 +454,13 @@ Feature: Teams
Then the response status is 200 Represents a user's association to a team
And the response "data" has length 0

@team:DataDog/aaa-omg
Scenario: Link Teams with GitHub Teams returns "No Content" response
Given new "SyncTeams" request
And body with value {"data": {"attributes": {"source": "github", "type": "link", "selection_state": [{"external_id": {"type": "organization", "value": "1"}}]}, "type": "team_sync_bulk"}}
When the request is sent
Then the response status is 204 No Content

@generated @skip @team:DataDog/aaa-omg
Scenario: Link Teams with GitHub Teams returns "OK" response
Given new "SyncTeams" request
Expand Down Expand Up @@ -582,13 +582,6 @@ Feature: Teams
When the request is sent
Then the response status is 204 No Content

@replay-only @team:DataDog/aaa-omg
Scenario: Sync teams returns "OK" response
Given new "SyncTeams" request
And body with value {"data": {"attributes": {"source": "github", "type": "link"}, "type": "team_sync_bulk"}}
When the request is sent
Then the response status is 200 OK

@team:DataDog/aaa-omg
Scenario: Update a team link returns "API error response." response
Given new "UpdateTeamLink" request
Expand Down
5 changes: 5 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5247,6 +5247,11 @@ def overrides
"v2.team_sync_data" => "TeamSyncData",
"v2.team_sync_request" => "TeamSyncRequest",
"v2.team_sync_response" => "TeamSyncResponse",
"v2.team_sync_selection_state_external_id" => "TeamSyncSelectionStateExternalId",
"v2.team_sync_selection_state_external_id_type" => "TeamSyncSelectionStateExternalIdType",
"v2.team_sync_selection_state_item" => "TeamSyncSelectionStateItem",
"v2.team_sync_selection_state_operation" => "TeamSyncSelectionStateOperation",
"v2.team_sync_selection_state_scope" => "TeamSyncSelectionStateScope",
"v2.team_target" => "TeamTarget",
"v2.team_target_type" => "TeamTargetType",
"v2.team_type" => "TeamType",
Expand Down
4 changes: 4 additions & 0 deletions lib/datadog_api_client/v2/api/teams_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2114,6 +2114,10 @@ def sync_teams(body, opts = {})
#
# 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 Down
16 changes: 15 additions & 1 deletion lib/datadog_api_client/v2/models/team_sync_attributes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ class TeamSyncAttributes
# How often the sync process should be run. Defaults to `once` when not provided.
attr_accessor :frequency

# Specifies which teams or organizations to sync. When
# provided, synchronization is limited to the specified
# items and their subtrees.
attr_accessor :selection_state

# The external source platform for team synchronization. Only "github" is supported.
attr_reader :source

Expand All @@ -40,6 +45,7 @@ class TeamSyncAttributes
def self.attribute_map
{
:'frequency' => :'frequency',
:'selection_state' => :'selection_state',
:'source' => :'source',
:'sync_membership' => :'sync_membership',
:'type' => :'type'
Expand All @@ -51,6 +57,7 @@ def self.attribute_map
def self.openapi_types
{
:'frequency' => :'TeamSyncAttributesFrequency',
:'selection_state' => :'Array<TeamSyncSelectionStateItem>',
:'source' => :'TeamSyncAttributesSource',
:'sync_membership' => :'Boolean',
:'type' => :'TeamSyncAttributesType'
Expand Down Expand Up @@ -79,6 +86,12 @@ def initialize(attributes = {})
self.frequency = attributes[:'frequency']
end

if attributes.key?(:'selection_state')
if (value = attributes[:'selection_state']).is_a?(Array)
self.selection_state = value
end
end

if attributes.key?(:'source')
self.source = attributes[:'source']
end
Expand Down Expand Up @@ -148,6 +161,7 @@ def ==(o)
return true if self.equal?(o)
self.class == o.class &&
frequency == o.frequency &&
selection_state == o.selection_state &&
source == o.source &&
sync_membership == o.sync_membership &&
type == o.type &&
Expand All @@ -158,7 +172,7 @@ def ==(o)
# @return [Integer] Hash code
# @!visibility private
def hash
[frequency, source, sync_membership, type, additional_properties].hash
[frequency, selection_state, source, sync_membership, type, additional_properties].hash
end
end
end
Loading
Loading