@@ -1045,6 +1045,94 @@ func (a *TeamsApi) GetTeamPermissionSettings(ctx _context.Context, teamId string
10451045 return localVarReturnValue , localVarHTTPResponse , nil
10461046}
10471047
1048+ // GetTeamSync Get team sync configurations.
1049+ // Get all team synchronization configurations.
1050+ // Returns a list of configurations used for linking or provisioning teams with external sources like GitHub.
1051+ func (a * TeamsApi ) GetTeamSync (ctx _context.Context , filterSource TeamSyncAttributesSource ) (TeamSyncResponse , * _nethttp.Response , error ) {
1052+ var (
1053+ localVarHTTPMethod = _nethttp .MethodGet
1054+ localVarPostBody interface {}
1055+ localVarReturnValue TeamSyncResponse
1056+ )
1057+
1058+ operationId := "v2.GetTeamSync"
1059+ isOperationEnabled := a .Client .Cfg .IsUnstableOperationEnabled (operationId )
1060+ if ! isOperationEnabled {
1061+ return localVarReturnValue , nil , datadog.GenericOpenAPIError {ErrorMessage : _fmt .Sprintf ("Unstable operation '%s' is disabled" , operationId )}
1062+ }
1063+ if isOperationEnabled && a .Client .Cfg .Debug {
1064+ _log .Printf ("WARNING: Using unstable operation '%s'" , operationId )
1065+ }
1066+
1067+ localBasePath , err := a .Client .Cfg .ServerURLWithContext (ctx , "v2.TeamsApi.GetTeamSync" )
1068+ if err != nil {
1069+ return localVarReturnValue , nil , datadog.GenericOpenAPIError {ErrorMessage : err .Error ()}
1070+ }
1071+
1072+ localVarPath := localBasePath + "/api/v2/team/sync"
1073+
1074+ localVarHeaderParams := make (map [string ]string )
1075+ localVarQueryParams := _neturl.Values {}
1076+ localVarFormParams := _neturl.Values {}
1077+ localVarQueryParams .Add ("filter[source]" , datadog .ParameterToString (filterSource , "" ))
1078+ localVarHeaderParams ["Accept" ] = "application/json"
1079+
1080+ if a .Client .Cfg .DelegatedTokenConfig != nil {
1081+ err = datadog .UseDelegatedTokenAuth (ctx , & localVarHeaderParams , a .Client .Cfg .DelegatedTokenConfig )
1082+ if err != nil {
1083+ return localVarReturnValue , nil , err
1084+ }
1085+ } else {
1086+ datadog .SetAuthKeys (
1087+ ctx ,
1088+ & localVarHeaderParams ,
1089+ [2 ]string {"apiKeyAuth" , "DD-API-KEY" },
1090+ [2 ]string {"appKeyAuth" , "DD-APPLICATION-KEY" },
1091+ )
1092+ }
1093+ req , err := a .Client .PrepareRequest (ctx , localVarPath , localVarHTTPMethod , localVarPostBody , localVarHeaderParams , localVarQueryParams , localVarFormParams , nil )
1094+ if err != nil {
1095+ return localVarReturnValue , nil , err
1096+ }
1097+
1098+ localVarHTTPResponse , err := a .Client .CallAPI (req )
1099+ if err != nil || localVarHTTPResponse == nil {
1100+ return localVarReturnValue , localVarHTTPResponse , err
1101+ }
1102+
1103+ localVarBody , err := datadog .ReadBody (localVarHTTPResponse )
1104+ if err != nil {
1105+ return localVarReturnValue , localVarHTTPResponse , err
1106+ }
1107+
1108+ if localVarHTTPResponse .StatusCode >= 300 {
1109+ newErr := datadog.GenericOpenAPIError {
1110+ ErrorBody : localVarBody ,
1111+ ErrorMessage : localVarHTTPResponse .Status ,
1112+ }
1113+ if localVarHTTPResponse .StatusCode == 403 || localVarHTTPResponse .StatusCode == 404 || localVarHTTPResponse .StatusCode == 429 {
1114+ var v APIErrorResponse
1115+ err = a .Client .Decode (& v , localVarBody , localVarHTTPResponse .Header .Get ("Content-Type" ))
1116+ if err != nil {
1117+ return localVarReturnValue , localVarHTTPResponse , newErr
1118+ }
1119+ newErr .ErrorModel = v
1120+ }
1121+ return localVarReturnValue , localVarHTTPResponse , newErr
1122+ }
1123+
1124+ err = a .Client .Decode (& localVarReturnValue , localVarBody , localVarHTTPResponse .Header .Get ("Content-Type" ))
1125+ if err != nil {
1126+ newErr := datadog.GenericOpenAPIError {
1127+ ErrorBody : localVarBody ,
1128+ ErrorMessage : err .Error (),
1129+ }
1130+ return localVarReturnValue , localVarHTTPResponse , newErr
1131+ }
1132+
1133+ return localVarReturnValue , localVarHTTPResponse , nil
1134+ }
1135+
10481136// GetUserMemberships Get user memberships.
10491137// Get a list of memberships for a user
10501138func (a * TeamsApi ) GetUserMemberships (ctx _context.Context , userUuid string ) (UserTeamsResponse , * _nethttp.Response , error ) {
@@ -1617,7 +1705,7 @@ func (a *TeamsApi) RemoveMemberTeam(ctx _context.Context, superTeamId string, me
16171705// [A GitHub organization must be connected to your Datadog account](https://docs.datadoghq.com/integrations/github/),
16181706// 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
16191707// using a normalized exact match; case is ignored and spaces are removed. No modifications are made
1620- // to teams in GitHub. This will not create new Teams in Datadog.
1708+ // to teams in GitHub. This only creates new teams in Datadog when type is set to `provision` .
16211709func (a * TeamsApi ) SyncTeams (ctx _context.Context , body TeamSyncRequest ) (* _nethttp.Response , error ) {
16221710 var (
16231711 localVarHTTPMethod = _nethttp .MethodPost
0 commit comments