diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index cfbcb7286ac..f2717583220 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -54290,6 +54290,109 @@ components: $ref: '#/components/schemas/TeamLink' type: array type: object + TeamNotificationRule: + description: Team notification rule + properties: + attributes: + $ref: '#/components/schemas/TeamNotificationRuleAttributes' + id: + description: The identifier of the team notification rule + example: b8626d7e-cedd-11eb-abf5-da7ad0900001 + type: string + type: object + TeamNotificationRuleAttributes: + description: Team notification rule attributes + properties: + email: + $ref: '#/components/schemas/TeamNotificationRuleAttributesEmail' + ms_teams: + $ref: '#/components/schemas/TeamNotificationRuleAttributesMsTeams' + pagerduty: + $ref: '#/components/schemas/TeamNotificationRuleAttributesPagerduty' + slack: + $ref: '#/components/schemas/TeamNotificationRuleAttributesSlack' + type: object + TeamNotificationRuleAttributesEmail: + description: Email notification settings for the team + properties: + enabled: + description: Flag indicating email notification + type: boolean + type: object + TeamNotificationRuleAttributesMsTeams: + description: MS Teams notification settings for the team + properties: + connector_name: + description: Handle for MS Teams + type: string + type: object + TeamNotificationRuleAttributesPagerduty: + description: PagerDuty notification settings for the team + properties: + service_name: + description: Service name for PagerDuty + type: string + type: object + TeamNotificationRuleAttributesSlack: + description: Slack notification settings for the team + properties: + channel: + description: Channel for slack notification + type: string + workspace: + description: Workspace for slack notification + type: string + type: object + TeamNotificationRulesResponse: + description: Team notification rules response + properties: + data: + description: Team notification rules response data + items: + $ref: '#/components/schemas/TeamNotificationRule' + type: array + meta: + $ref: '#/components/schemas/TeamNotificationRulesResponseMeta' + type: object + TeamNotificationRulesResponseMeta: + description: Metadata related to paging information that is included in the + response when querying the team notification rules + properties: + first_number: + description: First page number. + format: int64 + type: integer + last_number: + description: Last page number. + format: int64 + type: integer + next_number: + description: Next page number. + format: int64 + nullable: true + type: integer + number: + description: Page number. + format: int64 + type: integer + prev_number: + description: Previous page number. + format: int64 + nullable: true + type: integer + size: + description: Page size. + format: int64 + type: integer + total: + description: Total number of results. + format: int64 + type: integer + type: + description: Pagination type. + example: number_size + type: string + type: object TeamOnCallResponders: description: Root object representing a team's on-call responder configuration. example: @@ -86882,6 +86985,230 @@ paths: operator: OR permissions: - teams_read + /api/v2/team/{team_id}/notification-rules: + get: + operationId: GetTeamNotificationRules + parameters: + - description: None + in: path + name: team_id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamNotificationRulesResponse' + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Get team notification rules + tags: + - Teams + x-permission: + operator: OR + permissions: + - teams_read + post: + operationId: CreateTeamNotificationRule + parameters: + - description: None + in: path + name: team_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TeamNotificationRule' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamNotificationRule' + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Create team notification rule + tags: + - Teams + x-permission: + operator: OR + permissions: + - teams_read + /api/v2/team/{team_id}/notification-rules/{rule_id}: + delete: + operationId: DeleteTeamNotificationRule + parameters: + - description: None + in: path + name: rule_id + required: true + schema: + type: string + - description: None + in: path + name: team_id + required: true + schema: + type: string + responses: + '204': + description: No Content + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Delete team notification rule + tags: + - Teams + x-permission: + operator: OR + permissions: + - teams_read + get: + operationId: GetTeamNotificationRule + parameters: + - description: None + in: path + name: rule_id + required: true + schema: + type: string + - description: None + in: path + name: team_id + required: true + schema: + type: string + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamNotificationRule' + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Get team notification rule + tags: + - Teams + x-permission: + operator: OR + permissions: + - teams_read + put: + operationId: UpdateTeamNotificationRule + parameters: + - description: None + in: path + name: rule_id + required: true + schema: + type: string + - description: None + in: path + name: team_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TeamNotificationRule' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamNotificationRule' + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Update team notification rule + tags: + - Teams + x-permission: + operator: OR + permissions: + - teams_read /api/v2/team/{team_id}/permission-settings: get: description: Get all permission settings for a given team. diff --git a/examples/v2/teams/CreateTeamNotificationRule.java b/examples/v2/teams/CreateTeamNotificationRule.java new file mode 100644 index 00000000000..6c5f19b5128 --- /dev/null +++ b/examples/v2/teams/CreateTeamNotificationRule.java @@ -0,0 +1,39 @@ +// Create team notification rule returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.TeamsApi; +import com.datadog.api.client.v2.model.TeamNotificationRule; +import com.datadog.api.client.v2.model.TeamNotificationRuleAttributes; +import com.datadog.api.client.v2.model.TeamNotificationRuleAttributesEmail; +import com.datadog.api.client.v2.model.TeamNotificationRuleAttributesMsTeams; +import com.datadog.api.client.v2.model.TeamNotificationRuleAttributesPagerduty; +import com.datadog.api.client.v2.model.TeamNotificationRuleAttributesSlack; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + TeamsApi apiInstance = new TeamsApi(defaultClient); + + TeamNotificationRule body = + new TeamNotificationRule() + .attributes( + new TeamNotificationRuleAttributes() + .email(new TeamNotificationRuleAttributesEmail()) + .msTeams(new TeamNotificationRuleAttributesMsTeams()) + .pagerduty(new TeamNotificationRuleAttributesPagerduty()) + .slack(new TeamNotificationRuleAttributesSlack())) + .id("b8626d7e-cedd-11eb-abf5-da7ad0900001"); + + try { + TeamNotificationRule result = apiInstance.createTeamNotificationRule("team_id", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#createTeamNotificationRule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/teams/DeleteTeamNotificationRule.java b/examples/v2/teams/DeleteTeamNotificationRule.java new file mode 100644 index 00000000000..aaba02ac138 --- /dev/null +++ b/examples/v2/teams/DeleteTeamNotificationRule.java @@ -0,0 +1,22 @@ +// Delete team notification rule returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.TeamsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + TeamsApi apiInstance = new TeamsApi(defaultClient); + + try { + apiInstance.deleteTeamNotificationRule("rule_id", "team_id"); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#deleteTeamNotificationRule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/teams/GetTeamNotificationRule.java b/examples/v2/teams/GetTeamNotificationRule.java new file mode 100644 index 00000000000..b6ce5e2320b --- /dev/null +++ b/examples/v2/teams/GetTeamNotificationRule.java @@ -0,0 +1,24 @@ +// Get team notification rule returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.TeamsApi; +import com.datadog.api.client.v2.model.TeamNotificationRule; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + TeamsApi apiInstance = new TeamsApi(defaultClient); + + try { + TeamNotificationRule result = apiInstance.getTeamNotificationRule("rule_id", "team_id"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#getTeamNotificationRule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/teams/GetTeamNotificationRules.java b/examples/v2/teams/GetTeamNotificationRules.java new file mode 100644 index 00000000000..77ac9504cb7 --- /dev/null +++ b/examples/v2/teams/GetTeamNotificationRules.java @@ -0,0 +1,24 @@ +// Get team notification rules returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.TeamsApi; +import com.datadog.api.client.v2.model.TeamNotificationRulesResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + TeamsApi apiInstance = new TeamsApi(defaultClient); + + try { + TeamNotificationRulesResponse result = apiInstance.getTeamNotificationRules("team_id"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#getTeamNotificationRules"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/teams/UpdateTeamNotificationRule.java b/examples/v2/teams/UpdateTeamNotificationRule.java new file mode 100644 index 00000000000..42468583e6d --- /dev/null +++ b/examples/v2/teams/UpdateTeamNotificationRule.java @@ -0,0 +1,40 @@ +// Update team notification rule returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.TeamsApi; +import com.datadog.api.client.v2.model.TeamNotificationRule; +import com.datadog.api.client.v2.model.TeamNotificationRuleAttributes; +import com.datadog.api.client.v2.model.TeamNotificationRuleAttributesEmail; +import com.datadog.api.client.v2.model.TeamNotificationRuleAttributesMsTeams; +import com.datadog.api.client.v2.model.TeamNotificationRuleAttributesPagerduty; +import com.datadog.api.client.v2.model.TeamNotificationRuleAttributesSlack; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + TeamsApi apiInstance = new TeamsApi(defaultClient); + + TeamNotificationRule body = + new TeamNotificationRule() + .attributes( + new TeamNotificationRuleAttributes() + .email(new TeamNotificationRuleAttributesEmail()) + .msTeams(new TeamNotificationRuleAttributesMsTeams()) + .pagerduty(new TeamNotificationRuleAttributesPagerduty()) + .slack(new TeamNotificationRuleAttributesSlack())) + .id("b8626d7e-cedd-11eb-abf5-da7ad0900001"); + + try { + TeamNotificationRule result = + apiInstance.updateTeamNotificationRule("rule_id", "team_id", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#updateTeamNotificationRule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/TeamsApi.java b/src/main/java/com/datadog/api/client/v2/api/TeamsApi.java index 5c13c64019c..d9122800d80 100644 --- a/src/main/java/com/datadog/api/client/v2/api/TeamsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/TeamsApi.java @@ -22,6 +22,8 @@ import com.datadog.api.client.v2.model.TeamLinkCreateRequest; import com.datadog.api.client.v2.model.TeamLinkResponse; import com.datadog.api.client.v2.model.TeamLinksResponse; +import com.datadog.api.client.v2.model.TeamNotificationRule; +import com.datadog.api.client.v2.model.TeamNotificationRulesResponse; import com.datadog.api.client.v2.model.TeamPermissionSettingResponse; import com.datadog.api.client.v2.model.TeamPermissionSettingUpdateRequest; import com.datadog.api.client.v2.model.TeamPermissionSettingsResponse; @@ -979,6 +981,163 @@ public CompletableFuture> createTeamMembershipWith new GenericType() {}); } + /** + * Create team notification rule. + * + *

