From 250cf93ba47862f616d9789452f60d243c1a0cb0 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 24 Nov 2025 17:40:13 +0000 Subject: [PATCH] Regenerate client from commit 6cc4321 of spec repo --- .generator/schemas/v2/openapi.yaml | 462 +++++++++- examples/v2/teams/AddTeamHierarchyLink.java | 57 ++ examples/v2/teams/GetTeamHierarchyLink.java | 28 + examples/v2/teams/GetTeamHierarchyLinks.java | 37 + .../GetTeamHierarchyLinks_3360757486.java | 26 + .../v2/teams/RemoveTeamHierarchyLink.java | 25 + .../datadog/api/client/v2/api/TeamsApi.java | 838 ++++++++++++++++-- .../RelationshipToUserTeamPermission.java | 21 +- .../api/client/v2/model/TeamAttributes.java | 84 +- .../client/v2/model/TeamHierarchyLink.java | 237 +++++ .../v2/model/TeamHierarchyLinkAttributes.java | 175 ++++ .../v2/model/TeamHierarchyLinkCreate.java | 181 ++++ .../TeamHierarchyLinkCreateRelationships.java | 183 ++++ .../model/TeamHierarchyLinkCreateRequest.java | 147 +++ .../v2/model/TeamHierarchyLinkCreateTeam.java | 179 ++++ ...amHierarchyLinkCreateTeamRelationship.java | 148 ++++ .../model/TeamHierarchyLinkRelationships.java | 181 ++++ .../v2/model/TeamHierarchyLinkResponse.java | 208 +++++ .../v2/model/TeamHierarchyLinkTeam.java | 206 +++++ .../TeamHierarchyLinkTeamAttributes.java | 395 +++++++++ .../TeamHierarchyLinkTeamRelationship.java | 147 +++ .../v2/model/TeamHierarchyLinkType.java | 56 ++ .../v2/model/TeamHierarchyLinksResponse.java | 247 ++++++ .../TeamsHierarchyLinksResponseLinks.java | 288 ++++++ .../TeamsHierarchyLinksResponseMeta.java | 138 +++ .../TeamsHierarchyLinksResponseMetaPage.java | 358 ++++++++ ...archy_link_returns_CREATED_response.freeze | 1 + ...erarchy_link_returns_CREATED_response.json | 155 ++++ ...rchy_link_returns_Conflict_response.freeze | 1 + ...rarchy_link_returns_Conflict_response.json | 185 ++++ ..._hierarchy_link_returns_OK_response.freeze | 1 + ...am_hierarchy_link_returns_OK_response.json | 155 ++++ ...archy_link_returns_SUCCESS_response.freeze | 1 + ...erarchy_link_returns_SUCCESS_response.json | 155 ++++ ...returns_API_error_response_response.freeze | 1 + ...k_returns_API_error_response_response.json | 28 + ..._hierarchy_link_returns_OK_response.freeze | 1 + ...am_hierarchy_link_returns_OK_response.json | 181 ++++ ...hierarchy_links_returns_OK_response.freeze | 1 + ...m_hierarchy_links_returns_OK_response.json | 195 ++++ ...returns_API_error_response_response.freeze | 1 + ...k_returns_API_error_response_response.json | 28 + ...hy_link_returns_No_Content_response.freeze | 1 + ...rchy_link_returns_No_Content_response.json | 181 ++++ .../com/datadog/api/client/v2/api/given.json | 24 + .../datadog/api/client/v2/api/teams.feature | 83 ++ .../com/datadog/api/client/v2/api/undo.json | 31 + 47 files changed, 6383 insertions(+), 79 deletions(-) create mode 100644 examples/v2/teams/AddTeamHierarchyLink.java create mode 100644 examples/v2/teams/GetTeamHierarchyLink.java create mode 100644 examples/v2/teams/GetTeamHierarchyLinks.java create mode 100644 examples/v2/teams/GetTeamHierarchyLinks_3360757486.java create mode 100644 examples/v2/teams/RemoveTeamHierarchyLink.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLink.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkCreate.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkCreateRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkCreateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkCreateTeam.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkCreateTeamRelationship.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkTeam.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkTeamAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkTeamRelationship.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinksResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamsHierarchyLinksResponseLinks.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamsHierarchyLinksResponseMeta.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamsHierarchyLinksResponseMetaPage.java create mode 100644 src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_CREATED_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_CREATED_response.json create mode 100644 src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_Conflict_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_Conflict_response.json create mode 100644 src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_SUCCESS_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_SUCCESS_response.json create mode 100644 src/test/resources/cassettes/features/v2/Get_a_team_hierarchy_link_returns_API_error_response_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_a_team_hierarchy_link_returns_API_error_response_response.json create mode 100644 src/test/resources/cassettes/features/v2/Get_a_team_hierarchy_link_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_a_team_hierarchy_link_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/Get_team_hierarchy_links_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_team_hierarchy_links_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/Remove_a_team_hierarchy_link_returns_API_error_response_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Remove_a_team_hierarchy_link_returns_API_error_response_response.json create mode 100644 src/test/resources/cassettes/features/v2/Remove_a_team_hierarchy_link_returns_No_Content_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Remove_a_team_hierarchy_link_returns_No_Content_response.json diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 9bceb715496..a69cc7784ca 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -41410,6 +41410,7 @@ components: type: object RelationshipToUserTeamPermissionData: description: Related user team permission data + nullable: true properties: id: description: The ID of the user team permission @@ -51804,7 +51805,11 @@ components: items: description: String identifier of the module type: string + nullable: true type: array + is_managed: + description: Whether the team is managed from an external source + type: boolean link_count: description: The number of links belonging to the team format: int32 @@ -51836,6 +51841,7 @@ components: items: description: String identifier of the module type: string + nullable: true type: array required: - handle @@ -52016,6 +52022,206 @@ components: required: - data type: object + TeamHierarchyLink: + description: Team hierarchy link + properties: + attributes: + $ref: '#/components/schemas/TeamHierarchyLinkAttributes' + id: + description: The team hierarchy link's identifier + example: b8626d7e-cedd-11eb-abf5-da7ad0900001 + type: string + relationships: + $ref: '#/components/schemas/TeamHierarchyLinkRelationships' + type: + $ref: '#/components/schemas/TeamHierarchyLinkType' + required: + - attributes + - id + - type + type: object + TeamHierarchyLinkAttributes: + description: Team hierarchy link attributes + properties: + created_at: + description: Timestamp when the team hierarchy link was created + example: '' + format: date-time + type: string + provisioned_by: + description: The provisioner of the team hierarchy link + example: system + type: string + required: + - provisioned_by + - created_at + type: object + TeamHierarchyLinkCreate: + description: Team hierarchy link creation + properties: + relationships: + $ref: '#/components/schemas/TeamHierarchyLinkCreateRelationships' + type: + $ref: '#/components/schemas/TeamHierarchyLinkType' + required: + - relationships + - type + type: object + TeamHierarchyLinkCreateRelationships: + description: Team hierarchy link creation relationships + properties: + parent_team: + $ref: '#/components/schemas/TeamHierarchyLinkCreateTeamRelationship' + sub_team: + $ref: '#/components/schemas/TeamHierarchyLinkCreateTeamRelationship' + required: + - parent_team + - sub_team + type: object + TeamHierarchyLinkCreateRequest: + description: Request to create a team hierarchy link + properties: + data: + $ref: '#/components/schemas/TeamHierarchyLinkCreate' + required: + - data + type: object + TeamHierarchyLinkCreateTeam: + description: Team reference for hierarchy link creation + properties: + id: + description: The team's identifier + example: 692e8073-12c4-4c71-8408-5090bd44c9c8 + type: string + type: + $ref: '#/components/schemas/TeamType' + required: + - id + - type + type: object + TeamHierarchyLinkCreateTeamRelationship: + description: Team relationship for hierarchy link creation + properties: + data: + $ref: '#/components/schemas/TeamHierarchyLinkCreateTeam' + required: + - data + type: object + TeamHierarchyLinkRelationships: + description: Team hierarchy link relationships + properties: + parent_team: + $ref: '#/components/schemas/TeamHierarchyLinkTeamRelationship' + sub_team: + $ref: '#/components/schemas/TeamHierarchyLinkTeamRelationship' + required: + - parent_team + - sub_team + type: object + TeamHierarchyLinkResponse: + description: Team hierarchy link response + properties: + data: + $ref: '#/components/schemas/TeamHierarchyLink' + included: + description: Included teams + items: + $ref: '#/components/schemas/TeamHierarchyLinkTeam' + type: array + links: + $ref: '#/components/schemas/TeamsHierarchyLinksResponseLinks' + type: object + TeamHierarchyLinkTeam: + description: Team information in hierarchy link context + properties: + attributes: + $ref: '#/components/schemas/TeamHierarchyLinkTeamAttributes' + id: + description: The team's identifier + example: 692e8073-12c4-4c71-8408-5090bd44c9c8 + type: string + type: + $ref: '#/components/schemas/TeamType' + required: + - id + - type + type: object + TeamHierarchyLinkTeamAttributes: + description: Team attributes in hierarchy link context + properties: + avatar: + description: The team's avatar + nullable: true + type: string + banner: + description: The team's banner + format: int64 + type: integer + handle: + description: The team's handle + example: team-handle + type: string + is_managed: + description: Whether the team is managed + type: boolean + is_open_membership: + description: Whether the team has open membership + type: boolean + link_count: + description: The number of links for the team + format: int64 + type: integer + name: + description: The team's name + example: Team Name + type: string + summary: + description: The team's summary + nullable: true + type: string + user_count: + description: The number of users in the team + format: int64 + type: integer + required: + - handle + - name + type: object + TeamHierarchyLinkTeamRelationship: + description: Team hierarchy link team relationship + properties: + data: + $ref: '#/components/schemas/TeamHierarchyLinkTeam' + required: + - data + type: object + TeamHierarchyLinkType: + default: team_hierarchy_links + description: Team hierarchy link type + enum: + - team_hierarchy_links + example: team_hierarchy_links + type: string + x-enum-varnames: + - TEAM_HIERARCHY_LINKS + TeamHierarchyLinksResponse: + description: Team hierarchy links response + properties: + data: + description: Team hierarchy links response data + items: + $ref: '#/components/schemas/TeamHierarchyLink' + type: array + included: + description: Included teams + items: + $ref: '#/components/schemas/TeamHierarchyLinkTeam' + type: array + links: + $ref: '#/components/schemas/TeamsHierarchyLinksResponseLinks' + meta: + $ref: '#/components/schemas/TeamsHierarchyLinksResponseMeta' + type: object TeamIncluded: description: Included resources related to the team oneOf: @@ -52895,6 +53101,73 @@ components: - LINK_COUNT - TEAM_LINKS - USER_TEAM_PERMISSIONS + TeamsHierarchyLinksResponseLinks: + description: Teams hierarchy links response links. + properties: + first: + description: Link to the first page. + nullable: true + type: string + last: + description: Link to the last page. + nullable: true + type: string + next: + description: Link to the next page. + nullable: true + type: string + prev: + description: Link to the previous page. + nullable: true + type: string + self: + description: Link to the current object. + type: string + type: object + TeamsHierarchyLinksResponseMeta: + description: Team hierarchy links response metadata. + properties: + page: + $ref: '#/components/schemas/TeamsHierarchyLinksResponseMetaPage' + type: object + TeamsHierarchyLinksResponseMetaPage: + description: Teams hierarchy links response page metadata. + 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 TeamsResponse: description: Response with multiple teams properties: @@ -81999,6 +82272,170 @@ paths: permissions: - teams_read - teams_manage + /api/v2/team-hierarchy-links: + get: + description: Get all team hierarchy links that match the provided filters. + operationId: GetTeamHierarchyLinks + parameters: + - $ref: '#/components/parameters/PageNumber' + - $ref: '#/components/parameters/PageSize' + - description: Filter by parent team ID + in: query + name: filter[parent_team] + required: false + schema: + type: string + - description: Filter by sub team ID + in: query + name: filter[sub_team] + required: false + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamHierarchyLinksResponse' + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Get team hierarchy links + tags: + - Teams + x-pagination: + limitParam: page[size] + pageParam: page[number] + resultsPath: data + x-permission: + operator: OR + permissions: + - teams_read + post: + description: Create a new team hierarchy link between a parent team and a sub + team. + operationId: AddTeamHierarchyLink + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TeamHierarchyLinkCreateRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamHierarchyLinkResponse' + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Conflict + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + - teams_manage + summary: Create a team hierarchy link + tags: + - Teams + x-permission: + operator: AND + permissions: + - teams_read + - teams_manage + /api/v2/team-hierarchy-links/{link_id}: + delete: + description: Remove a team hierarchy link by the given link_id. + operationId: RemoveTeamHierarchyLink + parameters: + - description: The team hierarchy link's identifier + in: path + name: link_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 + - teams_manage + summary: Remove a team hierarchy link + tags: + - Teams + x-permission: + operator: AND + permissions: + - teams_read + - teams_manage + get: + description: Get a single team hierarchy link for the given link_id. + operationId: GetTeamHierarchyLink + parameters: + - description: The team hierarchy link's identifier + in: path + name: link_id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamHierarchyLinkResponse' + 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 a team hierarchy link + tags: + - Teams + x-permission: + operator: OR + permissions: + - teams_read /api/v2/team/connections: delete: description: Delete multiple team connections. @@ -82273,7 +82710,13 @@ paths: If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/team/{super_team_id}/member_teams: get: - description: Get all member teams. + deprecated: true + description: 'Get all member teams. + + + **Note**: This API is deprecated. For team hierarchy relationships (parent-child + + teams), use the team hierarchy links API: `GET /api/v2/team-hierarchy-links`.' operationId: ListMemberTeams parameters: - description: None @@ -82326,14 +82769,20 @@ paths: operator: OR permissions: - teams_read + x-sunset: '2026-06-01' x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' post: + deprecated: true description: 'Add a member team. Adds the team given by the `id` in the body as a member team of the super - team.' + team. + + + **Note**: This API is deprecated. For creating team hierarchy links, use the + team hierarchy links API: `POST /api/v2/team-hierarchy-links`.' operationId: AddMemberTeam parameters: - description: None @@ -82373,12 +82822,18 @@ paths: operator: OR permissions: - teams_read + x-sunset: '2026-06-01' x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/team/{super_team_id}/member_teams/{member_team_id}: delete: - description: Remove a super team's member team identified by `member_team_id`. + deprecated: true + description: 'Remove a super team''s member team identified by `member_team_id`. + + + **Note**: This API is deprecated. For deleting team hierarchy links, use the + team hierarchy links API: `DELETE /api/v2/team-hierarchy-links/{link_id}`.' operationId: RemoveMemberTeam parameters: - description: None @@ -82418,6 +82873,7 @@ paths: operator: OR permissions: - teams_read + x-sunset: '2026-06-01' x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' diff --git a/examples/v2/teams/AddTeamHierarchyLink.java b/examples/v2/teams/AddTeamHierarchyLink.java new file mode 100644 index 00000000000..953f8a377f8 --- /dev/null +++ b/examples/v2/teams/AddTeamHierarchyLink.java @@ -0,0 +1,57 @@ +// Create a team hierarchy link 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.TeamHierarchyLinkCreate; +import com.datadog.api.client.v2.model.TeamHierarchyLinkCreateRelationships; +import com.datadog.api.client.v2.model.TeamHierarchyLinkCreateRequest; +import com.datadog.api.client.v2.model.TeamHierarchyLinkCreateTeam; +import com.datadog.api.client.v2.model.TeamHierarchyLinkCreateTeamRelationship; +import com.datadog.api.client.v2.model.TeamHierarchyLinkResponse; +import com.datadog.api.client.v2.model.TeamHierarchyLinkType; +import com.datadog.api.client.v2.model.TeamType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + TeamsApi apiInstance = new TeamsApi(defaultClient); + + // there is a valid "dd_team" in the system + String DD_TEAM_DATA_ID = System.getenv("DD_TEAM_DATA_ID"); + + // there is a valid "dd_team_2" in the system + String DD_TEAM_2_DATA_ID = System.getenv("DD_TEAM_2_DATA_ID"); + + TeamHierarchyLinkCreateRequest body = + new TeamHierarchyLinkCreateRequest() + .data( + new TeamHierarchyLinkCreate() + .relationships( + new TeamHierarchyLinkCreateRelationships() + .parentTeam( + new TeamHierarchyLinkCreateTeamRelationship() + .data( + new TeamHierarchyLinkCreateTeam() + .id(DD_TEAM_DATA_ID) + .type(TeamType.TEAM))) + .subTeam( + new TeamHierarchyLinkCreateTeamRelationship() + .data( + new TeamHierarchyLinkCreateTeam() + .id(DD_TEAM_2_DATA_ID) + .type(TeamType.TEAM)))) + .type(TeamHierarchyLinkType.TEAM_HIERARCHY_LINKS)); + + try { + TeamHierarchyLinkResponse result = apiInstance.addTeamHierarchyLink(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#addTeamHierarchyLink"); + 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/GetTeamHierarchyLink.java b/examples/v2/teams/GetTeamHierarchyLink.java new file mode 100644 index 00000000000..53ec6a3c4c6 --- /dev/null +++ b/examples/v2/teams/GetTeamHierarchyLink.java @@ -0,0 +1,28 @@ +// Get a team hierarchy link 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.TeamHierarchyLinkResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + TeamsApi apiInstance = new TeamsApi(defaultClient); + + // there is a valid "team_hierarchy_link" in the system + String TEAM_HIERARCHY_LINK_DATA_ID = System.getenv("TEAM_HIERARCHY_LINK_DATA_ID"); + + try { + TeamHierarchyLinkResponse result = + apiInstance.getTeamHierarchyLink(TEAM_HIERARCHY_LINK_DATA_ID); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#getTeamHierarchyLink"); + 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/GetTeamHierarchyLinks.java b/examples/v2/teams/GetTeamHierarchyLinks.java new file mode 100644 index 00000000000..96d035729e9 --- /dev/null +++ b/examples/v2/teams/GetTeamHierarchyLinks.java @@ -0,0 +1,37 @@ +// Get team hierarchy links 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.api.TeamsApi.GetTeamHierarchyLinksOptionalParameters; +import com.datadog.api.client.v2.model.TeamHierarchyLinksResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + TeamsApi apiInstance = new TeamsApi(defaultClient); + + // there is a valid "team_hierarchy_link" in the system + String TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_PARENT_TEAM_DATA_ID = + System.getenv("TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_PARENT_TEAM_DATA_ID"); + String TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_SUB_TEAM_DATA_ID = + System.getenv("TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_SUB_TEAM_DATA_ID"); + + try { + TeamHierarchyLinksResponse result = + apiInstance.getTeamHierarchyLinks( + new GetTeamHierarchyLinksOptionalParameters() + .filterParentTeam(TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_PARENT_TEAM_DATA_ID) + .filterSubTeam(TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_SUB_TEAM_DATA_ID) + .pageNumber(0L) + .pageSize(100L)); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#getTeamHierarchyLinks"); + 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/GetTeamHierarchyLinks_3360757486.java b/examples/v2/teams/GetTeamHierarchyLinks_3360757486.java new file mode 100644 index 00000000000..09b84a049a6 --- /dev/null +++ b/examples/v2/teams/GetTeamHierarchyLinks_3360757486.java @@ -0,0 +1,26 @@ +// Get team hierarchy links returns "OK" response with pagination + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.PaginationIterable; +import com.datadog.api.client.v2.api.TeamsApi; +import com.datadog.api.client.v2.model.TeamHierarchyLink; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + TeamsApi apiInstance = new TeamsApi(defaultClient); + + try { + PaginationIterable iterable = + apiInstance.getTeamHierarchyLinksWithPagination(); + + for (TeamHierarchyLink item : iterable) { + System.out.println(item); + } + } catch (RuntimeException e) { + System.err.println("Exception when calling TeamsApi#getTeamHierarchyLinksWithPagination"); + System.err.println("Reason: " + e.getMessage()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/teams/RemoveTeamHierarchyLink.java b/examples/v2/teams/RemoveTeamHierarchyLink.java new file mode 100644 index 00000000000..a8ec28039ca --- /dev/null +++ b/examples/v2/teams/RemoveTeamHierarchyLink.java @@ -0,0 +1,25 @@ +// Remove a team hierarchy link 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); + + // there is a valid "team_hierarchy_link" in the system + String TEAM_HIERARCHY_LINK_DATA_ID = System.getenv("TEAM_HIERARCHY_LINK_DATA_ID"); + + try { + apiInstance.removeTeamHierarchyLink(TEAM_HIERARCHY_LINK_DATA_ID); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#removeTeamHierarchyLink"); + 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 7d887905321..0f0c30c43b4 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 @@ -11,6 +11,10 @@ import com.datadog.api.client.v2.model.ListTeamsSort; import com.datadog.api.client.v2.model.Team; import com.datadog.api.client.v2.model.TeamCreateRequest; +import com.datadog.api.client.v2.model.TeamHierarchyLink; +import com.datadog.api.client.v2.model.TeamHierarchyLinkCreateRequest; +import com.datadog.api.client.v2.model.TeamHierarchyLinkResponse; +import com.datadog.api.client.v2.model.TeamHierarchyLinksResponse; import com.datadog.api.client.v2.model.TeamLinkCreateRequest; import com.datadog.api.client.v2.model.TeamLinkResponse; import com.datadog.api.client.v2.model.TeamLinksResponse; @@ -77,7 +81,9 @@ public void setApiClient(ApiClient apiClient) { * @param superTeamId None (required) * @param body (required) * @throws ApiException if fails to make API call + * @deprecated */ + @Deprecated public void addMemberTeam(String superTeamId, AddMemberTeamRequest body) throws ApiException { addMemberTeamWithHttpInfo(superTeamId, body); } @@ -90,7 +96,9 @@ public void addMemberTeam(String superTeamId, AddMemberTeamRequest body) throws * @param superTeamId None (required) * @param body (required) * @return CompletableFuture + * @deprecated */ + @Deprecated public CompletableFuture addMemberTeamAsync(String superTeamId, AddMemberTeamRequest body) { return addMemberTeamWithHttpInfoAsync(superTeamId, body) .thenApply( @@ -103,6 +111,9 @@ public CompletableFuture addMemberTeamAsync(String superTeamId, AddMemberT * Add a member team. Adds the team given by the id in the body as a member team of * the super team. * + *

