Skip to content

Commit f15af9d

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit a11cf8b of spec repo
1 parent fc859e2 commit f15af9d

File tree

14 files changed

+376
-11
lines changed

14 files changed

+376
-11
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 89 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52263,14 +52263,31 @@ components:
5226352263
TeamSyncAttributes:
5226452264
description: Team sync attributes.
5226552265
properties:
52266+
frequency:
52267+
$ref: '#/components/schemas/TeamSyncAttributesFrequency'
5226652268
source:
5226752269
$ref: '#/components/schemas/TeamSyncAttributesSource'
52270+
sync_membership:
52271+
$ref: '#/components/schemas/TeamSyncAttributesSyncMembership'
5226852272
type:
5226952273
$ref: '#/components/schemas/TeamSyncAttributesType'
5227052274
required:
5227152275
- source
5227252276
- type
5227352277
type: object
52278+
TeamSyncAttributesFrequency:
52279+
description: How often the sync process should be run. Defaults to `once` when
52280+
not provided.
52281+
enum:
52282+
- once
52283+
- continuously
52284+
- paused
52285+
example: once
52286+
type: string
52287+
x-enum-varnames:
52288+
- ONCE
52289+
- CONTINUOUSLY
52290+
- PAUSED
5227452291
TeamSyncAttributesSource:
5227552292
description: The external source platform for team synchronization. Only "github"
5227652293
is supported.
@@ -52280,15 +52297,22 @@ components:
5228052297
type: string
5228152298
x-enum-varnames:
5228252299
- GITHUB
52300+
TeamSyncAttributesSyncMembership:
52301+
description: Whether to sync members from the external team to the Datadog team.
52302+
Defaults to `false` when not provided.
52303+
example: true
52304+
type: boolean
5228352305
TeamSyncAttributesType:
52284-
description: The type of synchronization operation. Only "link" is supported,
52285-
which links existing teams by matching names.
52306+
description: The type of synchronization operation. "link" connects teams by
52307+
matching names. "provision" creates new teams when no match is found.
5228652308
enum:
5228752309
- link
52310+
- provision
5228852311
example: link
5228952312
type: string
5229052313
x-enum-varnames:
5229152314
- LINK
52315+
- PROVISION
5229252316
TeamSyncBulkType:
5229352317
description: Team sync bulk type.
5229452318
enum:
@@ -52298,10 +52322,15 @@ components:
5229852322
x-enum-varnames:
5229952323
- TEAM_SYNC_BULK
5230052324
TeamSyncData:
52301-
description: Team sync data.
52325+
description: A configuration governing syncing between Datadog teams and teams
52326+
from an external system.
5230252327
properties:
5230352328
attributes:
5230452329
$ref: '#/components/schemas/TeamSyncAttributes'
52330+
id:
52331+
description: The sync's identifier
52332+
example: aeadc05e-98a8-11ec-ac2c-da7ad0900001
52333+
type: string
5230552334
type:
5230652335
$ref: '#/components/schemas/TeamSyncBulkType'
5230752336
required:
@@ -52322,6 +52351,15 @@ components:
5232252351
required:
5232352352
- data
5232452353
type: object
52354+
TeamSyncResponse:
52355+
description: Team sync configurations response.
52356+
properties:
52357+
data:
52358+
description: List of team sync configurations
52359+
items:
52360+
$ref: '#/components/schemas/TeamSyncData'
52361+
type: array
52362+
type: object
5232552363
TeamTarget:
5232652364
description: Represents a team target for an escalation policy step, including
5232752365
the team's ID and resource type.
@@ -81182,6 +81220,52 @@ paths:
8118281220