See {@link #createTeamNotificationRuleWithHttpInfo}. + * + * @param teamId None (required) + * @param body (required) + * @return TeamNotificationRule + * @throws ApiException if fails to make API call + */ + public TeamNotificationRule createTeamNotificationRule(String teamId, TeamNotificationRule body) + throws ApiException { + return createTeamNotificationRuleWithHttpInfo(teamId, body).getData(); + } + + /** + * Create team notification rule. + * + *

See {@link #createTeamNotificationRuleWithHttpInfoAsync}. + * + * @param teamId None (required) + * @param body (required) + * @return CompletableFuture<TeamNotificationRule> + */ + public CompletableFuture createTeamNotificationRuleAsync( + String teamId, TeamNotificationRule body) { + return createTeamNotificationRuleWithHttpInfoAsync(teamId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * @param teamId None (required) + * @param body (required) + * @return ApiResponse<TeamNotificationRule> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 API error response. -
409 API error response. -
429 Too many requests -
+ */ + public ApiResponse createTeamNotificationRuleWithHttpInfo( + String teamId, TeamNotificationRule body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + throw new ApiException( + 400, "Missing the required parameter 'teamId' when calling createTeamNotificationRule"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createTeamNotificationRule"); + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}/notification-rules" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.TeamsApi.createTeamNotificationRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create team notification rule. + * + *

See {@link #createTeamNotificationRuleWithHttpInfo}. + * + * @param teamId None (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<TeamNotificationRule>> + */ + public CompletableFuture> + createTeamNotificationRuleWithHttpInfoAsync(String teamId, TeamNotificationRule body) { + Object localVarPostBody = body; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'teamId' when calling createTeamNotificationRule")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling createTeamNotificationRule")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}/notification-rules" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.TeamsApi.createTeamNotificationRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Remove a team. * @@ -1557,6 +1716,161 @@ public CompletableFuture> deleteTeamMembershipWithHttpInfoAsyn null); } + /** + * Delete team notification rule. + * + *

See {@link #deleteTeamNotificationRuleWithHttpInfo}. + * + * @param ruleId None (required) + * @param teamId None (required) + * @throws ApiException if fails to make API call + */ + public void deleteTeamNotificationRule(String ruleId, String teamId) throws ApiException { + deleteTeamNotificationRuleWithHttpInfo(ruleId, teamId); + } + + /** + * Delete team notification rule. + * + *

See {@link #deleteTeamNotificationRuleWithHttpInfoAsync}. + * + * @param ruleId None (required) + * @param teamId None (required) + * @return CompletableFuture + */ + public CompletableFuture deleteTeamNotificationRuleAsync(String ruleId, String teamId) { + return deleteTeamNotificationRuleWithHttpInfoAsync(ruleId, teamId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * @param ruleId None (required) + * @param teamId None (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
403 Forbidden -
404 API error response. -
429 Too many requests -
+ */ + public ApiResponse deleteTeamNotificationRuleWithHttpInfo(String ruleId, String teamId) + throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'ruleId' is set + if (ruleId == null) { + throw new ApiException( + 400, "Missing the required parameter 'ruleId' when calling deleteTeamNotificationRule"); + } + + // verify the required parameter 'teamId' is set + if (teamId == null) { + throw new ApiException( + 400, "Missing the required parameter 'teamId' when calling deleteTeamNotificationRule"); + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}/notification-rules/{rule_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())) + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.TeamsApi.deleteTeamNotificationRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete team notification rule. + * + *

See {@link #deleteTeamNotificationRuleWithHttpInfo}. + * + * @param ruleId None (required) + * @param teamId None (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteTeamNotificationRuleWithHttpInfoAsync( + String ruleId, String teamId) { + Object localVarPostBody = null; + + // verify the required parameter 'ruleId' is set + if (ruleId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'ruleId' when calling deleteTeamNotificationRule")); + return result; + } + + // verify the required parameter 'teamId' is set + if (teamId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'teamId' when calling deleteTeamNotificationRule")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}/notification-rules/{rule_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())) + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.TeamsApi.deleteTeamNotificationRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + /** * Get a team. * @@ -2198,32 +2512,402 @@ public CompletableFuture getTeamMembershipsAsync(String teamI } /** - * Get team memberships. + * Get team memberships. + * + *

See {@link #getTeamMembershipsWithHttpInfo}. + * + * @param teamId None (required) + * @param parameters Optional parameters for the request. + * @return UserTeamsResponse + * @throws ApiException if fails to make API call + */ + public UserTeamsResponse getTeamMemberships( + String teamId, GetTeamMembershipsOptionalParameters parameters) throws ApiException { + return getTeamMembershipsWithHttpInfo(teamId, parameters).getData(); + } + + /** + * Get team memberships. + * + *

See {@link #getTeamMembershipsWithHttpInfoAsync}. + * + * @param teamId None (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<UserTeamsResponse> + */ + public CompletableFuture getTeamMembershipsAsync( + String teamId, GetTeamMembershipsOptionalParameters parameters) { + return getTeamMembershipsWithHttpInfoAsync(teamId, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get team memberships. + * + *

See {@link #getTeamMembershipsWithHttpInfo}. + * + * @param teamId None (required) + * @return PaginationIterable<UserTeam> + */ + public PaginationIterable getTeamMembershipsWithPagination(String teamId) { + GetTeamMembershipsOptionalParameters parameters = new GetTeamMembershipsOptionalParameters(); + return getTeamMembershipsWithPagination(teamId, parameters); + } + + /** + * Get team memberships. + * + *

See {@link #getTeamMembershipsWithHttpInfo}. + * + * @param teamId None (required) + * @return UserTeamsResponse + */ + public PaginationIterable getTeamMembershipsWithPagination( + String teamId, GetTeamMembershipsOptionalParameters parameters) { + String resultsPath = "getData"; + String valueGetterPath = ""; + String valueSetterPath = "pageNumber"; + Boolean valueSetterParamOptional = true; + parameters.pageNumber(0l); + Long limit; + + if (parameters.pageSize == null) { + limit = 10l; + parameters.pageSize(limit); + } else { + limit = parameters.pageSize; + } + + LinkedHashMap args = new LinkedHashMap(); + args.put("teamId", teamId); + args.put("optionalParams", parameters); + + PaginationIterable iterator = + new PaginationIterable( + this, + "getTeamMemberships", + resultsPath, + valueGetterPath, + valueSetterPath, + valueSetterParamOptional, + false, + limit, + args); + + return iterator; + } + + /** + * Get a paginated list of members for a team + * + * @param teamId None (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<UserTeamsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 Represents a user's association to a team -
403 Forbidden -
404 API error response. -
429 Too many requests -
+ */ + public ApiResponse getTeamMembershipsWithHttpInfo( + String teamId, GetTeamMembershipsOptionalParameters parameters) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + throw new ApiException( + 400, "Missing the required parameter 'teamId' when calling getTeamMemberships"); + } + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + GetTeamMembershipsSort sort = parameters.sort; + String filterKeyword = parameters.filterKeyword; + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}/memberships" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[keyword]", filterKeyword)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.TeamsApi.getTeamMemberships", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get team memberships. + * + *

See {@link #getTeamMembershipsWithHttpInfo}. + * + * @param teamId None (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<UserTeamsResponse>> + */ + public CompletableFuture> getTeamMembershipsWithHttpInfoAsync( + String teamId, GetTeamMembershipsOptionalParameters parameters) { + Object localVarPostBody = null; + + // verify the required parameter 'teamId' is set + if (teamId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'teamId' when calling getTeamMemberships")); + return result; + } + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + GetTeamMembershipsSort sort = parameters.sort; + String filterKeyword = parameters.filterKeyword; + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}/memberships" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[keyword]", filterKeyword)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.TeamsApi.getTeamMemberships", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get team notification rule. + * + *

See {@link #getTeamNotificationRuleWithHttpInfo}. + * + * @param ruleId None (required) + * @param teamId None (required) + * @return TeamNotificationRule + * @throws ApiException if fails to make API call + */ + public TeamNotificationRule getTeamNotificationRule(String ruleId, String teamId) + throws ApiException { + return getTeamNotificationRuleWithHttpInfo(ruleId, teamId).getData(); + } + + /** + * Get team notification rule. + * + *

See {@link #getTeamNotificationRuleWithHttpInfoAsync}. + * + * @param ruleId None (required) + * @param teamId None (required) + * @return CompletableFuture<TeamNotificationRule> + */ + public CompletableFuture getTeamNotificationRuleAsync( + String ruleId, String teamId) { + return getTeamNotificationRuleWithHttpInfoAsync(ruleId, teamId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * @param ruleId None (required) + * @param teamId None (required) + * @return ApiResponse<TeamNotificationRule> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 OK -
403 Forbidden -
404 API error response. -
429 Too many requests -
+ */ + public ApiResponse getTeamNotificationRuleWithHttpInfo( + String ruleId, String teamId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'ruleId' is set + if (ruleId == null) { + throw new ApiException( + 400, "Missing the required parameter 'ruleId' when calling getTeamNotificationRule"); + } + + // verify the required parameter 'teamId' is set + if (teamId == null) { + throw new ApiException( + 400, "Missing the required parameter 'teamId' when calling getTeamNotificationRule"); + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}/notification-rules/{rule_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())) + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.TeamsApi.getTeamNotificationRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get team notification rule. + * + *

See {@link #getTeamNotificationRuleWithHttpInfo}. + * + * @param ruleId None (required) + * @param teamId None (required) + * @return CompletableFuture<ApiResponse<TeamNotificationRule>> + */ + public CompletableFuture> + getTeamNotificationRuleWithHttpInfoAsync(String ruleId, String teamId) { + Object localVarPostBody = null; + + // verify the required parameter 'ruleId' is set + if (ruleId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'ruleId' when calling getTeamNotificationRule")); + return result; + } + + // verify the required parameter 'teamId' is set + if (teamId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'teamId' when calling getTeamNotificationRule")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}/notification-rules/{rule_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())) + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.TeamsApi.getTeamNotificationRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get team notification rules. * - *

See {@link #getTeamMembershipsWithHttpInfo}. + *

See {@link #getTeamNotificationRulesWithHttpInfo}. * * @param teamId None (required) - * @param parameters Optional parameters for the request. - * @return UserTeamsResponse + * @return TeamNotificationRulesResponse * @throws ApiException if fails to make API call */ - public UserTeamsResponse getTeamMemberships( - String teamId, GetTeamMembershipsOptionalParameters parameters) throws ApiException { - return getTeamMembershipsWithHttpInfo(teamId, parameters).getData(); + public TeamNotificationRulesResponse getTeamNotificationRules(String teamId) throws ApiException { + return getTeamNotificationRulesWithHttpInfo(teamId).getData(); } /** - * Get team memberships. + * Get team notification rules. * - *

See {@link #getTeamMembershipsWithHttpInfoAsync}. + *

See {@link #getTeamNotificationRulesWithHttpInfoAsync}. * * @param teamId None (required) - * @param parameters Optional parameters for the request. - * @return CompletableFuture<UserTeamsResponse> + * @return CompletableFuture<TeamNotificationRulesResponse> */ - public CompletableFuture getTeamMembershipsAsync( - String teamId, GetTeamMembershipsOptionalParameters parameters) { - return getTeamMembershipsWithHttpInfoAsync(teamId, parameters) + public CompletableFuture getTeamNotificationRulesAsync( + String teamId) { + return getTeamNotificationRulesWithHttpInfoAsync(teamId) .thenApply( response -> { return response.getData(); @@ -2231,109 +2915,40 @@ public CompletableFuture getTeamMembershipsAsync( } /** - * Get team memberships. - * - *

See {@link #getTeamMembershipsWithHttpInfo}. - * - * @param teamId None (required) - * @return PaginationIterable<UserTeam> - */ - public PaginationIterable getTeamMembershipsWithPagination(String teamId) { - GetTeamMembershipsOptionalParameters parameters = new GetTeamMembershipsOptionalParameters(); - return getTeamMembershipsWithPagination(teamId, parameters); - } - - /** - * Get team memberships. - * - *

See {@link #getTeamMembershipsWithHttpInfo}. - * - * @param teamId None (required) - * @return UserTeamsResponse - */ - public PaginationIterable getTeamMembershipsWithPagination( - String teamId, GetTeamMembershipsOptionalParameters parameters) { - String resultsPath = "getData"; - String valueGetterPath = ""; - String valueSetterPath = "pageNumber"; - Boolean valueSetterParamOptional = true; - parameters.pageNumber(0l); - Long limit; - - if (parameters.pageSize == null) { - limit = 10l; - parameters.pageSize(limit); - } else { - limit = parameters.pageSize; - } - - LinkedHashMap args = new LinkedHashMap(); - args.put("teamId", teamId); - args.put("optionalParams", parameters); - - PaginationIterable iterator = - new PaginationIterable( - this, - "getTeamMemberships", - resultsPath, - valueGetterPath, - valueSetterPath, - valueSetterParamOptional, - false, - limit, - args); - - return iterator; - } - - /** - * Get a paginated list of members for a team - * * @param teamId None (required) - * @param parameters Optional parameters for the request. - * @return ApiResponse<UserTeamsResponse> + * @return ApiResponse<TeamNotificationRulesResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * * * *
Response details
Status Code Description Response Headers
200 Represents a user's association to a team -
200 OK -
403 Forbidden -
404 API error response. -
429 Too many requests -
*/ - public ApiResponse getTeamMembershipsWithHttpInfo( - String teamId, GetTeamMembershipsOptionalParameters parameters) throws ApiException { + public ApiResponse getTeamNotificationRulesWithHttpInfo( + String teamId) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'teamId' is set if (teamId == null) { throw new ApiException( - 400, "Missing the required parameter 'teamId' when calling getTeamMemberships"); + 400, "Missing the required parameter 'teamId' when calling getTeamNotificationRules"); } - Long pageSize = parameters.pageSize; - Long pageNumber = parameters.pageNumber; - GetTeamMembershipsSort sort = parameters.sort; - String filterKeyword = parameters.filterKeyword; // create path and map variables String localVarPath = - "/api/v2/team/{team_id}/memberships" + "/api/v2/team/{team_id}/notification-rules" .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[keyword]", filterKeyword)); - Invocation.Builder builder = apiClient.createBuilder( - "v2.TeamsApi.getTeamMemberships", + "v2.TeamsApi.getTeamNotificationRules", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, @@ -2346,60 +2961,52 @@ public ApiResponse getTeamMembershipsWithHttpInfo( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get team memberships. + * Get team notification rules. * - *

See {@link #getTeamMembershipsWithHttpInfo}. + *

See {@link #getTeamNotificationRulesWithHttpInfo}. * * @param teamId None (required) - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<UserTeamsResponse>> + * @return CompletableFuture<ApiResponse<TeamNotificationRulesResponse>> */ - public CompletableFuture> getTeamMembershipsWithHttpInfoAsync( - String teamId, GetTeamMembershipsOptionalParameters parameters) { + public CompletableFuture> + getTeamNotificationRulesWithHttpInfoAsync(String teamId) { Object localVarPostBody = null; // verify the required parameter 'teamId' is set if (teamId == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'teamId' when calling getTeamMemberships")); + 400, + "Missing the required parameter 'teamId' when calling getTeamNotificationRules")); return result; } - Long pageSize = parameters.pageSize; - Long pageNumber = parameters.pageNumber; - GetTeamMembershipsSort sort = parameters.sort; - String filterKeyword = parameters.filterKeyword; // create path and map variables String localVarPath = - "/api/v2/team/{team_id}/memberships" + "/api/v2/team/{team_id}/notification-rules" .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[keyword]", filterKeyword)); - Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.TeamsApi.getTeamMemberships", + "v2.TeamsApi.getTeamNotificationRules", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -2411,7 +3018,7 @@ public CompletableFuture> getTeamMembershipsWithH localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** @@ -5029,6 +5636,185 @@ public CompletableFuture> updateTeamMembershipWith new GenericType() {}); } + /** + * Update team notification rule. + * + *

See {@link #updateTeamNotificationRuleWithHttpInfo}. + * + * @param ruleId None (required) + * @param teamId None (required) + * @param body (required) + * @return TeamNotificationRule + * @throws ApiException if fails to make API call + */ + public TeamNotificationRule updateTeamNotificationRule( + String ruleId, String teamId, TeamNotificationRule body) throws ApiException { + return updateTeamNotificationRuleWithHttpInfo(ruleId, teamId, body).getData(); + } + + /** + * Update team notification rule. + * + *

See {@link #updateTeamNotificationRuleWithHttpInfoAsync}. + * + * @param ruleId None (required) + * @param teamId None (required) + * @param body (required) + * @return CompletableFuture<TeamNotificationRule> + */ + public CompletableFuture updateTeamNotificationRuleAsync( + String ruleId, String teamId, TeamNotificationRule body) { + return updateTeamNotificationRuleWithHttpInfoAsync(ruleId, teamId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * @param ruleId None (required) + * @param teamId None (required) + * @param body (required) + * @return ApiResponse<TeamNotificationRule> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 API error response. -
429 Too many requests -
+ */ + public ApiResponse updateTeamNotificationRuleWithHttpInfo( + String ruleId, String teamId, TeamNotificationRule body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'ruleId' is set + if (ruleId == null) { + throw new ApiException( + 400, "Missing the required parameter 'ruleId' when calling updateTeamNotificationRule"); + } + + // verify the required parameter 'teamId' is set + if (teamId == null) { + throw new ApiException( + 400, "Missing the required parameter 'teamId' when calling updateTeamNotificationRule"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateTeamNotificationRule"); + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}/notification-rules/{rule_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())) + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.TeamsApi.updateTeamNotificationRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update team notification rule. + * + *

See {@link #updateTeamNotificationRuleWithHttpInfo}. + * + * @param ruleId None (required) + * @param teamId None (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<TeamNotificationRule>> + */ + public CompletableFuture> + updateTeamNotificationRuleWithHttpInfoAsync( + String ruleId, String teamId, TeamNotificationRule body) { + Object localVarPostBody = body; + + // verify the required parameter 'ruleId' is set + if (ruleId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'ruleId' when calling updateTeamNotificationRule")); + return result; + } + + // verify the required parameter 'teamId' is set + if (teamId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'teamId' when calling updateTeamNotificationRule")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling updateTeamNotificationRule")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}/notification-rules/{rule_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())) + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.TeamsApi.updateTeamNotificationRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Update permission setting for team. * diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamNotificationRule.java b/src/main/java/com/datadog/api/client/v2/model/TeamNotificationRule.java new file mode 100644 index 00000000000..079ace2df71 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamNotificationRule.java @@ -0,0 +1,165 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Team notification rule */ +@JsonPropertyOrder({ + TeamNotificationRule.JSON_PROPERTY_ATTRIBUTES, + TeamNotificationRule.JSON_PROPERTY_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamNotificationRule { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TeamNotificationRuleAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public TeamNotificationRule attributes(TeamNotificationRuleAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Team notification rule attributes + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamNotificationRuleAttributes getAttributes() { + return attributes; + } + + public void setAttributes(TeamNotificationRuleAttributes attributes) { + this.attributes = attributes; + } + + public TeamNotificationRule id(String id) { + this.id = id; + return this; + } + + /** + * The identifier of the team notification rule + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamNotificationRule + */ + @JsonAnySetter + public TeamNotificationRule putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamNotificationRule object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamNotificationRule teamNotificationRule = (TeamNotificationRule) o; + return Objects.equals(this.attributes, teamNotificationRule.attributes) + && Objects.equals(this.id, teamNotificationRule.id) + && Objects.equals(this.additionalProperties, teamNotificationRule.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamNotificationRule {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamNotificationRuleAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TeamNotificationRuleAttributes.java new file mode 100644 index 00000000000..ca69a707b4c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamNotificationRuleAttributes.java @@ -0,0 +1,225 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Team notification rule attributes */ +@JsonPropertyOrder({ + TeamNotificationRuleAttributes.JSON_PROPERTY_EMAIL, + TeamNotificationRuleAttributes.JSON_PROPERTY_MS_TEAMS, + TeamNotificationRuleAttributes.JSON_PROPERTY_PAGERDUTY, + TeamNotificationRuleAttributes.JSON_PROPERTY_SLACK +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamNotificationRuleAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_EMAIL = "email"; + private TeamNotificationRuleAttributesEmail email; + + public static final String JSON_PROPERTY_MS_TEAMS = "ms_teams"; + private TeamNotificationRuleAttributesMsTeams msTeams; + + public static final String JSON_PROPERTY_PAGERDUTY = "pagerduty"; + private TeamNotificationRuleAttributesPagerduty pagerduty; + + public static final String JSON_PROPERTY_SLACK = "slack"; + private TeamNotificationRuleAttributesSlack slack; + + public TeamNotificationRuleAttributes email(TeamNotificationRuleAttributesEmail email) { + this.email = email; + this.unparsed |= email.unparsed; + return this; + } + + /** + * Email notification settings for the team + * + * @return email + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamNotificationRuleAttributesEmail getEmail() { + return email; + } + + public void setEmail(TeamNotificationRuleAttributesEmail email) { + this.email = email; + } + + public TeamNotificationRuleAttributes msTeams(TeamNotificationRuleAttributesMsTeams msTeams) { + this.msTeams = msTeams; + this.unparsed |= msTeams.unparsed; + return this; + } + + /** + * MS Teams notification settings for the team + * + * @return msTeams + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MS_TEAMS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamNotificationRuleAttributesMsTeams getMsTeams() { + return msTeams; + } + + public void setMsTeams(TeamNotificationRuleAttributesMsTeams msTeams) { + this.msTeams = msTeams; + } + + public TeamNotificationRuleAttributes pagerduty( + TeamNotificationRuleAttributesPagerduty pagerduty) { + this.pagerduty = pagerduty; + this.unparsed |= pagerduty.unparsed; + return this; + } + + /** + * PagerDuty notification settings for the team + * + * @return pagerduty + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGERDUTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamNotificationRuleAttributesPagerduty getPagerduty() { + return pagerduty; + } + + public void setPagerduty(TeamNotificationRuleAttributesPagerduty pagerduty) { + this.pagerduty = pagerduty; + } + + public TeamNotificationRuleAttributes slack(TeamNotificationRuleAttributesSlack slack) { + this.slack = slack; + this.unparsed |= slack.unparsed; + return this; + } + + /** + * Slack notification settings for the team + * + * @return slack + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SLACK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamNotificationRuleAttributesSlack getSlack() { + return slack; + } + + public void setSlack(TeamNotificationRuleAttributesSlack slack) { + this.slack = slack; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamNotificationRuleAttributes + */ + @JsonAnySetter + public TeamNotificationRuleAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamNotificationRuleAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamNotificationRuleAttributes teamNotificationRuleAttributes = + (TeamNotificationRuleAttributes) o; + return Objects.equals(this.email, teamNotificationRuleAttributes.email) + && Objects.equals(this.msTeams, teamNotificationRuleAttributes.msTeams) + && Objects.equals(this.pagerduty, teamNotificationRuleAttributes.pagerduty) + && Objects.equals(this.slack, teamNotificationRuleAttributes.slack) + && Objects.equals( + this.additionalProperties, teamNotificationRuleAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, msTeams, pagerduty, slack, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamNotificationRuleAttributes {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" msTeams: ").append(toIndentedString(msTeams)).append("\n"); + sb.append(" pagerduty: ").append(toIndentedString(pagerduty)).append("\n"); + sb.append(" slack: ").append(toIndentedString(slack)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamNotificationRuleAttributesEmail.java b/src/main/java/com/datadog/api/client/v2/model/TeamNotificationRuleAttributesEmail.java new file mode 100644 index 00000000000..85490e47749 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamNotificationRuleAttributesEmail.java @@ -0,0 +1,137 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Email notification settings for the team */ +@JsonPropertyOrder({TeamNotificationRuleAttributesEmail.JSON_PROPERTY_ENABLED}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamNotificationRuleAttributesEmail { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + public TeamNotificationRuleAttributesEmail enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Flag indicating email notification + * + * @return enabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamNotificationRuleAttributesEmail + */ + @JsonAnySetter + public TeamNotificationRuleAttributesEmail putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamNotificationRuleAttributesEmail object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamNotificationRuleAttributesEmail teamNotificationRuleAttributesEmail = + (TeamNotificationRuleAttributesEmail) o; + return Objects.equals(this.enabled, teamNotificationRuleAttributesEmail.enabled) + && Objects.equals( + this.additionalProperties, teamNotificationRuleAttributesEmail.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(enabled, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamNotificationRuleAttributesEmail {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamNotificationRuleAttributesMsTeams.java b/src/main/java/com/datadog/api/client/v2/model/TeamNotificationRuleAttributesMsTeams.java new file mode 100644 index 00000000000..cec86feff49 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamNotificationRuleAttributesMsTeams.java @@ -0,0 +1,137 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** MS Teams notification settings for the team */ +@JsonPropertyOrder({TeamNotificationRuleAttributesMsTeams.JSON_PROPERTY_CONNECTOR_NAME}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamNotificationRuleAttributesMsTeams { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CONNECTOR_NAME = "connector_name"; + private String connectorName; + + public TeamNotificationRuleAttributesMsTeams connectorName(String connectorName) { + this.connectorName = connectorName; + return this; + } + + /** + * Handle for MS Teams + * + * @return connectorName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONNECTOR_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getConnectorName() { + return connectorName; + } + + public void setConnectorName(String connectorName) { + this.connectorName = connectorName; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamNotificationRuleAttributesMsTeams + */ + @JsonAnySetter + public TeamNotificationRuleAttributesMsTeams putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamNotificationRuleAttributesMsTeams object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamNotificationRuleAttributesMsTeams teamNotificationRuleAttributesMsTeams = + (TeamNotificationRuleAttributesMsTeams) o; + return Objects.equals(this.connectorName, teamNotificationRuleAttributesMsTeams.connectorName) + && Objects.equals( + this.additionalProperties, teamNotificationRuleAttributesMsTeams.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(connectorName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamNotificationRuleAttributesMsTeams {\n"); + sb.append(" connectorName: ").append(toIndentedString(connectorName)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamNotificationRuleAttributesPagerduty.java b/src/main/java/com/datadog/api/client/v2/model/TeamNotificationRuleAttributesPagerduty.java new file mode 100644 index 00000000000..dffc98d32d1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamNotificationRuleAttributesPagerduty.java @@ -0,0 +1,138 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** PagerDuty notification settings for the team */ +@JsonPropertyOrder({TeamNotificationRuleAttributesPagerduty.JSON_PROPERTY_SERVICE_NAME}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamNotificationRuleAttributesPagerduty { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_SERVICE_NAME = "service_name"; + private String serviceName; + + public TeamNotificationRuleAttributesPagerduty serviceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Service name for PagerDuty + * + * @return serviceName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SERVICE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getServiceName() { + return serviceName; + } + + public void setServiceName(String serviceName) { + this.serviceName = serviceName; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamNotificationRuleAttributesPagerduty + */ + @JsonAnySetter + public TeamNotificationRuleAttributesPagerduty putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamNotificationRuleAttributesPagerduty object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamNotificationRuleAttributesPagerduty teamNotificationRuleAttributesPagerduty = + (TeamNotificationRuleAttributesPagerduty) o; + return Objects.equals(this.serviceName, teamNotificationRuleAttributesPagerduty.serviceName) + && Objects.equals( + this.additionalProperties, + teamNotificationRuleAttributesPagerduty.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(serviceName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamNotificationRuleAttributesPagerduty {\n"); + sb.append(" serviceName: ").append(toIndentedString(serviceName)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamNotificationRuleAttributesSlack.java b/src/main/java/com/datadog/api/client/v2/model/TeamNotificationRuleAttributesSlack.java new file mode 100644 index 00000000000..e748b72135f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamNotificationRuleAttributesSlack.java @@ -0,0 +1,166 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Slack notification settings for the team */ +@JsonPropertyOrder({ + TeamNotificationRuleAttributesSlack.JSON_PROPERTY_CHANNEL, + TeamNotificationRuleAttributesSlack.JSON_PROPERTY_WORKSPACE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamNotificationRuleAttributesSlack { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CHANNEL = "channel"; + private String channel; + + public static final String JSON_PROPERTY_WORKSPACE = "workspace"; + private String workspace; + + public TeamNotificationRuleAttributesSlack channel(String channel) { + this.channel = channel; + return this; + } + + /** + * Channel for slack notification + * + * @return channel + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHANNEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChannel() { + return channel; + } + + public void setChannel(String channel) { + this.channel = channel; + } + + public TeamNotificationRuleAttributesSlack workspace(String workspace) { + this.workspace = workspace; + return this; + } + + /** + * Workspace for slack notification + * + * @return workspace + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WORKSPACE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getWorkspace() { + return workspace; + } + + public void setWorkspace(String workspace) { + this.workspace = workspace; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamNotificationRuleAttributesSlack + */ + @JsonAnySetter + public TeamNotificationRuleAttributesSlack putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamNotificationRuleAttributesSlack object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamNotificationRuleAttributesSlack teamNotificationRuleAttributesSlack = + (TeamNotificationRuleAttributesSlack) o; + return Objects.equals(this.channel, teamNotificationRuleAttributesSlack.channel) + && Objects.equals(this.workspace, teamNotificationRuleAttributesSlack.workspace) + && Objects.equals( + this.additionalProperties, teamNotificationRuleAttributesSlack.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(channel, workspace, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamNotificationRuleAttributesSlack {\n"); + sb.append(" channel: ").append(toIndentedString(channel)).append("\n"); + sb.append(" workspace: ").append(toIndentedString(workspace)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamNotificationRulesResponse.java b/src/main/java/com/datadog/api/client/v2/model/TeamNotificationRulesResponse.java new file mode 100644 index 00000000000..2511f8f645e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamNotificationRulesResponse.java @@ -0,0 +1,181 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 notification rules response */ +@JsonPropertyOrder({ + TeamNotificationRulesResponse.JSON_PROPERTY_DATA, + TeamNotificationRulesResponse.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamNotificationRulesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public static final String JSON_PROPERTY_META = "meta"; + private TeamNotificationRulesResponseMeta meta; + + public TeamNotificationRulesResponse data(List data) { + this.data = data; + for (TeamNotificationRule item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public TeamNotificationRulesResponse addDataItem(TeamNotificationRule dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Team notification rules response data + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public TeamNotificationRulesResponse meta(TeamNotificationRulesResponseMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Metadata related to paging information that is included in the response when querying the team + * notification rules + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamNotificationRulesResponseMeta getMeta() { + return meta; + } + + public void setMeta(TeamNotificationRulesResponseMeta meta) { + this.meta = meta; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamNotificationRulesResponse + */ + @JsonAnySetter + public TeamNotificationRulesResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamNotificationRulesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamNotificationRulesResponse teamNotificationRulesResponse = (TeamNotificationRulesResponse) o; + return Objects.equals(this.data, teamNotificationRulesResponse.data) + && Objects.equals(this.meta, teamNotificationRulesResponse.meta) + && Objects.equals( + this.additionalProperties, teamNotificationRulesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamNotificationRulesResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamNotificationRulesResponseMeta.java b/src/main/java/com/datadog/api/client/v2/model/TeamNotificationRulesResponseMeta.java new file mode 100644 index 00000000000..625ef9dcae1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamNotificationRulesResponseMeta.java @@ -0,0 +1,361 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * Metadata related to paging information that is included in the response when querying the team + * notification rules + */ +@JsonPropertyOrder({ + TeamNotificationRulesResponseMeta.JSON_PROPERTY_FIRST_NUMBER, + TeamNotificationRulesResponseMeta.JSON_PROPERTY_LAST_NUMBER, + TeamNotificationRulesResponseMeta.JSON_PROPERTY_NEXT_NUMBER, + TeamNotificationRulesResponseMeta.JSON_PROPERTY_NUMBER, + TeamNotificationRulesResponseMeta.JSON_PROPERTY_PREV_NUMBER, + TeamNotificationRulesResponseMeta.JSON_PROPERTY_SIZE, + TeamNotificationRulesResponseMeta.JSON_PROPERTY_TOTAL, + TeamNotificationRulesResponseMeta.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamNotificationRulesResponseMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FIRST_NUMBER = "first_number"; + private Long firstNumber; + + public static final String JSON_PROPERTY_LAST_NUMBER = "last_number"; + private Long lastNumber; + + public static final String JSON_PROPERTY_NEXT_NUMBER = "next_number"; + private JsonNullable nextNumber = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_NUMBER = "number"; + private Long number; + + public static final String JSON_PROPERTY_PREV_NUMBER = "prev_number"; + private JsonNullable prevNumber = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_SIZE = "size"; + private Long size; + + public static final String JSON_PROPERTY_TOTAL = "total"; + private Long total; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public TeamNotificationRulesResponseMeta firstNumber(Long firstNumber) { + this.firstNumber = firstNumber; + return this; + } + + /** + * First page number. + * + * @return firstNumber + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIRST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getFirstNumber() { + return firstNumber; + } + + public void setFirstNumber(Long firstNumber) { + this.firstNumber = firstNumber; + } + + public TeamNotificationRulesResponseMeta lastNumber(Long lastNumber) { + this.lastNumber = lastNumber; + return this; + } + + /** + * Last page number. + * + * @return lastNumber + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getLastNumber() { + return lastNumber; + } + + public void setLastNumber(Long lastNumber) { + this.lastNumber = lastNumber; + } + + public TeamNotificationRulesResponseMeta nextNumber(Long nextNumber) { + this.nextNumber = JsonNullable.of(nextNumber); + return this; + } + + /** + * Next page number. + * + * @return nextNumber + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getNextNumber() { + return nextNumber.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_NEXT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getNextNumber_JsonNullable() { + return nextNumber; + } + + @JsonProperty(JSON_PROPERTY_NEXT_NUMBER) + public void setNextNumber_JsonNullable(JsonNullable nextNumber) { + this.nextNumber = nextNumber; + } + + public void setNextNumber(Long nextNumber) { + this.nextNumber = JsonNullable.of(nextNumber); + } + + public TeamNotificationRulesResponseMeta number(Long number) { + this.number = number; + return this; + } + + /** + * Page number. + * + * @return number + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getNumber() { + return number; + } + + public void setNumber(Long number) { + this.number = number; + } + + public TeamNotificationRulesResponseMeta prevNumber(Long prevNumber) { + this.prevNumber = JsonNullable.of(prevNumber); + return this; + } + + /** + * Previous page number. + * + * @return prevNumber + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getPrevNumber() { + return prevNumber.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_PREV_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getPrevNumber_JsonNullable() { + return prevNumber; + } + + @JsonProperty(JSON_PROPERTY_PREV_NUMBER) + public void setPrevNumber_JsonNullable(JsonNullable prevNumber) { + this.prevNumber = prevNumber; + } + + public void setPrevNumber(Long prevNumber) { + this.prevNumber = JsonNullable.of(prevNumber); + } + + public TeamNotificationRulesResponseMeta size(Long size) { + this.size = size; + return this; + } + + /** + * Page size. + * + * @return size + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getSize() { + return size; + } + + public void setSize(Long size) { + this.size = size; + } + + public TeamNotificationRulesResponseMeta total(Long total) { + this.total = total; + return this; + } + + /** + * Total number of results. + * + * @return total + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTotal() { + return total; + } + + public void setTotal(Long total) { + this.total = total; + } + + public TeamNotificationRulesResponseMeta type(String type) { + this.type = type; + return this; + } + + /** + * Pagination type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamNotificationRulesResponseMeta + */ + @JsonAnySetter + public TeamNotificationRulesResponseMeta putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamNotificationRulesResponseMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamNotificationRulesResponseMeta teamNotificationRulesResponseMeta = + (TeamNotificationRulesResponseMeta) o; + return Objects.equals(this.firstNumber, teamNotificationRulesResponseMeta.firstNumber) + && Objects.equals(this.lastNumber, teamNotificationRulesResponseMeta.lastNumber) + && Objects.equals(this.nextNumber, teamNotificationRulesResponseMeta.nextNumber) + && Objects.equals(this.number, teamNotificationRulesResponseMeta.number) + && Objects.equals(this.prevNumber, teamNotificationRulesResponseMeta.prevNumber) + && Objects.equals(this.size, teamNotificationRulesResponseMeta.size) + && Objects.equals(this.total, teamNotificationRulesResponseMeta.total) + && Objects.equals(this.type, teamNotificationRulesResponseMeta.type) + && Objects.equals( + this.additionalProperties, teamNotificationRulesResponseMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + firstNumber, + lastNumber, + nextNumber, + number, + prevNumber, + size, + total, + type, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamNotificationRulesResponseMeta {\n"); + sb.append(" firstNumber: ").append(toIndentedString(firstNumber)).append("\n"); + sb.append(" lastNumber: ").append(toIndentedString(lastNumber)).append("\n"); + sb.append(" nextNumber: ").append(toIndentedString(nextNumber)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" prevNumber: ").append(toIndentedString(prevNumber)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/teams.feature b/src/test/resources/com/datadog/api/client/v2/api/teams.feature index 9deac2e88af..08d1f9631d8 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/teams.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/teams.feature @@ -144,6 +144,22 @@ Feature: Teams And the response "data.data[0].relationships.connected_team.data.id" is equal to "@MyGitHubAccount/my-team-name" And the response "data.data[0].type" is equal to "team_connection" + @generated @skip @team:DataDog/aaa-omg + Scenario: Create team notification rule returns "API error response." response + Given new "CreateTeamNotificationRule" request + And request contains "team_id" parameter from "REPLACE.ME" + And body with value {"attributes": {"email": {}, "ms_teams": {}, "pagerduty": {}, "slack": {}}, "id": "b8626d7e-cedd-11eb-abf5-da7ad0900001"} + When the request is sent + Then the response status is 409 API error response. + + @generated @skip @team:DataDog/aaa-omg + Scenario: Create team notification rule returns "OK" response + Given new "CreateTeamNotificationRule" request + And request contains "team_id" parameter from "REPLACE.ME" + And body with value {"attributes": {"email": {}, "ms_teams": {}, "pagerduty": {}, "slack": {}}, "id": "b8626d7e-cedd-11eb-abf5-da7ad0900001"} + When the request is sent + Then the response status is 200 OK + @skip @team:DataDog/aaa-omg Scenario: Delete team connections returns "Bad Request" response Given operation "DeleteTeamConnections" enabled @@ -166,6 +182,22 @@ Feature: Teams When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/aaa-omg + Scenario: Delete team notification rule returns "API error response." response + Given new "DeleteTeamNotificationRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And request contains "team_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/aaa-omg + Scenario: Delete team notification rule returns "No Content" response + Given new "DeleteTeamNotificationRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And request contains "team_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + @team:DataDog/aaa-omg Scenario: Get a team hierarchy link returns "API error response." response Given new "GetTeamHierarchyLink" request @@ -352,6 +384,36 @@ Feature: Teams Then the response status is 200 OK And the response has 3 items + @generated @skip @team:DataDog/aaa-omg + Scenario: Get team notification rule returns "API error response." response + Given new "GetTeamNotificationRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And request contains "team_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/aaa-omg + Scenario: Get team notification rule returns "OK" response + Given new "GetTeamNotificationRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And request contains "team_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 201 OK + + @generated @skip @team:DataDog/aaa-omg + Scenario: Get team notification rules returns "API error response." response + Given new "GetTeamNotificationRules" request + And request contains "team_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/aaa-omg + Scenario: Get team notification rules returns "OK" response + Given new "GetTeamNotificationRules" request + And request contains "team_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/aaa-omg Scenario: Get team sync configurations returns "OK" response Given new "GetTeamSync" request @@ -606,3 +668,21 @@ Feature: Teams And body with value {"data": {"attributes": {"value": "admins"}, "type": "team_permission_settings"}} When the request is sent Then the response status is 200 OK + + @generated @skip @team:DataDog/aaa-omg + Scenario: Update team notification rule returns "API error response." response + Given new "UpdateTeamNotificationRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And request contains "team_id" parameter from "REPLACE.ME" + And body with value {"attributes": {"email": {}, "ms_teams": {}, "pagerduty": {}, "slack": {}}, "id": "b8626d7e-cedd-11eb-abf5-da7ad0900001"} + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/aaa-omg + Scenario: Update team notification rule returns "OK" response + Given new "UpdateTeamNotificationRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And request contains "team_id" parameter from "REPLACE.ME" + And body with value {"attributes": {"email": {}, "ms_teams": {}, "pagerduty": {}, "slack": {}}, "id": "b8626d7e-cedd-11eb-abf5-da7ad0900001"} + When the request is sent + Then the response status is 200 OK diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index e0f0b98d0c9..8113423fc70 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -4705,6 +4705,47 @@ "type": "idempotent" } }, + "GetTeamNotificationRules": { + "tag": "Teams", + "undo": { + "type": "safe" + } + }, + "CreateTeamNotificationRule": { + "tag": "Teams", + "undo": { + "operationId": "DeleteTeamNotificationRule", + "parameters": [ + { + "name": "rule_id", + "source": "" + }, + { + "name": "team_id", + "source": "" + } + ], + "type": "unsafe" + } + }, + "DeleteTeamNotificationRule": { + "tag": "Teams", + "undo": { + "type": "idempotent" + } + }, + "GetTeamNotificationRule": { + "tag": "Teams", + "undo": { + "type": "safe" + } + }, + "UpdateTeamNotificationRule": { + "tag": "Teams", + "undo": { + "type": "idempotent" + } + }, "GetTeamPermissionSettings": { "tag": "Teams", "undo": {