diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 9bceb715496..382f5391507 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -52016,6 +52016,205 @@ 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 + 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 + - attributes + 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 +53094,70 @@ 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 + type: integer + number: + description: Page number. + format: int64 + type: integer + prev_number: + description: Previous page number. + format: int64 + type: integer + size: + description: Page size. + format: int64 + type: integer + total: + description: Total number of results. + format: int64 + type: integer + type: + description: Offset type. + type: string + type: object TeamsResponse: description: Response with multiple teams properties: @@ -81999,6 +82262,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: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamHierarchyLinkResponse' + description: CREATED + '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 +82700,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 +82759,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 +82812,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 +82863,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..4360744bba9 --- /dev/null +++ b/examples/v2/teams/AddTeamHierarchyLink.java @@ -0,0 +1,51 @@ +// Create a team hierarchy link returns "CREATED" 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); + + TeamHierarchyLinkCreateRequest body = + new TeamHierarchyLinkCreateRequest() + .data( + new TeamHierarchyLinkCreate() + .relationships( + new TeamHierarchyLinkCreateRelationships() + .parentTeam( + new TeamHierarchyLinkCreateTeamRelationship() + .data( + new TeamHierarchyLinkCreateTeam() + .id("692e8073-12c4-4c71-8408-5090bd44c9c8") + .type(TeamType.TEAM))) + .subTeam( + new TeamHierarchyLinkCreateTeamRelationship() + .data( + new TeamHierarchyLinkCreateTeam() + .id("692e8073-12c4-4c71-8408-5090bd44c9c8") + .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..e2307fa0063 --- /dev/null +++ b/examples/v2/teams/GetTeamHierarchyLink.java @@ -0,0 +1,24 @@ +// 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); + + try { + TeamHierarchyLinkResponse result = apiInstance.getTeamHierarchyLink("link_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..4ce66cc76b8 --- /dev/null +++ b/examples/v2/teams/GetTeamHierarchyLinks.java @@ -0,0 +1,24 @@ +// 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.model.TeamHierarchyLinksResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + TeamsApi apiInstance = new TeamsApi(defaultClient); + + try { + TeamHierarchyLinksResponse result = apiInstance.getTeamHierarchyLinks(); + 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..4016a32f108 --- /dev/null +++ b/examples/v2/teams/RemoveTeamHierarchyLink.java @@ -0,0 +1,22 @@ +// 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); + + try { + apiInstance.removeTeamHierarchyLink("link_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..a52dee1c5fb 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
201 CREATED -
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/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..f9dcdd9e7b7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkResponse.java @@ -0,0 +1,180 @@ +/* + * 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 +}) +@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 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; + } + + /** + * 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.additionalProperties, teamHierarchyLinkResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, 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(" 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..72f9372b5db --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkTeam.java @@ -0,0 +1,209 @@ +/* + * 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_ATTRIBUTES) + TeamHierarchyLinkTeamAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) TeamType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + 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 + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + 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..d63d0468d6f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamsHierarchyLinksResponseMetaPage.java @@ -0,0 +1,337 @@ +/* + * 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; + +/** 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 Long nextNumber; + + public static final String JSON_PROPERTY_NUMBER = "number"; + private Long number; + + public static final String JSON_PROPERTY_PREV_NUMBER = "prev_number"; + private Long prevNumber; + + 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 = nextNumber; + return this; + } + + /** + * Next page number. + * + * @return nextNumber + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NEXT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getNextNumber() { + return nextNumber; + } + + public void setNextNumber(Long nextNumber) { + this.nextNumber = 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 = prevNumber; + return this; + } + + /** + * Previous page number. + * + * @return prevNumber + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREV_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPrevNumber() { + return prevNumber; + } + + public void setPrevNumber(Long prevNumber) { + this.prevNumber = 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; + } + + /** + * Offset 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/com/datadog/api/client/v2/api/given.json b/src/test/resources/com/datadog/api/client/v2/api/given.json index 198c7af1b51..52692e0bcb3 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,18 @@ "tag": "Teams", "operationId": "CreateTeam" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"team_hierarchy_links\",\n \"attributes\": {\n \"created_at\": \"2025-07-16T19:56:30.033205Z\",\n \"provisioned_by\": \"\"\n },\n \"relationships\": {\n \"parent_team\": {\n \"data\": {\n \"id\": \"9f3bae64-7d3b-4f27-8768-9ecb66ddd15f\",\n \"type\": \"team\"\n }\n },\n \"sub_team\": {\n \"data\": {\n \"id\": \"053b5ece-bca2-420a-b303-e07919e979b1\",\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..460c9aeaf62 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,20 @@ Feature: Teams When the request is sent Then the response status is 200 Represents a user's association to a team + @generated @skip @team:DataDog/aaa-omg + Scenario: Create a team hierarchy link returns "CREATED" response + Given new "AddTeamHierarchyLink" request + And body with value {"data": {"relationships": {"parent_team": {"data": {"id": "692e8073-12c4-4c71-8408-5090bd44c9c8", "type": "team"}}, "sub_team": {"data": {"id": "692e8073-12c4-4c71-8408-5090bd44c9c8", "type": "team"}}}, "type": "team_hierarchy_links"}} + When the request is sent + Then the response status is 201 CREATED + + @generated @skip @team:DataDog/aaa-omg + Scenario: Create a team hierarchy link returns "Conflict" response + Given new "AddTeamHierarchyLink" request + And body with value {"data": {"relationships": {"parent_team": {"data": {"id": "692e8073-12c4-4c71-8408-5090bd44c9c8", "type": "team"}}, "sub_team": {"data": {"id": "692e8073-12c4-4c71-8408-5090bd44c9c8", "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 link returns "API error response." response Given new "CreateTeamLink" request @@ -96,6 +110,20 @@ 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"] + @generated @skip @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 from "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/aaa-omg + Scenario: Get a team hierarchy link returns "OK" response + Given new "GetTeamHierarchyLink" request + And request contains "link_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @team:DataDog/aaa-omg Scenario: Get a team link returns "API error response." response Given new "GetTeamLink" request @@ -211,6 +239,18 @@ Feature: Teams When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/aaa-omg + Scenario: Get team hierarchy links returns "OK" response + Given new "GetTeamHierarchyLinks" request + When the request is sent + Then the response status is 200 OK + + @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 +333,20 @@ Feature: Teams When the request is sent Then the response status is 204 No Content + @generated @skip @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 from "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/aaa-omg + Scenario: Remove a team hierarchy link returns "No Content" response + Given new "RemoveTeamHierarchyLink" request + And request contains "link_id" parameter from "REPLACE.ME" + 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..f037e95f045 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": "response" + } + ], + "type": "unsafe" + } + }, + "RemoveTeamHierarchyLink": { + "tag": "Teams", + "undo": { + "type": "idempotent" + } + }, + "GetTeamHierarchyLink": { + "tag": "Teams", + "undo": { + "type": "safe" + } + }, "DeleteTeamConnections": { "tag": "Team Connections", "undo": {