8118381221
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
8118481222
/api/v2/team/sync:
81223+
get:
81224+
description: 'Get all team synchronization configurations.
81225+
81226+
Returns a list of configurations used for linking or provisioning teams with
81227+
external sources like GitHub.'
81228+
operationId: GetTeamSync
81229+
parameters:
81230+
- description: Filter by the external source platform for team synchronization
81231+
in: query
81232+
name: filter[source]
81233+
required: true
81234+
schema:
81235+
$ref: '#/components/schemas/TeamSyncAttributesSource'
81236+
responses:
81237+
'200':
81238+
content:
81239+
application/json:
81240+
schema:
81241+
$ref: '#/components/schemas/TeamSyncResponse'
81242+
description: OK
81243+
'403':
81244+
$ref: '#/components/responses/ForbiddenResponse'
81245+
'404':
81246+
content:
81247+
application/json:
81248+
schema:
81249+
$ref: '#/components/schemas/APIErrorResponse'
81250+
description: Team sync configurations not found
81251+
'429':
81252+
$ref: '#/components/responses/TooManyRequestsResponse'
81253+
security:
81254+
- apiKeyAuth: []
81255+
appKeyAuth: []
81256+
- AuthZ:
81257+
- teams_read
81258+
summary: Get team sync configurations
81259+
tags:
81260+
- Teams
81261+
x-permission:
81262+
operator: OR
81263+
permissions:
81264+
- teams_read
81265+
x-unstable: '**Note**: This endpoint is in Preview. To request access, fill
81266+
out this [form](https://www.datadoghq.com/product-preview/github-integration-for-teams/).
81267+
81268+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
8118581269
post:
8118681270
description: 'This endpoint attempts to link your existing Datadog teams with
8118781271
GitHub teams by matching their names.
@@ -81208,7 +81292,8 @@ paths:
8120881292
using a normalized exact match; case is ignored and spaces are removed. No
8120981293
modifications are made
8121081294

81211-
to teams in GitHub. This will not create new Teams in Datadog.'
81295+
to teams in GitHub. This only creates new teams in Datadog when type is set
81296+
to `provision`.'
8121281297
operationId: SyncTeams
8121381298
requestBody:
8121481299
content:

examples/v2/teams/GetTeamSync.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Get team sync configurations returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.get_team_sync".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::TeamsAPI.new
8+
p api_instance.get_team_sync(TeamSyncAttributesSource::GITHUB)

features/scenarios_model_mapping.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3072,6 +3072,9 @@
30723072
"v2.CreateTeam" => {
30733073
"body" => "TeamCreateRequest",
30743074
},
3075+
"v2.GetTeamSync" => {
3076+
"filter_source" => "TeamSyncAttributesSource",
3077+
},
30753078
"v2.SyncTeams" => {
30763079
"body" => "TeamSyncRequest",
30773080
},

features/v2/teams.feature

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,22 @@ Feature: Teams
235235
Then the response status is 200 OK
236236
And the response has 3 items
237237

238+
@generated @skip @team:DataDog/aaa-omg
239+
Scenario: Get team sync configurations returns "OK" response
240+
Given operation "GetTeamSync" enabled
241+
And new "GetTeamSync" request
242+
And request contains "filter[source]" parameter from "REPLACE.ME"
243+
When the request is sent
244+
Then the response status is 200 OK
245+
246+
@generated @skip @team:DataDog/aaa-omg
247+
Scenario: Get team sync configurations returns "Team sync configurations not found" response
248+
Given operation "GetTeamSync" enabled
249+
And new "GetTeamSync" request
250+
And request contains "filter[source]" parameter from "REPLACE.ME"
251+
When the request is sent
252+
Then the response status is 404 Team sync configurations not found
253+
238254
@generated @skip @team:DataDog/aaa-omg
239255
Scenario: Get user memberships returns "API error response." response
240256
Given new "GetUserMemberships" request

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4287,6 +4287,12 @@
42874287
"type": "unsafe"
42884288
}
42894289
},
4290+
"GetTeamSync": {
4291+
"tag": "Teams",
4292+
"undo": {
4293+
"type": "safe"
4294+
}
4295+
},
42904296
"SyncTeams": {
42914297
"tag": "Teams",
42924298
"undo": {

lib/datadog_api_client/configuration.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ def initialize
314314
"v2.create_sca_resolve_vulnerable_symbols": false,
315315
"v2.create_sca_result": false,
316316
"v2.add_member_team": false,
317+
"v2.get_team_sync": false,
317318
"v2.list_member_teams": false,
318319
"v2.remove_member_team": false,
319320
"v2.sync_teams": false,

lib/datadog_api_client/inflector.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4245,11 +4245,13 @@ def overrides
42454245
"v2.teams_response_meta" => "TeamsResponseMeta",
42464246
"v2.teams_response_meta_pagination" => "TeamsResponseMetaPagination",
42474247
"v2.team_sync_attributes" => "TeamSyncAttributes",
4248+
"v2.team_sync_attributes_frequency" => "TeamSyncAttributesFrequency",
42484249
"v2.team_sync_attributes_source" => "TeamSyncAttributesSource",
42494250
"v2.team_sync_attributes_type" => "TeamSyncAttributesType",
42504251
"v2.team_sync_bulk_type" => "TeamSyncBulkType",
42514252
"v2.team_sync_data" => "TeamSyncData",
42524253
"v2.team_sync_request" => "TeamSyncRequest",
4254+
"v2.team_sync_response" => "TeamSyncResponse",
42534255
"v2.team_target" => "TeamTarget",
42544256
"v2.team_target_type" => "TeamTargetType",
42554257
"v2.team_type" => "TeamType",

lib/datadog_api_client/v2/api/teams_api.rb

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,84 @@ def get_team_permission_settings_with_http_info(team_id, opts = {})
883883
return data, status_code, headers
884884
end
885885

886+
# Get team sync configurations.
887+
#
888+
# @see #get_team_sync_with_http_info
889+
def get_team_sync(filter_source, opts = {})
890+
data, _status_code, _headers = get_team_sync_with_http_info(filter_source, opts)
891+
data
892+
end
893+
894+
# Get team sync configurations.
895+
#
896+
# Get all team synchronization configurations.
897+
# Returns a list of configurations used for linking or provisioning teams with external sources like GitHub.
898+
#
899+
# @param filter_source [TeamSyncAttributesSource] Filter by the external source platform for team synchronization
900+
# @param opts [Hash] the optional parameters
901+
# @return [Array<(TeamSyncResponse, Integer, Hash)>] TeamSyncResponse data, response status code and response headers
902+
def get_team_sync_with_http_info(filter_source, opts = {})
903+
unstable_enabled = @api_client.config.unstable_operations["v2.get_team_sync".to_sym]
904+
if unstable_enabled
905+
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_team_sync")
906+
else
907+
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_team_sync"))
908+
end
909+
910+
if @api_client.config.debugging
911+
@api_client.config.logger.debug 'Calling API: TeamsAPI.get_team_sync ...'
912+
end
913+
# verify the required parameter 'filter_source' is set
914+
if @api_client.config.client_side_validation && filter_source.nil?
915+
fail ArgumentError, "Missing the required parameter 'filter_source' when calling TeamsAPI.get_team_sync"
916+
end
917+
# verify enum value
918+
allowable_values = ['github']
919+
if @api_client.config.client_side_validation && !allowable_values.include?(filter_source)
920+
fail ArgumentError, "invalid value for \"filter_source\", must be one of #{allowable_values}"
921+
end
922+
# resource path
923+
local_var_path = '/api/v2/team/sync'
924+
925+
# query parameters
926+
query_params = opts[:query_params] || {}
927+
query_params[:'filter[source]'] = filter_source
928+
929+
# header parameters
930+
header_params = opts[:header_params] || {}
931+
# HTTP header 'Accept' (if needed)
932+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
933+
934+
# form parameters
935+
form_params = opts[:form_params] || {}
936+
937+
# http body (model)
938+
post_body = opts[:debug_body]
939+
940+
# return_type
941+
return_type = opts[:debug_return_type] || 'TeamSyncResponse'
942+
943+
# auth_names
944+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
945+
946+
new_options = opts.merge(
947+
:operation => :get_team_sync,
948+
:header_params => header_params,
949+
:query_params => query_params,
950+
:form_params => form_params,
951+
:body => post_body,
952+
:auth_names => auth_names,
953+
:return_type => return_type,
954+
:api_version => "V2"
955+
)
956+
957+
data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)
958+
if @api_client.config.debugging
959+
@api_client.config.logger.debug "API called: TeamsAPI#get_team_sync\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
960+
end
961+
return data, status_code, headers
962+
end
963+
886964
# Get user memberships.
887965
#
888966
# @see #get_user_memberships_with_http_info
@@ -1245,7 +1323,7 @@ def sync_teams(body, opts = {})
12451323
# [A GitHub organization must be connected to your Datadog account](https://docs.datadoghq.com/integrations/github/),
12461324
# 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
12471325
# using a normalized exact match; case is ignored and spaces are removed. No modifications are made
1248-
# to teams in GitHub. This will not create new Teams in Datadog.
1326+
# to teams in GitHub. This only creates new teams in Datadog when type is set to `provision`.
12491327
#
12501328
# @param body [TeamSyncRequest]
12511329
# @param opts [Hash] the optional parameters

lib/datadog_api_client/v2/models/team_sync_attributes.rb

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,16 @@ module DatadogAPIClient::V2
2121
class TeamSyncAttributes
2222
include BaseGenericModel
2323

24+
# How often the sync process should be run. Defaults to `once` when not provided.
25+
attr_accessor :frequency
26+
2427
# The external source platform for team synchronization. Only "github" is supported.
2528
attr_reader :source
2629

27-
# The type of synchronization operation. Only "link" is supported, which links existing teams by matching names.
30+
# Whether to sync members from the external team to the Datadog team. Defaults to `false` when not provided.
31+
attr_accessor :sync_membership
32+
33+
# The type of synchronization operation. "link" connects teams by matching names. "provision" creates new teams when no match is found.
2834
attr_reader :type
2935

3036
attr_accessor :additional_properties
@@ -33,7 +39,9 @@ class TeamSyncAttributes
3339
# @!visibility private
3440
def self.attribute_map
3541
{
42+
:'frequency' => :'frequency',
3643
:'source' => :'source',
44+
:'sync_membership' => :'sync_membership',
3745
:'type' => :'type'
3846
}
3947
end
@@ -42,7 +50,9 @@ def self.attribute_map
4250
# @!visibility private
4351
def self.openapi_types
4452
{
53+
:'frequency' => :'TeamSyncAttributesFrequency',
4554
:'source' => :'TeamSyncAttributesSource',
55+
:'sync_membership' => :'Boolean',
4656
:'type' => :'TeamSyncAttributesType'
4757
}
4858
end
@@ -65,10 +75,18 @@ def initialize(attributes = {})
6575
end
6676
}
6777

78+
if attributes.key?(:'frequency')
79+
self.frequency = attributes[:'frequency']
80+
end
81+
6882
if attributes.key?(:'source')
6983
self.source = attributes[:'source']
7084
end
7185

86+
if attributes.key?(:'sync_membership')
87+
self.sync_membership = attributes[:'sync_membership']
88+
end
89+
7290
if attributes.key?(:'type')
7391
self.type = attributes[:'type']
7492
end
@@ -129,7 +147,9 @@ def to_hash
129147
def ==(o)
130148
return true if self.equal?(o)
131149
self.class == o.class &&
150+
frequency == o.frequency &&
132151
source == o.source &&
152+
sync_membership == o.sync_membership &&
133153
type == o.type &&
134154
additional_properties == o.additional_properties
135155
end
@@ -138,7 +158,7 @@ def ==(o)
138158
# @return [Integer] Hash code
139159
# @!visibility private
140160
def hash
141-
[source, type, additional_properties].hash
161+
[frequency, source, sync_membership, type, additional_properties].hash
142162
end
143163
end
144164
end

0 commit comments

Comments
 (0)