Note: This API is deprecated. For creating team hierarchy links, use the + * team hierarchy links API: POST /api/v2/team-hierarchy-links. + * * @param superTeamId None (required) * @param body (required) * @return ApiResponse<Void> @@ -116,7 +127,10 @@ public CompletableFuture addMemberTeamAsync(String superTeamId, AddMemberT * 409 API error response. - * 429 Too many requests - * + * + * @deprecated */ + @Deprecated public ApiResponse addMemberTeamWithHttpInfo(String superTeamId, AddMemberTeamRequest body) throws ApiException { // Check if unstable operation is enabled @@ -175,7 +189,9 @@ public ApiResponse addMemberTeamWithHttpInfo(String superTeamId, AddMember * @param superTeamId None (required) * @param body (required) * @return CompletableFuture<ApiResponse<Void>> + * @deprecated */ + @Deprecated public CompletableFuture> addMemberTeamWithHttpInfoAsync( String superTeamId, AddMemberTeamRequest body) { // Check if unstable operation is enabled @@ -242,6 +258,139 @@ public CompletableFuture> addMemberTeamWithHttpInfoAsync( null); } + /** + * Create a team hierarchy link. + * + *

See {@link #addTeamHierarchyLinkWithHttpInfo}. + * + * @param body (required) + * @return TeamHierarchyLinkResponse + * @throws ApiException if fails to make API call + */ + public TeamHierarchyLinkResponse addTeamHierarchyLink(TeamHierarchyLinkCreateRequest body) + throws ApiException { + return addTeamHierarchyLinkWithHttpInfo(body).getData(); + } + + /** + * Create a team hierarchy link. + * + *

See {@link #addTeamHierarchyLinkWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<TeamHierarchyLinkResponse> + */ + public CompletableFuture addTeamHierarchyLinkAsync( + TeamHierarchyLinkCreateRequest body) { + return addTeamHierarchyLinkWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create a new team hierarchy link between a parent team and a sub team. + * + * @param body (required) + * @return ApiResponse<TeamHierarchyLinkResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Forbidden -
409 Conflict -
429 Too many requests -
+ */ + public ApiResponse addTeamHierarchyLinkWithHttpInfo( + TeamHierarchyLinkCreateRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling addTeamHierarchyLink"); + } + // create path and map variables + String localVarPath = "/api/v2/team-hierarchy-links"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.TeamsApi.addTeamHierarchyLink", + 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 a team hierarchy link. + * + *

See {@link #addTeamHierarchyLinkWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<TeamHierarchyLinkResponse>> + */ + public CompletableFuture> + addTeamHierarchyLinkWithHttpInfoAsync(TeamHierarchyLinkCreateRequest body) { + Object localVarPostBody = body; + + // 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 addTeamHierarchyLink")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/team-hierarchy-links"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.TeamsApi.addTeamHierarchyLink", + 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() {}); + } + /** * Create a team. * @@ -1116,40 +1265,358 @@ public CompletableFuture> deleteTeamMembershipWithHttpInfoAsyn result.completeExceptionally(ex); return result; } - return apiClient.invokeAPIAsync( - "DELETE", - builder, - localVarHeaderParams, - new String[] {}, - localVarPostBody, - new HashMap(), - false, - null); + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Get a team. + * + *

See {@link #getTeamWithHttpInfo}. + * + * @param teamId None (required) + * @return TeamResponse + * @throws ApiException if fails to make API call + */ + public TeamResponse getTeam(String teamId) throws ApiException { + return getTeamWithHttpInfo(teamId).getData(); + } + + /** + * Get a team. + * + *

See {@link #getTeamWithHttpInfoAsync}. + * + * @param teamId None (required) + * @return CompletableFuture<TeamResponse> + */ + public CompletableFuture getTeamAsync(String teamId) { + return getTeamWithHttpInfoAsync(teamId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a single team using the team's id. + * + * @param teamId None (required) + * @return ApiResponse<TeamResponse> + * @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 getTeamWithHttpInfo(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 getTeam"); + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.TeamsApi.getTeam", + 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 a team. + * + *

See {@link #getTeamWithHttpInfo}. + * + * @param teamId None (required) + * @return CompletableFuture<ApiResponse<TeamResponse>> + */ + public CompletableFuture> getTeamWithHttpInfoAsync(String teamId) { + 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 getTeam")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/team/{team_id}" + .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.TeamsApi.getTeam", + 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 a team hierarchy link. + * + *

See {@link #getTeamHierarchyLinkWithHttpInfo}. + * + * @param linkId The team hierarchy link's identifier (required) + * @return TeamHierarchyLinkResponse + * @throws ApiException if fails to make API call + */ + public TeamHierarchyLinkResponse getTeamHierarchyLink(String linkId) throws ApiException { + return getTeamHierarchyLinkWithHttpInfo(linkId).getData(); + } + + /** + * Get a team hierarchy link. + * + *

See {@link #getTeamHierarchyLinkWithHttpInfoAsync}. + * + * @param linkId The team hierarchy link's identifier (required) + * @return CompletableFuture<TeamHierarchyLinkResponse> + */ + public CompletableFuture getTeamHierarchyLinkAsync(String linkId) { + return getTeamHierarchyLinkWithHttpInfoAsync(linkId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a single team hierarchy link for the given link_id. + * + * @param linkId The team hierarchy link's identifier (required) + * @return ApiResponse<TeamHierarchyLinkResponse> + * @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 getTeamHierarchyLinkWithHttpInfo(String linkId) + throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'linkId' is set + if (linkId == null) { + throw new ApiException( + 400, "Missing the required parameter 'linkId' when calling getTeamHierarchyLink"); + } + // create path and map variables + String localVarPath = + "/api/v2/team-hierarchy-links/{link_id}" + .replaceAll("\\{" + "link_id" + "\\}", apiClient.escapeString(linkId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.TeamsApi.getTeamHierarchyLink", + 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 a team hierarchy link. + * + *

See {@link #getTeamHierarchyLinkWithHttpInfo}. + * + * @param linkId The team hierarchy link's identifier (required) + * @return CompletableFuture<ApiResponse<TeamHierarchyLinkResponse>> + */ + public CompletableFuture> + getTeamHierarchyLinkWithHttpInfoAsync(String linkId) { + Object localVarPostBody = null; + + // verify the required parameter 'linkId' is set + if (linkId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'linkId' when calling getTeamHierarchyLink")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/team-hierarchy-links/{link_id}" + .replaceAll("\\{" + "link_id" + "\\}", apiClient.escapeString(linkId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.TeamsApi.getTeamHierarchyLink", + 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() {}); + } + + /** Manage optional parameters to getTeamHierarchyLinks. */ + public static class GetTeamHierarchyLinksOptionalParameters { + private Long pageNumber; + private Long pageSize; + private String filterParentTeam; + private String filterSubTeam; + + /** + * Set pageNumber. + * + * @param pageNumber Specific page number to return. (optional, default to 0) + * @return GetTeamHierarchyLinksOptionalParameters + */ + public GetTeamHierarchyLinksOptionalParameters pageNumber(Long pageNumber) { + this.pageNumber = pageNumber; + return this; + } + + /** + * Set pageSize. + * + * @param pageSize Size for a given page. The maximum allowed value is 100. (optional, default + * to 10) + * @return GetTeamHierarchyLinksOptionalParameters + */ + public GetTeamHierarchyLinksOptionalParameters pageSize(Long pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Set filterParentTeam. + * + * @param filterParentTeam Filter by parent team ID (optional) + * @return GetTeamHierarchyLinksOptionalParameters + */ + public GetTeamHierarchyLinksOptionalParameters filterParentTeam(String filterParentTeam) { + this.filterParentTeam = filterParentTeam; + return this; + } + + /** + * Set filterSubTeam. + * + * @param filterSubTeam Filter by sub team ID (optional) + * @return GetTeamHierarchyLinksOptionalParameters + */ + public GetTeamHierarchyLinksOptionalParameters filterSubTeam(String filterSubTeam) { + this.filterSubTeam = filterSubTeam; + return this; + } } /** - * Get a team. + * Get team hierarchy links. * - *

See {@link #getTeamWithHttpInfo}. + *

See {@link #getTeamHierarchyLinksWithHttpInfo}. * - * @param teamId None (required) - * @return TeamResponse + * @return TeamHierarchyLinksResponse * @throws ApiException if fails to make API call */ - public TeamResponse getTeam(String teamId) throws ApiException { - return getTeamWithHttpInfo(teamId).getData(); + public TeamHierarchyLinksResponse getTeamHierarchyLinks() throws ApiException { + return getTeamHierarchyLinksWithHttpInfo(new GetTeamHierarchyLinksOptionalParameters()) + .getData(); } /** - * Get a team. + * Get team hierarchy links. * - *

See {@link #getTeamWithHttpInfoAsync}. + *

See {@link #getTeamHierarchyLinksWithHttpInfoAsync}. * - * @param teamId None (required) - * @return CompletableFuture<TeamResponse> + * @return CompletableFuture<TeamHierarchyLinksResponse> */ - public CompletableFuture getTeamAsync(String teamId) { - return getTeamWithHttpInfoAsync(teamId) + public CompletableFuture getTeamHierarchyLinksAsync() { + return getTeamHierarchyLinksWithHttpInfoAsync(new GetTeamHierarchyLinksOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -1157,10 +1624,95 @@ public CompletableFuture getTeamAsync(String teamId) { } /** - * Get a single team using the team's id. + * Get team hierarchy links. * - * @param teamId None (required) - * @return ApiResponse<TeamResponse> + *

See {@link #getTeamHierarchyLinksWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return TeamHierarchyLinksResponse + * @throws ApiException if fails to make API call + */ + public TeamHierarchyLinksResponse getTeamHierarchyLinks( + GetTeamHierarchyLinksOptionalParameters parameters) throws ApiException { + return getTeamHierarchyLinksWithHttpInfo(parameters).getData(); + } + + /** + * Get team hierarchy links. + * + *

See {@link #getTeamHierarchyLinksWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<TeamHierarchyLinksResponse> + */ + public CompletableFuture getTeamHierarchyLinksAsync( + GetTeamHierarchyLinksOptionalParameters parameters) { + return getTeamHierarchyLinksWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get team hierarchy links. + * + *

See {@link #getTeamHierarchyLinksWithHttpInfo}. + * + * @return PaginationIterable<TeamHierarchyLink> + */ + public PaginationIterable getTeamHierarchyLinksWithPagination() { + GetTeamHierarchyLinksOptionalParameters parameters = + new GetTeamHierarchyLinksOptionalParameters(); + return getTeamHierarchyLinksWithPagination(parameters); + } + + /** + * Get team hierarchy links. + * + *

See {@link #getTeamHierarchyLinksWithHttpInfo}. + * + * @return TeamHierarchyLinksResponse + */ + public PaginationIterable getTeamHierarchyLinksWithPagination( + GetTeamHierarchyLinksOptionalParameters 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("optionalParams", parameters); + + PaginationIterable iterator = + new PaginationIterable( + this, + "getTeamHierarchyLinks", + resultsPath, + valueGetterPath, + valueSetterPath, + valueSetterParamOptional, + false, + limit, + args); + + return iterator; + } + + /** + * Get all team hierarchy links that match the provided filters. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<TeamHierarchyLinksResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -1168,29 +1720,33 @@ public CompletableFuture getTeamAsync(String teamId) { * * * - * * *
Status Code Description Response Headers
200 OK -
403 Forbidden -
404 API error response. -
429 Too many requests -
*/ - public ApiResponse getTeamWithHttpInfo(String teamId) throws ApiException { + public ApiResponse getTeamHierarchyLinksWithHttpInfo( + GetTeamHierarchyLinksOptionalParameters 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 getTeam"); - } + Long pageNumber = parameters.pageNumber; + Long pageSize = parameters.pageSize; + String filterParentTeam = parameters.filterParentTeam; + String filterSubTeam = parameters.filterSubTeam; // create path and map variables - String localVarPath = - "/api/v2/team/{team_id}" - .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + String localVarPath = "/api/v2/team-hierarchy-links"; + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[parent_team]", filterParentTeam)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[sub_team]", filterSubTeam)); + Invocation.Builder builder = apiClient.createBuilder( - "v2.TeamsApi.getTeam", + "v2.TeamsApi.getTeamHierarchyLinks", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, @@ -1203,47 +1759,49 @@ public ApiResponse getTeamWithHttpInfo(String teamId) throws ApiEx localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a team. + * Get team hierarchy links. * - *

See {@link #getTeamWithHttpInfo}. + *

See {@link #getTeamHierarchyLinksWithHttpInfo}. * - * @param teamId None (required) - * @return CompletableFuture<ApiResponse<TeamResponse>> + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<TeamHierarchyLinksResponse>> */ - public CompletableFuture> getTeamWithHttpInfoAsync(String teamId) { + public CompletableFuture> + getTeamHierarchyLinksWithHttpInfoAsync(GetTeamHierarchyLinksOptionalParameters 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 getTeam")); - return result; - } + Long pageNumber = parameters.pageNumber; + Long pageSize = parameters.pageSize; + String filterParentTeam = parameters.filterParentTeam; + String filterSubTeam = parameters.filterSubTeam; // create path and map variables - String localVarPath = - "/api/v2/team/{team_id}" - .replaceAll("\\{" + "team_id" + "\\}", apiClient.escapeString(teamId.toString())); + String localVarPath = "/api/v2/team-hierarchy-links"; + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[parent_team]", filterParentTeam)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[sub_team]", filterSubTeam)); + Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.TeamsApi.getTeam", + "v2.TeamsApi.getTeamHierarchyLinks", localVarPath, - new ArrayList(), + localVarQueryParams, 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; } @@ -1255,7 +1813,7 @@ public CompletableFuture> getTeamWithHttpInfoAsync(Str localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** @@ -2328,7 +2886,9 @@ public ListMemberTeamsOptionalParameters fieldsTeam(List fieldsTeam) * @param superTeamId None (required) * @return TeamsResponse * @throws ApiException if fails to make API call + * @deprecated */ + @Deprecated public TeamsResponse listMemberTeams(String superTeamId) throws ApiException { return listMemberTeamsWithHttpInfo(superTeamId, new ListMemberTeamsOptionalParameters()) .getData(); @@ -2341,7 +2901,9 @@ public TeamsResponse listMemberTeams(String superTeamId) throws ApiException { * * @param superTeamId None (required) * @return CompletableFuture<TeamsResponse> + * @deprecated */ + @Deprecated public CompletableFuture listMemberTeamsAsync(String superTeamId) { return listMemberTeamsWithHttpInfoAsync(superTeamId, new ListMemberTeamsOptionalParameters()) .thenApply( @@ -2359,7 +2921,9 @@ public CompletableFuture listMemberTeamsAsync(String superTeamId) * @param parameters Optional parameters for the request. * @return TeamsResponse * @throws ApiException if fails to make API call + * @deprecated */ + @Deprecated public TeamsResponse listMemberTeams( String superTeamId, ListMemberTeamsOptionalParameters parameters) throws ApiException { return listMemberTeamsWithHttpInfo(superTeamId, parameters).getData(); @@ -2373,7 +2937,9 @@ public TeamsResponse listMemberTeams( * @param superTeamId None (required) * @param parameters Optional parameters for the request. * @return CompletableFuture<TeamsResponse> + * @deprecated */ + @Deprecated public CompletableFuture listMemberTeamsAsync( String superTeamId, ListMemberTeamsOptionalParameters parameters) { return listMemberTeamsWithHttpInfoAsync(superTeamId, parameters) @@ -2390,7 +2956,9 @@ public CompletableFuture listMemberTeamsAsync( * * @param superTeamId None (required) * @return PaginationIterable<Team> + * @deprecated */ + @Deprecated public PaginationIterable listMemberTeamsWithPagination(String superTeamId) { ListMemberTeamsOptionalParameters parameters = new ListMemberTeamsOptionalParameters(); return listMemberTeamsWithPagination(superTeamId, parameters); @@ -2403,7 +2971,9 @@ public PaginationIterable listMemberTeamsWithPagination(String superTeamId * * @param superTeamId None (required) * @return TeamsResponse + * @deprecated */ + @Deprecated public PaginationIterable listMemberTeamsWithPagination( String superTeamId, ListMemberTeamsOptionalParameters parameters) { String resultsPath = "getData"; @@ -2442,6 +3012,10 @@ public PaginationIterable listMemberTeamsWithPagination( /** * Get all member teams. * + *

Note: This API is deprecated. For team hierarchy relationships + * (parent-child teams), use the team hierarchy links API: GET /api/v2/team-hierarchy-links + * . + * * @param superTeamId None (required) * @param parameters Optional parameters for the request. * @return ApiResponse<TeamsResponse> @@ -2455,7 +3029,10 @@ public PaginationIterable listMemberTeamsWithPagination( * 404 API error response. - * 429 Too many requests - * + * + * @deprecated */ + @Deprecated public ApiResponse listMemberTeamsWithHttpInfo( String superTeamId, ListMemberTeamsOptionalParameters parameters) throws ApiException { // Check if unstable operation is enabled @@ -2516,7 +3093,9 @@ public ApiResponse listMemberTeamsWithHttpInfo( * @param superTeamId None (required) * @param parameters Optional parameters for the request. * @return CompletableFuture<ApiResponse<TeamsResponse>> + * @deprecated */ + @Deprecated public CompletableFuture> listMemberTeamsWithHttpInfoAsync( String superTeamId, ListMemberTeamsOptionalParameters parameters) { // Check if unstable operation is enabled @@ -2908,7 +3487,9 @@ public CompletableFuture> listTeamsWithHttpInfoAsync( * @param superTeamId None (required) * @param memberTeamId None (required) * @throws ApiException if fails to make API call + * @deprecated */ + @Deprecated public void removeMemberTeam(String superTeamId, String memberTeamId) throws ApiException { removeMemberTeamWithHttpInfo(superTeamId, memberTeamId); } @@ -2921,7 +3502,9 @@ public void removeMemberTeam(String superTeamId, String memberTeamId) throws Api * @param superTeamId None (required) * @param memberTeamId None (required) * @return CompletableFuture + * @deprecated */ + @Deprecated public CompletableFuture removeMemberTeamAsync(String superTeamId, String memberTeamId) { return removeMemberTeamWithHttpInfoAsync(superTeamId, memberTeamId) .thenApply( @@ -2933,6 +3516,9 @@ public CompletableFuture removeMemberTeamAsync(String superTeamId, String /** * Remove a super team's member team identified by member_team_id. * + *

Note: This API is deprecated. For deleting team hierarchy links, use the + * team hierarchy links API: DELETE /api/v2/team-hierarchy-links/{link_id}. + * * @param superTeamId None (required) * @param memberTeamId None (required) * @return ApiResponse<Void> @@ -2946,7 +3532,10 @@ public CompletableFuture removeMemberTeamAsync(String superTeamId, String * 404 API error response. - * 429 Too many requests - * + * + * @deprecated */ + @Deprecated public ApiResponse removeMemberTeamWithHttpInfo(String superTeamId, String memberTeamId) throws ApiException { // Check if unstable operation is enabled @@ -3007,7 +3596,9 @@ public ApiResponse removeMemberTeamWithHttpInfo(String superTeamId, String * @param superTeamId None (required) * @param memberTeamId None (required) * @return CompletableFuture<ApiResponse<Void>> + * @deprecated */ + @Deprecated public CompletableFuture> removeMemberTeamWithHttpInfoAsync( String superTeamId, String memberTeamId) { // Check if unstable operation is enabled @@ -3076,6 +3667,139 @@ public CompletableFuture> removeMemberTeamWithHttpInfoAsync( null); } + /** + * Remove a team hierarchy link. + * + *

See {@link #removeTeamHierarchyLinkWithHttpInfo}. + * + * @param linkId The team hierarchy link's identifier (required) + * @throws ApiException if fails to make API call + */ + public void removeTeamHierarchyLink(String linkId) throws ApiException { + removeTeamHierarchyLinkWithHttpInfo(linkId); + } + + /** + * Remove a team hierarchy link. + * + *

See {@link #removeTeamHierarchyLinkWithHttpInfoAsync}. + * + * @param linkId The team hierarchy link's identifier (required) + * @return CompletableFuture + */ + public CompletableFuture removeTeamHierarchyLinkAsync(String linkId) { + return removeTeamHierarchyLinkWithHttpInfoAsync(linkId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Remove a team hierarchy link by the given link_id. + * + * @param linkId The team hierarchy link's identifier (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 removeTeamHierarchyLinkWithHttpInfo(String linkId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'linkId' is set + if (linkId == null) { + throw new ApiException( + 400, "Missing the required parameter 'linkId' when calling removeTeamHierarchyLink"); + } + // create path and map variables + String localVarPath = + "/api/v2/team-hierarchy-links/{link_id}" + .replaceAll("\\{" + "link_id" + "\\}", apiClient.escapeString(linkId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.TeamsApi.removeTeamHierarchyLink", + 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); + } + + /** + * Remove a team hierarchy link. + * + *

See {@link #removeTeamHierarchyLinkWithHttpInfo}. + * + * @param linkId The team hierarchy link's identifier (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> removeTeamHierarchyLinkWithHttpInfoAsync( + String linkId) { + Object localVarPostBody = null; + + // verify the required parameter 'linkId' is set + if (linkId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'linkId' when calling removeTeamHierarchyLink")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/team-hierarchy-links/{link_id}" + .replaceAll("\\{" + "link_id" + "\\}", apiClient.escapeString(linkId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.TeamsApi.removeTeamHierarchyLink", + 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); + } + /** * Link Teams with GitHub Teams. * diff --git a/src/main/java/com/datadog/api/client/v2/model/RelationshipToUserTeamPermission.java b/src/main/java/com/datadog/api/client/v2/model/RelationshipToUserTeamPermission.java index c998bc232a0..b332897c7a5 100644 --- a/src/main/java/com/datadog/api/client/v2/model/RelationshipToUserTeamPermission.java +++ b/src/main/java/com/datadog/api/client/v2/model/RelationshipToUserTeamPermission.java @@ -15,6 +15,7 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; /** Relationship between a user team permission and a team */ @JsonPropertyOrder({ @@ -26,14 +27,14 @@ public class RelationshipToUserTeamPermission { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_DATA = "data"; - private RelationshipToUserTeamPermissionData data; + private JsonNullable data = + JsonNullable.undefined(); public static final String JSON_PROPERTY_LINKS = "links"; private TeamRelationshipsLinks links; public RelationshipToUserTeamPermission data(RelationshipToUserTeamPermissionData data) { - this.data = data; - this.unparsed |= data.unparsed; + this.data = JsonNullable.of(data); return this; } @@ -43,16 +44,26 @@ public RelationshipToUserTeamPermission data(RelationshipToUserTeamPermissionDat * @return data */ @jakarta.annotation.Nullable + @JsonIgnore + public RelationshipToUserTeamPermissionData getData() { + return data.orElse(null); + } + @JsonProperty(JSON_PROPERTY_DATA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public RelationshipToUserTeamPermissionData getData() { + public JsonNullable getData_JsonNullable() { return data; } - public void setData(RelationshipToUserTeamPermissionData data) { + @JsonProperty(JSON_PROPERTY_DATA) + public void setData_JsonNullable(JsonNullable data) { this.data = data; } + public void setData(RelationshipToUserTeamPermissionData data) { + this.data = JsonNullable.of(data); + } + public RelationshipToUserTeamPermission links(TeamRelationshipsLinks links) { this.links = links; this.unparsed |= links.unparsed; diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TeamAttributes.java index b8d0e601ec2..bdd28ce03a9 100644 --- a/src/main/java/com/datadog/api/client/v2/model/TeamAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/TeamAttributes.java @@ -29,6 +29,7 @@ TeamAttributes.JSON_PROPERTY_DESCRIPTION, TeamAttributes.JSON_PROPERTY_HANDLE, TeamAttributes.JSON_PROPERTY_HIDDEN_MODULES, + TeamAttributes.JSON_PROPERTY_IS_MANAGED, TeamAttributes.JSON_PROPERTY_LINK_COUNT, TeamAttributes.JSON_PROPERTY_MODIFIED_AT, TeamAttributes.JSON_PROPERTY_NAME, @@ -56,7 +57,10 @@ public class TeamAttributes { private String handle; public static final String JSON_PROPERTY_HIDDEN_MODULES = "hidden_modules"; - private List hiddenModules = null; + private JsonNullable> hiddenModules = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_IS_MANAGED = "is_managed"; + private Boolean isManaged; public static final String JSON_PROPERTY_LINK_COUNT = "link_count"; private Integer linkCount; @@ -74,7 +78,7 @@ public class TeamAttributes { private Integer userCount; public static final String JSON_PROPERTY_VISIBLE_MODULES = "visible_modules"; - private List visibleModules = null; + private JsonNullable> visibleModules = JsonNullable.>undefined(); public TeamAttributes() {} @@ -221,15 +225,19 @@ public void setHandle(String handle) { } public TeamAttributes hiddenModules(List hiddenModules) { - this.hiddenModules = hiddenModules; + this.hiddenModules = JsonNullable.>of(hiddenModules); return this; } public TeamAttributes addHiddenModulesItem(String hiddenModulesItem) { - if (this.hiddenModules == null) { - this.hiddenModules = new ArrayList<>(); + if (this.hiddenModules == null || !this.hiddenModules.isPresent()) { + this.hiddenModules = JsonNullable.>of(new ArrayList<>()); + } + try { + this.hiddenModules.get().add(hiddenModulesItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.hiddenModules.add(hiddenModulesItem); return this; } @@ -239,16 +247,47 @@ public TeamAttributes addHiddenModulesItem(String hiddenModulesItem) { * @return hiddenModules */ @jakarta.annotation.Nullable + @JsonIgnore + public List getHiddenModules() { + return hiddenModules.orElse(null); + } + @JsonProperty(JSON_PROPERTY_HIDDEN_MODULES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getHiddenModules() { + public JsonNullable> getHiddenModules_JsonNullable() { return hiddenModules; } - public void setHiddenModules(List hiddenModules) { + @JsonProperty(JSON_PROPERTY_HIDDEN_MODULES) + public void setHiddenModules_JsonNullable(JsonNullable> hiddenModules) { this.hiddenModules = hiddenModules; } + public void setHiddenModules(List hiddenModules) { + this.hiddenModules = JsonNullable.>of(hiddenModules); + } + + public TeamAttributes isManaged(Boolean isManaged) { + this.isManaged = isManaged; + return this; + } + + /** + * Whether the team is managed from an external source + * + * @return isManaged + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_MANAGED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsManaged() { + return isManaged; + } + + public void setIsManaged(Boolean isManaged) { + this.isManaged = isManaged; + } + /** * The number of links belonging to the team maximum: 2147483647 * @@ -346,15 +385,19 @@ public Integer getUserCount() { } public TeamAttributes visibleModules(List visibleModules) { - this.visibleModules = visibleModules; + this.visibleModules = JsonNullable.>of(visibleModules); return this; } public TeamAttributes addVisibleModulesItem(String visibleModulesItem) { - if (this.visibleModules == null) { - this.visibleModules = new ArrayList<>(); + if (this.visibleModules == null || !this.visibleModules.isPresent()) { + this.visibleModules = JsonNullable.>of(new ArrayList<>()); + } + try { + this.visibleModules.get().add(visibleModulesItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.visibleModules.add(visibleModulesItem); return this; } @@ -364,16 +407,26 @@ public TeamAttributes addVisibleModulesItem(String visibleModulesItem) { * @return visibleModules */ @jakarta.annotation.Nullable + @JsonIgnore + public List getVisibleModules() { + return visibleModules.orElse(null); + } + @JsonProperty(JSON_PROPERTY_VISIBLE_MODULES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getVisibleModules() { + public JsonNullable> getVisibleModules_JsonNullable() { return visibleModules; } - public void setVisibleModules(List visibleModules) { + @JsonProperty(JSON_PROPERTY_VISIBLE_MODULES) + public void setVisibleModules_JsonNullable(JsonNullable> visibleModules) { this.visibleModules = visibleModules; } + public void setVisibleModules(List visibleModules) { + this.visibleModules = JsonNullable.>of(visibleModules); + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -436,6 +489,7 @@ public boolean equals(Object o) { && Objects.equals(this.description, teamAttributes.description) && Objects.equals(this.handle, teamAttributes.handle) && Objects.equals(this.hiddenModules, teamAttributes.hiddenModules) + && Objects.equals(this.isManaged, teamAttributes.isManaged) && Objects.equals(this.linkCount, teamAttributes.linkCount) && Objects.equals(this.modifiedAt, teamAttributes.modifiedAt) && Objects.equals(this.name, teamAttributes.name) @@ -454,6 +508,7 @@ public int hashCode() { description, handle, hiddenModules, + isManaged, linkCount, modifiedAt, name, @@ -473,6 +528,7 @@ public String toString() { sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" handle: ").append(toIndentedString(handle)).append("\n"); sb.append(" hiddenModules: ").append(toIndentedString(hiddenModules)).append("\n"); + sb.append(" isManaged: ").append(toIndentedString(isManaged)).append("\n"); sb.append(" linkCount: ").append(toIndentedString(linkCount)).append("\n"); sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLink.java b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLink.java new file mode 100644 index 00000000000..5a7ba0ed824 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLink.java @@ -0,0 +1,237 @@ +/* + * 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.JsonCreator; +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 hierarchy link */ +@JsonPropertyOrder({ + TeamHierarchyLink.JSON_PROPERTY_ATTRIBUTES, + TeamHierarchyLink.JSON_PROPERTY_ID, + TeamHierarchyLink.JSON_PROPERTY_RELATIONSHIPS, + TeamHierarchyLink.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamHierarchyLink { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TeamHierarchyLinkAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private TeamHierarchyLinkRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TeamHierarchyLinkType type = TeamHierarchyLinkType.TEAM_HIERARCHY_LINKS; + + public TeamHierarchyLink() {} + + @JsonCreator + public TeamHierarchyLink( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + TeamHierarchyLinkAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) TeamHierarchyLinkType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TeamHierarchyLink attributes(TeamHierarchyLinkAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Team hierarchy link attributes + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamHierarchyLinkAttributes getAttributes() { + return attributes; + } + + public void setAttributes(TeamHierarchyLinkAttributes attributes) { + this.attributes = attributes; + } + + public TeamHierarchyLink id(String id) { + this.id = id; + return this; + } + + /** + * The team hierarchy link's identifier + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public TeamHierarchyLink relationships(TeamHierarchyLinkRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Team hierarchy link relationships + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamHierarchyLinkRelationships getRelationships() { + return relationships; + } + + public void setRelationships(TeamHierarchyLinkRelationships relationships) { + this.relationships = relationships; + } + + public TeamHierarchyLink type(TeamHierarchyLinkType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Team hierarchy link type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamHierarchyLinkType getType() { + return type; + } + + public void setType(TeamHierarchyLinkType type) { + if (!type.isValid()) { + this.unparsed = true; + } + 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 TeamHierarchyLink + */ + @JsonAnySetter + public TeamHierarchyLink 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 TeamHierarchyLink object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamHierarchyLink teamHierarchyLink = (TeamHierarchyLink) o; + return Objects.equals(this.attributes, teamHierarchyLink.attributes) + && Objects.equals(this.id, teamHierarchyLink.id) + && Objects.equals(this.relationships, teamHierarchyLink.relationships) + && Objects.equals(this.type, teamHierarchyLink.type) + && Objects.equals(this.additionalProperties, teamHierarchyLink.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamHierarchyLink {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).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/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkAttributes.java new file mode 100644 index 00000000000..ca2f3cdce29 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkAttributes.java @@ -0,0 +1,175 @@ +/* + * 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.JsonCreator; +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.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Team hierarchy link attributes */ +@JsonPropertyOrder({ + TeamHierarchyLinkAttributes.JSON_PROPERTY_CREATED_AT, + TeamHierarchyLinkAttributes.JSON_PROPERTY_PROVISIONED_BY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamHierarchyLinkAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_PROVISIONED_BY = "provisioned_by"; + private String provisionedBy; + + public TeamHierarchyLinkAttributes() {} + + @JsonCreator + public TeamHierarchyLinkAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_PROVISIONED_BY) String provisionedBy) { + this.createdAt = createdAt; + this.provisionedBy = provisionedBy; + } + + public TeamHierarchyLinkAttributes createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Timestamp when the team hierarchy link was created + * + * @return createdAt + */ + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public TeamHierarchyLinkAttributes provisionedBy(String provisionedBy) { + this.provisionedBy = provisionedBy; + return this; + } + + /** + * The provisioner of the team hierarchy link + * + * @return provisionedBy + */ + @JsonProperty(JSON_PROPERTY_PROVISIONED_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getProvisionedBy() { + return provisionedBy; + } + + public void setProvisionedBy(String provisionedBy) { + this.provisionedBy = provisionedBy; + } + + /** + * 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 TeamHierarchyLinkAttributes + */ + @JsonAnySetter + public TeamHierarchyLinkAttributes 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 TeamHierarchyLinkAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamHierarchyLinkAttributes teamHierarchyLinkAttributes = (TeamHierarchyLinkAttributes) o; + return Objects.equals(this.createdAt, teamHierarchyLinkAttributes.createdAt) + && Objects.equals(this.provisionedBy, teamHierarchyLinkAttributes.provisionedBy) + && Objects.equals( + this.additionalProperties, teamHierarchyLinkAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(createdAt, provisionedBy, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamHierarchyLinkAttributes {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" provisionedBy: ").append(toIndentedString(provisionedBy)).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/TeamHierarchyLinkCreate.java b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkCreate.java new file mode 100644 index 00000000000..38d55a3121b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkCreate.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.JsonCreator; +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 hierarchy link creation */ +@JsonPropertyOrder({ + TeamHierarchyLinkCreate.JSON_PROPERTY_RELATIONSHIPS, + TeamHierarchyLinkCreate.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamHierarchyLinkCreate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private TeamHierarchyLinkCreateRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TeamHierarchyLinkType type = TeamHierarchyLinkType.TEAM_HIERARCHY_LINKS; + + public TeamHierarchyLinkCreate() {} + + @JsonCreator + public TeamHierarchyLinkCreate( + @JsonProperty(required = true, value = JSON_PROPERTY_RELATIONSHIPS) + TeamHierarchyLinkCreateRelationships relationships, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) TeamHierarchyLinkType type) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TeamHierarchyLinkCreate relationships(TeamHierarchyLinkCreateRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Team hierarchy link creation relationships + * + * @return relationships + */ + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamHierarchyLinkCreateRelationships getRelationships() { + return relationships; + } + + public void setRelationships(TeamHierarchyLinkCreateRelationships relationships) { + this.relationships = relationships; + } + + public TeamHierarchyLinkCreate type(TeamHierarchyLinkType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Team hierarchy link type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamHierarchyLinkType getType() { + return type; + } + + public void setType(TeamHierarchyLinkType type) { + if (!type.isValid()) { + this.unparsed = true; + } + 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 TeamHierarchyLinkCreate + */ + @JsonAnySetter + public TeamHierarchyLinkCreate 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 TeamHierarchyLinkCreate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamHierarchyLinkCreate teamHierarchyLinkCreate = (TeamHierarchyLinkCreate) o; + return Objects.equals(this.relationships, teamHierarchyLinkCreate.relationships) + && Objects.equals(this.type, teamHierarchyLinkCreate.type) + && Objects.equals(this.additionalProperties, teamHierarchyLinkCreate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamHierarchyLinkCreate {\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).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/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkCreateRelationships.java b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkCreateRelationships.java new file mode 100644 index 00000000000..ca13ee83a76 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkCreateRelationships.java @@ -0,0 +1,183 @@ +/* + * 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.JsonCreator; +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 hierarchy link creation relationships */ +@JsonPropertyOrder({ + TeamHierarchyLinkCreateRelationships.JSON_PROPERTY_PARENT_TEAM, + TeamHierarchyLinkCreateRelationships.JSON_PROPERTY_SUB_TEAM +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamHierarchyLinkCreateRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_PARENT_TEAM = "parent_team"; + private TeamHierarchyLinkCreateTeamRelationship parentTeam; + + public static final String JSON_PROPERTY_SUB_TEAM = "sub_team"; + private TeamHierarchyLinkCreateTeamRelationship subTeam; + + public TeamHierarchyLinkCreateRelationships() {} + + @JsonCreator + public TeamHierarchyLinkCreateRelationships( + @JsonProperty(required = true, value = JSON_PROPERTY_PARENT_TEAM) + TeamHierarchyLinkCreateTeamRelationship parentTeam, + @JsonProperty(required = true, value = JSON_PROPERTY_SUB_TEAM) + TeamHierarchyLinkCreateTeamRelationship subTeam) { + this.parentTeam = parentTeam; + this.unparsed |= parentTeam.unparsed; + this.subTeam = subTeam; + this.unparsed |= subTeam.unparsed; + } + + public TeamHierarchyLinkCreateRelationships parentTeam( + TeamHierarchyLinkCreateTeamRelationship parentTeam) { + this.parentTeam = parentTeam; + this.unparsed |= parentTeam.unparsed; + return this; + } + + /** + * Team relationship for hierarchy link creation + * + * @return parentTeam + */ + @JsonProperty(JSON_PROPERTY_PARENT_TEAM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamHierarchyLinkCreateTeamRelationship getParentTeam() { + return parentTeam; + } + + public void setParentTeam(TeamHierarchyLinkCreateTeamRelationship parentTeam) { + this.parentTeam = parentTeam; + } + + public TeamHierarchyLinkCreateRelationships subTeam( + TeamHierarchyLinkCreateTeamRelationship subTeam) { + this.subTeam = subTeam; + this.unparsed |= subTeam.unparsed; + return this; + } + + /** + * Team relationship for hierarchy link creation + * + * @return subTeam + */ + @JsonProperty(JSON_PROPERTY_SUB_TEAM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamHierarchyLinkCreateTeamRelationship getSubTeam() { + return subTeam; + } + + public void setSubTeam(TeamHierarchyLinkCreateTeamRelationship subTeam) { + this.subTeam = subTeam; + } + + /** + * 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 TeamHierarchyLinkCreateRelationships + */ + @JsonAnySetter + public TeamHierarchyLinkCreateRelationships 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 TeamHierarchyLinkCreateRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamHierarchyLinkCreateRelationships teamHierarchyLinkCreateRelationships = + (TeamHierarchyLinkCreateRelationships) o; + return Objects.equals(this.parentTeam, teamHierarchyLinkCreateRelationships.parentTeam) + && Objects.equals(this.subTeam, teamHierarchyLinkCreateRelationships.subTeam) + && Objects.equals( + this.additionalProperties, teamHierarchyLinkCreateRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(parentTeam, subTeam, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamHierarchyLinkCreateRelationships {\n"); + sb.append(" parentTeam: ").append(toIndentedString(parentTeam)).append("\n"); + sb.append(" subTeam: ").append(toIndentedString(subTeam)).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/TeamHierarchyLinkCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkCreateRequest.java new file mode 100644 index 00000000000..a171495f7b2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkCreateRequest.java @@ -0,0 +1,147 @@ +/* + * 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.JsonCreator; +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; + +/** Request to create a team hierarchy link */ +@JsonPropertyOrder({TeamHierarchyLinkCreateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamHierarchyLinkCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private TeamHierarchyLinkCreate data; + + public TeamHierarchyLinkCreateRequest() {} + + @JsonCreator + public TeamHierarchyLinkCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) TeamHierarchyLinkCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public TeamHierarchyLinkCreateRequest data(TeamHierarchyLinkCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Team hierarchy link creation + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamHierarchyLinkCreate getData() { + return data; + } + + public void setData(TeamHierarchyLinkCreate data) { + this.data = data; + } + + /** + * 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 TeamHierarchyLinkCreateRequest + */ + @JsonAnySetter + public TeamHierarchyLinkCreateRequest 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 TeamHierarchyLinkCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamHierarchyLinkCreateRequest teamHierarchyLinkCreateRequest = + (TeamHierarchyLinkCreateRequest) o; + return Objects.equals(this.data, teamHierarchyLinkCreateRequest.data) + && Objects.equals( + this.additionalProperties, teamHierarchyLinkCreateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamHierarchyLinkCreateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).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/TeamHierarchyLinkCreateTeam.java b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkCreateTeam.java new file mode 100644 index 00000000000..63f0456629d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkCreateTeam.java @@ -0,0 +1,179 @@ +/* + * 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.JsonCreator; +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 reference for hierarchy link creation */ +@JsonPropertyOrder({ + TeamHierarchyLinkCreateTeam.JSON_PROPERTY_ID, + TeamHierarchyLinkCreateTeam.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamHierarchyLinkCreateTeam { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TeamType type = TeamType.TEAM; + + public TeamHierarchyLinkCreateTeam() {} + + @JsonCreator + public TeamHierarchyLinkCreateTeam( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) TeamType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TeamHierarchyLinkCreateTeam id(String id) { + this.id = id; + return this; + } + + /** + * The team's identifier + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public TeamHierarchyLinkCreateTeam type(TeamType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Team type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamType getType() { + return type; + } + + public void setType(TeamType type) { + if (!type.isValid()) { + this.unparsed = true; + } + 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 TeamHierarchyLinkCreateTeam + */ + @JsonAnySetter + public TeamHierarchyLinkCreateTeam 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 TeamHierarchyLinkCreateTeam object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamHierarchyLinkCreateTeam teamHierarchyLinkCreateTeam = (TeamHierarchyLinkCreateTeam) o; + return Objects.equals(this.id, teamHierarchyLinkCreateTeam.id) + && Objects.equals(this.type, teamHierarchyLinkCreateTeam.type) + && Objects.equals( + this.additionalProperties, teamHierarchyLinkCreateTeam.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamHierarchyLinkCreateTeam {\n"); + sb.append(" id: ").append(toIndentedString(id)).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/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkCreateTeamRelationship.java b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkCreateTeamRelationship.java new file mode 100644 index 00000000000..f8458ac0788 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkCreateTeamRelationship.java @@ -0,0 +1,148 @@ +/* + * 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.JsonCreator; +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 relationship for hierarchy link creation */ +@JsonPropertyOrder({TeamHierarchyLinkCreateTeamRelationship.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamHierarchyLinkCreateTeamRelationship { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private TeamHierarchyLinkCreateTeam data; + + public TeamHierarchyLinkCreateTeamRelationship() {} + + @JsonCreator + public TeamHierarchyLinkCreateTeamRelationship( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) TeamHierarchyLinkCreateTeam data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public TeamHierarchyLinkCreateTeamRelationship data(TeamHierarchyLinkCreateTeam data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Team reference for hierarchy link creation + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamHierarchyLinkCreateTeam getData() { + return data; + } + + public void setData(TeamHierarchyLinkCreateTeam data) { + this.data = data; + } + + /** + * 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 TeamHierarchyLinkCreateTeamRelationship + */ + @JsonAnySetter + public TeamHierarchyLinkCreateTeamRelationship 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 TeamHierarchyLinkCreateTeamRelationship object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamHierarchyLinkCreateTeamRelationship teamHierarchyLinkCreateTeamRelationship = + (TeamHierarchyLinkCreateTeamRelationship) o; + return Objects.equals(this.data, teamHierarchyLinkCreateTeamRelationship.data) + && Objects.equals( + this.additionalProperties, + teamHierarchyLinkCreateTeamRelationship.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamHierarchyLinkCreateTeamRelationship {\n"); + sb.append(" data: ").append(toIndentedString(data)).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/TeamHierarchyLinkRelationships.java b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkRelationships.java new file mode 100644 index 00000000000..4635c64ecdb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkRelationships.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.JsonCreator; +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 hierarchy link relationships */ +@JsonPropertyOrder({ + TeamHierarchyLinkRelationships.JSON_PROPERTY_PARENT_TEAM, + TeamHierarchyLinkRelationships.JSON_PROPERTY_SUB_TEAM +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamHierarchyLinkRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_PARENT_TEAM = "parent_team"; + private TeamHierarchyLinkTeamRelationship parentTeam; + + public static final String JSON_PROPERTY_SUB_TEAM = "sub_team"; + private TeamHierarchyLinkTeamRelationship subTeam; + + public TeamHierarchyLinkRelationships() {} + + @JsonCreator + public TeamHierarchyLinkRelationships( + @JsonProperty(required = true, value = JSON_PROPERTY_PARENT_TEAM) + TeamHierarchyLinkTeamRelationship parentTeam, + @JsonProperty(required = true, value = JSON_PROPERTY_SUB_TEAM) + TeamHierarchyLinkTeamRelationship subTeam) { + this.parentTeam = parentTeam; + this.unparsed |= parentTeam.unparsed; + this.subTeam = subTeam; + this.unparsed |= subTeam.unparsed; + } + + public TeamHierarchyLinkRelationships parentTeam(TeamHierarchyLinkTeamRelationship parentTeam) { + this.parentTeam = parentTeam; + this.unparsed |= parentTeam.unparsed; + return this; + } + + /** + * Team hierarchy link team relationship + * + * @return parentTeam + */ + @JsonProperty(JSON_PROPERTY_PARENT_TEAM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamHierarchyLinkTeamRelationship getParentTeam() { + return parentTeam; + } + + public void setParentTeam(TeamHierarchyLinkTeamRelationship parentTeam) { + this.parentTeam = parentTeam; + } + + public TeamHierarchyLinkRelationships subTeam(TeamHierarchyLinkTeamRelationship subTeam) { + this.subTeam = subTeam; + this.unparsed |= subTeam.unparsed; + return this; + } + + /** + * Team hierarchy link team relationship + * + * @return subTeam + */ + @JsonProperty(JSON_PROPERTY_SUB_TEAM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamHierarchyLinkTeamRelationship getSubTeam() { + return subTeam; + } + + public void setSubTeam(TeamHierarchyLinkTeamRelationship subTeam) { + this.subTeam = subTeam; + } + + /** + * 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 TeamHierarchyLinkRelationships + */ + @JsonAnySetter + public TeamHierarchyLinkRelationships 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 TeamHierarchyLinkRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamHierarchyLinkRelationships teamHierarchyLinkRelationships = + (TeamHierarchyLinkRelationships) o; + return Objects.equals(this.parentTeam, teamHierarchyLinkRelationships.parentTeam) + && Objects.equals(this.subTeam, teamHierarchyLinkRelationships.subTeam) + && Objects.equals( + this.additionalProperties, teamHierarchyLinkRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(parentTeam, subTeam, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamHierarchyLinkRelationships {\n"); + sb.append(" parentTeam: ").append(toIndentedString(parentTeam)).append("\n"); + sb.append(" subTeam: ").append(toIndentedString(subTeam)).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/TeamHierarchyLinkResponse.java b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkResponse.java new file mode 100644 index 00000000000..a8e24aee26f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkResponse.java @@ -0,0 +1,208 @@ +/* + * 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 hierarchy link response */ +@JsonPropertyOrder({ + TeamHierarchyLinkResponse.JSON_PROPERTY_DATA, + TeamHierarchyLinkResponse.JSON_PROPERTY_INCLUDED, + TeamHierarchyLinkResponse.JSON_PROPERTY_LINKS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamHierarchyLinkResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private TeamHierarchyLink data; + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = null; + + public static final String JSON_PROPERTY_LINKS = "links"; + private TeamsHierarchyLinksResponseLinks links; + + public TeamHierarchyLinkResponse data(TeamHierarchyLink data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Team hierarchy link + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamHierarchyLink getData() { + return data; + } + + public void setData(TeamHierarchyLink data) { + this.data = data; + } + + public TeamHierarchyLinkResponse included(List included) { + this.included = included; + for (TeamHierarchyLinkTeam item : included) { + this.unparsed |= item.unparsed; + } + return this; + } + + public TeamHierarchyLinkResponse addIncludedItem(TeamHierarchyLinkTeam includedItem) { + if (this.included == null) { + this.included = new ArrayList<>(); + } + this.included.add(includedItem); + this.unparsed |= includedItem.unparsed; + return this; + } + + /** + * Included teams + * + * @return included + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCLUDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIncluded() { + return included; + } + + public void setIncluded(List included) { + this.included = included; + } + + public TeamHierarchyLinkResponse links(TeamsHierarchyLinksResponseLinks links) { + this.links = links; + this.unparsed |= links.unparsed; + return this; + } + + /** + * Teams hierarchy links response links. + * + * @return links + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LINKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamsHierarchyLinksResponseLinks getLinks() { + return links; + } + + public void setLinks(TeamsHierarchyLinksResponseLinks links) { + this.links = links; + } + + /** + * 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 TeamHierarchyLinkResponse + */ + @JsonAnySetter + public TeamHierarchyLinkResponse 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 TeamHierarchyLinkResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamHierarchyLinkResponse teamHierarchyLinkResponse = (TeamHierarchyLinkResponse) o; + return Objects.equals(this.data, teamHierarchyLinkResponse.data) + && Objects.equals(this.included, teamHierarchyLinkResponse.included) + && Objects.equals(this.links, teamHierarchyLinkResponse.links) + && Objects.equals( + this.additionalProperties, teamHierarchyLinkResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, links, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamHierarchyLinkResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" included: ").append(toIndentedString(included)).append("\n"); + sb.append(" links: ").append(toIndentedString(links)).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/TeamHierarchyLinkTeam.java b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkTeam.java new file mode 100644 index 00000000000..8e637cd9d4a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkTeam.java @@ -0,0 +1,206 @@ +/* + * 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.JsonCreator; +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 information in hierarchy link context */ +@JsonPropertyOrder({ + TeamHierarchyLinkTeam.JSON_PROPERTY_ATTRIBUTES, + TeamHierarchyLinkTeam.JSON_PROPERTY_ID, + TeamHierarchyLinkTeam.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamHierarchyLinkTeam { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TeamHierarchyLinkTeamAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TeamType type = TeamType.TEAM; + + public TeamHierarchyLinkTeam() {} + + @JsonCreator + public TeamHierarchyLinkTeam( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) TeamType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TeamHierarchyLinkTeam attributes(TeamHierarchyLinkTeamAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Team attributes in hierarchy link context + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamHierarchyLinkTeamAttributes getAttributes() { + return attributes; + } + + public void setAttributes(TeamHierarchyLinkTeamAttributes attributes) { + this.attributes = attributes; + } + + public TeamHierarchyLinkTeam id(String id) { + this.id = id; + return this; + } + + /** + * The team's identifier + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public TeamHierarchyLinkTeam type(TeamType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Team type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamType getType() { + return type; + } + + public void setType(TeamType type) { + if (!type.isValid()) { + this.unparsed = true; + } + 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 TeamHierarchyLinkTeam + */ + @JsonAnySetter + public TeamHierarchyLinkTeam 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 TeamHierarchyLinkTeam object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamHierarchyLinkTeam teamHierarchyLinkTeam = (TeamHierarchyLinkTeam) o; + return Objects.equals(this.attributes, teamHierarchyLinkTeam.attributes) + && Objects.equals(this.id, teamHierarchyLinkTeam.id) + && Objects.equals(this.type, teamHierarchyLinkTeam.type) + && Objects.equals(this.additionalProperties, teamHierarchyLinkTeam.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamHierarchyLinkTeam {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).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/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkTeamAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkTeamAttributes.java new file mode 100644 index 00000000000..880cc3e1a02 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkTeamAttributes.java @@ -0,0 +1,395 @@ +/* + * 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.JsonCreator; +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; + +/** Team attributes in hierarchy link context */ +@JsonPropertyOrder({ + TeamHierarchyLinkTeamAttributes.JSON_PROPERTY_AVATAR, + TeamHierarchyLinkTeamAttributes.JSON_PROPERTY_BANNER, + TeamHierarchyLinkTeamAttributes.JSON_PROPERTY_HANDLE, + TeamHierarchyLinkTeamAttributes.JSON_PROPERTY_IS_MANAGED, + TeamHierarchyLinkTeamAttributes.JSON_PROPERTY_IS_OPEN_MEMBERSHIP, + TeamHierarchyLinkTeamAttributes.JSON_PROPERTY_LINK_COUNT, + TeamHierarchyLinkTeamAttributes.JSON_PROPERTY_NAME, + TeamHierarchyLinkTeamAttributes.JSON_PROPERTY_SUMMARY, + TeamHierarchyLinkTeamAttributes.JSON_PROPERTY_USER_COUNT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamHierarchyLinkTeamAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AVATAR = "avatar"; + private JsonNullable avatar = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_BANNER = "banner"; + private Long banner; + + public static final String JSON_PROPERTY_HANDLE = "handle"; + private String handle; + + public static final String JSON_PROPERTY_IS_MANAGED = "is_managed"; + private Boolean isManaged; + + public static final String JSON_PROPERTY_IS_OPEN_MEMBERSHIP = "is_open_membership"; + private Boolean isOpenMembership; + + public static final String JSON_PROPERTY_LINK_COUNT = "link_count"; + private Long linkCount; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_SUMMARY = "summary"; + private JsonNullable summary = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_USER_COUNT = "user_count"; + private Long userCount; + + public TeamHierarchyLinkTeamAttributes() {} + + @JsonCreator + public TeamHierarchyLinkTeamAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_HANDLE) String handle, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.handle = handle; + this.name = name; + } + + public TeamHierarchyLinkTeamAttributes avatar(String avatar) { + this.avatar = JsonNullable.of(avatar); + return this; + } + + /** + * The team's avatar + * + * @return avatar + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getAvatar() { + return avatar.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_AVATAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getAvatar_JsonNullable() { + return avatar; + } + + @JsonProperty(JSON_PROPERTY_AVATAR) + public void setAvatar_JsonNullable(JsonNullable avatar) { + this.avatar = avatar; + } + + public void setAvatar(String avatar) { + this.avatar = JsonNullable.of(avatar); + } + + public TeamHierarchyLinkTeamAttributes banner(Long banner) { + this.banner = banner; + return this; + } + + /** + * The team's banner + * + * @return banner + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BANNER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getBanner() { + return banner; + } + + public void setBanner(Long banner) { + this.banner = banner; + } + + public TeamHierarchyLinkTeamAttributes handle(String handle) { + this.handle = handle; + return this; + } + + /** + * The team's handle + * + * @return handle + */ + @JsonProperty(JSON_PROPERTY_HANDLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + public TeamHierarchyLinkTeamAttributes isManaged(Boolean isManaged) { + this.isManaged = isManaged; + return this; + } + + /** + * Whether the team is managed + * + * @return isManaged + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_MANAGED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsManaged() { + return isManaged; + } + + public void setIsManaged(Boolean isManaged) { + this.isManaged = isManaged; + } + + public TeamHierarchyLinkTeamAttributes isOpenMembership(Boolean isOpenMembership) { + this.isOpenMembership = isOpenMembership; + return this; + } + + /** + * Whether the team has open membership + * + * @return isOpenMembership + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_OPEN_MEMBERSHIP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsOpenMembership() { + return isOpenMembership; + } + + public void setIsOpenMembership(Boolean isOpenMembership) { + this.isOpenMembership = isOpenMembership; + } + + public TeamHierarchyLinkTeamAttributes linkCount(Long linkCount) { + this.linkCount = linkCount; + return this; + } + + /** + * The number of links for the team + * + * @return linkCount + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LINK_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getLinkCount() { + return linkCount; + } + + public void setLinkCount(Long linkCount) { + this.linkCount = linkCount; + } + + public TeamHierarchyLinkTeamAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The team's name + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public TeamHierarchyLinkTeamAttributes summary(String summary) { + this.summary = JsonNullable.of(summary); + return this; + } + + /** + * The team's summary + * + * @return summary + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getSummary() { + return summary.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_SUMMARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getSummary_JsonNullable() { + return summary; + } + + @JsonProperty(JSON_PROPERTY_SUMMARY) + public void setSummary_JsonNullable(JsonNullable summary) { + this.summary = summary; + } + + public void setSummary(String summary) { + this.summary = JsonNullable.of(summary); + } + + public TeamHierarchyLinkTeamAttributes userCount(Long userCount) { + this.userCount = userCount; + return this; + } + + /** + * The number of users in the team + * + * @return userCount + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USER_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getUserCount() { + return userCount; + } + + public void setUserCount(Long userCount) { + this.userCount = userCount; + } + + /** + * 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 TeamHierarchyLinkTeamAttributes + */ + @JsonAnySetter + public TeamHierarchyLinkTeamAttributes 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 TeamHierarchyLinkTeamAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamHierarchyLinkTeamAttributes teamHierarchyLinkTeamAttributes = + (TeamHierarchyLinkTeamAttributes) o; + return Objects.equals(this.avatar, teamHierarchyLinkTeamAttributes.avatar) + && Objects.equals(this.banner, teamHierarchyLinkTeamAttributes.banner) + && Objects.equals(this.handle, teamHierarchyLinkTeamAttributes.handle) + && Objects.equals(this.isManaged, teamHierarchyLinkTeamAttributes.isManaged) + && Objects.equals(this.isOpenMembership, teamHierarchyLinkTeamAttributes.isOpenMembership) + && Objects.equals(this.linkCount, teamHierarchyLinkTeamAttributes.linkCount) + && Objects.equals(this.name, teamHierarchyLinkTeamAttributes.name) + && Objects.equals(this.summary, teamHierarchyLinkTeamAttributes.summary) + && Objects.equals(this.userCount, teamHierarchyLinkTeamAttributes.userCount) + && Objects.equals( + this.additionalProperties, teamHierarchyLinkTeamAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + avatar, + banner, + handle, + isManaged, + isOpenMembership, + linkCount, + name, + summary, + userCount, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamHierarchyLinkTeamAttributes {\n"); + sb.append(" avatar: ").append(toIndentedString(avatar)).append("\n"); + sb.append(" banner: ").append(toIndentedString(banner)).append("\n"); + sb.append(" handle: ").append(toIndentedString(handle)).append("\n"); + sb.append(" isManaged: ").append(toIndentedString(isManaged)).append("\n"); + sb.append(" isOpenMembership: ").append(toIndentedString(isOpenMembership)).append("\n"); + sb.append(" linkCount: ").append(toIndentedString(linkCount)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" summary: ").append(toIndentedString(summary)).append("\n"); + sb.append(" userCount: ").append(toIndentedString(userCount)).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/TeamHierarchyLinkTeamRelationship.java b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkTeamRelationship.java new file mode 100644 index 00000000000..50c529e220d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkTeamRelationship.java @@ -0,0 +1,147 @@ +/* + * 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.JsonCreator; +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 hierarchy link team relationship */ +@JsonPropertyOrder({TeamHierarchyLinkTeamRelationship.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamHierarchyLinkTeamRelationship { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private TeamHierarchyLinkTeam data; + + public TeamHierarchyLinkTeamRelationship() {} + + @JsonCreator + public TeamHierarchyLinkTeamRelationship( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) TeamHierarchyLinkTeam data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public TeamHierarchyLinkTeamRelationship data(TeamHierarchyLinkTeam data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Team information in hierarchy link context + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamHierarchyLinkTeam getData() { + return data; + } + + public void setData(TeamHierarchyLinkTeam data) { + this.data = data; + } + + /** + * 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 TeamHierarchyLinkTeamRelationship + */ + @JsonAnySetter + public TeamHierarchyLinkTeamRelationship 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 TeamHierarchyLinkTeamRelationship object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamHierarchyLinkTeamRelationship teamHierarchyLinkTeamRelationship = + (TeamHierarchyLinkTeamRelationship) o; + return Objects.equals(this.data, teamHierarchyLinkTeamRelationship.data) + && Objects.equals( + this.additionalProperties, teamHierarchyLinkTeamRelationship.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamHierarchyLinkTeamRelationship {\n"); + sb.append(" data: ").append(toIndentedString(data)).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/TeamHierarchyLinkType.java b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkType.java new file mode 100644 index 00000000000..10b5032d408 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkType.java @@ -0,0 +1,56 @@ +/* + * 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.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Team hierarchy link type */ +@JsonSerialize(using = TeamHierarchyLinkType.TeamHierarchyLinkTypeSerializer.class) +public class TeamHierarchyLinkType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("team_hierarchy_links")); + + public static final TeamHierarchyLinkType TEAM_HIERARCHY_LINKS = + new TeamHierarchyLinkType("team_hierarchy_links"); + + TeamHierarchyLinkType(String value) { + super(value, allowedValues); + } + + public static class TeamHierarchyLinkTypeSerializer extends StdSerializer { + public TeamHierarchyLinkTypeSerializer(Class t) { + super(t); + } + + public TeamHierarchyLinkTypeSerializer() { + this(null); + } + + @Override + public void serialize( + TeamHierarchyLinkType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static TeamHierarchyLinkType fromValue(String value) { + return new TeamHierarchyLinkType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinksResponse.java b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinksResponse.java new file mode 100644 index 00000000000..871d133faff --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinksResponse.java @@ -0,0 +1,247 @@ +/* + * 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 hierarchy links response */ +@JsonPropertyOrder({ + TeamHierarchyLinksResponse.JSON_PROPERTY_DATA, + TeamHierarchyLinksResponse.JSON_PROPERTY_INCLUDED, + TeamHierarchyLinksResponse.JSON_PROPERTY_LINKS, + TeamHierarchyLinksResponse.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamHierarchyLinksResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = null; + + public static final String JSON_PROPERTY_LINKS = "links"; + private TeamsHierarchyLinksResponseLinks links; + + public static final String JSON_PROPERTY_META = "meta"; + private TeamsHierarchyLinksResponseMeta meta; + + public TeamHierarchyLinksResponse data(List data) { + this.data = data; + for (TeamHierarchyLink item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public TeamHierarchyLinksResponse addDataItem(TeamHierarchyLink dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Team hierarchy links 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 TeamHierarchyLinksResponse included(List included) { + this.included = included; + for (TeamHierarchyLinkTeam item : included) { + this.unparsed |= item.unparsed; + } + return this; + } + + public TeamHierarchyLinksResponse addIncludedItem(TeamHierarchyLinkTeam includedItem) { + if (this.included == null) { + this.included = new ArrayList<>(); + } + this.included.add(includedItem); + this.unparsed |= includedItem.unparsed; + return this; + } + + /** + * Included teams + * + * @return included + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCLUDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIncluded() { + return included; + } + + public void setIncluded(List included) { + this.included = included; + } + + public TeamHierarchyLinksResponse links(TeamsHierarchyLinksResponseLinks links) { + this.links = links; + this.unparsed |= links.unparsed; + return this; + } + + /** + * Teams hierarchy links response links. + * + * @return links + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LINKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamsHierarchyLinksResponseLinks getLinks() { + return links; + } + + public void setLinks(TeamsHierarchyLinksResponseLinks links) { + this.links = links; + } + + public TeamHierarchyLinksResponse meta(TeamsHierarchyLinksResponseMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Team hierarchy links response metadata. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamsHierarchyLinksResponseMeta getMeta() { + return meta; + } + + public void setMeta(TeamsHierarchyLinksResponseMeta 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 TeamHierarchyLinksResponse + */ + @JsonAnySetter + public TeamHierarchyLinksResponse 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 TeamHierarchyLinksResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamHierarchyLinksResponse teamHierarchyLinksResponse = (TeamHierarchyLinksResponse) o; + return Objects.equals(this.data, teamHierarchyLinksResponse.data) + && Objects.equals(this.included, teamHierarchyLinksResponse.included) + && Objects.equals(this.links, teamHierarchyLinksResponse.links) + && Objects.equals(this.meta, teamHierarchyLinksResponse.meta) + && Objects.equals( + this.additionalProperties, teamHierarchyLinksResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, links, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamHierarchyLinksResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" included: ").append(toIndentedString(included)).append("\n"); + sb.append(" links: ").append(toIndentedString(links)).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/TeamsHierarchyLinksResponseLinks.java b/src/main/java/com/datadog/api/client/v2/model/TeamsHierarchyLinksResponseLinks.java new file mode 100644 index 00000000000..092d87b9dad --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamsHierarchyLinksResponseLinks.java @@ -0,0 +1,288 @@ +/* + * 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; + +/** Teams hierarchy links response links. */ +@JsonPropertyOrder({ + TeamsHierarchyLinksResponseLinks.JSON_PROPERTY_FIRST, + TeamsHierarchyLinksResponseLinks.JSON_PROPERTY_LAST, + TeamsHierarchyLinksResponseLinks.JSON_PROPERTY_NEXT, + TeamsHierarchyLinksResponseLinks.JSON_PROPERTY_PREV, + TeamsHierarchyLinksResponseLinks.JSON_PROPERTY_SELF +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamsHierarchyLinksResponseLinks { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FIRST = "first"; + private JsonNullable first = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_LAST = "last"; + private JsonNullable last = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_NEXT = "next"; + private JsonNullable next = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_PREV = "prev"; + private JsonNullable prev = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_SELF = "self"; + private String self; + + public TeamsHierarchyLinksResponseLinks first(String first) { + this.first = JsonNullable.of(first); + return this; + } + + /** + * Link to the first page. + * + * @return first + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getFirst() { + return first.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_FIRST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getFirst_JsonNullable() { + return first; + } + + @JsonProperty(JSON_PROPERTY_FIRST) + public void setFirst_JsonNullable(JsonNullable first) { + this.first = first; + } + + public void setFirst(String first) { + this.first = JsonNullable.of(first); + } + + public TeamsHierarchyLinksResponseLinks last(String last) { + this.last = JsonNullable.of(last); + return this; + } + + /** + * Link to the last page. + * + * @return last + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getLast() { + return last.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_LAST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getLast_JsonNullable() { + return last; + } + + @JsonProperty(JSON_PROPERTY_LAST) + public void setLast_JsonNullable(JsonNullable last) { + this.last = last; + } + + public void setLast(String last) { + this.last = JsonNullable.of(last); + } + + public TeamsHierarchyLinksResponseLinks next(String next) { + this.next = JsonNullable.of(next); + return this; + } + + /** + * Link to the next page. + * + * @return next + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getNext() { + return next.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_NEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getNext_JsonNullable() { + return next; + } + + @JsonProperty(JSON_PROPERTY_NEXT) + public void setNext_JsonNullable(JsonNullable next) { + this.next = next; + } + + public void setNext(String next) { + this.next = JsonNullable.of(next); + } + + public TeamsHierarchyLinksResponseLinks prev(String prev) { + this.prev = JsonNullable.of(prev); + return this; + } + + /** + * Link to the previous page. + * + * @return prev + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getPrev() { + return prev.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_PREV) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getPrev_JsonNullable() { + return prev; + } + + @JsonProperty(JSON_PROPERTY_PREV) + public void setPrev_JsonNullable(JsonNullable prev) { + this.prev = prev; + } + + public void setPrev(String prev) { + this.prev = JsonNullable.of(prev); + } + + public TeamsHierarchyLinksResponseLinks self(String self) { + this.self = self; + return this; + } + + /** + * Link to the current object. + * + * @return self + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SELF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSelf() { + return self; + } + + public void setSelf(String self) { + this.self = self; + } + + /** + * 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 TeamsHierarchyLinksResponseLinks + */ + @JsonAnySetter + public TeamsHierarchyLinksResponseLinks 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 TeamsHierarchyLinksResponseLinks object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamsHierarchyLinksResponseLinks teamsHierarchyLinksResponseLinks = + (TeamsHierarchyLinksResponseLinks) o; + return Objects.equals(this.first, teamsHierarchyLinksResponseLinks.first) + && Objects.equals(this.last, teamsHierarchyLinksResponseLinks.last) + && Objects.equals(this.next, teamsHierarchyLinksResponseLinks.next) + && Objects.equals(this.prev, teamsHierarchyLinksResponseLinks.prev) + && Objects.equals(this.self, teamsHierarchyLinksResponseLinks.self) + && Objects.equals( + this.additionalProperties, teamsHierarchyLinksResponseLinks.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(first, last, next, prev, self, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamsHierarchyLinksResponseLinks {\n"); + sb.append(" first: ").append(toIndentedString(first)).append("\n"); + sb.append(" last: ").append(toIndentedString(last)).append("\n"); + sb.append(" next: ").append(toIndentedString(next)).append("\n"); + sb.append(" prev: ").append(toIndentedString(prev)).append("\n"); + sb.append(" self: ").append(toIndentedString(self)).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/TeamsHierarchyLinksResponseMeta.java b/src/main/java/com/datadog/api/client/v2/model/TeamsHierarchyLinksResponseMeta.java new file mode 100644 index 00000000000..bea1d031703 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamsHierarchyLinksResponseMeta.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; + +/** Team hierarchy links response metadata. */ +@JsonPropertyOrder({TeamsHierarchyLinksResponseMeta.JSON_PROPERTY_PAGE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamsHierarchyLinksResponseMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_PAGE = "page"; + private TeamsHierarchyLinksResponseMetaPage page; + + public TeamsHierarchyLinksResponseMeta page(TeamsHierarchyLinksResponseMetaPage page) { + this.page = page; + this.unparsed |= page.unparsed; + return this; + } + + /** + * Teams hierarchy links response page metadata. + * + * @return page + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamsHierarchyLinksResponseMetaPage getPage() { + return page; + } + + public void setPage(TeamsHierarchyLinksResponseMetaPage page) { + this.page = page; + } + + /** + * 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 TeamsHierarchyLinksResponseMeta + */ + @JsonAnySetter + public TeamsHierarchyLinksResponseMeta 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 TeamsHierarchyLinksResponseMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamsHierarchyLinksResponseMeta teamsHierarchyLinksResponseMeta = + (TeamsHierarchyLinksResponseMeta) o; + return Objects.equals(this.page, teamsHierarchyLinksResponseMeta.page) + && Objects.equals( + this.additionalProperties, teamsHierarchyLinksResponseMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(page, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamsHierarchyLinksResponseMeta {\n"); + sb.append(" page: ").append(toIndentedString(page)).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/TeamsHierarchyLinksResponseMetaPage.java b/src/main/java/com/datadog/api/client/v2/model/TeamsHierarchyLinksResponseMetaPage.java new file mode 100644 index 00000000000..2a8c4fce8e3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamsHierarchyLinksResponseMetaPage.java @@ -0,0 +1,358 @@ +/* + * 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; + +/** Teams hierarchy links response page metadata. */ +@JsonPropertyOrder({ + TeamsHierarchyLinksResponseMetaPage.JSON_PROPERTY_FIRST_NUMBER, + TeamsHierarchyLinksResponseMetaPage.JSON_PROPERTY_LAST_NUMBER, + TeamsHierarchyLinksResponseMetaPage.JSON_PROPERTY_NEXT_NUMBER, + TeamsHierarchyLinksResponseMetaPage.JSON_PROPERTY_NUMBER, + TeamsHierarchyLinksResponseMetaPage.JSON_PROPERTY_PREV_NUMBER, + TeamsHierarchyLinksResponseMetaPage.JSON_PROPERTY_SIZE, + TeamsHierarchyLinksResponseMetaPage.JSON_PROPERTY_TOTAL, + TeamsHierarchyLinksResponseMetaPage.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamsHierarchyLinksResponseMetaPage { + @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 TeamsHierarchyLinksResponseMetaPage 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 TeamsHierarchyLinksResponseMetaPage 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 TeamsHierarchyLinksResponseMetaPage 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 TeamsHierarchyLinksResponseMetaPage 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 TeamsHierarchyLinksResponseMetaPage 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 TeamsHierarchyLinksResponseMetaPage 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 TeamsHierarchyLinksResponseMetaPage 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 TeamsHierarchyLinksResponseMetaPage 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 TeamsHierarchyLinksResponseMetaPage + */ + @JsonAnySetter + public TeamsHierarchyLinksResponseMetaPage 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 TeamsHierarchyLinksResponseMetaPage object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamsHierarchyLinksResponseMetaPage teamsHierarchyLinksResponseMetaPage = + (TeamsHierarchyLinksResponseMetaPage) o; + return Objects.equals(this.firstNumber, teamsHierarchyLinksResponseMetaPage.firstNumber) + && Objects.equals(this.lastNumber, teamsHierarchyLinksResponseMetaPage.lastNumber) + && Objects.equals(this.nextNumber, teamsHierarchyLinksResponseMetaPage.nextNumber) + && Objects.equals(this.number, teamsHierarchyLinksResponseMetaPage.number) + && Objects.equals(this.prevNumber, teamsHierarchyLinksResponseMetaPage.prevNumber) + && Objects.equals(this.size, teamsHierarchyLinksResponseMetaPage.size) + && Objects.equals(this.total, teamsHierarchyLinksResponseMetaPage.total) + && Objects.equals(this.type, teamsHierarchyLinksResponseMetaPage.type) + && Objects.equals( + this.additionalProperties, teamsHierarchyLinksResponseMetaPage.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 TeamsHierarchyLinksResponseMetaPage {\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/cassettes/features/v2/Create_a_team_hierarchy_link_returns_CREATED_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_CREATED_response.freeze new file mode 100644 index 00000000000..5ca151ab8b7 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_CREATED_response.freeze @@ -0,0 +1 @@ +2025-11-24T14:29:58.684Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_CREATED_response.json b/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_CREATED_response.json new file mode 100644 index 00000000000..fb306ed507a --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_CREATED_response.json @@ -0,0 +1,155 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-34095e00d70ee50a\",\"name\":\"test-name-34095e00d70ee50a\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"551c947a-0f0f-4ff0-8c41-0ceddabe3551\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":3,\"created_at\":\"2025-11-24T14:29:59.195740+00:00\",\"description\":null,\"handle\":\"test-handle-34095e00d70ee50a\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T14:29:59.195740+00:00\",\"name\":\"test-name-34095e00d70ee50a\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/551c947a-0f0f-4ff0-8c41-0ceddabe3551/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/551c947a-0f0f-4ff0-8c41-0ceddabe3551/permission-settings\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "b6efdcce-beff-203f-e451-c6d279b6f1c8" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-2-34095e00d70ee50a\",\"name\":\"test-name-2-34095e00d70ee50a\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"e1c6ab08-0325-4df7-aea1-6bec76692d55\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":14,\"created_at\":\"2025-11-24T14:29:59.754699+00:00\",\"description\":null,\"handle\":\"test-handle-2-34095e00d70ee50a\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T14:29:59.754699+00:00\",\"name\":\"test-name-2-34095e00d70ee50a\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/e1c6ab08-0325-4df7-aea1-6bec76692d55/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/e1c6ab08-0325-4df7-aea1-6bec76692d55/permission-settings\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "14ff0479-33ab-31db-16c6-c7cd6b0624ea" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"551c947a-0f0f-4ff0-8c41-0ceddabe3551\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"e1c6ab08-0325-4df7-aea1-6bec76692d55\",\"type\":\"team\"}}},\"type\":\"team_hierarchy_links\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team-hierarchy-links", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"c53bed14-1c0a-4895-b845-1c04be086ba0\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2025-11-24T14:30:00.032477595Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"551c947a-0f0f-4ff0-8c41-0ceddabe3551\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"e1c6ab08-0325-4df7-aea1-6bec76692d55\",\"type\":\"team\"}}}},\"included\":[{\"id\":\"551c947a-0f0f-4ff0-8c41-0ceddabe3551\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":3,\"handle\":\"test-handle-34095e00d70ee50a\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-34095e00d70ee50a\",\"summary\":null,\"user_count\":0}},{\"id\":\"e1c6ab08-0325-4df7-aea1-6bec76692d55\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":14,\"handle\":\"test-handle-2-34095e00d70ee50a\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-2-34095e00d70ee50a\",\"summary\":null,\"user_count\":0}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ebb0e177-162b-d934-64de-74ac3cef2e38" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team-hierarchy-links/c53bed14-1c0a-4895-b845-1c04be086ba0", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "d75ce0db-fd36-b7bb-af8a-bdb42e98c73e" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/e1c6ab08-0325-4df7-aea1-6bec76692d55", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6d81924b-f5b8-653f-44e5-ac1455978289" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/551c947a-0f0f-4ff0-8c41-0ceddabe3551", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "bc39bebd-acee-3cfe-a04d-975a22d8bd87" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_Conflict_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_Conflict_response.freeze new file mode 100644 index 00000000000..4da94657eeb --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_Conflict_response.freeze @@ -0,0 +1 @@ +2025-11-24T17:06:46.856Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_Conflict_response.json b/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_Conflict_response.json new file mode 100644 index 00000000000..01394f19e95 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_Conflict_response.json @@ -0,0 +1,185 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-6c891437b748aea8\",\"name\":\"test-name-6c891437b748aea8\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":0,\"created_at\":\"2025-11-24T17:06:47.453319+00:00\",\"description\":null,\"handle\":\"test-handle-6c891437b748aea8\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T17:06:47.453319+00:00\",\"name\":\"test-name-6c891437b748aea8\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87/permission-settings\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "adf5deff-6dc2-c965-d647-9abfd55aaf51" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-2-6c891437b748aea8\",\"name\":\"test-name-2-6c891437b748aea8\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"21296c73-c9e2-4889-a33f-417d2974b2bd\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":2,\"created_at\":\"2025-11-24T17:06:48.020887+00:00\",\"description\":null,\"handle\":\"test-handle-2-6c891437b748aea8\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T17:06:48.020887+00:00\",\"name\":\"test-name-2-6c891437b748aea8\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/21296c73-c9e2-4889-a33f-417d2974b2bd/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/21296c73-c9e2-4889-a33f-417d2974b2bd/permission-settings\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "37f9b24b-2c32-3ffb-9c59-63c23ea57a89" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"21296c73-c9e2-4889-a33f-417d2974b2bd\",\"type\":\"team\"}}},\"type\":\"team_hierarchy_links\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team-hierarchy-links", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"e980108e-d535-4bdf-84ca-5e8f84a68480\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2025-11-24T17:06:48.279316439Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"21296c73-c9e2-4889-a33f-417d2974b2bd\",\"type\":\"team\"}}}},\"included\":[{\"id\":\"4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":0,\"handle\":\"test-handle-6c891437b748aea8\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-6c891437b748aea8\",\"summary\":null,\"user_count\":0}},{\"id\":\"21296c73-c9e2-4889-a33f-417d2974b2bd\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":2,\"handle\":\"test-handle-2-6c891437b748aea8\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-2-6c891437b748aea8\",\"summary\":null,\"user_count\":0}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "267eba7d-1710-0a48-2168-9df14ad63c61" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"21296c73-c9e2-4889-a33f-417d2974b2bd\",\"type\":\"team\"}}},\"type\":\"team_hierarchy_links\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team-hierarchy-links", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"Conflict: could not add team 21296c73-c9e2-4889-a33f-417d2974b2bd as a member team of team 4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87 in org 321813: team hierarchy link between super team 4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87 and member team 21296c73-c9e2-4889-a33f-417d2974b2bd already exists in org 321813\"]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 409, + "reasonPhrase": "Conflict" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "267eba7d-1710-0a48-2168-9df14ad63c62" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team-hierarchy-links/e980108e-d535-4bdf-84ca-5e8f84a68480", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "43a96ba1-e2d1-5111-86d4-d9cc8c497fed" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/21296c73-c9e2-4889-a33f-417d2974b2bd", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "47b09fbf-2ee1-3d4c-d9b8-8682d56a87a1" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "0b87c8a4-1da2-68e8-f817-61e5b6974c1e" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_OK_response.freeze new file mode 100644 index 00000000000..bf8a8d4fa45 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-11-24T16:01:16.053Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_OK_response.json new file mode 100644 index 00000000000..d71b7d36f20 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_OK_response.json @@ -0,0 +1,155 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-4d8084da4dfa4ed8\",\"name\":\"test-name-4d8084da4dfa4ed8\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"d5b049f4-59f1-474d-ad98-5a7342a8961f\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":11,\"created_at\":\"2025-11-24T16:01:16.149673+00:00\",\"description\":null,\"handle\":\"test-handle-4d8084da4dfa4ed8\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T16:01:16.149673+00:00\",\"name\":\"test-name-4d8084da4dfa4ed8\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/d5b049f4-59f1-474d-ad98-5a7342a8961f/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/d5b049f4-59f1-474d-ad98-5a7342a8961f/permission-settings\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "f51dc8b1-f646-051d-3017-2e2e4672585c" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-2-4d8084da4dfa4ed8\",\"name\":\"test-name-2-4d8084da4dfa4ed8\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"790428f6-10bc-427d-bf36-f53ca3c197e0\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":4,\"created_at\":\"2025-11-24T16:01:16.315013+00:00\",\"description\":null,\"handle\":\"test-handle-2-4d8084da4dfa4ed8\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T16:01:16.315013+00:00\",\"name\":\"test-name-2-4d8084da4dfa4ed8\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/790428f6-10bc-427d-bf36-f53ca3c197e0/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/790428f6-10bc-427d-bf36-f53ca3c197e0/permission-settings\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e7e795a9-a0a4-0b1f-3108-a95eb0c0845a" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"d5b049f4-59f1-474d-ad98-5a7342a8961f\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"790428f6-10bc-427d-bf36-f53ca3c197e0\",\"type\":\"team\"}}},\"type\":\"team_hierarchy_links\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team-hierarchy-links", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"6cf86539-2c6e-497e-8cef-0b285ff05514\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2025-11-24T16:01:16.460042023Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"d5b049f4-59f1-474d-ad98-5a7342a8961f\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"790428f6-10bc-427d-bf36-f53ca3c197e0\",\"type\":\"team\"}}}},\"included\":[{\"id\":\"d5b049f4-59f1-474d-ad98-5a7342a8961f\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":11,\"handle\":\"test-handle-4d8084da4dfa4ed8\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-4d8084da4dfa4ed8\",\"summary\":null,\"user_count\":0}},{\"id\":\"790428f6-10bc-427d-bf36-f53ca3c197e0\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":4,\"handle\":\"test-handle-2-4d8084da4dfa4ed8\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-2-4d8084da4dfa4ed8\",\"summary\":null,\"user_count\":0}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "cbc1af8b-d3fa-ae42-69f6-3ec95d122c37" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team-hierarchy-links/6cf86539-2c6e-497e-8cef-0b285ff05514", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6453e612-5ae8-3962-a8a9-439efd6fd387" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/790428f6-10bc-427d-bf36-f53ca3c197e0", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "03667a10-74b0-5151-c93a-8caa250c0b2d" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/d5b049f4-59f1-474d-ad98-5a7342a8961f", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6f791bb8-4f5b-af6e-3abb-6198566110c1" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_SUCCESS_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_SUCCESS_response.freeze new file mode 100644 index 00000000000..e4ed51cc867 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_SUCCESS_response.freeze @@ -0,0 +1 @@ +2025-11-24T15:48:39.900Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_SUCCESS_response.json b/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_SUCCESS_response.json new file mode 100644 index 00000000000..657d9abcc3c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_SUCCESS_response.json @@ -0,0 +1,155 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-a75ee0b8b483d66f\",\"name\":\"test-name-a75ee0b8b483d66f\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":3,\"created_at\":\"2025-11-24T15:48:40.359260+00:00\",\"description\":null,\"handle\":\"test-handle-a75ee0b8b483d66f\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T15:48:40.359261+00:00\",\"name\":\"test-name-a75ee0b8b483d66f\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd/permission-settings\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "a2753edb-970c-fffe-b922-aed09f6fdbdc" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-2-a75ee0b8b483d66f\",\"name\":\"test-name-2-a75ee0b8b483d66f\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"2d096572-eb6a-4579-ba38-b4247cf75e17\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":8,\"created_at\":\"2025-11-24T15:48:40.893488+00:00\",\"description\":null,\"handle\":\"test-handle-2-a75ee0b8b483d66f\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T15:48:40.893488+00:00\",\"name\":\"test-name-2-a75ee0b8b483d66f\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/2d096572-eb6a-4579-ba38-b4247cf75e17/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/2d096572-eb6a-4579-ba38-b4247cf75e17/permission-settings\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "f158473a-07cd-c089-2d92-0faf55be902d" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"2d096572-eb6a-4579-ba38-b4247cf75e17\",\"type\":\"team\"}}},\"type\":\"team_hierarchy_links\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team-hierarchy-links", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"fb94d43b-fe10-4c5f-ae7c-4ad745428651\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2025-11-24T15:48:41.150923395Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"2d096572-eb6a-4579-ba38-b4247cf75e17\",\"type\":\"team\"}}}},\"included\":[{\"id\":\"b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":3,\"handle\":\"test-handle-a75ee0b8b483d66f\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-a75ee0b8b483d66f\",\"summary\":null,\"user_count\":0}},{\"id\":\"2d096572-eb6a-4579-ba38-b4247cf75e17\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":8,\"handle\":\"test-handle-2-a75ee0b8b483d66f\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-2-a75ee0b8b483d66f\",\"summary\":null,\"user_count\":0}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "8ef0058d-92ab-3007-6975-11d2bed31ad6" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team-hierarchy-links/fb94d43b-fe10-4c5f-ae7c-4ad745428651", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "b586f65c-5e8c-5c75-934c-2310020328b2" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/2d096572-eb6a-4579-ba38-b4247cf75e17", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "df534d51-8851-12f9-7264-0ec13f719086" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "10a7d2f1-489b-3643-d02d-08eeed113a13" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_team_hierarchy_link_returns_API_error_response_response.freeze b/src/test/resources/cassettes/features/v2/Get_a_team_hierarchy_link_returns_API_error_response_response.freeze new file mode 100644 index 00000000000..21b6221c0da --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_team_hierarchy_link_returns_API_error_response_response.freeze @@ -0,0 +1 @@ +2025-11-24T13:19:11.816Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_team_hierarchy_link_returns_API_error_response_response.json b/src/test/resources/cassettes/features/v2/Get_a_team_hierarchy_link_returns_API_error_response_response.json new file mode 100644 index 00000000000..5fd85dfe4d2 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_team_hierarchy_link_returns_API_error_response_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/team-hierarchy-links/aaa11111-aa11-aa11-aaaa-aaaaaa111111", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"Not Found: team hierarchy link not found (linkId=aaa11111-aa11-aa11-aaaa-aaaaaa111111)\"]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "c4e82909-dd35-3220-4c88-18e59e6b3249" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_team_hierarchy_link_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_a_team_hierarchy_link_returns_OK_response.freeze new file mode 100644 index 00000000000..be8e0fd4a38 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_team_hierarchy_link_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-11-24T17:07:09.212Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_team_hierarchy_link_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_a_team_hierarchy_link_returns_OK_response.json new file mode 100644 index 00000000000..16c9f0932d5 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_team_hierarchy_link_returns_OK_response.json @@ -0,0 +1,181 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-ae3e76a23be3747a\",\"name\":\"test-name-ae3e76a23be3747a\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"fafeac94-42b4-4469-91e8-0ae5ca3f564b\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":11,\"created_at\":\"2025-11-24T17:07:09.817794+00:00\",\"description\":null,\"handle\":\"test-handle-ae3e76a23be3747a\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T17:07:09.817794+00:00\",\"name\":\"test-name-ae3e76a23be3747a\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/fafeac94-42b4-4469-91e8-0ae5ca3f564b/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/fafeac94-42b4-4469-91e8-0ae5ca3f564b/permission-settings\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "799e86d0-e894-7671-30bc-91ff5c599a26" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-2-ae3e76a23be3747a\",\"name\":\"test-name-2-ae3e76a23be3747a\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"196bcc55-bd30-4cfd-8549-b3d255a0517b\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":4,\"created_at\":\"2025-11-24T17:07:10.381761+00:00\",\"description\":null,\"handle\":\"test-handle-2-ae3e76a23be3747a\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T17:07:10.381761+00:00\",\"name\":\"test-name-2-ae3e76a23be3747a\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/196bcc55-bd30-4cfd-8549-b3d255a0517b/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/196bcc55-bd30-4cfd-8549-b3d255a0517b/permission-settings\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "204f2b1e-ad63-f2cd-7450-28e92c8c13a0" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"fafeac94-42b4-4469-91e8-0ae5ca3f564b\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"196bcc55-bd30-4cfd-8549-b3d255a0517b\",\"type\":\"team\"}}},\"type\":\"team_hierarchy_links\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team-hierarchy-links", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"5401e712-de1b-4deb-ac35-2c6ee1943ad0\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2025-11-24T17:07:10.643798843Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"fafeac94-42b4-4469-91e8-0ae5ca3f564b\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"196bcc55-bd30-4cfd-8549-b3d255a0517b\",\"type\":\"team\"}}}},\"included\":[{\"id\":\"fafeac94-42b4-4469-91e8-0ae5ca3f564b\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":11,\"handle\":\"test-handle-ae3e76a23be3747a\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-ae3e76a23be3747a\",\"summary\":null,\"user_count\":0}},{\"id\":\"196bcc55-bd30-4cfd-8549-b3d255a0517b\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":4,\"handle\":\"test-handle-2-ae3e76a23be3747a\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-2-ae3e76a23be3747a\",\"summary\":null,\"user_count\":0}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e977f4ab-a3b3-ed38-ae02-cab7cdbd1751" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/team-hierarchy-links/5401e712-de1b-4deb-ac35-2c6ee1943ad0", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"5401e712-de1b-4deb-ac35-2c6ee1943ad0\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2025-11-24T17:07:10.643799Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"fafeac94-42b4-4469-91e8-0ae5ca3f564b\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"196bcc55-bd30-4cfd-8549-b3d255a0517b\",\"type\":\"team\"}}}},\"links\":{\"self\":\"https://api.datadoghq.com/api/v2/team-hierarchy-links/5401e712-de1b-4deb-ac35-2c6ee1943ad0\"},\"included\":[{\"id\":\"196bcc55-bd30-4cfd-8549-b3d255a0517b\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":4,\"handle\":\"test-handle-2-ae3e76a23be3747a\",\"is_managed\":false,\"is_open_membership\":true,\"link_count\":0,\"name\":\"test-name-2-ae3e76a23be3747a\",\"summary\":null,\"user_count\":0}},{\"id\":\"fafeac94-42b4-4469-91e8-0ae5ca3f564b\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":11,\"handle\":\"test-handle-ae3e76a23be3747a\",\"is_managed\":false,\"is_open_membership\":true,\"link_count\":0,\"name\":\"test-name-ae3e76a23be3747a\",\"summary\":null,\"user_count\":0}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "cc894026-b05c-6521-1b8e-356dfa0a73eb" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team-hierarchy-links/5401e712-de1b-4deb-ac35-2c6ee1943ad0", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "8056212d-8b1d-a7f5-40ee-5746517e097a" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/196bcc55-bd30-4cfd-8549-b3d255a0517b", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "586f38aa-ff9d-0a61-8099-35af45195b9e" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/fafeac94-42b4-4469-91e8-0ae5ca3f564b", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "a8a73b2a-08ce-e2eb-7d4e-7aaa724beafc" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_team_hierarchy_links_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_team_hierarchy_links_returns_OK_response.freeze new file mode 100644 index 00000000000..1d3731961ea --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_team_hierarchy_links_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-11-24T17:18:13.180Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_team_hierarchy_links_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_team_hierarchy_links_returns_OK_response.json new file mode 100644 index 00000000000..b37bf1a1702 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_team_hierarchy_links_returns_OK_response.json @@ -0,0 +1,195 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-ab0ee85594ae1dfd\",\"name\":\"test-name-ab0ee85594ae1dfd\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"d1baf3de-7316-43b5-8582-dc887acc26ef\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":6,\"created_at\":\"2025-11-24T17:18:13.814865+00:00\",\"description\":null,\"handle\":\"test-handle-ab0ee85594ae1dfd\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T17:18:13.814865+00:00\",\"name\":\"test-name-ab0ee85594ae1dfd\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/d1baf3de-7316-43b5-8582-dc887acc26ef/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/d1baf3de-7316-43b5-8582-dc887acc26ef/permission-settings\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "093aa88f-7ea9-46d8-2113-cff45a47e3d2" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-2-ab0ee85594ae1dfd\",\"name\":\"test-name-2-ab0ee85594ae1dfd\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":13,\"created_at\":\"2025-11-24T17:18:14.383042+00:00\",\"description\":null,\"handle\":\"test-handle-2-ab0ee85594ae1dfd\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T17:18:14.383042+00:00\",\"name\":\"test-name-2-ab0ee85594ae1dfd\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/61b0ab36-c1e5-47fd-898a-ba9bfc860e9d/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/61b0ab36-c1e5-47fd-898a-ba9bfc860e9d/permission-settings\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "cf77824c-0d3e-3bdc-25a9-32a44f937627" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"d1baf3de-7316-43b5-8582-dc887acc26ef\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\",\"type\":\"team\"}}},\"type\":\"team_hierarchy_links\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team-hierarchy-links", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"61509612-5bb0-42c5-a16e-bf4920acf473\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2025-11-24T17:18:14.635205462Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"d1baf3de-7316-43b5-8582-dc887acc26ef\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\",\"type\":\"team\"}}}},\"included\":[{\"id\":\"d1baf3de-7316-43b5-8582-dc887acc26ef\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":6,\"handle\":\"test-handle-ab0ee85594ae1dfd\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-ab0ee85594ae1dfd\",\"summary\":null,\"user_count\":0}},{\"id\":\"61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":13,\"handle\":\"test-handle-2-ab0ee85594ae1dfd\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-2-ab0ee85594ae1dfd\",\"summary\":null,\"user_count\":0}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "438095ff-e9ea-20dc-a602-6521b23a66ff" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/team-hierarchy-links", + "queryStringParameters": { + "filter[parent_team]": [ + "d1baf3de-7316-43b5-8582-dc887acc26ef" + ], + "filter[sub_team]": [ + "61b0ab36-c1e5-47fd-898a-ba9bfc860e9d" + ], + "page[number]": [ + "0" + ], + "page[size]": [ + "100" + ] + }, + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"id\":\"61509612-5bb0-42c5-a16e-bf4920acf473\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2025-11-24T17:18:14.635205Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"d1baf3de-7316-43b5-8582-dc887acc26ef\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\",\"type\":\"team\"}}}}],\"meta\":{\"page\":{\"type\":\"number_size\",\"number\":0,\"size\":100,\"total\":1,\"first_number\":0,\"prev_number\":null,\"next_number\":null,\"last_number\":0}},\"links\":{\"self\":\"https://api.datadoghq.com/api/v2/team-hierarchy-links?filter%5Bparent_team%5D=d1baf3de-7316-43b5-8582-dc887acc26ef\\u0026filter%5Bsub_team%5D=61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\\u0026page%5Bnumber%5D=0\\u0026page%5Bsize%5D=100\",\"first\":\"https://api.datadoghq.com/api/v2/team-hierarchy-links?filter[parent_team]=d1baf3de-7316-43b5-8582-dc887acc26ef\\u0026filter[sub_team]=61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\\u0026page[number]=0\\u0026page[size]=100\",\"last\":\"https://api.datadoghq.com/api/v2/team-hierarchy-links?filter[parent_team]=d1baf3de-7316-43b5-8582-dc887acc26ef\\u0026filter[sub_team]=61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\\u0026page[number]=0\\u0026page[size]=100\"},\"included\":[{\"id\":\"61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":13,\"handle\":\"test-handle-2-ab0ee85594ae1dfd\",\"is_managed\":false,\"is_open_membership\":true,\"link_count\":0,\"name\":\"test-name-2-ab0ee85594ae1dfd\",\"summary\":null,\"user_count\":0}},{\"id\":\"d1baf3de-7316-43b5-8582-dc887acc26ef\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":6,\"handle\":\"test-handle-ab0ee85594ae1dfd\",\"is_managed\":false,\"is_open_membership\":true,\"link_count\":0,\"name\":\"test-name-ab0ee85594ae1dfd\",\"summary\":null,\"user_count\":0}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "30a85d94-f55c-f421-b4cd-9237fe54b4b4" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team-hierarchy-links/61509612-5bb0-42c5-a16e-bf4920acf473", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6328f8cc-535e-dc28-83dc-a930b551cd1b" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/61b0ab36-c1e5-47fd-898a-ba9bfc860e9d", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "55c11b3f-b0bd-6d61-e5cb-f13a96303649" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/d1baf3de-7316-43b5-8582-dc887acc26ef", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "23b646bc-99d2-8db4-7fbb-7c5ccbc4ee00" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Remove_a_team_hierarchy_link_returns_API_error_response_response.freeze b/src/test/resources/cassettes/features/v2/Remove_a_team_hierarchy_link_returns_API_error_response_response.freeze new file mode 100644 index 00000000000..73f686747b4 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Remove_a_team_hierarchy_link_returns_API_error_response_response.freeze @@ -0,0 +1 @@ +2025-11-24T13:14:20.481Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Remove_a_team_hierarchy_link_returns_API_error_response_response.json b/src/test/resources/cassettes/features/v2/Remove_a_team_hierarchy_link_returns_API_error_response_response.json new file mode 100644 index 00000000000..cf5e8c45054 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Remove_a_team_hierarchy_link_returns_API_error_response_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team-hierarchy-links/aaa11111-aa11-aa11-aaaa-aaaaaa111111", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"Not Found: link with id aaa11111-aa11-aa11-aaaa-aaaaaa111111 not found\"]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "360527a7-cd17-c12c-763c-534ca0bf2e10" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Remove_a_team_hierarchy_link_returns_No_Content_response.freeze b/src/test/resources/cassettes/features/v2/Remove_a_team_hierarchy_link_returns_No_Content_response.freeze new file mode 100644 index 00000000000..be1311ed7c9 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Remove_a_team_hierarchy_link_returns_No_Content_response.freeze @@ -0,0 +1 @@ +2025-11-24T17:08:01.196Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Remove_a_team_hierarchy_link_returns_No_Content_response.json b/src/test/resources/cassettes/features/v2/Remove_a_team_hierarchy_link_returns_No_Content_response.json new file mode 100644 index 00000000000..6460e4fb5da --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Remove_a_team_hierarchy_link_returns_No_Content_response.json @@ -0,0 +1,181 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-db31819631324305\",\"name\":\"test-name-db31819631324305\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"eaf01981-6b63-41ba-b49f-30449c50e865\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":10,\"created_at\":\"2025-11-24T17:08:01.930314+00:00\",\"description\":null,\"handle\":\"test-handle-db31819631324305\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T17:08:01.930314+00:00\",\"name\":\"test-name-db31819631324305\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/eaf01981-6b63-41ba-b49f-30449c50e865/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/eaf01981-6b63-41ba-b49f-30449c50e865/permission-settings\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "83a592d3-fc05-7f6c-2225-6a804b6cb3fd" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-2-db31819631324305\",\"name\":\"test-name-2-db31819631324305\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"120aeb27-ca42-4e38-a9e4-6497b8f9407c\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":6,\"created_at\":\"2025-11-24T17:08:02.174211+00:00\",\"description\":null,\"handle\":\"test-handle-2-db31819631324305\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T17:08:02.174211+00:00\",\"name\":\"test-name-2-db31819631324305\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/120aeb27-ca42-4e38-a9e4-6497b8f9407c/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/120aeb27-ca42-4e38-a9e4-6497b8f9407c/permission-settings\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "60fd2072-6a36-5270-a7ac-420092d128f7" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"eaf01981-6b63-41ba-b49f-30449c50e865\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"120aeb27-ca42-4e38-a9e4-6497b8f9407c\",\"type\":\"team\"}}},\"type\":\"team_hierarchy_links\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team-hierarchy-links", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"185446b8-1e88-419c-b266-3933f1411b6e\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2025-11-24T17:08:02.736655421Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"eaf01981-6b63-41ba-b49f-30449c50e865\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"120aeb27-ca42-4e38-a9e4-6497b8f9407c\",\"type\":\"team\"}}}},\"included\":[{\"id\":\"eaf01981-6b63-41ba-b49f-30449c50e865\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":10,\"handle\":\"test-handle-db31819631324305\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-db31819631324305\",\"summary\":null,\"user_count\":0}},{\"id\":\"120aeb27-ca42-4e38-a9e4-6497b8f9407c\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":6,\"handle\":\"test-handle-2-db31819631324305\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-2-db31819631324305\",\"summary\":null,\"user_count\":0}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "1ed15f6e-36fe-e51e-ffaa-3009d34464e7" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team-hierarchy-links/185446b8-1e88-419c-b266-3933f1411b6e", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "954ab98a-3b9c-8c13-b2fa-c9692349b4a9" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team-hierarchy-links/185446b8-1e88-419c-b266-3933f1411b6e", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"Not Found: link with id 185446b8-1e88-419c-b266-3933f1411b6e not found\"]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "954ab98a-3b9c-8c13-b2fa-c9692349b4aa" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/120aeb27-ca42-4e38-a9e4-6497b8f9407c", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "eab70343-b6b4-67c9-8bcc-3a1ac13f5c75" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/eaf01981-6b63-41ba-b49f-30449c50e865", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "d01fd700-c1e5-677d-4032-73e8d5805ab6" + } +] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/given.json b/src/test/resources/com/datadog/api/client/v2/api/given.json index 198c7af1b51..64b50d8057c 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/given.json +++ b/src/test/resources/com/datadog/api/client/v2/api/given.json @@ -1169,6 +1169,30 @@ "tag": "Teams", "operationId": "CreateTeam" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"handle\": \"test-handle-2-{{ unique_hash }}\",\n \"name\": \"test-name-2-{{ unique_hash }}\"\n },\n \"type\": \"team\"\n }\n}" + } + ], + "step": "there is a valid \"dd_team_2\" in the system", + "key": "dd_team_2", + "tag": "Teams", + "operationId": "CreateTeam" + }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"team_hierarchy_links\",\n \"relationships\": {\n \"parent_team\": {\n \"data\": {\n \"id\": \"{{ dd_team.data.id }}\",\n \"type\": \"team\"\n }\n },\n \"sub_team\": {\n \"data\": {\n \"id\": \"{{ dd_team_2.data.id }}\",\n \"type\": \"team\"\n }\n }\n }\n }\n}" + } + ], + "step": "there is a valid \"team_hierarchy_link\" in the system", + "key": "team_hierarchy_link", + "tag": "Teams", + "operationId": "AddTeamHierarchyLink" + }, { "source": "data.data[0]", "step": "there is a valid \"team_connection\" in the system", 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 bf11bd0316d..885a804a37c 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 @@ -43,6 +43,25 @@ Feature: Teams When the request is sent Then the response status is 200 Represents a user's association to a team + @team:DataDog/aaa-omg + Scenario: Create a team hierarchy link returns "Conflict" response + Given new "AddTeamHierarchyLink" request + And there is a valid "dd_team" in the system + And there is a valid "dd_team_2" in the system + And there is a valid "team_hierarchy_link" in the system + And body with value {"data": {"relationships": {"parent_team": {"data": {"id": "{{team_hierarchy_link.data.relationships.parent_team.data.id}}", "type": "team"}}, "sub_team": {"data": {"id": "{{team_hierarchy_link.data.relationships.sub_team.data.id}}", "type": "team"}}}, "type": "team_hierarchy_links"}} + When the request is sent + Then the response status is 409 Conflict + + @team:DataDog/aaa-omg + Scenario: Create a team hierarchy link returns "OK" response + Given new "AddTeamHierarchyLink" request + And there is a valid "dd_team" in the system + And there is a valid "dd_team_2" in the system + And body with value {"data": {"relationships": {"parent_team": {"data": {"id": "{{dd_team.data.id}}", "type": "team"}}, "sub_team": {"data": {"id": "{{dd_team_2.data.id}}", "type": "team"}}}, "type": "team_hierarchy_links"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/aaa-omg Scenario: Create a team link returns "API error response." response Given new "CreateTeamLink" request @@ -96,6 +115,28 @@ Feature: Teams And the response "data.attributes.visible_modules" is equal to ["m1","m2"] And the response "data.attributes.hidden_modules" is equal to ["m3"] + @team:DataDog/aaa-omg + Scenario: Get a team hierarchy link returns "API error response." response + Given new "GetTeamHierarchyLink" request + And request contains "link_id" parameter with value "aaa11111-aa11-aa11-aaaa-aaaaaa111111" + When the request is sent + Then the response status is 404 API error response. + + @team:DataDog/aaa-omg + Scenario: Get a team hierarchy link returns "OK" response + Given new "GetTeamHierarchyLink" request + And there is a valid "dd_team" in the system + And there is a valid "dd_team_2" in the system + And there is a valid "team_hierarchy_link" in the system + And request contains "link_id" parameter from "team_hierarchy_link.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "{{ team_hierarchy_link.data.id }}" + And the response "data.relationships.parent_team.data.id" is equal to "{{ dd_team.data.id }}" + And the response "data.relationships.sub_team.data.id" is equal to "{{ dd_team_2.data.id }}" + And the response "included" has item with field "id" with value "{{ dd_team.data.id }}" + And the response "included" has item with field "id" with value "{{ dd_team_2.data.id }}" + @team:DataDog/aaa-omg Scenario: Get a team link returns "API error response." response Given new "GetTeamLink" request @@ -211,6 +252,31 @@ Feature: Teams When the request is sent Then the response status is 200 OK + @team:DataDog/aaa-omg + Scenario: Get team hierarchy links returns "OK" response + Given new "GetTeamHierarchyLinks" request + And there is a valid "dd_team" in the system + And there is a valid "dd_team_2" in the system + And there is a valid "team_hierarchy_link" in the system + And request contains "filter[parent_team]" parameter from "team_hierarchy_link.data.relationships.parent_team.data.id" + And request contains "filter[sub_team]" parameter from "team_hierarchy_link.data.relationships.sub_team.data.id" + And request contains "page[number]" parameter with value 0 + And request contains "page[size]" parameter with value 100 + When the request is sent + Then the response status is 200 OK + And the response "data" has length 1 + And the response "data[0].id" is equal to "{{ team_hierarchy_link.data.id }}" + And the response "data[0].relationships.parent_team.data.id" is equal to "{{ dd_team.data.id }}" + And the response "data[0].relationships.sub_team.data.id" is equal to "{{ dd_team_2.data.id }}" + And the response "included" has item with field "id" with value "{{ dd_team.data.id }}" + And the response "included" has item with field "id" with value "{{ dd_team_2.data.id }}" + + @generated @skip @team:DataDog/aaa-omg @with-pagination + Scenario: Get team hierarchy links returns "OK" response with pagination + Given new "GetTeamHierarchyLinks" request + When the request with pagination is sent + Then the response status is 200 OK + @team:DataDog/aaa-omg Scenario: Get team memberships returns "API error response." response Given new "GetTeamMemberships" request @@ -293,6 +359,23 @@ Feature: Teams When the request is sent Then the response status is 204 No Content + @team:DataDog/aaa-omg + Scenario: Remove a team hierarchy link returns "API error response." response + Given new "RemoveTeamHierarchyLink" request + And request contains "link_id" parameter with value "aaa11111-aa11-aa11-aaaa-aaaaaa111111" + When the request is sent + Then the response status is 404 API error response. + + @team:DataDog/aaa-omg + Scenario: Remove a team hierarchy link returns "No Content" response + Given new "RemoveTeamHierarchyLink" request + And there is a valid "dd_team" in the system + And there is a valid "dd_team_2" in the system + And there is a valid "team_hierarchy_link" in the system + And request contains "link_id" parameter from "team_hierarchy_link.data.id" + When the request is sent + Then the response status is 204 No Content + @team:DataDog/aaa-omg Scenario: Remove a team link returns "API error response." response Given new "DeleteTeamLink" request 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 3799e64e630..55b43323024 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 @@ -4345,6 +4345,37 @@ "type": "unsafe" } }, + "GetTeamHierarchyLinks": { + "tag": "Teams", + "undo": { + "type": "safe" + } + }, + "AddTeamHierarchyLink": { + "tag": "Teams", + "undo": { + "operationId": "RemoveTeamHierarchyLink", + "parameters": [ + { + "name": "link_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "RemoveTeamHierarchyLink": { + "tag": "Teams", + "undo": { + "type": "idempotent" + } + }, + "GetTeamHierarchyLink": { + "tag": "Teams", + "undo": { + "type": "safe" + } + }, "DeleteTeamConnections": { "tag": "Team Connections", "undo": {