|
18 | 18 | import com.datadog.api.client.v2.model.TeamPermissionSettingUpdateRequest; |
19 | 19 | import com.datadog.api.client.v2.model.TeamPermissionSettingsResponse; |
20 | 20 | import com.datadog.api.client.v2.model.TeamResponse; |
| 21 | +import com.datadog.api.client.v2.model.TeamSyncAttributesSource; |
21 | 22 | import com.datadog.api.client.v2.model.TeamSyncRequest; |
| 23 | +import com.datadog.api.client.v2.model.TeamSyncResponse; |
22 | 24 | import com.datadog.api.client.v2.model.TeamUpdateRequest; |
23 | 25 | import com.datadog.api.client.v2.model.TeamsField; |
24 | 26 | import com.datadog.api.client.v2.model.TeamsResponse; |
@@ -1987,6 +1989,162 @@ public ApiResponse<TeamPermissionSettingsResponse> getTeamPermissionSettingsWith |
1987 | 1989 | new GenericType<TeamPermissionSettingsResponse>() {}); |
1988 | 1990 | } |
1989 | 1991 |
|
| 1992 | + /** |
| 1993 | + * Get team sync configurations. |
| 1994 | + * |
| 1995 | + * <p>See {@link #getTeamSyncWithHttpInfo}. |
| 1996 | + * |
| 1997 | + * @param filterSource Filter by the external source platform for team synchronization (required) |
| 1998 | + * @return TeamSyncResponse |
| 1999 | + * @throws ApiException if fails to make API call |
| 2000 | + */ |
| 2001 | + public TeamSyncResponse getTeamSync(TeamSyncAttributesSource filterSource) throws ApiException { |
| 2002 | + return getTeamSyncWithHttpInfo(filterSource).getData(); |
| 2003 | + } |
| 2004 | + |
| 2005 | + /** |
| 2006 | + * Get team sync configurations. |
| 2007 | + * |
| 2008 | + * <p>See {@link #getTeamSyncWithHttpInfoAsync}. |
| 2009 | + * |
| 2010 | + * @param filterSource Filter by the external source platform for team synchronization (required) |
| 2011 | + * @return CompletableFuture<TeamSyncResponse> |
| 2012 | + */ |
| 2013 | + public CompletableFuture<TeamSyncResponse> getTeamSyncAsync( |
| 2014 | + TeamSyncAttributesSource filterSource) { |
| 2015 | + return getTeamSyncWithHttpInfoAsync(filterSource) |
| 2016 | + .thenApply( |
| 2017 | + response -> { |
| 2018 | + return response.getData(); |
| 2019 | + }); |
| 2020 | + } |
| 2021 | + |
| 2022 | + /** |
| 2023 | + * Get all team synchronization configurations. Returns a list of configurations used for linking |
| 2024 | + * or provisioning teams with external sources like GitHub. |
| 2025 | + * |
| 2026 | + * @param filterSource Filter by the external source platform for team synchronization (required) |
| 2027 | + * @return ApiResponse<TeamSyncResponse> |
| 2028 | + * @throws ApiException if fails to make API call |
| 2029 | + * @http.response.details |
| 2030 | + * <table border="1"> |
| 2031 | + * <caption>Response details</caption> |
| 2032 | + * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| 2033 | + * <tr><td> 200 </td><td> OK </td><td> - </td></tr> |
| 2034 | + * <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> |
| 2035 | + * <tr><td> 404 </td><td> Team sync configurations not found </td><td> - </td></tr> |
| 2036 | + * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> |
| 2037 | + * </table> |
| 2038 | + */ |
| 2039 | + public ApiResponse<TeamSyncResponse> getTeamSyncWithHttpInfo( |
| 2040 | + TeamSyncAttributesSource filterSource) throws ApiException { |
| 2041 | + // Check if unstable operation is enabled |
| 2042 | + String operationId = "getTeamSync"; |
| 2043 | + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { |
| 2044 | + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); |
| 2045 | + } else { |
| 2046 | + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); |
| 2047 | + } |
| 2048 | + Object localVarPostBody = null; |
| 2049 | + |
| 2050 | + // verify the required parameter 'filterSource' is set |
| 2051 | + if (filterSource == null) { |
| 2052 | + throw new ApiException( |
| 2053 | + 400, "Missing the required parameter 'filterSource' when calling getTeamSync"); |
| 2054 | + } |
| 2055 | + // create path and map variables |
| 2056 | + String localVarPath = "/api/v2/team/sync"; |
| 2057 | + |
| 2058 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 2059 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 2060 | + |
| 2061 | + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[source]", filterSource)); |
| 2062 | + |
| 2063 | + Invocation.Builder builder = |
| 2064 | + apiClient.createBuilder( |
| 2065 | + "v2.TeamsApi.getTeamSync", |
| 2066 | + localVarPath, |
| 2067 | + localVarQueryParams, |
| 2068 | + localVarHeaderParams, |
| 2069 | + new HashMap<String, String>(), |
| 2070 | + new String[] {"application/json"}, |
| 2071 | + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); |
| 2072 | + return apiClient.invokeAPI( |
| 2073 | + "GET", |
| 2074 | + builder, |
| 2075 | + localVarHeaderParams, |
| 2076 | + new String[] {}, |
| 2077 | + localVarPostBody, |
| 2078 | + new HashMap<String, Object>(), |
| 2079 | + false, |
| 2080 | + new GenericType<TeamSyncResponse>() {}); |
| 2081 | + } |
| 2082 | + |
| 2083 | + /** |
| 2084 | + * Get team sync configurations. |
| 2085 | + * |
| 2086 | + * <p>See {@link #getTeamSyncWithHttpInfo}. |
| 2087 | + * |
| 2088 | + * @param filterSource Filter by the external source platform for team synchronization (required) |
| 2089 | + * @return CompletableFuture<ApiResponse<TeamSyncResponse>> |
| 2090 | + */ |
| 2091 | + public CompletableFuture<ApiResponse<TeamSyncResponse>> getTeamSyncWithHttpInfoAsync( |
| 2092 | + TeamSyncAttributesSource filterSource) { |
| 2093 | + // Check if unstable operation is enabled |
| 2094 | + String operationId = "getTeamSync"; |
| 2095 | + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { |
| 2096 | + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); |
| 2097 | + } else { |
| 2098 | + CompletableFuture<ApiResponse<TeamSyncResponse>> result = new CompletableFuture<>(); |
| 2099 | + result.completeExceptionally( |
| 2100 | + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); |
| 2101 | + return result; |
| 2102 | + } |
| 2103 | + Object localVarPostBody = null; |
| 2104 | + |
| 2105 | + // verify the required parameter 'filterSource' is set |
| 2106 | + if (filterSource == null) { |
| 2107 | + CompletableFuture<ApiResponse<TeamSyncResponse>> result = new CompletableFuture<>(); |
| 2108 | + result.completeExceptionally( |
| 2109 | + new ApiException( |
| 2110 | + 400, "Missing the required parameter 'filterSource' when calling getTeamSync")); |
| 2111 | + return result; |
| 2112 | + } |
| 2113 | + // create path and map variables |
| 2114 | + String localVarPath = "/api/v2/team/sync"; |
| 2115 | + |
| 2116 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 2117 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 2118 | + |
| 2119 | + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[source]", filterSource)); |
| 2120 | + |
| 2121 | + Invocation.Builder builder; |
| 2122 | + try { |
| 2123 | + builder = |
| 2124 | + apiClient.createBuilder( |
| 2125 | + "v2.TeamsApi.getTeamSync", |
| 2126 | + localVarPath, |
| 2127 | + localVarQueryParams, |
| 2128 | + localVarHeaderParams, |
| 2129 | + new HashMap<String, String>(), |
| 2130 | + new String[] {"application/json"}, |
| 2131 | + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); |
| 2132 | + } catch (ApiException ex) { |
| 2133 | + CompletableFuture<ApiResponse<TeamSyncResponse>> result = new CompletableFuture<>(); |
| 2134 | + result.completeExceptionally(ex); |
| 2135 | + return result; |
| 2136 | + } |
| 2137 | + return apiClient.invokeAPIAsync( |
| 2138 | + "GET", |
| 2139 | + builder, |
| 2140 | + localVarHeaderParams, |
| 2141 | + new String[] {}, |
| 2142 | + localVarPostBody, |
| 2143 | + new HashMap<String, Object>(), |
| 2144 | + false, |
| 2145 | + new GenericType<TeamSyncResponse>() {}); |
| 2146 | + } |
| 2147 | + |
1990 | 2148 | /** |
1991 | 2149 | * Get user memberships. |
1992 | 2150 | * |
@@ -2958,8 +3116,8 @@ public CompletableFuture<Void> syncTeamsAsync(TeamSyncRequest body) { |
2958 | 3116 | * connected to your Datadog account</a>, and the GitHub App integrated with Datadog must have the |
2959 | 3117 | * <code>Members Read</code> permission. Matching is performed by comparing the Datadog team |
2960 | 3118 | * handle to the GitHub team slug using a normalized exact match; case is ignored and spaces are |
2961 | | - * removed. No modifications are made to teams in GitHub. This will not create new Teams in |
2962 | | - * Datadog. |
| 3119 | + * removed. No modifications are made to teams in GitHub. This only creates new teams in Datadog |
| 3120 | + * when type is set to <code>provision</code>. |
2963 | 3121 | * |
2964 | 3122 | * @param body (required) |
2965 | 3123 | * @return ApiResponse<Void> |
|
0 commit comments