diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 9bceb715496..6bc8997cfde 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -945,6 +945,27 @@ components: required: true schema: type: string + RestrictionQueryID: + description: The ID of the restriction query. + in: path + name: restriction_query_id + required: true + schema: + type: string + RestrictionQueryRoleID: + description: The ID of the role. + in: path + name: role_id + required: true + schema: + type: string + RestrictionQueryUserID: + description: The ID of the user. + in: path + name: user_id + required: true + schema: + type: string RetentionFilterIdParam: description: The ID of the retention filter. in: path @@ -30501,6 +30522,15 @@ components: example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== type: string type: object + LogsRestrictionQueriesType: + default: logs_restriction_queries + description: Restriction query resource type. + enum: + - logs_restriction_queries + example: logs_restriction_queries + type: string + x-enum-varnames: + - LOGS_RESTRICTION_QUERIES LogsSort: description: Sort parameters when querying logs. enum: @@ -41410,6 +41440,7 @@ components: type: object RelationshipToUserTeamPermissionData: description: Related user team permission data + nullable: true properties: id: description: The ID of the user team permission @@ -41838,6 +41869,191 @@ components: required: - data type: object + RestrictionQueryAttributes: + description: Attributes of the restriction query. + properties: + created_at: + description: Creation time of the restriction query. + example: '2020-03-17T21:06:44.000Z' + format: date-time + readOnly: true + type: string + last_modifier_email: + description: Email of the user who last modified this restriction query. + example: user@example.com + readOnly: true + type: string + last_modifier_name: + description: Name of the user who last modified this restriction query. + example: John Doe + readOnly: true + type: string + modified_at: + description: Time of last restriction query modification. + example: '2020-03-17T21:15:15.000Z' + format: date-time + readOnly: true + type: string + restriction_query: + description: The query that defines the restriction. Only the content matching + the query can be returned. + example: env:sandbox + type: string + role_count: + description: Number of roles associated with this restriction query. + example: 3 + format: int64 + readOnly: true + type: integer + user_count: + description: Number of users associated with this restriction query. + example: 5 + format: int64 + readOnly: true + type: integer + type: object + RestrictionQueryCreateAttributes: + description: Attributes of the created restriction query. + properties: + restriction_query: + description: The restriction query. + example: env:sandbox + type: string + required: + - restriction_query + type: object + RestrictionQueryCreateData: + description: Data related to the creation of a restriction query. + properties: + attributes: + $ref: '#/components/schemas/RestrictionQueryCreateAttributes' + type: + $ref: '#/components/schemas/LogsRestrictionQueriesType' + type: object + RestrictionQueryCreatePayload: + description: Create a restriction query. + properties: + data: + $ref: '#/components/schemas/RestrictionQueryCreateData' + type: object + RestrictionQueryListResponse: + description: Response containing information about multiple restriction queries. + properties: + data: + description: Array of returned restriction queries. + items: + $ref: '#/components/schemas/RestrictionQueryWithoutRelationships' + type: array + type: object + RestrictionQueryResponseIncludedItem: + description: An object related to a restriction query. + oneOf: + - $ref: '#/components/schemas/RestrictionQueryRole' + RestrictionQueryRole: + description: Partial role object. + properties: + attributes: + $ref: '#/components/schemas/RestrictionQueryRoleAttribute' + id: + description: ID of the role. + example: + type: string + type: + $ref: '#/components/schemas/RolesType' + required: + - type + - id + - attributes + type: object + RestrictionQueryRoleAttribute: + description: Attributes of the role for a restriction query. + properties: + name: + description: The role name. + example: Datadog Admin Role + type: string + type: object + RestrictionQueryRolesResponse: + description: Response containing information about roles attached to a restriction + query. + properties: + data: + description: Array of roles. + items: + $ref: '#/components/schemas/RestrictionQueryRole' + type: array + type: object + RestrictionQueryUpdateAttributes: + description: Attributes of the edited restriction query. + properties: + restriction_query: + description: The restriction query. + example: env:sandbox + type: string + required: + - restriction_query + type: object + RestrictionQueryUpdateData: + description: Data related to the update of a restriction query. + properties: + attributes: + $ref: '#/components/schemas/RestrictionQueryUpdateAttributes' + type: + $ref: '#/components/schemas/LogsRestrictionQueriesType' + type: object + RestrictionQueryUpdatePayload: + description: Update a restriction query. + properties: + data: + $ref: '#/components/schemas/RestrictionQueryUpdateData' + type: object + RestrictionQueryWithRelationships: + description: Restriction query object returned by the API. + properties: + attributes: + $ref: '#/components/schemas/RestrictionQueryAttributes' + id: + description: ID of the restriction query. + example: 79a0e60a-644a-11ea-ad29-43329f7f58b5 + type: string + relationships: + $ref: '#/components/schemas/UserRelationships' + type: + $ref: '#/components/schemas/LogsRestrictionQueriesType' + type: object + RestrictionQueryWithRelationshipsResponse: + description: Response containing information about a single restriction query. + properties: + data: + $ref: '#/components/schemas/RestrictionQueryWithRelationships' + included: + description: Array of objects related to the restriction query. + items: + $ref: '#/components/schemas/RestrictionQueryResponseIncludedItem' + type: array + type: object + RestrictionQueryWithoutRelationships: + description: Restriction query object returned by the API. + properties: + attributes: + $ref: '#/components/schemas/RestrictionQueryAttributes' + id: + description: ID of the restriction query. + example: 79a0e60a-644a-11ea-ad29-43329f7f58b5 + type: string + type: + default: logs_restriction_queries + description: Restriction queries type. + example: logs_restriction_queries + readOnly: true + type: string + type: object + RestrictionQueryWithoutRelationshipsResponse: + description: Response containing information about a single restriction query. + properties: + data: + $ref: '#/components/schemas/RestrictionQueryWithoutRelationships' + type: object RetentionFilter: description: The definition of the retention filter. properties: @@ -51804,7 +52020,11 @@ components: items: description: String identifier of the module type: string + nullable: true type: array + is_managed: + description: Whether the team is managed from an external source + type: boolean link_count: description: The number of links belonging to the team format: int32 @@ -51836,6 +52056,7 @@ components: items: description: String identifier of the module type: string + nullable: true type: array required: - handle @@ -52016,6 +52237,211 @@ 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: Data provided when creating a team hierarchy link + properties: + relationships: + $ref: '#/components/schemas/TeamHierarchyLinkCreateRelationships' + type: + $ref: '#/components/schemas/TeamHierarchyLinkType' + required: + - relationships + - type + type: object + TeamHierarchyLinkCreateRelationships: + description: The related teams that will be connected by the team hierarchy + link + 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: This schema defines the attributes about each team that has to + be provided when creating a team hierarchy link + 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: Data about each team that will be connected by the team hierarchy + link + properties: + data: + $ref: '#/components/schemas/TeamHierarchyLinkCreateTeam' + required: + - data + type: object + TeamHierarchyLinkRelationships: + description: Team hierarchy link relationships + properties: + parent_team: + $ref: '#/components/schemas/TeamHierarchyLinkTeamRelationship' + sub_team: + $ref: '#/components/schemas/TeamHierarchyLinkTeamRelationship' + required: + - parent_team + - sub_team + type: object + TeamHierarchyLinkResponse: + description: Team hierarchy link response + properties: + data: + $ref: '#/components/schemas/TeamHierarchyLink' + included: + description: Included teams + items: + $ref: '#/components/schemas/TeamHierarchyLinkTeam' + type: array + links: + $ref: '#/components/schemas/TeamsHierarchyLinksResponseLinks' + type: object + TeamHierarchyLinkTeam: + description: Team hierarchy links connect different teams. This represents team + objects that are connected by the team hierarchy link. + properties: + attributes: + $ref: '#/components/schemas/TeamHierarchyLinkTeamAttributes' + id: + description: The team's identifier + example: 692e8073-12c4-4c71-8408-5090bd44c9c8 + type: string + type: + $ref: '#/components/schemas/TeamType' + required: + - id + - type + type: object + TeamHierarchyLinkTeamAttributes: + description: Team hierarchy links connect different teams. This represents attributes + from teams that are connected by the team hierarchy link. + 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 +53321,76 @@ components: - LINK_COUNT - TEAM_LINKS - USER_TEAM_PERMISSIONS + TeamsHierarchyLinksResponseLinks: + description: When querying team hierarchy links, a set of links for navigation + between different pages is included + 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: Metadata that is included in the response when querying the team + hierarchy links + properties: + page: + $ref: '#/components/schemas/TeamsHierarchyLinksResponseMetaPage' + type: object + TeamsHierarchyLinksResponseMetaPage: + description: Metadata related to paging information that is included in the + response when querying the team hierarchy links + properties: + first_number: + description: First page number. + format: int64 + type: integer + last_number: + description: Last page number. + format: int64 + type: integer + next_number: + description: Next page number. + format: int64 + nullable: true + type: integer + number: + description: Page number. + format: int64 + type: integer + prev_number: + description: Previous page number. + format: int64 + nullable: true + type: integer + size: + description: Page size. + format: int64 + type: integer + total: + description: Total number of results. + format: int64 + type: integer + type: + description: Pagination type. + example: number_size + type: string + type: object TeamsResponse: description: Response with multiple teams properties: @@ -70264,6 +70760,487 @@ paths: operator: OR permissions: - logs_generate_metrics + /api/v2/logs/config/restriction_queries: + get: + description: Returns all restriction queries, including their names and IDs. + operationId: ListRestrictionQueries + parameters: + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/PageNumber' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryListResponse' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List restriction queries + tags: + - Logs Restriction Queries + x-permission: + operator: OR + permissions: + - logs_read_config + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Create a new restriction query for your organization. + operationId: CreateRestrictionQuery + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryCreatePayload' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryWithoutRelationshipsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create a restriction query + tags: + - Logs Restriction Queries + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - user_access_manage + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/logs/config/restriction_queries/role/{role_id}: + get: + description: Get restriction query for a given role. + operationId: GetRoleRestrictionQuery + parameters: + - $ref: '#/components/parameters/RestrictionQueryRoleID' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryListResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get restriction query for a given role + tags: + - Logs Restriction Queries + x-permission: + operator: OR + permissions: + - logs_read_config + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/logs/config/restriction_queries/user/{user_id}: + get: + description: Get all restriction queries for a given user. + operationId: ListUserRestrictionQueries + parameters: + - $ref: '#/components/parameters/RestrictionQueryUserID' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryListResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get all restriction queries for a given user + tags: + - Logs Restriction Queries + x-permission: + operator: OR + permissions: + - logs_read_config + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/logs/config/restriction_queries/{restriction_query_id}: + delete: + description: Deletes a restriction query. + operationId: DeleteRestrictionQuery + parameters: + - $ref: '#/components/parameters/RestrictionQueryID' + responses: + '204': + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete a restriction query + tags: + - Logs Restriction Queries + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - user_access_manage + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + get: + description: Get a restriction query in the organization specified by the restriction + query's `restriction_query_id`. + operationId: GetRestrictionQuery + parameters: + - $ref: '#/components/parameters/RestrictionQueryID' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryWithRelationshipsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get a restriction query + tags: + - Logs Restriction Queries + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - logs_read_config + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + patch: + description: Edit a restriction query. + operationId: UpdateRestrictionQuery + parameters: + - $ref: '#/components/parameters/RestrictionQueryID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryUpdatePayload' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryWithoutRelationshipsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update a restriction query + tags: + - Logs Restriction Queries + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - user_access_manage + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + put: + description: Replace a restriction query. + operationId: ReplaceRestrictionQuery + parameters: + - $ref: '#/components/parameters/RestrictionQueryID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryUpdatePayload' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryWithoutRelationshipsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Replace a restriction query + tags: + - Logs Restriction Queries + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - user_access_manage + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/logs/config/restriction_queries/{restriction_query_id}/roles: + delete: + description: Removes a role from a restriction query. + operationId: RemoveRoleFromRestrictionQuery + parameters: + - $ref: '#/components/parameters/RestrictionQueryID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RelationshipToRole' + required: true + responses: + '204': + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Revoke role from a restriction query + tags: + - Logs Restriction Queries + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - user_access_manage + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + get: + description: Returns all roles that have a given restriction query. + operationId: ListRestrictionQueryRoles + parameters: + - $ref: '#/components/parameters/RestrictionQueryID' + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/PageNumber' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryRolesResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List roles for a restriction query + tags: + - Logs Restriction Queries + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - logs_read_config + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: 'Adds a role to a restriction query. + + + **Note**: This operation automatically grants the `logs_read_data` permission + to the role if it doesn''t already have it.' + operationId: AddRoleToRestrictionQuery + parameters: + - $ref: '#/components/parameters/RestrictionQueryID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RelationshipToRole' + required: true + responses: + '204': + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Grant role to a restriction query + tags: + - Logs Restriction Queries + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - user_access_manage + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/logs/events: get: description: 'List endpoint returns logs that match a log search query. @@ -81999,6 +82976,170 @@ paths: permissions: - teams_read - teams_manage + /api/v2/team-hierarchy-links: + get: + description: List all team hierarchy links that match the provided filters. + operationId: ListTeamHierarchyLinks + parameters: + - $ref: '#/components/parameters/PageNumber' + - $ref: '#/components/parameters/PageSize' + - description: Filter by parent team ID + in: query + name: filter[parent_team] + required: false + schema: + type: string + - description: Filter by sub team ID + in: query + name: filter[sub_team] + required: false + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamHierarchyLinksResponse' + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Get team hierarchy links + tags: + - Teams + x-pagination: + limitParam: page[size] + pageParam: page[number] + resultsPath: data + x-permission: + operator: OR + permissions: + - teams_read + post: + description: Create a new team hierarchy link between a parent team and a sub + team. + operationId: AddTeamHierarchyLink + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TeamHierarchyLinkCreateRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamHierarchyLinkResponse' + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Conflict + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + - teams_manage + summary: Create a team hierarchy link + tags: + - Teams + x-permission: + operator: AND + permissions: + - teams_read + - teams_manage + /api/v2/team-hierarchy-links/{link_id}: + delete: + description: Remove a team hierarchy link by the given link_id. + operationId: RemoveTeamHierarchyLink + parameters: + - description: The team hierarchy link's identifier + in: path + name: link_id + required: true + schema: + type: string + responses: + '204': + description: No Content + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + - teams_manage + summary: Remove a team hierarchy link + tags: + - Teams + x-permission: + operator: AND + permissions: + - teams_read + - teams_manage + get: + description: Get a single team hierarchy link for the given link_id. + operationId: GetTeamHierarchyLink + parameters: + - description: The team hierarchy link's identifier + in: path + name: link_id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamHierarchyLinkResponse' + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Get a team hierarchy link + tags: + - Teams + x-permission: + operator: OR + permissions: + - teams_read /api/v2/team/connections: delete: description: Delete multiple team connections. @@ -82273,7 +83414,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 +83473,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 +83526,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 +83577,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/).' @@ -85210,6 +86370,44 @@ tags: description: Find out more at url: https://docs.datadoghq.com/logs/logs_to_metrics/ name: Logs Metrics +- description: '**Note: This endpoint is in public beta. If you have any feedback, + contact [Datadog support](https://docs.datadoghq.com/help/).** + + + A Restriction Query is a logs query that restricts which logs the `logs_read_data` + permission grants read access to. + + For users whose roles have Restriction Queries, any log query they make only returns + those log events that also match + + one of their Restriction Queries. This is true whether the user queries log events + from any log-related feature, including + + the log explorer, Live Tail, re-hydration, or a dashboard widget. + + + Restriction Queries currently only support use of the following components of + log events: + + + - Reserved attributes + + - The log message + + - Tags + + + To restrict read access on log data, add a team tag to log events to indicate + which teams own them, and then scope Restriction Queries to the relevant values + of the team tag. Tags can be applied to log events in many ways, and a log event + can have multiple tags with the same key (like team) and different values. This + means the same log event can be visible to roles whose restriction queries are + scoped to different team values. + + + See [How to Set Up RBAC for Logs](https://docs.datadoghq.com/logs/guide/logs-rbac/?tab=api#restrict-access-to-logs) + for details on how to add restriction queries.' + name: Logs Restriction Queries - description: "The metrics endpoint allows you to:\n\n- Post metrics data so it can be graphed on Datadog\u2019s dashboards\n- Query metrics from any time period (timeseries and scalar)\n- Modify tag configurations for metrics\n- View tags diff --git a/examples/v2/logs-restriction-queries/AddRoleToRestrictionQuery.java b/examples/v2/logs-restriction-queries/AddRoleToRestrictionQuery.java new file mode 100644 index 00000000000..2cd75d1cd59 --- /dev/null +++ b/examples/v2/logs-restriction-queries/AddRoleToRestrictionQuery.java @@ -0,0 +1,37 @@ +// Grant role to a restriction query returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.LogsRestrictionQueriesApi; +import com.datadog.api.client.v2.model.RelationshipToRole; +import com.datadog.api.client.v2.model.RelationshipToRoleData; +import com.datadog.api.client.v2.model.RolesType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.addRoleToRestrictionQuery", true); + LogsRestrictionQueriesApi apiInstance = new LogsRestrictionQueriesApi(defaultClient); + + // there is a valid "restriction_query" in the system + String RESTRICTION_QUERY_DATA_ID = System.getenv("RESTRICTION_QUERY_DATA_ID"); + + // there is a valid "role" in the system + String ROLE_DATA_ID = System.getenv("ROLE_DATA_ID"); + + RelationshipToRole body = + new RelationshipToRole() + .data(new RelationshipToRoleData().id(ROLE_DATA_ID).type(RolesType.ROLES)); + + try { + apiInstance.addRoleToRestrictionQuery(RESTRICTION_QUERY_DATA_ID, body); + } catch (ApiException e) { + System.err.println( + "Exception when calling LogsRestrictionQueriesApi#addRoleToRestrictionQuery"); + 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/logs-restriction-queries/CreateRestrictionQuery.java b/examples/v2/logs-restriction-queries/CreateRestrictionQuery.java new file mode 100644 index 00000000000..662290bd5f6 --- /dev/null +++ b/examples/v2/logs-restriction-queries/CreateRestrictionQuery.java @@ -0,0 +1,38 @@ +// Create a restriction query returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.LogsRestrictionQueriesApi; +import com.datadog.api.client.v2.model.LogsRestrictionQueriesType; +import com.datadog.api.client.v2.model.RestrictionQueryCreateAttributes; +import com.datadog.api.client.v2.model.RestrictionQueryCreateData; +import com.datadog.api.client.v2.model.RestrictionQueryCreatePayload; +import com.datadog.api.client.v2.model.RestrictionQueryWithoutRelationshipsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createRestrictionQuery", true); + LogsRestrictionQueriesApi apiInstance = new LogsRestrictionQueriesApi(defaultClient); + + RestrictionQueryCreatePayload body = + new RestrictionQueryCreatePayload() + .data( + new RestrictionQueryCreateData() + .attributes( + new RestrictionQueryCreateAttributes().restrictionQuery("env:sandbox")) + .type(LogsRestrictionQueriesType.LOGS_RESTRICTION_QUERIES)); + + try { + RestrictionQueryWithoutRelationshipsResponse result = + apiInstance.createRestrictionQuery(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling LogsRestrictionQueriesApi#createRestrictionQuery"); + 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/logs-restriction-queries/DeleteRestrictionQuery.java b/examples/v2/logs-restriction-queries/DeleteRestrictionQuery.java new file mode 100644 index 00000000000..67c301ed2aa --- /dev/null +++ b/examples/v2/logs-restriction-queries/DeleteRestrictionQuery.java @@ -0,0 +1,26 @@ +// Delete a restriction query returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.LogsRestrictionQueriesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.deleteRestrictionQuery", true); + LogsRestrictionQueriesApi apiInstance = new LogsRestrictionQueriesApi(defaultClient); + + // there is a valid "restriction_query" in the system + String RESTRICTION_QUERY_DATA_ID = System.getenv("RESTRICTION_QUERY_DATA_ID"); + + try { + apiInstance.deleteRestrictionQuery(RESTRICTION_QUERY_DATA_ID); + } catch (ApiException e) { + System.err.println("Exception when calling LogsRestrictionQueriesApi#deleteRestrictionQuery"); + 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/logs-restriction-queries/GetRestrictionQuery.java b/examples/v2/logs-restriction-queries/GetRestrictionQuery.java new file mode 100644 index 00000000000..7a8d96436f7 --- /dev/null +++ b/examples/v2/logs-restriction-queries/GetRestrictionQuery.java @@ -0,0 +1,29 @@ +// Get a restriction query returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.LogsRestrictionQueriesApi; +import com.datadog.api.client.v2.model.RestrictionQueryWithRelationshipsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getRestrictionQuery", true); + LogsRestrictionQueriesApi apiInstance = new LogsRestrictionQueriesApi(defaultClient); + + // there is a valid "restriction_query" in the system + String RESTRICTION_QUERY_DATA_ID = System.getenv("RESTRICTION_QUERY_DATA_ID"); + + try { + RestrictionQueryWithRelationshipsResponse result = + apiInstance.getRestrictionQuery(RESTRICTION_QUERY_DATA_ID); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling LogsRestrictionQueriesApi#getRestrictionQuery"); + 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/logs-restriction-queries/GetRoleRestrictionQuery.java b/examples/v2/logs-restriction-queries/GetRoleRestrictionQuery.java new file mode 100644 index 00000000000..81562bc34db --- /dev/null +++ b/examples/v2/logs-restriction-queries/GetRoleRestrictionQuery.java @@ -0,0 +1,29 @@ +// Get restriction query for a given role returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.LogsRestrictionQueriesApi; +import com.datadog.api.client.v2.model.RestrictionQueryListResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getRoleRestrictionQuery", true); + LogsRestrictionQueriesApi apiInstance = new LogsRestrictionQueriesApi(defaultClient); + + // there is a valid "role" in the system + String ROLE_DATA_ID = System.getenv("ROLE_DATA_ID"); + + try { + RestrictionQueryListResponse result = apiInstance.getRoleRestrictionQuery(ROLE_DATA_ID); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling LogsRestrictionQueriesApi#getRoleRestrictionQuery"); + 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/logs-restriction-queries/ListRestrictionQueries.java b/examples/v2/logs-restriction-queries/ListRestrictionQueries.java new file mode 100644 index 00000000000..99a86fdbaca --- /dev/null +++ b/examples/v2/logs-restriction-queries/ListRestrictionQueries.java @@ -0,0 +1,25 @@ +// List restriction queries returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.LogsRestrictionQueriesApi; +import com.datadog.api.client.v2.model.RestrictionQueryListResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listRestrictionQueries", true); + LogsRestrictionQueriesApi apiInstance = new LogsRestrictionQueriesApi(defaultClient); + + try { + RestrictionQueryListResponse result = apiInstance.listRestrictionQueries(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling LogsRestrictionQueriesApi#listRestrictionQueries"); + 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/logs-restriction-queries/ListRestrictionQueryRoles.java b/examples/v2/logs-restriction-queries/ListRestrictionQueryRoles.java new file mode 100644 index 00000000000..a6c5ec17ff8 --- /dev/null +++ b/examples/v2/logs-restriction-queries/ListRestrictionQueryRoles.java @@ -0,0 +1,30 @@ +// List roles for a restriction query returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.LogsRestrictionQueriesApi; +import com.datadog.api.client.v2.model.RestrictionQueryRolesResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listRestrictionQueryRoles", true); + LogsRestrictionQueriesApi apiInstance = new LogsRestrictionQueriesApi(defaultClient); + + // there is a valid "restriction_query" in the system + String RESTRICTION_QUERY_DATA_ID = System.getenv("RESTRICTION_QUERY_DATA_ID"); + + try { + RestrictionQueryRolesResponse result = + apiInstance.listRestrictionQueryRoles(RESTRICTION_QUERY_DATA_ID); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling LogsRestrictionQueriesApi#listRestrictionQueryRoles"); + 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/logs-restriction-queries/ListUserRestrictionQueries.java b/examples/v2/logs-restriction-queries/ListUserRestrictionQueries.java new file mode 100644 index 00000000000..bce06b28054 --- /dev/null +++ b/examples/v2/logs-restriction-queries/ListUserRestrictionQueries.java @@ -0,0 +1,29 @@ +// Get all restriction queries for a given user returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.LogsRestrictionQueriesApi; +import com.datadog.api.client.v2.model.RestrictionQueryListResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listUserRestrictionQueries", true); + LogsRestrictionQueriesApi apiInstance = new LogsRestrictionQueriesApi(defaultClient); + + // there is a valid "user" in the system + String USER_DATA_ID = System.getenv("USER_DATA_ID"); + + try { + RestrictionQueryListResponse result = apiInstance.listUserRestrictionQueries(USER_DATA_ID); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling LogsRestrictionQueriesApi#listUserRestrictionQueries"); + 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/logs-restriction-queries/RemoveRoleFromRestrictionQuery.java b/examples/v2/logs-restriction-queries/RemoveRoleFromRestrictionQuery.java new file mode 100644 index 00000000000..b3b04b39b2e --- /dev/null +++ b/examples/v2/logs-restriction-queries/RemoveRoleFromRestrictionQuery.java @@ -0,0 +1,37 @@ +// Revoke role from a restriction query returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.LogsRestrictionQueriesApi; +import com.datadog.api.client.v2.model.RelationshipToRole; +import com.datadog.api.client.v2.model.RelationshipToRoleData; +import com.datadog.api.client.v2.model.RolesType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.removeRoleFromRestrictionQuery", true); + LogsRestrictionQueriesApi apiInstance = new LogsRestrictionQueriesApi(defaultClient); + + // there is a valid "restriction_query" in the system + String RESTRICTION_QUERY_DATA_ID = System.getenv("RESTRICTION_QUERY_DATA_ID"); + + // there is a valid "role" in the system + String ROLE_DATA_ID = System.getenv("ROLE_DATA_ID"); + + RelationshipToRole body = + new RelationshipToRole() + .data(new RelationshipToRoleData().id(ROLE_DATA_ID).type(RolesType.ROLES)); + + try { + apiInstance.removeRoleFromRestrictionQuery(RESTRICTION_QUERY_DATA_ID, body); + } catch (ApiException e) { + System.err.println( + "Exception when calling LogsRestrictionQueriesApi#removeRoleFromRestrictionQuery"); + 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/logs-restriction-queries/ReplaceRestrictionQuery.java b/examples/v2/logs-restriction-queries/ReplaceRestrictionQuery.java new file mode 100644 index 00000000000..4f745064169 --- /dev/null +++ b/examples/v2/logs-restriction-queries/ReplaceRestrictionQuery.java @@ -0,0 +1,42 @@ +// Replace a restriction query returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.LogsRestrictionQueriesApi; +import com.datadog.api.client.v2.model.LogsRestrictionQueriesType; +import com.datadog.api.client.v2.model.RestrictionQueryUpdateAttributes; +import com.datadog.api.client.v2.model.RestrictionQueryUpdateData; +import com.datadog.api.client.v2.model.RestrictionQueryUpdatePayload; +import com.datadog.api.client.v2.model.RestrictionQueryWithoutRelationshipsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.replaceRestrictionQuery", true); + LogsRestrictionQueriesApi apiInstance = new LogsRestrictionQueriesApi(defaultClient); + + // there is a valid "restriction_query" in the system + String RESTRICTION_QUERY_DATA_ID = System.getenv("RESTRICTION_QUERY_DATA_ID"); + + RestrictionQueryUpdatePayload body = + new RestrictionQueryUpdatePayload() + .data( + new RestrictionQueryUpdateData() + .attributes( + new RestrictionQueryUpdateAttributes().restrictionQuery("env:staging")) + .type(LogsRestrictionQueriesType.LOGS_RESTRICTION_QUERIES)); + + try { + RestrictionQueryWithoutRelationshipsResponse result = + apiInstance.replaceRestrictionQuery(RESTRICTION_QUERY_DATA_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling LogsRestrictionQueriesApi#replaceRestrictionQuery"); + 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/logs-restriction-queries/UpdateRestrictionQuery.java b/examples/v2/logs-restriction-queries/UpdateRestrictionQuery.java new file mode 100644 index 00000000000..6510d6c3f39 --- /dev/null +++ b/examples/v2/logs-restriction-queries/UpdateRestrictionQuery.java @@ -0,0 +1,41 @@ +// Update a restriction query returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.LogsRestrictionQueriesApi; +import com.datadog.api.client.v2.model.LogsRestrictionQueriesType; +import com.datadog.api.client.v2.model.RestrictionQueryUpdateAttributes; +import com.datadog.api.client.v2.model.RestrictionQueryUpdateData; +import com.datadog.api.client.v2.model.RestrictionQueryUpdatePayload; +import com.datadog.api.client.v2.model.RestrictionQueryWithoutRelationshipsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.updateRestrictionQuery", true); + LogsRestrictionQueriesApi apiInstance = new LogsRestrictionQueriesApi(defaultClient); + + // there is a valid "restriction_query" in the system + String RESTRICTION_QUERY_DATA_ID = System.getenv("RESTRICTION_QUERY_DATA_ID"); + + RestrictionQueryUpdatePayload body = + new RestrictionQueryUpdatePayload() + .data( + new RestrictionQueryUpdateData() + .attributes( + new RestrictionQueryUpdateAttributes().restrictionQuery("env:production")) + .type(LogsRestrictionQueriesType.LOGS_RESTRICTION_QUERIES)); + + try { + RestrictionQueryWithoutRelationshipsResponse result = + apiInstance.updateRestrictionQuery(RESTRICTION_QUERY_DATA_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling LogsRestrictionQueriesApi#updateRestrictionQuery"); + 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/AddTeamHierarchyLink.java b/examples/v2/teams/AddTeamHierarchyLink.java new file mode 100644 index 00000000000..953f8a377f8 --- /dev/null +++ b/examples/v2/teams/AddTeamHierarchyLink.java @@ -0,0 +1,57 @@ +// Create a team hierarchy link returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.TeamsApi; +import com.datadog.api.client.v2.model.TeamHierarchyLinkCreate; +import com.datadog.api.client.v2.model.TeamHierarchyLinkCreateRelationships; +import com.datadog.api.client.v2.model.TeamHierarchyLinkCreateRequest; +import com.datadog.api.client.v2.model.TeamHierarchyLinkCreateTeam; +import com.datadog.api.client.v2.model.TeamHierarchyLinkCreateTeamRelationship; +import com.datadog.api.client.v2.model.TeamHierarchyLinkResponse; +import com.datadog.api.client.v2.model.TeamHierarchyLinkType; +import com.datadog.api.client.v2.model.TeamType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + TeamsApi apiInstance = new TeamsApi(defaultClient); + + // there is a valid "dd_team" in the system + String DD_TEAM_DATA_ID = System.getenv("DD_TEAM_DATA_ID"); + + // there is a valid "dd_team_2" in the system + String DD_TEAM_2_DATA_ID = System.getenv("DD_TEAM_2_DATA_ID"); + + TeamHierarchyLinkCreateRequest body = + new TeamHierarchyLinkCreateRequest() + .data( + new TeamHierarchyLinkCreate() + .relationships( + new TeamHierarchyLinkCreateRelationships() + .parentTeam( + new TeamHierarchyLinkCreateTeamRelationship() + .data( + new TeamHierarchyLinkCreateTeam() + .id(DD_TEAM_DATA_ID) + .type(TeamType.TEAM))) + .subTeam( + new TeamHierarchyLinkCreateTeamRelationship() + .data( + new TeamHierarchyLinkCreateTeam() + .id(DD_TEAM_2_DATA_ID) + .type(TeamType.TEAM)))) + .type(TeamHierarchyLinkType.TEAM_HIERARCHY_LINKS)); + + try { + TeamHierarchyLinkResponse result = apiInstance.addTeamHierarchyLink(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#addTeamHierarchyLink"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/teams/GetTeamHierarchyLink.java b/examples/v2/teams/GetTeamHierarchyLink.java new file mode 100644 index 00000000000..53ec6a3c4c6 --- /dev/null +++ b/examples/v2/teams/GetTeamHierarchyLink.java @@ -0,0 +1,28 @@ +// Get a team hierarchy link returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.TeamsApi; +import com.datadog.api.client.v2.model.TeamHierarchyLinkResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + TeamsApi apiInstance = new TeamsApi(defaultClient); + + // there is a valid "team_hierarchy_link" in the system + String TEAM_HIERARCHY_LINK_DATA_ID = System.getenv("TEAM_HIERARCHY_LINK_DATA_ID"); + + try { + TeamHierarchyLinkResponse result = + apiInstance.getTeamHierarchyLink(TEAM_HIERARCHY_LINK_DATA_ID); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#getTeamHierarchyLink"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/teams/ListTeamHierarchyLinks.java b/examples/v2/teams/ListTeamHierarchyLinks.java new file mode 100644 index 00000000000..b80b43e55d0 --- /dev/null +++ b/examples/v2/teams/ListTeamHierarchyLinks.java @@ -0,0 +1,37 @@ +// Get team hierarchy links returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.TeamsApi; +import com.datadog.api.client.v2.api.TeamsApi.ListTeamHierarchyLinksOptionalParameters; +import com.datadog.api.client.v2.model.TeamHierarchyLinksResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + TeamsApi apiInstance = new TeamsApi(defaultClient); + + // there is a valid "team_hierarchy_link" in the system + String TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_PARENT_TEAM_DATA_ID = + System.getenv("TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_PARENT_TEAM_DATA_ID"); + String TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_SUB_TEAM_DATA_ID = + System.getenv("TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_SUB_TEAM_DATA_ID"); + + try { + TeamHierarchyLinksResponse result = + apiInstance.listTeamHierarchyLinks( + new ListTeamHierarchyLinksOptionalParameters() + .filterParentTeam(TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_PARENT_TEAM_DATA_ID) + .filterSubTeam(TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_SUB_TEAM_DATA_ID) + .pageNumber(0L) + .pageSize(100L)); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#listTeamHierarchyLinks"); + 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/ListTeamHierarchyLinks_3360757486.java b/examples/v2/teams/ListTeamHierarchyLinks_3360757486.java new file mode 100644 index 00000000000..23d050d9d83 --- /dev/null +++ b/examples/v2/teams/ListTeamHierarchyLinks_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.listTeamHierarchyLinksWithPagination(); + + for (TeamHierarchyLink item : iterable) { + System.out.println(item); + } + } catch (RuntimeException e) { + System.err.println("Exception when calling TeamsApi#listTeamHierarchyLinksWithPagination"); + System.err.println("Reason: " + e.getMessage()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/teams/RemoveTeamHierarchyLink.java b/examples/v2/teams/RemoveTeamHierarchyLink.java new file mode 100644 index 00000000000..a8ec28039ca --- /dev/null +++ b/examples/v2/teams/RemoveTeamHierarchyLink.java @@ -0,0 +1,25 @@ +// Remove a team hierarchy link returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.TeamsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + TeamsApi apiInstance = new TeamsApi(defaultClient); + + // there is a valid "team_hierarchy_link" in the system + String TEAM_HIERARCHY_LINK_DATA_ID = System.getenv("TEAM_HIERARCHY_LINK_DATA_ID"); + + try { + apiInstance.removeTeamHierarchyLink(TEAM_HIERARCHY_LINK_DATA_ID); + } catch (ApiException e) { + System.err.println("Exception when calling TeamsApi#removeTeamHierarchyLink"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index fb04e6a5367..0544b80c31c 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -777,6 +777,17 @@ public class ApiClient { put("v2.updateIncidentNotificationTemplate", false); put("v2.updateIncidentTodo", false); put("v2.updateIncidentType", false); + put("v2.addRoleToRestrictionQuery", false); + put("v2.createRestrictionQuery", false); + put("v2.deleteRestrictionQuery", false); + put("v2.getRestrictionQuery", false); + put("v2.getRoleRestrictionQuery", false); + put("v2.listRestrictionQueries", false); + put("v2.listRestrictionQueryRoles", false); + put("v2.listUserRestrictionQueries", false); + put("v2.removeRoleFromRestrictionQuery", false); + put("v2.replaceRestrictionQuery", false); + put("v2.updateRestrictionQuery", false); put("v2.createMonitorUserTemplate", false); put("v2.deleteMonitorUserTemplate", false); put("v2.getMonitorUserTemplate", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/LogsRestrictionQueriesApi.java b/src/main/java/com/datadog/api/client/v2/api/LogsRestrictionQueriesApi.java new file mode 100644 index 00000000000..8a2b61d12c0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/LogsRestrictionQueriesApi.java @@ -0,0 +1,2045 @@ +package com.datadog.api.client.v2.api; + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.ApiResponse; +import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.RelationshipToRole; +import com.datadog.api.client.v2.model.RestrictionQueryCreatePayload; +import com.datadog.api.client.v2.model.RestrictionQueryListResponse; +import com.datadog.api.client.v2.model.RestrictionQueryRolesResponse; +import com.datadog.api.client.v2.model.RestrictionQueryUpdatePayload; +import com.datadog.api.client.v2.model.RestrictionQueryWithRelationshipsResponse; +import com.datadog.api.client.v2.model.RestrictionQueryWithoutRelationshipsResponse; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.GenericType; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CompletableFuture; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LogsRestrictionQueriesApi { + private ApiClient apiClient; + + public LogsRestrictionQueriesApi() { + this(ApiClient.getDefaultApiClient()); + } + + public LogsRestrictionQueriesApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client. + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client. + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Grant role to a restriction query. + * + *

See {@link #addRoleToRestrictionQueryWithHttpInfo}. + * + * @param restrictionQueryId The ID of the restriction query. (required) + * @param body (required) + * @throws ApiException if fails to make API call + */ + public void addRoleToRestrictionQuery(String restrictionQueryId, RelationshipToRole body) + throws ApiException { + addRoleToRestrictionQueryWithHttpInfo(restrictionQueryId, body); + } + + /** + * Grant role to a restriction query. + * + *

See {@link #addRoleToRestrictionQueryWithHttpInfoAsync}. + * + * @param restrictionQueryId The ID of the restriction query. (required) + * @param body (required) + * @return CompletableFuture + */ + public CompletableFuture addRoleToRestrictionQueryAsync( + String restrictionQueryId, RelationshipToRole body) { + return addRoleToRestrictionQueryWithHttpInfoAsync(restrictionQueryId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Adds a role to a restriction query. + * + *

Note: This operation automatically grants the logs_read_data + * permission to the role if it doesn't already have it. + * + * @param restrictionQueryId The ID of the restriction query. (required) + * @param body (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 OK -
400 Bad Request -
403 Authentication error -
404 Not found -
429 Too many requests -
+ */ + public ApiResponse addRoleToRestrictionQueryWithHttpInfo( + String restrictionQueryId, RelationshipToRole body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "addRoleToRestrictionQuery"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'restrictionQueryId' is set + if (restrictionQueryId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'restrictionQueryId' when calling" + + " addRoleToRestrictionQuery"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling addRoleToRestrictionQuery"); + } + // create path and map variables + String localVarPath = + "/api/v2/logs/config/restriction_queries/{restriction_query_id}/roles" + .replaceAll( + "\\{" + "restriction_query_id" + "\\}", + apiClient.escapeString(restrictionQueryId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.LogsRestrictionQueriesApi.addRoleToRestrictionQuery", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Grant role to a restriction query. + * + *

See {@link #addRoleToRestrictionQueryWithHttpInfo}. + * + * @param restrictionQueryId The ID of the restriction query. (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> addRoleToRestrictionQueryWithHttpInfoAsync( + String restrictionQueryId, RelationshipToRole body) { + // Check if unstable operation is enabled + String operationId = "addRoleToRestrictionQuery"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'restrictionQueryId' is set + if (restrictionQueryId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'restrictionQueryId' when calling" + + " addRoleToRestrictionQuery")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling addRoleToRestrictionQuery")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/logs/config/restriction_queries/{restriction_query_id}/roles" + .replaceAll( + "\\{" + "restriction_query_id" + "\\}", + apiClient.escapeString(restrictionQueryId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.LogsRestrictionQueriesApi.addRoleToRestrictionQuery", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } 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, + null); + } + + /** + * Create a restriction query. + * + *

See {@link #createRestrictionQueryWithHttpInfo}. + * + * @param body (required) + * @return RestrictionQueryWithoutRelationshipsResponse + * @throws ApiException if fails to make API call + */ + public RestrictionQueryWithoutRelationshipsResponse createRestrictionQuery( + RestrictionQueryCreatePayload body) throws ApiException { + return createRestrictionQueryWithHttpInfo(body).getData(); + } + + /** + * Create a restriction query. + * + *

See {@link #createRestrictionQueryWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<RestrictionQueryWithoutRelationshipsResponse> + */ + public CompletableFuture + createRestrictionQueryAsync(RestrictionQueryCreatePayload body) { + return createRestrictionQueryWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create a new restriction query for your organization. + * + * @param body (required) + * @return ApiResponse<RestrictionQueryWithoutRelationshipsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Authentication error -
429 Too many requests -
+ */ + public ApiResponse + createRestrictionQueryWithHttpInfo(RestrictionQueryCreatePayload body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "createRestrictionQuery"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createRestrictionQuery"); + } + // create path and map variables + String localVarPath = "/api/v2/logs/config/restriction_queries"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.LogsRestrictionQueriesApi.createRestrictionQuery", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create a restriction query. + * + *

See {@link #createRestrictionQueryWithHttpInfo}. + * + * @param body (required) + * @return + * CompletableFuture<ApiResponse<RestrictionQueryWithoutRelationshipsResponse>> + */ + public CompletableFuture> + createRestrictionQueryWithHttpInfoAsync(RestrictionQueryCreatePayload body) { + // Check if unstable operation is enabled + String operationId = "createRestrictionQuery"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + 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 createRestrictionQuery")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/logs/config/restriction_queries"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.LogsRestrictionQueriesApi.createRestrictionQuery", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } 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() {}); + } + + /** + * Delete a restriction query. + * + *

See {@link #deleteRestrictionQueryWithHttpInfo}. + * + * @param restrictionQueryId The ID of the restriction query. (required) + * @throws ApiException if fails to make API call + */ + public void deleteRestrictionQuery(String restrictionQueryId) throws ApiException { + deleteRestrictionQueryWithHttpInfo(restrictionQueryId); + } + + /** + * Delete a restriction query. + * + *

See {@link #deleteRestrictionQueryWithHttpInfoAsync}. + * + * @param restrictionQueryId The ID of the restriction query. (required) + * @return CompletableFuture + */ + public CompletableFuture deleteRestrictionQueryAsync(String restrictionQueryId) { + return deleteRestrictionQueryWithHttpInfoAsync(restrictionQueryId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Deletes a restriction query. + * + * @param restrictionQueryId The ID of the restriction query. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 OK -
400 Bad Request -
403 Authentication error -
404 Not found -
429 Too many requests -
+ */ + public ApiResponse deleteRestrictionQueryWithHttpInfo(String restrictionQueryId) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "deleteRestrictionQuery"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'restrictionQueryId' is set + if (restrictionQueryId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'restrictionQueryId' when calling" + + " deleteRestrictionQuery"); + } + // create path and map variables + String localVarPath = + "/api/v2/logs/config/restriction_queries/{restriction_query_id}" + .replaceAll( + "\\{" + "restriction_query_id" + "\\}", + apiClient.escapeString(restrictionQueryId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.LogsRestrictionQueriesApi.deleteRestrictionQuery", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete a restriction query. + * + *

See {@link #deleteRestrictionQueryWithHttpInfo}. + * + * @param restrictionQueryId The ID of the restriction query. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteRestrictionQueryWithHttpInfoAsync( + String restrictionQueryId) { + // Check if unstable operation is enabled + String operationId = "deleteRestrictionQuery"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'restrictionQueryId' is set + if (restrictionQueryId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'restrictionQueryId' when calling" + + " deleteRestrictionQuery")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/logs/config/restriction_queries/{restriction_query_id}" + .replaceAll( + "\\{" + "restriction_query_id" + "\\}", + apiClient.escapeString(restrictionQueryId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.LogsRestrictionQueriesApi.deleteRestrictionQuery", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Get a restriction query. + * + *

See {@link #getRestrictionQueryWithHttpInfo}. + * + * @param restrictionQueryId The ID of the restriction query. (required) + * @return RestrictionQueryWithRelationshipsResponse + * @throws ApiException if fails to make API call + */ + public RestrictionQueryWithRelationshipsResponse getRestrictionQuery(String restrictionQueryId) + throws ApiException { + return getRestrictionQueryWithHttpInfo(restrictionQueryId).getData(); + } + + /** + * Get a restriction query. + * + *

See {@link #getRestrictionQueryWithHttpInfoAsync}. + * + * @param restrictionQueryId The ID of the restriction query. (required) + * @return CompletableFuture<RestrictionQueryWithRelationshipsResponse> + */ + public CompletableFuture getRestrictionQueryAsync( + String restrictionQueryId) { + return getRestrictionQueryWithHttpInfoAsync(restrictionQueryId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a restriction query in the organization specified by the restriction query's + * restriction_query_id. + * + * @param restrictionQueryId The ID of the restriction query. (required) + * @return ApiResponse<RestrictionQueryWithRelationshipsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Authentication error -
404 Not found -
429 Too many requests -
+ */ + public ApiResponse getRestrictionQueryWithHttpInfo( + String restrictionQueryId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "getRestrictionQuery"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'restrictionQueryId' is set + if (restrictionQueryId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'restrictionQueryId' when calling getRestrictionQuery"); + } + // create path and map variables + String localVarPath = + "/api/v2/logs/config/restriction_queries/{restriction_query_id}" + .replaceAll( + "\\{" + "restriction_query_id" + "\\}", + apiClient.escapeString(restrictionQueryId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.LogsRestrictionQueriesApi.getRestrictionQuery", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a restriction query. + * + *

See {@link #getRestrictionQueryWithHttpInfo}. + * + * @param restrictionQueryId The ID of the restriction query. (required) + * @return CompletableFuture<ApiResponse<RestrictionQueryWithRelationshipsResponse>> + */ + public CompletableFuture> + getRestrictionQueryWithHttpInfoAsync(String restrictionQueryId) { + // Check if unstable operation is enabled + String operationId = "getRestrictionQuery"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'restrictionQueryId' is set + if (restrictionQueryId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'restrictionQueryId' when calling" + + " getRestrictionQuery")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/logs/config/restriction_queries/{restriction_query_id}" + .replaceAll( + "\\{" + "restriction_query_id" + "\\}", + apiClient.escapeString(restrictionQueryId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.LogsRestrictionQueriesApi.getRestrictionQuery", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } 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 restriction query for a given role. + * + *

See {@link #getRoleRestrictionQueryWithHttpInfo}. + * + * @param roleId The ID of the role. (required) + * @return RestrictionQueryListResponse + * @throws ApiException if fails to make API call + */ + public RestrictionQueryListResponse getRoleRestrictionQuery(String roleId) throws ApiException { + return getRoleRestrictionQueryWithHttpInfo(roleId).getData(); + } + + /** + * Get restriction query for a given role. + * + *

See {@link #getRoleRestrictionQueryWithHttpInfoAsync}. + * + * @param roleId The ID of the role. (required) + * @return CompletableFuture<RestrictionQueryListResponse> + */ + public CompletableFuture getRoleRestrictionQueryAsync( + String roleId) { + return getRoleRestrictionQueryWithHttpInfoAsync(roleId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get restriction query for a given role. + * + * @param roleId The ID of the role. (required) + * @return ApiResponse<RestrictionQueryListResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Authentication error -
404 Not found -
429 Too many requests -
+ */ + public ApiResponse getRoleRestrictionQueryWithHttpInfo( + String roleId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "getRoleRestrictionQuery"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'roleId' is set + if (roleId == null) { + throw new ApiException( + 400, "Missing the required parameter 'roleId' when calling getRoleRestrictionQuery"); + } + // create path and map variables + String localVarPath = + "/api/v2/logs/config/restriction_queries/role/{role_id}" + .replaceAll("\\{" + "role_id" + "\\}", apiClient.escapeString(roleId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.LogsRestrictionQueriesApi.getRoleRestrictionQuery", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get restriction query for a given role. + * + *

See {@link #getRoleRestrictionQueryWithHttpInfo}. + * + * @param roleId The ID of the role. (required) + * @return CompletableFuture<ApiResponse<RestrictionQueryListResponse>> + */ + public CompletableFuture> + getRoleRestrictionQueryWithHttpInfoAsync(String roleId) { + // Check if unstable operation is enabled + String operationId = "getRoleRestrictionQuery"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'roleId' is set + if (roleId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'roleId' when calling getRoleRestrictionQuery")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/logs/config/restriction_queries/role/{role_id}" + .replaceAll("\\{" + "role_id" + "\\}", apiClient.escapeString(roleId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.LogsRestrictionQueriesApi.getRoleRestrictionQuery", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } 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 listRestrictionQueries. */ + public static class ListRestrictionQueriesOptionalParameters { + private Long pageSize; + private Long pageNumber; + + /** + * Set pageSize. + * + * @param pageSize Size for a given page. The maximum allowed value is 100. (optional, default + * to 10) + * @return ListRestrictionQueriesOptionalParameters + */ + public ListRestrictionQueriesOptionalParameters pageSize(Long pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Set pageNumber. + * + * @param pageNumber Specific page number to return. (optional, default to 0) + * @return ListRestrictionQueriesOptionalParameters + */ + public ListRestrictionQueriesOptionalParameters pageNumber(Long pageNumber) { + this.pageNumber = pageNumber; + return this; + } + } + + /** + * List restriction queries. + * + *

See {@link #listRestrictionQueriesWithHttpInfo}. + * + * @return RestrictionQueryListResponse + * @throws ApiException if fails to make API call + */ + public RestrictionQueryListResponse listRestrictionQueries() throws ApiException { + return listRestrictionQueriesWithHttpInfo(new ListRestrictionQueriesOptionalParameters()) + .getData(); + } + + /** + * List restriction queries. + * + *

See {@link #listRestrictionQueriesWithHttpInfoAsync}. + * + * @return CompletableFuture<RestrictionQueryListResponse> + */ + public CompletableFuture listRestrictionQueriesAsync() { + return listRestrictionQueriesWithHttpInfoAsync(new ListRestrictionQueriesOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List restriction queries. + * + *

See {@link #listRestrictionQueriesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return RestrictionQueryListResponse + * @throws ApiException if fails to make API call + */ + public RestrictionQueryListResponse listRestrictionQueries( + ListRestrictionQueriesOptionalParameters parameters) throws ApiException { + return listRestrictionQueriesWithHttpInfo(parameters).getData(); + } + + /** + * List restriction queries. + * + *

See {@link #listRestrictionQueriesWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<RestrictionQueryListResponse> + */ + public CompletableFuture listRestrictionQueriesAsync( + ListRestrictionQueriesOptionalParameters parameters) { + return listRestrictionQueriesWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Returns all restriction queries, including their names and IDs. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<RestrictionQueryListResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Authentication error -
429 Too many requests -
+ */ + public ApiResponse listRestrictionQueriesWithHttpInfo( + ListRestrictionQueriesOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listRestrictionQueries"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + // create path and map variables + String localVarPath = "/api/v2/logs/config/restriction_queries"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.LogsRestrictionQueriesApi.listRestrictionQueries", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List restriction queries. + * + *

See {@link #listRestrictionQueriesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<RestrictionQueryListResponse>> + */ + public CompletableFuture> + listRestrictionQueriesWithHttpInfoAsync(ListRestrictionQueriesOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listRestrictionQueries"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + // create path and map variables + String localVarPath = "/api/v2/logs/config/restriction_queries"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.LogsRestrictionQueriesApi.listRestrictionQueries", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } 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 listRestrictionQueryRoles. */ + public static class ListRestrictionQueryRolesOptionalParameters { + private Long pageSize; + private Long pageNumber; + + /** + * Set pageSize. + * + * @param pageSize Size for a given page. The maximum allowed value is 100. (optional, default + * to 10) + * @return ListRestrictionQueryRolesOptionalParameters + */ + public ListRestrictionQueryRolesOptionalParameters pageSize(Long pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Set pageNumber. + * + * @param pageNumber Specific page number to return. (optional, default to 0) + * @return ListRestrictionQueryRolesOptionalParameters + */ + public ListRestrictionQueryRolesOptionalParameters pageNumber(Long pageNumber) { + this.pageNumber = pageNumber; + return this; + } + } + + /** + * List roles for a restriction query. + * + *

See {@link #listRestrictionQueryRolesWithHttpInfo}. + * + * @param restrictionQueryId The ID of the restriction query. (required) + * @return RestrictionQueryRolesResponse + * @throws ApiException if fails to make API call + */ + public RestrictionQueryRolesResponse listRestrictionQueryRoles(String restrictionQueryId) + throws ApiException { + return listRestrictionQueryRolesWithHttpInfo( + restrictionQueryId, new ListRestrictionQueryRolesOptionalParameters()) + .getData(); + } + + /** + * List roles for a restriction query. + * + *

See {@link #listRestrictionQueryRolesWithHttpInfoAsync}. + * + * @param restrictionQueryId The ID of the restriction query. (required) + * @return CompletableFuture<RestrictionQueryRolesResponse> + */ + public CompletableFuture listRestrictionQueryRolesAsync( + String restrictionQueryId) { + return listRestrictionQueryRolesWithHttpInfoAsync( + restrictionQueryId, new ListRestrictionQueryRolesOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List roles for a restriction query. + * + *

See {@link #listRestrictionQueryRolesWithHttpInfo}. + * + * @param restrictionQueryId The ID of the restriction query. (required) + * @param parameters Optional parameters for the request. + * @return RestrictionQueryRolesResponse + * @throws ApiException if fails to make API call + */ + public RestrictionQueryRolesResponse listRestrictionQueryRoles( + String restrictionQueryId, ListRestrictionQueryRolesOptionalParameters parameters) + throws ApiException { + return listRestrictionQueryRolesWithHttpInfo(restrictionQueryId, parameters).getData(); + } + + /** + * List roles for a restriction query. + * + *

See {@link #listRestrictionQueryRolesWithHttpInfoAsync}. + * + * @param restrictionQueryId The ID of the restriction query. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<RestrictionQueryRolesResponse> + */ + public CompletableFuture listRestrictionQueryRolesAsync( + String restrictionQueryId, ListRestrictionQueryRolesOptionalParameters parameters) { + return listRestrictionQueryRolesWithHttpInfoAsync(restrictionQueryId, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Returns all roles that have a given restriction query. + * + * @param restrictionQueryId The ID of the restriction query. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<RestrictionQueryRolesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Authentication error -
404 Not found -
429 Too many requests -
+ */ + public ApiResponse listRestrictionQueryRolesWithHttpInfo( + String restrictionQueryId, ListRestrictionQueryRolesOptionalParameters parameters) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "listRestrictionQueryRoles"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'restrictionQueryId' is set + if (restrictionQueryId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'restrictionQueryId' when calling" + + " listRestrictionQueryRoles"); + } + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + // create path and map variables + String localVarPath = + "/api/v2/logs/config/restriction_queries/{restriction_query_id}/roles" + .replaceAll( + "\\{" + "restriction_query_id" + "\\}", + apiClient.escapeString(restrictionQueryId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.LogsRestrictionQueriesApi.listRestrictionQueryRoles", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List roles for a restriction query. + * + *

See {@link #listRestrictionQueryRolesWithHttpInfo}. + * + * @param restrictionQueryId The ID of the restriction query. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<RestrictionQueryRolesResponse>> + */ + public CompletableFuture> + listRestrictionQueryRolesWithHttpInfoAsync( + String restrictionQueryId, ListRestrictionQueryRolesOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listRestrictionQueryRoles"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'restrictionQueryId' is set + if (restrictionQueryId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'restrictionQueryId' when calling" + + " listRestrictionQueryRoles")); + return result; + } + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + // create path and map variables + String localVarPath = + "/api/v2/logs/config/restriction_queries/{restriction_query_id}/roles" + .replaceAll( + "\\{" + "restriction_query_id" + "\\}", + apiClient.escapeString(restrictionQueryId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.LogsRestrictionQueriesApi.listRestrictionQueryRoles", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } 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 all restriction queries for a given user. + * + *

See {@link #listUserRestrictionQueriesWithHttpInfo}. + * + * @param userId The ID of the user. (required) + * @return RestrictionQueryListResponse + * @throws ApiException if fails to make API call + */ + public RestrictionQueryListResponse listUserRestrictionQueries(String userId) + throws ApiException { + return listUserRestrictionQueriesWithHttpInfo(userId).getData(); + } + + /** + * Get all restriction queries for a given user. + * + *

See {@link #listUserRestrictionQueriesWithHttpInfoAsync}. + * + * @param userId The ID of the user. (required) + * @return CompletableFuture<RestrictionQueryListResponse> + */ + public CompletableFuture listUserRestrictionQueriesAsync( + String userId) { + return listUserRestrictionQueriesWithHttpInfoAsync(userId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get all restriction queries for a given user. + * + * @param userId The ID of the user. (required) + * @return ApiResponse<RestrictionQueryListResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Authentication error -
404 Not found -
429 Too many requests -
+ */ + public ApiResponse listUserRestrictionQueriesWithHttpInfo( + String userId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listUserRestrictionQueries"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException( + 400, "Missing the required parameter 'userId' when calling listUserRestrictionQueries"); + } + // create path and map variables + String localVarPath = + "/api/v2/logs/config/restriction_queries/user/{user_id}" + .replaceAll("\\{" + "user_id" + "\\}", apiClient.escapeString(userId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.LogsRestrictionQueriesApi.listUserRestrictionQueries", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get all restriction queries for a given user. + * + *

See {@link #listUserRestrictionQueriesWithHttpInfo}. + * + * @param userId The ID of the user. (required) + * @return CompletableFuture<ApiResponse<RestrictionQueryListResponse>> + */ + public CompletableFuture> + listUserRestrictionQueriesWithHttpInfoAsync(String userId) { + // Check if unstable operation is enabled + String operationId = "listUserRestrictionQueries"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'userId' is set + if (userId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'userId' when calling listUserRestrictionQueries")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/logs/config/restriction_queries/user/{user_id}" + .replaceAll("\\{" + "user_id" + "\\}", apiClient.escapeString(userId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.LogsRestrictionQueriesApi.listUserRestrictionQueries", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } 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() {}); + } + + /** + * Revoke role from a restriction query. + * + *

See {@link #removeRoleFromRestrictionQueryWithHttpInfo}. + * + * @param restrictionQueryId The ID of the restriction query. (required) + * @param body (required) + * @throws ApiException if fails to make API call + */ + public void removeRoleFromRestrictionQuery(String restrictionQueryId, RelationshipToRole body) + throws ApiException { + removeRoleFromRestrictionQueryWithHttpInfo(restrictionQueryId, body); + } + + /** + * Revoke role from a restriction query. + * + *

See {@link #removeRoleFromRestrictionQueryWithHttpInfoAsync}. + * + * @param restrictionQueryId The ID of the restriction query. (required) + * @param body (required) + * @return CompletableFuture + */ + public CompletableFuture removeRoleFromRestrictionQueryAsync( + String restrictionQueryId, RelationshipToRole body) { + return removeRoleFromRestrictionQueryWithHttpInfoAsync(restrictionQueryId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Removes a role from a restriction query. + * + * @param restrictionQueryId The ID of the restriction query. (required) + * @param body (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 OK -
400 Bad Request -
403 Authentication error -
404 Not found -
429 Too many requests -
+ */ + public ApiResponse removeRoleFromRestrictionQueryWithHttpInfo( + String restrictionQueryId, RelationshipToRole body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "removeRoleFromRestrictionQuery"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'restrictionQueryId' is set + if (restrictionQueryId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'restrictionQueryId' when calling" + + " removeRoleFromRestrictionQuery"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling removeRoleFromRestrictionQuery"); + } + // create path and map variables + String localVarPath = + "/api/v2/logs/config/restriction_queries/{restriction_query_id}/roles" + .replaceAll( + "\\{" + "restriction_query_id" + "\\}", + apiClient.escapeString(restrictionQueryId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.LogsRestrictionQueriesApi.removeRoleFromRestrictionQuery", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Revoke role from a restriction query. + * + *

See {@link #removeRoleFromRestrictionQueryWithHttpInfo}. + * + * @param restrictionQueryId The ID of the restriction query. (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> removeRoleFromRestrictionQueryWithHttpInfoAsync( + String restrictionQueryId, RelationshipToRole body) { + // Check if unstable operation is enabled + String operationId = "removeRoleFromRestrictionQuery"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'restrictionQueryId' is set + if (restrictionQueryId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'restrictionQueryId' when calling" + + " removeRoleFromRestrictionQuery")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling removeRoleFromRestrictionQuery")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/logs/config/restriction_queries/{restriction_query_id}/roles" + .replaceAll( + "\\{" + "restriction_query_id" + "\\}", + apiClient.escapeString(restrictionQueryId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.LogsRestrictionQueriesApi.removeRoleFromRestrictionQuery", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Replace a restriction query. + * + *

See {@link #replaceRestrictionQueryWithHttpInfo}. + * + * @param restrictionQueryId The ID of the restriction query. (required) + * @param body (required) + * @return RestrictionQueryWithoutRelationshipsResponse + * @throws ApiException if fails to make API call + */ + public RestrictionQueryWithoutRelationshipsResponse replaceRestrictionQuery( + String restrictionQueryId, RestrictionQueryUpdatePayload body) throws ApiException { + return replaceRestrictionQueryWithHttpInfo(restrictionQueryId, body).getData(); + } + + /** + * Replace a restriction query. + * + *

See {@link #replaceRestrictionQueryWithHttpInfoAsync}. + * + * @param restrictionQueryId The ID of the restriction query. (required) + * @param body (required) + * @return CompletableFuture<RestrictionQueryWithoutRelationshipsResponse> + */ + public CompletableFuture + replaceRestrictionQueryAsync(String restrictionQueryId, RestrictionQueryUpdatePayload body) { + return replaceRestrictionQueryWithHttpInfoAsync(restrictionQueryId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Replace a restriction query. + * + * @param restrictionQueryId The ID of the restriction query. (required) + * @param body (required) + * @return ApiResponse<RestrictionQueryWithoutRelationshipsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Authentication error -
404 Not found -
429 Too many requests -
+ */ + public ApiResponse + replaceRestrictionQueryWithHttpInfo( + String restrictionQueryId, RestrictionQueryUpdatePayload body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "replaceRestrictionQuery"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'restrictionQueryId' is set + if (restrictionQueryId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'restrictionQueryId' when calling" + + " replaceRestrictionQuery"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling replaceRestrictionQuery"); + } + // create path and map variables + String localVarPath = + "/api/v2/logs/config/restriction_queries/{restriction_query_id}" + .replaceAll( + "\\{" + "restriction_query_id" + "\\}", + apiClient.escapeString(restrictionQueryId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.LogsRestrictionQueriesApi.replaceRestrictionQuery", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Replace a restriction query. + * + *

See {@link #replaceRestrictionQueryWithHttpInfo}. + * + * @param restrictionQueryId The ID of the restriction query. (required) + * @param body (required) + * @return + * CompletableFuture<ApiResponse<RestrictionQueryWithoutRelationshipsResponse>> + */ + public CompletableFuture> + replaceRestrictionQueryWithHttpInfoAsync( + String restrictionQueryId, RestrictionQueryUpdatePayload body) { + // Check if unstable operation is enabled + String operationId = "replaceRestrictionQuery"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'restrictionQueryId' is set + if (restrictionQueryId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'restrictionQueryId' when calling" + + " replaceRestrictionQuery")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling replaceRestrictionQuery")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/logs/config/restriction_queries/{restriction_query_id}" + .replaceAll( + "\\{" + "restriction_query_id" + "\\}", + apiClient.escapeString(restrictionQueryId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.LogsRestrictionQueriesApi.replaceRestrictionQuery", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update a restriction query. + * + *

See {@link #updateRestrictionQueryWithHttpInfo}. + * + * @param restrictionQueryId The ID of the restriction query. (required) + * @param body (required) + * @return RestrictionQueryWithoutRelationshipsResponse + * @throws ApiException if fails to make API call + */ + public RestrictionQueryWithoutRelationshipsResponse updateRestrictionQuery( + String restrictionQueryId, RestrictionQueryUpdatePayload body) throws ApiException { + return updateRestrictionQueryWithHttpInfo(restrictionQueryId, body).getData(); + } + + /** + * Update a restriction query. + * + *

See {@link #updateRestrictionQueryWithHttpInfoAsync}. + * + * @param restrictionQueryId The ID of the restriction query. (required) + * @param body (required) + * @return CompletableFuture<RestrictionQueryWithoutRelationshipsResponse> + */ + public CompletableFuture + updateRestrictionQueryAsync(String restrictionQueryId, RestrictionQueryUpdatePayload body) { + return updateRestrictionQueryWithHttpInfoAsync(restrictionQueryId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Edit a restriction query. + * + * @param restrictionQueryId The ID of the restriction query. (required) + * @param body (required) + * @return ApiResponse<RestrictionQueryWithoutRelationshipsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Authentication error -
404 Not found -
429 Too many requests -
+ */ + public ApiResponse + updateRestrictionQueryWithHttpInfo( + String restrictionQueryId, RestrictionQueryUpdatePayload body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateRestrictionQuery"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'restrictionQueryId' is set + if (restrictionQueryId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'restrictionQueryId' when calling" + + " updateRestrictionQuery"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateRestrictionQuery"); + } + // create path and map variables + String localVarPath = + "/api/v2/logs/config/restriction_queries/{restriction_query_id}" + .replaceAll( + "\\{" + "restriction_query_id" + "\\}", + apiClient.escapeString(restrictionQueryId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.LogsRestrictionQueriesApi.updateRestrictionQuery", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update a restriction query. + * + *

See {@link #updateRestrictionQueryWithHttpInfo}. + * + * @param restrictionQueryId The ID of the restriction query. (required) + * @param body (required) + * @return + * CompletableFuture<ApiResponse<RestrictionQueryWithoutRelationshipsResponse>> + */ + public CompletableFuture> + updateRestrictionQueryWithHttpInfoAsync( + String restrictionQueryId, RestrictionQueryUpdatePayload body) { + // Check if unstable operation is enabled + String operationId = "updateRestrictionQuery"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'restrictionQueryId' is set + if (restrictionQueryId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'restrictionQueryId' when calling" + + " updateRestrictionQuery")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateRestrictionQuery")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/logs/config/restriction_queries/{restriction_query_id}" + .replaceAll( + "\\{" + "restriction_query_id" + "\\}", + apiClient.escapeString(restrictionQueryId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.LogsRestrictionQueriesApi.updateRestrictionQuery", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } +} 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..f0edff68fae 100644 --- a/src/main/java/com/datadog/api/client/v2/api/TeamsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/TeamsApi.java @@ -11,6 +11,10 @@ import com.datadog.api.client.v2.model.ListTeamsSort; import com.datadog.api.client.v2.model.Team; import com.datadog.api.client.v2.model.TeamCreateRequest; +import com.datadog.api.client.v2.model.TeamHierarchyLink; +import com.datadog.api.client.v2.model.TeamHierarchyLinkCreateRequest; +import com.datadog.api.client.v2.model.TeamHierarchyLinkResponse; +import com.datadog.api.client.v2.model.TeamHierarchyLinksResponse; import com.datadog.api.client.v2.model.TeamLinkCreateRequest; import com.datadog.api.client.v2.model.TeamLinkResponse; import com.datadog.api.client.v2.model.TeamLinksResponse; @@ -77,7 +81,9 @@ public void setApiClient(ApiClient apiClient) { * @param superTeamId None (required) * @param body (required) * @throws ApiException if fails to make API call + * @deprecated */ + @Deprecated public void addMemberTeam(String superTeamId, AddMemberTeamRequest body) throws ApiException { addMemberTeamWithHttpInfo(superTeamId, body); } @@ -90,7 +96,9 @@ public void addMemberTeam(String superTeamId, AddMemberTeamRequest body) throws * @param superTeamId None (required) * @param body (required) * @return CompletableFuture + * @deprecated */ + @Deprecated public CompletableFuture addMemberTeamAsync(String superTeamId, AddMemberTeamRequest body) { return addMemberTeamWithHttpInfoAsync(superTeamId, body) .thenApply( @@ -103,6 +111,9 @@ public CompletableFuture addMemberTeamAsync(String superTeamId, AddMemberT * Add a member team. Adds the team given by the id in the body as a member team of * the super team. * + *

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

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

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

See {@link #addTeamHierarchyLinkWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<TeamHierarchyLinkResponse>> + */ + public CompletableFuture> + addTeamHierarchyLinkWithHttpInfoAsync(TeamHierarchyLinkCreateRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling addTeamHierarchyLink")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/team-hierarchy-links"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.TeamsApi.addTeamHierarchyLink", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Create a team. * @@ -1258,6 +1407,141 @@ public CompletableFuture> getTeamWithHttpInfoAsync(Str 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() {}); + } + /** * Get a team link. * @@ -2328,7 +2612,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 +2627,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 +2647,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 +2663,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 +2682,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 +2697,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 +2738,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 +2755,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 +2819,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 @@ -2582,23 +2887,20 @@ public CompletableFuture> listMemberTeamsWithHttpInfo new GenericType() {}); } - /** Manage optional parameters to listTeams. */ - public static class ListTeamsOptionalParameters { + /** Manage optional parameters to listTeamHierarchyLinks. */ + public static class ListTeamHierarchyLinksOptionalParameters { private Long pageNumber; private Long pageSize; - private ListTeamsSort sort; - private List include; - private String filterKeyword; - private Boolean filterMe; - private List fieldsTeam; + private String filterParentTeam; + private String filterSubTeam; /** * Set pageNumber. * * @param pageNumber Specific page number to return. (optional, default to 0) - * @return ListTeamsOptionalParameters + * @return ListTeamHierarchyLinksOptionalParameters */ - public ListTeamsOptionalParameters pageNumber(Long pageNumber) { + public ListTeamHierarchyLinksOptionalParameters pageNumber(Long pageNumber) { this.pageNumber = pageNumber; return this; } @@ -2608,54 +2910,331 @@ public ListTeamsOptionalParameters pageNumber(Long pageNumber) { * * @param pageSize Size for a given page. The maximum allowed value is 100. (optional, default * to 10) - * @return ListTeamsOptionalParameters + * @return ListTeamHierarchyLinksOptionalParameters */ - public ListTeamsOptionalParameters pageSize(Long pageSize) { + public ListTeamHierarchyLinksOptionalParameters pageSize(Long pageSize) { this.pageSize = pageSize; return this; } /** - * Set sort. + * Set filterParentTeam. * - * @param sort Specifies the order of the returned teams (optional) - * @return ListTeamsOptionalParameters + * @param filterParentTeam Filter by parent team ID (optional) + * @return ListTeamHierarchyLinksOptionalParameters */ - public ListTeamsOptionalParameters sort(ListTeamsSort sort) { - this.sort = sort; + public ListTeamHierarchyLinksOptionalParameters filterParentTeam(String filterParentTeam) { + this.filterParentTeam = filterParentTeam; return this; } /** - * Set include. + * Set filterSubTeam. * - * @param include Included related resources optionally requested. Allowed enum values: - * team_links, user_team_permissions (optional) - * @return ListTeamsOptionalParameters + * @param filterSubTeam Filter by sub team ID (optional) + * @return ListTeamHierarchyLinksOptionalParameters */ - public ListTeamsOptionalParameters include(List include) { - this.include = include; + public ListTeamHierarchyLinksOptionalParameters filterSubTeam(String filterSubTeam) { + this.filterSubTeam = filterSubTeam; return this; } + } - /** - * Set filterKeyword. - * - * @param filterKeyword Search query. Can be team name, team handle, or email of team member - * (optional) - * @return ListTeamsOptionalParameters - */ - public ListTeamsOptionalParameters filterKeyword(String filterKeyword) { - this.filterKeyword = filterKeyword; - return this; - } + /** + * Get team hierarchy links. + * + *

See {@link #listTeamHierarchyLinksWithHttpInfo}. + * + * @return TeamHierarchyLinksResponse + * @throws ApiException if fails to make API call + */ + public TeamHierarchyLinksResponse listTeamHierarchyLinks() throws ApiException { + return listTeamHierarchyLinksWithHttpInfo(new ListTeamHierarchyLinksOptionalParameters()) + .getData(); + } - /** - * Set filterMe. - * - * @param filterMe When true, only returns teams the current user belongs to (optional) - * @return ListTeamsOptionalParameters - */ + /** + * Get team hierarchy links. + * + *

See {@link #listTeamHierarchyLinksWithHttpInfoAsync}. + * + * @return CompletableFuture<TeamHierarchyLinksResponse> + */ + public CompletableFuture listTeamHierarchyLinksAsync() { + return listTeamHierarchyLinksWithHttpInfoAsync(new ListTeamHierarchyLinksOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get team hierarchy links. + * + *

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

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

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

See {@link #listTeamHierarchyLinksWithHttpInfo}. + * + * @return TeamHierarchyLinksResponse + */ + public PaginationIterable listTeamHierarchyLinksWithPagination( + ListTeamHierarchyLinksOptionalParameters 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, + "listTeamHierarchyLinks", + resultsPath, + valueGetterPath, + valueSetterPath, + valueSetterParamOptional, + false, + limit, + args); + + return iterator; + } + + /** + * List 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 + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse listTeamHierarchyLinksWithHttpInfo( + ListTeamHierarchyLinksOptionalParameters parameters) throws ApiException { + Object localVarPostBody = null; + 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-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.listTeamHierarchyLinks", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get team hierarchy links. + * + *

See {@link #listTeamHierarchyLinksWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<TeamHierarchyLinksResponse>> + */ + public CompletableFuture> + listTeamHierarchyLinksWithHttpInfoAsync(ListTeamHierarchyLinksOptionalParameters parameters) { + Object localVarPostBody = null; + 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-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.listTeamHierarchyLinks", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to listTeams. */ + public static class ListTeamsOptionalParameters { + private Long pageNumber; + private Long pageSize; + private ListTeamsSort sort; + private List include; + private String filterKeyword; + private Boolean filterMe; + private List fieldsTeam; + + /** + * Set pageNumber. + * + * @param pageNumber Specific page number to return. (optional, default to 0) + * @return ListTeamsOptionalParameters + */ + public ListTeamsOptionalParameters 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 ListTeamsOptionalParameters + */ + public ListTeamsOptionalParameters pageSize(Long pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Set sort. + * + * @param sort Specifies the order of the returned teams (optional) + * @return ListTeamsOptionalParameters + */ + public ListTeamsOptionalParameters sort(ListTeamsSort sort) { + this.sort = sort; + return this; + } + + /** + * Set include. + * + * @param include Included related resources optionally requested. Allowed enum values: + * team_links, user_team_permissions (optional) + * @return ListTeamsOptionalParameters + */ + public ListTeamsOptionalParameters include(List include) { + this.include = include; + return this; + } + + /** + * Set filterKeyword. + * + * @param filterKeyword Search query. Can be team name, team handle, or email of team member + * (optional) + * @return ListTeamsOptionalParameters + */ + public ListTeamsOptionalParameters filterKeyword(String filterKeyword) { + this.filterKeyword = filterKeyword; + return this; + } + + /** + * Set filterMe. + * + * @param filterMe When true, only returns teams the current user belongs to (optional) + * @return ListTeamsOptionalParameters + */ public ListTeamsOptionalParameters filterMe(Boolean filterMe) { this.filterMe = filterMe; return this; @@ -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/LogsRestrictionQueriesType.java b/src/main/java/com/datadog/api/client/v2/model/LogsRestrictionQueriesType.java new file mode 100644 index 00000000000..8a34072570d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/LogsRestrictionQueriesType.java @@ -0,0 +1,57 @@ +/* + * 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; + +/** Restriction query resource type. */ +@JsonSerialize(using = LogsRestrictionQueriesType.LogsRestrictionQueriesTypeSerializer.class) +public class LogsRestrictionQueriesType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("logs_restriction_queries")); + + public static final LogsRestrictionQueriesType LOGS_RESTRICTION_QUERIES = + new LogsRestrictionQueriesType("logs_restriction_queries"); + + LogsRestrictionQueriesType(String value) { + super(value, allowedValues); + } + + public static class LogsRestrictionQueriesTypeSerializer + extends StdSerializer { + public LogsRestrictionQueriesTypeSerializer(Class t) { + super(t); + } + + public LogsRestrictionQueriesTypeSerializer() { + this(null); + } + + @Override + public void serialize( + LogsRestrictionQueriesType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static LogsRestrictionQueriesType fromValue(String value) { + return new LogsRestrictionQueriesType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RelationshipToUserTeamPermission.java b/src/main/java/com/datadog/api/client/v2/model/RelationshipToUserTeamPermission.java index c998bc232a0..b332897c7a5 100644 --- a/src/main/java/com/datadog/api/client/v2/model/RelationshipToUserTeamPermission.java +++ b/src/main/java/com/datadog/api/client/v2/model/RelationshipToUserTeamPermission.java @@ -15,6 +15,7 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; /** Relationship between a user team permission and a team */ @JsonPropertyOrder({ @@ -26,14 +27,14 @@ public class RelationshipToUserTeamPermission { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_DATA = "data"; - private RelationshipToUserTeamPermissionData data; + private JsonNullable data = + JsonNullable.undefined(); public static final String JSON_PROPERTY_LINKS = "links"; private TeamRelationshipsLinks links; public RelationshipToUserTeamPermission data(RelationshipToUserTeamPermissionData data) { - this.data = data; - this.unparsed |= data.unparsed; + this.data = JsonNullable.of(data); return this; } @@ -43,16 +44,26 @@ public RelationshipToUserTeamPermission data(RelationshipToUserTeamPermissionDat * @return data */ @jakarta.annotation.Nullable + @JsonIgnore + public RelationshipToUserTeamPermissionData getData() { + return data.orElse(null); + } + @JsonProperty(JSON_PROPERTY_DATA) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public RelationshipToUserTeamPermissionData getData() { + public JsonNullable getData_JsonNullable() { return data; } - public void setData(RelationshipToUserTeamPermissionData data) { + @JsonProperty(JSON_PROPERTY_DATA) + public void setData_JsonNullable(JsonNullable data) { this.data = data; } + public void setData(RelationshipToUserTeamPermissionData data) { + this.data = JsonNullable.of(data); + } + public RelationshipToUserTeamPermission links(TeamRelationshipsLinks links) { this.links = links; this.unparsed |= links.unparsed; diff --git a/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryAttributes.java b/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryAttributes.java new file mode 100644 index 00000000000..f423067f239 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryAttributes.java @@ -0,0 +1,255 @@ +/* + * 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.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes of the restriction query. */ +@JsonPropertyOrder({ + RestrictionQueryAttributes.JSON_PROPERTY_CREATED_AT, + RestrictionQueryAttributes.JSON_PROPERTY_LAST_MODIFIER_EMAIL, + RestrictionQueryAttributes.JSON_PROPERTY_LAST_MODIFIER_NAME, + RestrictionQueryAttributes.JSON_PROPERTY_MODIFIED_AT, + RestrictionQueryAttributes.JSON_PROPERTY_RESTRICTION_QUERY, + RestrictionQueryAttributes.JSON_PROPERTY_ROLE_COUNT, + RestrictionQueryAttributes.JSON_PROPERTY_USER_COUNT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RestrictionQueryAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_LAST_MODIFIER_EMAIL = "last_modifier_email"; + private String lastModifierEmail; + + public static final String JSON_PROPERTY_LAST_MODIFIER_NAME = "last_modifier_name"; + private String lastModifierName; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at"; + private OffsetDateTime modifiedAt; + + public static final String JSON_PROPERTY_RESTRICTION_QUERY = "restriction_query"; + private String restrictionQuery; + + public static final String JSON_PROPERTY_ROLE_COUNT = "role_count"; + private Long roleCount; + + public static final String JSON_PROPERTY_USER_COUNT = "user_count"; + private Long userCount; + + /** + * Creation time of the restriction query. + * + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * Email of the user who last modified this restriction query. + * + * @return lastModifierEmail + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_MODIFIER_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastModifierEmail() { + return lastModifierEmail; + } + + /** + * Name of the user who last modified this restriction query. + * + * @return lastModifierName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_MODIFIER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastModifierName() { + return lastModifierName; + } + + /** + * Time of last restriction query modification. + * + * @return modifiedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getModifiedAt() { + return modifiedAt; + } + + public RestrictionQueryAttributes restrictionQuery(String restrictionQuery) { + this.restrictionQuery = restrictionQuery; + return this; + } + + /** + * The query that defines the restriction. Only the content matching the query can be returned. + * + * @return restrictionQuery + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESTRICTION_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRestrictionQuery() { + return restrictionQuery; + } + + public void setRestrictionQuery(String restrictionQuery) { + this.restrictionQuery = restrictionQuery; + } + + /** + * Number of roles associated with this restriction query. + * + * @return roleCount + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ROLE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getRoleCount() { + return roleCount; + } + + /** + * Number of users associated with this restriction query. + * + * @return userCount + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USER_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getUserCount() { + return 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 RestrictionQueryAttributes + */ + @JsonAnySetter + public RestrictionQueryAttributes 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 RestrictionQueryAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RestrictionQueryAttributes restrictionQueryAttributes = (RestrictionQueryAttributes) o; + return Objects.equals(this.createdAt, restrictionQueryAttributes.createdAt) + && Objects.equals(this.lastModifierEmail, restrictionQueryAttributes.lastModifierEmail) + && Objects.equals(this.lastModifierName, restrictionQueryAttributes.lastModifierName) + && Objects.equals(this.modifiedAt, restrictionQueryAttributes.modifiedAt) + && Objects.equals(this.restrictionQuery, restrictionQueryAttributes.restrictionQuery) + && Objects.equals(this.roleCount, restrictionQueryAttributes.roleCount) + && Objects.equals(this.userCount, restrictionQueryAttributes.userCount) + && Objects.equals( + this.additionalProperties, restrictionQueryAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + createdAt, + lastModifierEmail, + lastModifierName, + modifiedAt, + restrictionQuery, + roleCount, + userCount, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RestrictionQueryAttributes {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" lastModifierEmail: ").append(toIndentedString(lastModifierEmail)).append("\n"); + sb.append(" lastModifierName: ").append(toIndentedString(lastModifierName)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" restrictionQuery: ").append(toIndentedString(restrictionQuery)).append("\n"); + sb.append(" roleCount: ").append(toIndentedString(roleCount)).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/RestrictionQueryCreateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryCreateAttributes.java new file mode 100644 index 00000000000..023837fd087 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryCreateAttributes.java @@ -0,0 +1,146 @@ +/* + * 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; + +/** Attributes of the created restriction query. */ +@JsonPropertyOrder({RestrictionQueryCreateAttributes.JSON_PROPERTY_RESTRICTION_QUERY}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RestrictionQueryCreateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_RESTRICTION_QUERY = "restriction_query"; + private String restrictionQuery; + + public RestrictionQueryCreateAttributes() {} + + @JsonCreator + public RestrictionQueryCreateAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_RESTRICTION_QUERY) + String restrictionQuery) { + this.restrictionQuery = restrictionQuery; + } + + public RestrictionQueryCreateAttributes restrictionQuery(String restrictionQuery) { + this.restrictionQuery = restrictionQuery; + return this; + } + + /** + * The restriction query. + * + * @return restrictionQuery + */ + @JsonProperty(JSON_PROPERTY_RESTRICTION_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getRestrictionQuery() { + return restrictionQuery; + } + + public void setRestrictionQuery(String restrictionQuery) { + this.restrictionQuery = restrictionQuery; + } + + /** + * 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 RestrictionQueryCreateAttributes + */ + @JsonAnySetter + public RestrictionQueryCreateAttributes 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 RestrictionQueryCreateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RestrictionQueryCreateAttributes restrictionQueryCreateAttributes = + (RestrictionQueryCreateAttributes) o; + return Objects.equals(this.restrictionQuery, restrictionQueryCreateAttributes.restrictionQuery) + && Objects.equals( + this.additionalProperties, restrictionQueryCreateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(restrictionQuery, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RestrictionQueryCreateAttributes {\n"); + sb.append(" restrictionQuery: ").append(toIndentedString(restrictionQuery)).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/RestrictionQueryCreateData.java b/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryCreateData.java new file mode 100644 index 00000000000..775db7d9244 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryCreateData.java @@ -0,0 +1,170 @@ +/* + * 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; + +/** Data related to the creation of a restriction query. */ +@JsonPropertyOrder({ + RestrictionQueryCreateData.JSON_PROPERTY_ATTRIBUTES, + RestrictionQueryCreateData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RestrictionQueryCreateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private RestrictionQueryCreateAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private LogsRestrictionQueriesType type = LogsRestrictionQueriesType.LOGS_RESTRICTION_QUERIES; + + public RestrictionQueryCreateData attributes(RestrictionQueryCreateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of the created restriction query. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RestrictionQueryCreateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(RestrictionQueryCreateAttributes attributes) { + this.attributes = attributes; + } + + public RestrictionQueryCreateData type(LogsRestrictionQueriesType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Restriction query resource type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LogsRestrictionQueriesType getType() { + return type; + } + + public void setType(LogsRestrictionQueriesType 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 RestrictionQueryCreateData + */ + @JsonAnySetter + public RestrictionQueryCreateData 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 RestrictionQueryCreateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RestrictionQueryCreateData restrictionQueryCreateData = (RestrictionQueryCreateData) o; + return Objects.equals(this.attributes, restrictionQueryCreateData.attributes) + && Objects.equals(this.type, restrictionQueryCreateData.type) + && Objects.equals( + this.additionalProperties, restrictionQueryCreateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RestrictionQueryCreateData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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/RestrictionQueryCreatePayload.java b/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryCreatePayload.java new file mode 100644 index 00000000000..1c46ae2e825 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryCreatePayload.java @@ -0,0 +1,137 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Create a restriction query. */ +@JsonPropertyOrder({RestrictionQueryCreatePayload.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RestrictionQueryCreatePayload { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private RestrictionQueryCreateData data; + + public RestrictionQueryCreatePayload data(RestrictionQueryCreateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data related to the creation of a restriction query. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RestrictionQueryCreateData getData() { + return data; + } + + public void setData(RestrictionQueryCreateData 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 RestrictionQueryCreatePayload + */ + @JsonAnySetter + public RestrictionQueryCreatePayload 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 RestrictionQueryCreatePayload object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RestrictionQueryCreatePayload restrictionQueryCreatePayload = (RestrictionQueryCreatePayload) o; + return Objects.equals(this.data, restrictionQueryCreatePayload.data) + && Objects.equals( + this.additionalProperties, restrictionQueryCreatePayload.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RestrictionQueryCreatePayload {\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/RestrictionQueryListResponse.java b/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryListResponse.java new file mode 100644 index 00000000000..2eb7a68cdea --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryListResponse.java @@ -0,0 +1,150 @@ +/* + * 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; + +/** Response containing information about multiple restriction queries. */ +@JsonPropertyOrder({RestrictionQueryListResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RestrictionQueryListResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public RestrictionQueryListResponse data(List data) { + this.data = data; + for (RestrictionQueryWithoutRelationships item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public RestrictionQueryListResponse addDataItem(RestrictionQueryWithoutRelationships dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Array of returned restriction queries. + * + * @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; + } + + /** + * 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 RestrictionQueryListResponse + */ + @JsonAnySetter + public RestrictionQueryListResponse 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 RestrictionQueryListResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RestrictionQueryListResponse restrictionQueryListResponse = (RestrictionQueryListResponse) o; + return Objects.equals(this.data, restrictionQueryListResponse.data) + && Objects.equals( + this.additionalProperties, restrictionQueryListResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RestrictionQueryListResponse {\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/RestrictionQueryResponseIncludedItem.java b/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryResponseIncludedItem.java new file mode 100644 index 00000000000..5955109bc61 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryResponseIncludedItem.java @@ -0,0 +1,221 @@ +/* + * 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.AbstractOpenApiSchema; +import com.datadog.api.client.JSON; +import com.datadog.api.client.UnparsedObject; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import jakarta.ws.rs.core.GenericType; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +@JsonDeserialize( + using = + RestrictionQueryResponseIncludedItem.RestrictionQueryResponseIncludedItemDeserializer.class) +@JsonSerialize( + using = + RestrictionQueryResponseIncludedItem.RestrictionQueryResponseIncludedItemSerializer.class) +public class RestrictionQueryResponseIncludedItem extends AbstractOpenApiSchema { + private static final Logger log = + Logger.getLogger(RestrictionQueryResponseIncludedItem.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class RestrictionQueryResponseIncludedItemSerializer + extends StdSerializer { + public RestrictionQueryResponseIncludedItemSerializer( + Class t) { + super(t); + } + + public RestrictionQueryResponseIncludedItemSerializer() { + this(null); + } + + @Override + public void serialize( + RestrictionQueryResponseIncludedItem value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class RestrictionQueryResponseIncludedItemDeserializer + extends StdDeserializer { + public RestrictionQueryResponseIncludedItemDeserializer() { + this(RestrictionQueryResponseIncludedItem.class); + } + + public RestrictionQueryResponseIncludedItemDeserializer(Class vc) { + super(vc); + } + + @Override + public RestrictionQueryResponseIncludedItem deserialize( + JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + Object tmp = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize RestrictionQueryRole + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (RestrictionQueryRole.class.equals(Integer.class) + || RestrictionQueryRole.class.equals(Long.class) + || RestrictionQueryRole.class.equals(Float.class) + || RestrictionQueryRole.class.equals(Double.class) + || RestrictionQueryRole.class.equals(Boolean.class) + || RestrictionQueryRole.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((RestrictionQueryRole.class.equals(Integer.class) + || RestrictionQueryRole.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((RestrictionQueryRole.class.equals(Float.class) + || RestrictionQueryRole.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (RestrictionQueryRole.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (RestrictionQueryRole.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(RestrictionQueryRole.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((RestrictionQueryRole) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'RestrictionQueryRole'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'RestrictionQueryRole'", e); + } + + RestrictionQueryResponseIncludedItem ret = new RestrictionQueryResponseIncludedItem(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public RestrictionQueryResponseIncludedItem getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException( + ctxt.getParser(), "RestrictionQueryResponseIncludedItem cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public RestrictionQueryResponseIncludedItem() { + super("oneOf", Boolean.FALSE); + } + + public RestrictionQueryResponseIncludedItem(RestrictionQueryRole o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("RestrictionQueryRole", new GenericType() {}); + JSON.registerDescendants( + RestrictionQueryResponseIncludedItem.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return RestrictionQueryResponseIncludedItem.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: RestrictionQueryRole + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(RestrictionQueryRole.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException("Invalid instance type. Must be RestrictionQueryRole"); + } + + /** + * Get the actual instance, which can be the following: RestrictionQueryRole + * + * @return The actual instance (RestrictionQueryRole) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `RestrictionQueryRole`. If the actual instance is not + * `RestrictionQueryRole`, the ClassCastException will be thrown. + * + * @return The actual instance of `RestrictionQueryRole` + * @throws ClassCastException if the instance is not `RestrictionQueryRole` + */ + public RestrictionQueryRole getRestrictionQueryRole() throws ClassCastException { + return (RestrictionQueryRole) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryRole.java b/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryRole.java new file mode 100644 index 00000000000..e12ca9b8ed2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryRole.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; + +/** Partial role object. */ +@JsonPropertyOrder({ + RestrictionQueryRole.JSON_PROPERTY_ATTRIBUTES, + RestrictionQueryRole.JSON_PROPERTY_ID, + RestrictionQueryRole.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RestrictionQueryRole { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private RestrictionQueryRoleAttribute attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private RolesType type = RolesType.ROLES; + + public RestrictionQueryRole() {} + + @JsonCreator + public RestrictionQueryRole( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + RestrictionQueryRoleAttribute attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) RolesType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public RestrictionQueryRole attributes(RestrictionQueryRoleAttribute attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of the role for a restriction query. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RestrictionQueryRoleAttribute getAttributes() { + return attributes; + } + + public void setAttributes(RestrictionQueryRoleAttribute attributes) { + this.attributes = attributes; + } + + public RestrictionQueryRole id(String id) { + this.id = id; + return this; + } + + /** + * ID of the role. + * + * @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 RestrictionQueryRole type(RolesType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Roles type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RolesType getType() { + return type; + } + + public void setType(RolesType 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 RestrictionQueryRole + */ + @JsonAnySetter + public RestrictionQueryRole 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 RestrictionQueryRole object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RestrictionQueryRole restrictionQueryRole = (RestrictionQueryRole) o; + return Objects.equals(this.attributes, restrictionQueryRole.attributes) + && Objects.equals(this.id, restrictionQueryRole.id) + && Objects.equals(this.type, restrictionQueryRole.type) + && Objects.equals(this.additionalProperties, restrictionQueryRole.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RestrictionQueryRole {\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/RestrictionQueryRoleAttribute.java b/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryRoleAttribute.java new file mode 100644 index 00000000000..b19ef645d00 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryRoleAttribute.java @@ -0,0 +1,136 @@ +/* + * 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; + +/** Attributes of the role for a restriction query. */ +@JsonPropertyOrder({RestrictionQueryRoleAttribute.JSON_PROPERTY_NAME}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RestrictionQueryRoleAttribute { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public RestrictionQueryRoleAttribute name(String name) { + this.name = name; + return this; + } + + /** + * The role name. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * 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 RestrictionQueryRoleAttribute + */ + @JsonAnySetter + public RestrictionQueryRoleAttribute 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 RestrictionQueryRoleAttribute object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RestrictionQueryRoleAttribute restrictionQueryRoleAttribute = (RestrictionQueryRoleAttribute) o; + return Objects.equals(this.name, restrictionQueryRoleAttribute.name) + && Objects.equals( + this.additionalProperties, restrictionQueryRoleAttribute.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RestrictionQueryRoleAttribute {\n"); + sb.append(" name: ").append(toIndentedString(name)).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/RestrictionQueryRolesResponse.java b/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryRolesResponse.java new file mode 100644 index 00000000000..ac29d18e711 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryRolesResponse.java @@ -0,0 +1,150 @@ +/* + * 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; + +/** Response containing information about roles attached to a restriction query. */ +@JsonPropertyOrder({RestrictionQueryRolesResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RestrictionQueryRolesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public RestrictionQueryRolesResponse data(List data) { + this.data = data; + for (RestrictionQueryRole item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public RestrictionQueryRolesResponse addDataItem(RestrictionQueryRole dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Array of roles. + * + * @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; + } + + /** + * 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 RestrictionQueryRolesResponse + */ + @JsonAnySetter + public RestrictionQueryRolesResponse 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 RestrictionQueryRolesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RestrictionQueryRolesResponse restrictionQueryRolesResponse = (RestrictionQueryRolesResponse) o; + return Objects.equals(this.data, restrictionQueryRolesResponse.data) + && Objects.equals( + this.additionalProperties, restrictionQueryRolesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RestrictionQueryRolesResponse {\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/RestrictionQueryUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryUpdateAttributes.java new file mode 100644 index 00000000000..65f07a35013 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryUpdateAttributes.java @@ -0,0 +1,146 @@ +/* + * 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; + +/** Attributes of the edited restriction query. */ +@JsonPropertyOrder({RestrictionQueryUpdateAttributes.JSON_PROPERTY_RESTRICTION_QUERY}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RestrictionQueryUpdateAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_RESTRICTION_QUERY = "restriction_query"; + private String restrictionQuery; + + public RestrictionQueryUpdateAttributes() {} + + @JsonCreator + public RestrictionQueryUpdateAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_RESTRICTION_QUERY) + String restrictionQuery) { + this.restrictionQuery = restrictionQuery; + } + + public RestrictionQueryUpdateAttributes restrictionQuery(String restrictionQuery) { + this.restrictionQuery = restrictionQuery; + return this; + } + + /** + * The restriction query. + * + * @return restrictionQuery + */ + @JsonProperty(JSON_PROPERTY_RESTRICTION_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getRestrictionQuery() { + return restrictionQuery; + } + + public void setRestrictionQuery(String restrictionQuery) { + this.restrictionQuery = restrictionQuery; + } + + /** + * 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 RestrictionQueryUpdateAttributes + */ + @JsonAnySetter + public RestrictionQueryUpdateAttributes 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 RestrictionQueryUpdateAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RestrictionQueryUpdateAttributes restrictionQueryUpdateAttributes = + (RestrictionQueryUpdateAttributes) o; + return Objects.equals(this.restrictionQuery, restrictionQueryUpdateAttributes.restrictionQuery) + && Objects.equals( + this.additionalProperties, restrictionQueryUpdateAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(restrictionQuery, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RestrictionQueryUpdateAttributes {\n"); + sb.append(" restrictionQuery: ").append(toIndentedString(restrictionQuery)).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/RestrictionQueryUpdateData.java b/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryUpdateData.java new file mode 100644 index 00000000000..3ac6378d18f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryUpdateData.java @@ -0,0 +1,170 @@ +/* + * 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; + +/** Data related to the update of a restriction query. */ +@JsonPropertyOrder({ + RestrictionQueryUpdateData.JSON_PROPERTY_ATTRIBUTES, + RestrictionQueryUpdateData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RestrictionQueryUpdateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private RestrictionQueryUpdateAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private LogsRestrictionQueriesType type = LogsRestrictionQueriesType.LOGS_RESTRICTION_QUERIES; + + public RestrictionQueryUpdateData attributes(RestrictionQueryUpdateAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of the edited restriction query. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RestrictionQueryUpdateAttributes getAttributes() { + return attributes; + } + + public void setAttributes(RestrictionQueryUpdateAttributes attributes) { + this.attributes = attributes; + } + + public RestrictionQueryUpdateData type(LogsRestrictionQueriesType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Restriction query resource type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LogsRestrictionQueriesType getType() { + return type; + } + + public void setType(LogsRestrictionQueriesType 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 RestrictionQueryUpdateData + */ + @JsonAnySetter + public RestrictionQueryUpdateData 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 RestrictionQueryUpdateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RestrictionQueryUpdateData restrictionQueryUpdateData = (RestrictionQueryUpdateData) o; + return Objects.equals(this.attributes, restrictionQueryUpdateData.attributes) + && Objects.equals(this.type, restrictionQueryUpdateData.type) + && Objects.equals( + this.additionalProperties, restrictionQueryUpdateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RestrictionQueryUpdateData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).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/RestrictionQueryUpdatePayload.java b/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryUpdatePayload.java new file mode 100644 index 00000000000..18aa4941f33 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryUpdatePayload.java @@ -0,0 +1,137 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Update a restriction query. */ +@JsonPropertyOrder({RestrictionQueryUpdatePayload.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RestrictionQueryUpdatePayload { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private RestrictionQueryUpdateData data; + + public RestrictionQueryUpdatePayload data(RestrictionQueryUpdateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data related to the update of a restriction query. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RestrictionQueryUpdateData getData() { + return data; + } + + public void setData(RestrictionQueryUpdateData 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 RestrictionQueryUpdatePayload + */ + @JsonAnySetter + public RestrictionQueryUpdatePayload 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 RestrictionQueryUpdatePayload object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RestrictionQueryUpdatePayload restrictionQueryUpdatePayload = (RestrictionQueryUpdatePayload) o; + return Objects.equals(this.data, restrictionQueryUpdatePayload.data) + && Objects.equals( + this.additionalProperties, restrictionQueryUpdatePayload.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RestrictionQueryUpdatePayload {\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/RestrictionQueryWithRelationships.java b/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryWithRelationships.java new file mode 100644 index 00000000000..b85e74994a8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryWithRelationships.java @@ -0,0 +1,226 @@ +/* + * 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; + +/** Restriction query object returned by the API. */ +@JsonPropertyOrder({ + RestrictionQueryWithRelationships.JSON_PROPERTY_ATTRIBUTES, + RestrictionQueryWithRelationships.JSON_PROPERTY_ID, + RestrictionQueryWithRelationships.JSON_PROPERTY_RELATIONSHIPS, + RestrictionQueryWithRelationships.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RestrictionQueryWithRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private RestrictionQueryAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private UserRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private LogsRestrictionQueriesType type = LogsRestrictionQueriesType.LOGS_RESTRICTION_QUERIES; + + public RestrictionQueryWithRelationships attributes(RestrictionQueryAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of the restriction query. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RestrictionQueryAttributes getAttributes() { + return attributes; + } + + public void setAttributes(RestrictionQueryAttributes attributes) { + this.attributes = attributes; + } + + public RestrictionQueryWithRelationships id(String id) { + this.id = id; + return this; + } + + /** + * ID of the restriction query. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public RestrictionQueryWithRelationships relationships(UserRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationships of the user object. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UserRelationships getRelationships() { + return relationships; + } + + public void setRelationships(UserRelationships relationships) { + this.relationships = relationships; + } + + public RestrictionQueryWithRelationships type(LogsRestrictionQueriesType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Restriction query resource type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LogsRestrictionQueriesType getType() { + return type; + } + + public void setType(LogsRestrictionQueriesType 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 RestrictionQueryWithRelationships + */ + @JsonAnySetter + public RestrictionQueryWithRelationships 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 RestrictionQueryWithRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RestrictionQueryWithRelationships restrictionQueryWithRelationships = + (RestrictionQueryWithRelationships) o; + return Objects.equals(this.attributes, restrictionQueryWithRelationships.attributes) + && Objects.equals(this.id, restrictionQueryWithRelationships.id) + && Objects.equals(this.relationships, restrictionQueryWithRelationships.relationships) + && Objects.equals(this.type, restrictionQueryWithRelationships.type) + && Objects.equals( + this.additionalProperties, restrictionQueryWithRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RestrictionQueryWithRelationships {\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/RestrictionQueryWithRelationshipsResponse.java b/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryWithRelationshipsResponse.java new file mode 100644 index 00000000000..267ae4994e7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryWithRelationshipsResponse.java @@ -0,0 +1,184 @@ +/* + * 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; + +/** Response containing information about a single restriction query. */ +@JsonPropertyOrder({ + RestrictionQueryWithRelationshipsResponse.JSON_PROPERTY_DATA, + RestrictionQueryWithRelationshipsResponse.JSON_PROPERTY_INCLUDED +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RestrictionQueryWithRelationshipsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private RestrictionQueryWithRelationships data; + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = null; + + public RestrictionQueryWithRelationshipsResponse data(RestrictionQueryWithRelationships data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Restriction query object returned by the API. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RestrictionQueryWithRelationships getData() { + return data; + } + + public void setData(RestrictionQueryWithRelationships data) { + this.data = data; + } + + public RestrictionQueryWithRelationshipsResponse included( + List included) { + this.included = included; + for (RestrictionQueryResponseIncludedItem item : included) { + this.unparsed |= item.unparsed; + } + return this; + } + + public RestrictionQueryWithRelationshipsResponse addIncludedItem( + RestrictionQueryResponseIncludedItem includedItem) { + if (this.included == null) { + this.included = new ArrayList<>(); + } + this.included.add(includedItem); + this.unparsed |= includedItem.unparsed; + return this; + } + + /** + * Array of objects related to the restriction query. + * + * @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 RestrictionQueryWithRelationshipsResponse + */ + @JsonAnySetter + public RestrictionQueryWithRelationshipsResponse 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 RestrictionQueryWithRelationshipsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RestrictionQueryWithRelationshipsResponse restrictionQueryWithRelationshipsResponse = + (RestrictionQueryWithRelationshipsResponse) o; + return Objects.equals(this.data, restrictionQueryWithRelationshipsResponse.data) + && Objects.equals(this.included, restrictionQueryWithRelationshipsResponse.included) + && Objects.equals( + this.additionalProperties, + restrictionQueryWithRelationshipsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RestrictionQueryWithRelationshipsResponse {\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/RestrictionQueryWithoutRelationships.java b/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryWithoutRelationships.java new file mode 100644 index 00000000000..d98f1d119af --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryWithoutRelationships.java @@ -0,0 +1,185 @@ +/* + * 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; + +/** Restriction query object returned by the API. */ +@JsonPropertyOrder({ + RestrictionQueryWithoutRelationships.JSON_PROPERTY_ATTRIBUTES, + RestrictionQueryWithoutRelationships.JSON_PROPERTY_ID, + RestrictionQueryWithoutRelationships.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RestrictionQueryWithoutRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private RestrictionQueryAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "logs_restriction_queries"; + + public RestrictionQueryWithoutRelationships attributes(RestrictionQueryAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of the restriction query. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RestrictionQueryAttributes getAttributes() { + return attributes; + } + + public void setAttributes(RestrictionQueryAttributes attributes) { + this.attributes = attributes; + } + + public RestrictionQueryWithoutRelationships id(String id) { + this.id = id; + return this; + } + + /** + * ID of the restriction query. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + /** + * Restriction queries type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return 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 RestrictionQueryWithoutRelationships + */ + @JsonAnySetter + public RestrictionQueryWithoutRelationships 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 RestrictionQueryWithoutRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RestrictionQueryWithoutRelationships restrictionQueryWithoutRelationships = + (RestrictionQueryWithoutRelationships) o; + return Objects.equals(this.attributes, restrictionQueryWithoutRelationships.attributes) + && Objects.equals(this.id, restrictionQueryWithoutRelationships.id) + && Objects.equals(this.type, restrictionQueryWithoutRelationships.type) + && Objects.equals( + this.additionalProperties, restrictionQueryWithoutRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RestrictionQueryWithoutRelationships {\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/RestrictionQueryWithoutRelationshipsResponse.java b/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryWithoutRelationshipsResponse.java new file mode 100644 index 00000000000..165c78695c7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RestrictionQueryWithoutRelationshipsResponse.java @@ -0,0 +1,141 @@ +/* + * 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; + +/** Response containing information about a single restriction query. */ +@JsonPropertyOrder({RestrictionQueryWithoutRelationshipsResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RestrictionQueryWithoutRelationshipsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private RestrictionQueryWithoutRelationships data; + + public RestrictionQueryWithoutRelationshipsResponse data( + RestrictionQueryWithoutRelationships data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Restriction query object returned by the API. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RestrictionQueryWithoutRelationships getData() { + return data; + } + + public void setData(RestrictionQueryWithoutRelationships 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 RestrictionQueryWithoutRelationshipsResponse + */ + @JsonAnySetter + public RestrictionQueryWithoutRelationshipsResponse 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 RestrictionQueryWithoutRelationshipsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RestrictionQueryWithoutRelationshipsResponse restrictionQueryWithoutRelationshipsResponse = + (RestrictionQueryWithoutRelationshipsResponse) o; + return Objects.equals(this.data, restrictionQueryWithoutRelationshipsResponse.data) + && Objects.equals( + this.additionalProperties, + restrictionQueryWithoutRelationshipsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RestrictionQueryWithoutRelationshipsResponse {\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/TeamAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TeamAttributes.java index b8d0e601ec2..bdd28ce03a9 100644 --- a/src/main/java/com/datadog/api/client/v2/model/TeamAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/TeamAttributes.java @@ -29,6 +29,7 @@ TeamAttributes.JSON_PROPERTY_DESCRIPTION, TeamAttributes.JSON_PROPERTY_HANDLE, TeamAttributes.JSON_PROPERTY_HIDDEN_MODULES, + TeamAttributes.JSON_PROPERTY_IS_MANAGED, TeamAttributes.JSON_PROPERTY_LINK_COUNT, TeamAttributes.JSON_PROPERTY_MODIFIED_AT, TeamAttributes.JSON_PROPERTY_NAME, @@ -56,7 +57,10 @@ public class TeamAttributes { private String handle; public static final String JSON_PROPERTY_HIDDEN_MODULES = "hidden_modules"; - private List hiddenModules = null; + private JsonNullable> hiddenModules = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_IS_MANAGED = "is_managed"; + private Boolean isManaged; public static final String JSON_PROPERTY_LINK_COUNT = "link_count"; private Integer linkCount; @@ -74,7 +78,7 @@ public class TeamAttributes { private Integer userCount; public static final String JSON_PROPERTY_VISIBLE_MODULES = "visible_modules"; - private List visibleModules = null; + private JsonNullable> visibleModules = JsonNullable.>undefined(); public TeamAttributes() {} @@ -221,15 +225,19 @@ public void setHandle(String handle) { } public TeamAttributes hiddenModules(List hiddenModules) { - this.hiddenModules = hiddenModules; + this.hiddenModules = JsonNullable.>of(hiddenModules); return this; } public TeamAttributes addHiddenModulesItem(String hiddenModulesItem) { - if (this.hiddenModules == null) { - this.hiddenModules = new ArrayList<>(); + if (this.hiddenModules == null || !this.hiddenModules.isPresent()) { + this.hiddenModules = JsonNullable.>of(new ArrayList<>()); + } + try { + this.hiddenModules.get().add(hiddenModulesItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.hiddenModules.add(hiddenModulesItem); return this; } @@ -239,16 +247,47 @@ public TeamAttributes addHiddenModulesItem(String hiddenModulesItem) { * @return hiddenModules */ @jakarta.annotation.Nullable + @JsonIgnore + public List getHiddenModules() { + return hiddenModules.orElse(null); + } + @JsonProperty(JSON_PROPERTY_HIDDEN_MODULES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getHiddenModules() { + public JsonNullable> getHiddenModules_JsonNullable() { return hiddenModules; } - public void setHiddenModules(List hiddenModules) { + @JsonProperty(JSON_PROPERTY_HIDDEN_MODULES) + public void setHiddenModules_JsonNullable(JsonNullable> hiddenModules) { this.hiddenModules = hiddenModules; } + public void setHiddenModules(List hiddenModules) { + this.hiddenModules = JsonNullable.>of(hiddenModules); + } + + public TeamAttributes isManaged(Boolean isManaged) { + this.isManaged = isManaged; + return this; + } + + /** + * Whether the team is managed from an external source + * + * @return isManaged + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_MANAGED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsManaged() { + return isManaged; + } + + public void setIsManaged(Boolean isManaged) { + this.isManaged = isManaged; + } + /** * The number of links belonging to the team maximum: 2147483647 * @@ -346,15 +385,19 @@ public Integer getUserCount() { } public TeamAttributes visibleModules(List visibleModules) { - this.visibleModules = visibleModules; + this.visibleModules = JsonNullable.>of(visibleModules); return this; } public TeamAttributes addVisibleModulesItem(String visibleModulesItem) { - if (this.visibleModules == null) { - this.visibleModules = new ArrayList<>(); + if (this.visibleModules == null || !this.visibleModules.isPresent()) { + this.visibleModules = JsonNullable.>of(new ArrayList<>()); + } + try { + this.visibleModules.get().add(visibleModulesItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.visibleModules.add(visibleModulesItem); return this; } @@ -364,16 +407,26 @@ public TeamAttributes addVisibleModulesItem(String visibleModulesItem) { * @return visibleModules */ @jakarta.annotation.Nullable + @JsonIgnore + public List getVisibleModules() { + return visibleModules.orElse(null); + } + @JsonProperty(JSON_PROPERTY_VISIBLE_MODULES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getVisibleModules() { + public JsonNullable> getVisibleModules_JsonNullable() { return visibleModules; } - public void setVisibleModules(List visibleModules) { + @JsonProperty(JSON_PROPERTY_VISIBLE_MODULES) + public void setVisibleModules_JsonNullable(JsonNullable> visibleModules) { this.visibleModules = visibleModules; } + public void setVisibleModules(List visibleModules) { + this.visibleModules = JsonNullable.>of(visibleModules); + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -436,6 +489,7 @@ public boolean equals(Object o) { && Objects.equals(this.description, teamAttributes.description) && Objects.equals(this.handle, teamAttributes.handle) && Objects.equals(this.hiddenModules, teamAttributes.hiddenModules) + && Objects.equals(this.isManaged, teamAttributes.isManaged) && Objects.equals(this.linkCount, teamAttributes.linkCount) && Objects.equals(this.modifiedAt, teamAttributes.modifiedAt) && Objects.equals(this.name, teamAttributes.name) @@ -454,6 +508,7 @@ public int hashCode() { description, handle, hiddenModules, + isManaged, linkCount, modifiedAt, name, @@ -473,6 +528,7 @@ public String toString() { sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" handle: ").append(toIndentedString(handle)).append("\n"); sb.append(" hiddenModules: ").append(toIndentedString(hiddenModules)).append("\n"); + sb.append(" isManaged: ").append(toIndentedString(isManaged)).append("\n"); sb.append(" linkCount: ").append(toIndentedString(linkCount)).append("\n"); sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLink.java b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLink.java new file mode 100644 index 00000000000..5a7ba0ed824 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLink.java @@ -0,0 +1,237 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Team hierarchy link */ +@JsonPropertyOrder({ + TeamHierarchyLink.JSON_PROPERTY_ATTRIBUTES, + TeamHierarchyLink.JSON_PROPERTY_ID, + TeamHierarchyLink.JSON_PROPERTY_RELATIONSHIPS, + TeamHierarchyLink.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamHierarchyLink { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TeamHierarchyLinkAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private TeamHierarchyLinkRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TeamHierarchyLinkType type = TeamHierarchyLinkType.TEAM_HIERARCHY_LINKS; + + public TeamHierarchyLink() {} + + @JsonCreator + public TeamHierarchyLink( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + TeamHierarchyLinkAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) TeamHierarchyLinkType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TeamHierarchyLink attributes(TeamHierarchyLinkAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Team hierarchy link attributes + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamHierarchyLinkAttributes getAttributes() { + return attributes; + } + + public void setAttributes(TeamHierarchyLinkAttributes attributes) { + this.attributes = attributes; + } + + public TeamHierarchyLink id(String id) { + this.id = id; + return this; + } + + /** + * The team hierarchy link's identifier + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public TeamHierarchyLink relationships(TeamHierarchyLinkRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Team hierarchy link relationships + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamHierarchyLinkRelationships getRelationships() { + return relationships; + } + + public void setRelationships(TeamHierarchyLinkRelationships relationships) { + this.relationships = relationships; + } + + public TeamHierarchyLink type(TeamHierarchyLinkType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Team hierarchy link type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamHierarchyLinkType getType() { + return type; + } + + public void setType(TeamHierarchyLinkType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamHierarchyLink + */ + @JsonAnySetter + public TeamHierarchyLink putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamHierarchyLink object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamHierarchyLink teamHierarchyLink = (TeamHierarchyLink) o; + return Objects.equals(this.attributes, teamHierarchyLink.attributes) + && Objects.equals(this.id, teamHierarchyLink.id) + && Objects.equals(this.relationships, teamHierarchyLink.relationships) + && Objects.equals(this.type, teamHierarchyLink.type) + && Objects.equals(this.additionalProperties, teamHierarchyLink.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamHierarchyLink {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkAttributes.java new file mode 100644 index 00000000000..ca2f3cdce29 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkAttributes.java @@ -0,0 +1,175 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Team hierarchy link attributes */ +@JsonPropertyOrder({ + TeamHierarchyLinkAttributes.JSON_PROPERTY_CREATED_AT, + TeamHierarchyLinkAttributes.JSON_PROPERTY_PROVISIONED_BY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamHierarchyLinkAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_PROVISIONED_BY = "provisioned_by"; + private String provisionedBy; + + public TeamHierarchyLinkAttributes() {} + + @JsonCreator + public TeamHierarchyLinkAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_PROVISIONED_BY) String provisionedBy) { + this.createdAt = createdAt; + this.provisionedBy = provisionedBy; + } + + public TeamHierarchyLinkAttributes createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Timestamp when the team hierarchy link was created + * + * @return createdAt + */ + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public TeamHierarchyLinkAttributes provisionedBy(String provisionedBy) { + this.provisionedBy = provisionedBy; + return this; + } + + /** + * The provisioner of the team hierarchy link + * + * @return provisionedBy + */ + @JsonProperty(JSON_PROPERTY_PROVISIONED_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getProvisionedBy() { + return provisionedBy; + } + + public void setProvisionedBy(String provisionedBy) { + this.provisionedBy = provisionedBy; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamHierarchyLinkAttributes + */ + @JsonAnySetter + public TeamHierarchyLinkAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamHierarchyLinkAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamHierarchyLinkAttributes teamHierarchyLinkAttributes = (TeamHierarchyLinkAttributes) o; + return Objects.equals(this.createdAt, teamHierarchyLinkAttributes.createdAt) + && Objects.equals(this.provisionedBy, teamHierarchyLinkAttributes.provisionedBy) + && Objects.equals( + this.additionalProperties, teamHierarchyLinkAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(createdAt, provisionedBy, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamHierarchyLinkAttributes {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" provisionedBy: ").append(toIndentedString(provisionedBy)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkCreate.java b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkCreate.java new file mode 100644 index 00000000000..454339feb35 --- /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; + +/** Data provided when creating a team hierarchy link */ +@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; + } + + /** + * The related teams that will be connected by the team hierarchy link + * + * @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..155f391f677 --- /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; + +/** The related teams that will be connected by the team hierarchy link */ +@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; + } + + /** + * Data about each team that will be connected by the team hierarchy link + * + * @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; + } + + /** + * Data about each team that will be connected by the team hierarchy link + * + * @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..e80122a0355 --- /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; + } + + /** + * Data provided when creating a team hierarchy link + * + * @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..8b852770747 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkCreateTeam.java @@ -0,0 +1,182 @@ +/* + * 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; + +/** + * This schema defines the attributes about each team that has to be provided when creating a team + * hierarchy link + */ +@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..aa7f70df744 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkCreateTeamRelationship.java @@ -0,0 +1,149 @@ +/* + * 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; + +/** Data about each team that will be connected by the team hierarchy link */ +@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; + } + + /** + * This schema defines the attributes about each team that has to be provided when creating a team + * hierarchy link + * + * @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..c6563e78884 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkResponse.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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Team hierarchy link response */ +@JsonPropertyOrder({ + TeamHierarchyLinkResponse.JSON_PROPERTY_DATA, + TeamHierarchyLinkResponse.JSON_PROPERTY_INCLUDED, + TeamHierarchyLinkResponse.JSON_PROPERTY_LINKS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamHierarchyLinkResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private TeamHierarchyLink data; + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = null; + + public static final String JSON_PROPERTY_LINKS = "links"; + private TeamsHierarchyLinksResponseLinks links; + + public TeamHierarchyLinkResponse data(TeamHierarchyLink data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Team hierarchy link + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamHierarchyLink getData() { + return data; + } + + public void setData(TeamHierarchyLink data) { + this.data = data; + } + + public TeamHierarchyLinkResponse included(List included) { + this.included = included; + for (TeamHierarchyLinkTeam item : included) { + this.unparsed |= item.unparsed; + } + return this; + } + + public TeamHierarchyLinkResponse addIncludedItem(TeamHierarchyLinkTeam includedItem) { + if (this.included == null) { + this.included = new ArrayList<>(); + } + this.included.add(includedItem); + this.unparsed |= includedItem.unparsed; + return this; + } + + /** + * Included teams + * + * @return included + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCLUDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIncluded() { + return included; + } + + public void setIncluded(List included) { + this.included = included; + } + + public TeamHierarchyLinkResponse links(TeamsHierarchyLinksResponseLinks links) { + this.links = links; + this.unparsed |= links.unparsed; + return this; + } + + /** + * When querying team hierarchy links, a set of links for navigation between different pages is + * included + * + * @return links + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LINKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamsHierarchyLinksResponseLinks getLinks() { + return links; + } + + public void setLinks(TeamsHierarchyLinksResponseLinks links) { + this.links = links; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamHierarchyLinkResponse + */ + @JsonAnySetter + public TeamHierarchyLinkResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamHierarchyLinkResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamHierarchyLinkResponse teamHierarchyLinkResponse = (TeamHierarchyLinkResponse) o; + return Objects.equals(this.data, teamHierarchyLinkResponse.data) + && Objects.equals(this.included, teamHierarchyLinkResponse.included) + && Objects.equals(this.links, teamHierarchyLinkResponse.links) + && Objects.equals( + this.additionalProperties, teamHierarchyLinkResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, links, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamHierarchyLinkResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" included: ").append(toIndentedString(included)).append("\n"); + sb.append(" links: ").append(toIndentedString(links)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkTeam.java b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkTeam.java new file mode 100644 index 00000000000..31cda92c6f7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkTeam.java @@ -0,0 +1,210 @@ +/* + * 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 links connect different teams. This represents team objects that are connected by + * the team hierarchy link. + */ +@JsonPropertyOrder({ + TeamHierarchyLinkTeam.JSON_PROPERTY_ATTRIBUTES, + TeamHierarchyLinkTeam.JSON_PROPERTY_ID, + TeamHierarchyLinkTeam.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamHierarchyLinkTeam { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TeamHierarchyLinkTeamAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TeamType type = TeamType.TEAM; + + public TeamHierarchyLinkTeam() {} + + @JsonCreator + public TeamHierarchyLinkTeam( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) TeamType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TeamHierarchyLinkTeam attributes(TeamHierarchyLinkTeamAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Team hierarchy links connect different teams. This represents attributes from teams that are + * connected by the team hierarchy link. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamHierarchyLinkTeamAttributes getAttributes() { + return attributes; + } + + public void setAttributes(TeamHierarchyLinkTeamAttributes attributes) { + this.attributes = attributes; + } + + public TeamHierarchyLinkTeam id(String id) { + this.id = id; + return this; + } + + /** + * The team's identifier + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public TeamHierarchyLinkTeam type(TeamType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Team type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamType getType() { + return type; + } + + public void setType(TeamType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamHierarchyLinkTeam + */ + @JsonAnySetter + public TeamHierarchyLinkTeam putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamHierarchyLinkTeam object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamHierarchyLinkTeam teamHierarchyLinkTeam = (TeamHierarchyLinkTeam) o; + return Objects.equals(this.attributes, teamHierarchyLinkTeam.attributes) + && Objects.equals(this.id, teamHierarchyLinkTeam.id) + && Objects.equals(this.type, teamHierarchyLinkTeam.type) + && Objects.equals(this.additionalProperties, teamHierarchyLinkTeam.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamHierarchyLinkTeam {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkTeamAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkTeamAttributes.java new file mode 100644 index 00000000000..5af287417c4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkTeamAttributes.java @@ -0,0 +1,398 @@ +/* + * 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 hierarchy links connect different teams. This represents attributes from teams that are + * connected by the team hierarchy link. + */ +@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..11fe8830f3b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinkTeamRelationship.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 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 hierarchy links connect different teams. This represents team objects that are connected + * by the team hierarchy link. + * + * @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..a2fd1df824f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamHierarchyLinksResponse.java @@ -0,0 +1,248 @@ +/* + * 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; + } + + /** + * When querying team hierarchy links, a set of links for navigation between different pages is + * included + * + * @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; + } + + /** + * Metadata that is included in the response when querying the team hierarchy links + * + * @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..d8cc39babbd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamsHierarchyLinksResponseLinks.java @@ -0,0 +1,291 @@ +/* + * 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; + +/** + * When querying team hierarchy links, a set of links for navigation between different pages is + * included + */ +@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..4cc05557319 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamsHierarchyLinksResponseMeta.java @@ -0,0 +1,139 @@ +/* + * 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; + +/** Metadata that is included in the response when querying the team hierarchy links */ +@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; + } + + /** + * Metadata related to paging information that is included in the response when querying the team + * hierarchy links + * + * @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..ba4075ef8fd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamsHierarchyLinksResponseMetaPage.java @@ -0,0 +1,361 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * Metadata related to paging information that is included in the response when querying the team + * hierarchy links + */ +@JsonPropertyOrder({ + TeamsHierarchyLinksResponseMetaPage.JSON_PROPERTY_FIRST_NUMBER, + TeamsHierarchyLinksResponseMetaPage.JSON_PROPERTY_LAST_NUMBER, + TeamsHierarchyLinksResponseMetaPage.JSON_PROPERTY_NEXT_NUMBER, + TeamsHierarchyLinksResponseMetaPage.JSON_PROPERTY_NUMBER, + TeamsHierarchyLinksResponseMetaPage.JSON_PROPERTY_PREV_NUMBER, + TeamsHierarchyLinksResponseMetaPage.JSON_PROPERTY_SIZE, + TeamsHierarchyLinksResponseMetaPage.JSON_PROPERTY_TOTAL, + TeamsHierarchyLinksResponseMetaPage.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamsHierarchyLinksResponseMetaPage { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FIRST_NUMBER = "first_number"; + private Long firstNumber; + + public static final String JSON_PROPERTY_LAST_NUMBER = "last_number"; + private Long lastNumber; + + public static final String JSON_PROPERTY_NEXT_NUMBER = "next_number"; + private JsonNullable nextNumber = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_NUMBER = "number"; + private Long number; + + public static final String JSON_PROPERTY_PREV_NUMBER = "prev_number"; + private JsonNullable prevNumber = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_SIZE = "size"; + private Long size; + + public static final String JSON_PROPERTY_TOTAL = "total"; + private Long total; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public TeamsHierarchyLinksResponseMetaPage firstNumber(Long firstNumber) { + this.firstNumber = firstNumber; + return this; + } + + /** + * First page number. + * + * @return firstNumber + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIRST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getFirstNumber() { + return firstNumber; + } + + public void setFirstNumber(Long firstNumber) { + this.firstNumber = firstNumber; + } + + public TeamsHierarchyLinksResponseMetaPage lastNumber(Long lastNumber) { + this.lastNumber = lastNumber; + return this; + } + + /** + * Last page number. + * + * @return lastNumber + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getLastNumber() { + return lastNumber; + } + + public void setLastNumber(Long lastNumber) { + this.lastNumber = lastNumber; + } + + public TeamsHierarchyLinksResponseMetaPage nextNumber(Long nextNumber) { + this.nextNumber = JsonNullable.of(nextNumber); + return this; + } + + /** + * Next page number. + * + * @return nextNumber + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getNextNumber() { + return nextNumber.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_NEXT_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getNextNumber_JsonNullable() { + return nextNumber; + } + + @JsonProperty(JSON_PROPERTY_NEXT_NUMBER) + public void setNextNumber_JsonNullable(JsonNullable nextNumber) { + this.nextNumber = nextNumber; + } + + public void setNextNumber(Long nextNumber) { + this.nextNumber = JsonNullable.of(nextNumber); + } + + public TeamsHierarchyLinksResponseMetaPage number(Long number) { + this.number = number; + return this; + } + + /** + * Page number. + * + * @return number + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getNumber() { + return number; + } + + public void setNumber(Long number) { + this.number = number; + } + + public TeamsHierarchyLinksResponseMetaPage prevNumber(Long prevNumber) { + this.prevNumber = JsonNullable.of(prevNumber); + return this; + } + + /** + * Previous page number. + * + * @return prevNumber + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getPrevNumber() { + return prevNumber.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_PREV_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getPrevNumber_JsonNullable() { + return prevNumber; + } + + @JsonProperty(JSON_PROPERTY_PREV_NUMBER) + public void setPrevNumber_JsonNullable(JsonNullable prevNumber) { + this.prevNumber = prevNumber; + } + + public void setPrevNumber(Long prevNumber) { + this.prevNumber = JsonNullable.of(prevNumber); + } + + public TeamsHierarchyLinksResponseMetaPage size(Long size) { + this.size = size; + return this; + } + + /** + * Page size. + * + * @return size + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getSize() { + return size; + } + + public void setSize(Long size) { + this.size = size; + } + + public TeamsHierarchyLinksResponseMetaPage total(Long total) { + this.total = total; + return this; + } + + /** + * Total number of results. + * + * @return total + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTotal() { + return total; + } + + public void setTotal(Long total) { + this.total = total; + } + + public TeamsHierarchyLinksResponseMetaPage type(String type) { + this.type = type; + return this; + } + + /** + * Pagination type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamsHierarchyLinksResponseMetaPage + */ + @JsonAnySetter + public TeamsHierarchyLinksResponseMetaPage putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamsHierarchyLinksResponseMetaPage object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamsHierarchyLinksResponseMetaPage teamsHierarchyLinksResponseMetaPage = + (TeamsHierarchyLinksResponseMetaPage) o; + return Objects.equals(this.firstNumber, teamsHierarchyLinksResponseMetaPage.firstNumber) + && Objects.equals(this.lastNumber, teamsHierarchyLinksResponseMetaPage.lastNumber) + && Objects.equals(this.nextNumber, teamsHierarchyLinksResponseMetaPage.nextNumber) + && Objects.equals(this.number, teamsHierarchyLinksResponseMetaPage.number) + && Objects.equals(this.prevNumber, teamsHierarchyLinksResponseMetaPage.prevNumber) + && Objects.equals(this.size, teamsHierarchyLinksResponseMetaPage.size) + && Objects.equals(this.total, teamsHierarchyLinksResponseMetaPage.total) + && Objects.equals(this.type, teamsHierarchyLinksResponseMetaPage.type) + && Objects.equals( + this.additionalProperties, teamsHierarchyLinksResponseMetaPage.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + firstNumber, + lastNumber, + nextNumber, + number, + prevNumber, + size, + total, + type, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamsHierarchyLinksResponseMetaPage {\n"); + sb.append(" firstNumber: ").append(toIndentedString(firstNumber)).append("\n"); + sb.append(" lastNumber: ").append(toIndentedString(lastNumber)).append("\n"); + sb.append(" nextNumber: ").append(toIndentedString(nextNumber)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" prevNumber: ").append(toIndentedString(prevNumber)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/cassettes/features/v2/Create_a_restriction_query_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_restriction_query_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..46f704ffe2a --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_restriction_query_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-11-18T19:17:04.509Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_restriction_query_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Create_a_restriction_query_returns_Bad_Request_response.json new file mode 100644 index 00000000000..ae402c599d3 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_restriction_query_returns_Bad_Request_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"test\":\"bad_request\"}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/logs/config/restriction_queries", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"API input validation failed: {'_schema': [{'detail': 'Object must include `data` key.', 'source': {'pointer': '/'}}]}\"]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "914ab564-2c89-f946-8651-64b7d00223f9" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_restriction_query_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_restriction_query_returns_OK_response.freeze new file mode 100644 index 00000000000..e7d3eb34c15 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_restriction_query_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-11-18T19:17:05.128Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_restriction_query_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Create_a_restriction_query_returns_OK_response.json new file mode 100644 index 00000000000..7753c1c20c2 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_restriction_query_returns_OK_response.json @@ -0,0 +1,57 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"restriction_query\":\"env:sandbox\"},\"type\":\"logs_restriction_queries\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/logs/config/restriction_queries", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"logs_restriction_queries\",\"id\":\"2b5594f8-c4b3-11f0-a05d-da7ad0900002\",\"attributes\":{\"restriction_query\":\"env:sandbox\",\"created_at\":\"2025-11-18T19:17:05.370176+00:00\",\"modified_at\":\"2025-11-18T19:17:05.370176+00:00\"}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "eb3b308b-3d56-9ef8-4096-dd7718f51860" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/logs/config/restriction_queries/2b5594f8-c4b3-11f0-a05d-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": { + "Content-Type": [ + "text/html; charset=utf-8" + ] + }, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "f3226050-9fe5-0df1-9cfd-969a56c74aac" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_CREATED_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_CREATED_response.freeze new file mode 100644 index 00000000000..5ca151ab8b7 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_CREATED_response.freeze @@ -0,0 +1 @@ +2025-11-24T14:29:58.684Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_CREATED_response.json b/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_CREATED_response.json new file mode 100644 index 00000000000..fb306ed507a --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_CREATED_response.json @@ -0,0 +1,155 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-34095e00d70ee50a\",\"name\":\"test-name-34095e00d70ee50a\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"551c947a-0f0f-4ff0-8c41-0ceddabe3551\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":3,\"created_at\":\"2025-11-24T14:29:59.195740+00:00\",\"description\":null,\"handle\":\"test-handle-34095e00d70ee50a\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T14:29:59.195740+00:00\",\"name\":\"test-name-34095e00d70ee50a\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/551c947a-0f0f-4ff0-8c41-0ceddabe3551/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/551c947a-0f0f-4ff0-8c41-0ceddabe3551/permission-settings\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "b6efdcce-beff-203f-e451-c6d279b6f1c8" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-2-34095e00d70ee50a\",\"name\":\"test-name-2-34095e00d70ee50a\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"e1c6ab08-0325-4df7-aea1-6bec76692d55\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":14,\"created_at\":\"2025-11-24T14:29:59.754699+00:00\",\"description\":null,\"handle\":\"test-handle-2-34095e00d70ee50a\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T14:29:59.754699+00:00\",\"name\":\"test-name-2-34095e00d70ee50a\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/e1c6ab08-0325-4df7-aea1-6bec76692d55/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/e1c6ab08-0325-4df7-aea1-6bec76692d55/permission-settings\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "14ff0479-33ab-31db-16c6-c7cd6b0624ea" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"551c947a-0f0f-4ff0-8c41-0ceddabe3551\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"e1c6ab08-0325-4df7-aea1-6bec76692d55\",\"type\":\"team\"}}},\"type\":\"team_hierarchy_links\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team-hierarchy-links", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"c53bed14-1c0a-4895-b845-1c04be086ba0\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2025-11-24T14:30:00.032477595Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"551c947a-0f0f-4ff0-8c41-0ceddabe3551\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"e1c6ab08-0325-4df7-aea1-6bec76692d55\",\"type\":\"team\"}}}},\"included\":[{\"id\":\"551c947a-0f0f-4ff0-8c41-0ceddabe3551\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":3,\"handle\":\"test-handle-34095e00d70ee50a\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-34095e00d70ee50a\",\"summary\":null,\"user_count\":0}},{\"id\":\"e1c6ab08-0325-4df7-aea1-6bec76692d55\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":14,\"handle\":\"test-handle-2-34095e00d70ee50a\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-2-34095e00d70ee50a\",\"summary\":null,\"user_count\":0}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ebb0e177-162b-d934-64de-74ac3cef2e38" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team-hierarchy-links/c53bed14-1c0a-4895-b845-1c04be086ba0", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "d75ce0db-fd36-b7bb-af8a-bdb42e98c73e" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/e1c6ab08-0325-4df7-aea1-6bec76692d55", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6d81924b-f5b8-653f-44e5-ac1455978289" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/551c947a-0f0f-4ff0-8c41-0ceddabe3551", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "bc39bebd-acee-3cfe-a04d-975a22d8bd87" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_Conflict_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_Conflict_response.freeze new file mode 100644 index 00000000000..4da94657eeb --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_Conflict_response.freeze @@ -0,0 +1 @@ +2025-11-24T17:06:46.856Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_Conflict_response.json b/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_Conflict_response.json new file mode 100644 index 00000000000..01394f19e95 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_Conflict_response.json @@ -0,0 +1,185 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-6c891437b748aea8\",\"name\":\"test-name-6c891437b748aea8\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":0,\"created_at\":\"2025-11-24T17:06:47.453319+00:00\",\"description\":null,\"handle\":\"test-handle-6c891437b748aea8\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T17:06:47.453319+00:00\",\"name\":\"test-name-6c891437b748aea8\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87/permission-settings\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "adf5deff-6dc2-c965-d647-9abfd55aaf51" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-2-6c891437b748aea8\",\"name\":\"test-name-2-6c891437b748aea8\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"21296c73-c9e2-4889-a33f-417d2974b2bd\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":2,\"created_at\":\"2025-11-24T17:06:48.020887+00:00\",\"description\":null,\"handle\":\"test-handle-2-6c891437b748aea8\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T17:06:48.020887+00:00\",\"name\":\"test-name-2-6c891437b748aea8\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/21296c73-c9e2-4889-a33f-417d2974b2bd/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/21296c73-c9e2-4889-a33f-417d2974b2bd/permission-settings\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "37f9b24b-2c32-3ffb-9c59-63c23ea57a89" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"21296c73-c9e2-4889-a33f-417d2974b2bd\",\"type\":\"team\"}}},\"type\":\"team_hierarchy_links\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team-hierarchy-links", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"e980108e-d535-4bdf-84ca-5e8f84a68480\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2025-11-24T17:06:48.279316439Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"21296c73-c9e2-4889-a33f-417d2974b2bd\",\"type\":\"team\"}}}},\"included\":[{\"id\":\"4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":0,\"handle\":\"test-handle-6c891437b748aea8\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-6c891437b748aea8\",\"summary\":null,\"user_count\":0}},{\"id\":\"21296c73-c9e2-4889-a33f-417d2974b2bd\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":2,\"handle\":\"test-handle-2-6c891437b748aea8\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-2-6c891437b748aea8\",\"summary\":null,\"user_count\":0}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "267eba7d-1710-0a48-2168-9df14ad63c61" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"21296c73-c9e2-4889-a33f-417d2974b2bd\",\"type\":\"team\"}}},\"type\":\"team_hierarchy_links\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team-hierarchy-links", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"Conflict: could not add team 21296c73-c9e2-4889-a33f-417d2974b2bd as a member team of team 4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87 in org 321813: team hierarchy link between super team 4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87 and member team 21296c73-c9e2-4889-a33f-417d2974b2bd already exists in org 321813\"]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 409, + "reasonPhrase": "Conflict" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "267eba7d-1710-0a48-2168-9df14ad63c62" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team-hierarchy-links/e980108e-d535-4bdf-84ca-5e8f84a68480", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "43a96ba1-e2d1-5111-86d4-d9cc8c497fed" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/21296c73-c9e2-4889-a33f-417d2974b2bd", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "47b09fbf-2ee1-3d4c-d9b8-8682d56a87a1" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "0b87c8a4-1da2-68e8-f817-61e5b6974c1e" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_OK_response.freeze new file mode 100644 index 00000000000..bf8a8d4fa45 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-11-24T16:01:16.053Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_OK_response.json new file mode 100644 index 00000000000..d71b7d36f20 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_OK_response.json @@ -0,0 +1,155 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-4d8084da4dfa4ed8\",\"name\":\"test-name-4d8084da4dfa4ed8\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"d5b049f4-59f1-474d-ad98-5a7342a8961f\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":11,\"created_at\":\"2025-11-24T16:01:16.149673+00:00\",\"description\":null,\"handle\":\"test-handle-4d8084da4dfa4ed8\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T16:01:16.149673+00:00\",\"name\":\"test-name-4d8084da4dfa4ed8\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/d5b049f4-59f1-474d-ad98-5a7342a8961f/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/d5b049f4-59f1-474d-ad98-5a7342a8961f/permission-settings\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "f51dc8b1-f646-051d-3017-2e2e4672585c" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-2-4d8084da4dfa4ed8\",\"name\":\"test-name-2-4d8084da4dfa4ed8\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"790428f6-10bc-427d-bf36-f53ca3c197e0\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":4,\"created_at\":\"2025-11-24T16:01:16.315013+00:00\",\"description\":null,\"handle\":\"test-handle-2-4d8084da4dfa4ed8\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T16:01:16.315013+00:00\",\"name\":\"test-name-2-4d8084da4dfa4ed8\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/790428f6-10bc-427d-bf36-f53ca3c197e0/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/790428f6-10bc-427d-bf36-f53ca3c197e0/permission-settings\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e7e795a9-a0a4-0b1f-3108-a95eb0c0845a" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"d5b049f4-59f1-474d-ad98-5a7342a8961f\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"790428f6-10bc-427d-bf36-f53ca3c197e0\",\"type\":\"team\"}}},\"type\":\"team_hierarchy_links\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team-hierarchy-links", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"6cf86539-2c6e-497e-8cef-0b285ff05514\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2025-11-24T16:01:16.460042023Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"d5b049f4-59f1-474d-ad98-5a7342a8961f\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"790428f6-10bc-427d-bf36-f53ca3c197e0\",\"type\":\"team\"}}}},\"included\":[{\"id\":\"d5b049f4-59f1-474d-ad98-5a7342a8961f\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":11,\"handle\":\"test-handle-4d8084da4dfa4ed8\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-4d8084da4dfa4ed8\",\"summary\":null,\"user_count\":0}},{\"id\":\"790428f6-10bc-427d-bf36-f53ca3c197e0\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":4,\"handle\":\"test-handle-2-4d8084da4dfa4ed8\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-2-4d8084da4dfa4ed8\",\"summary\":null,\"user_count\":0}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "cbc1af8b-d3fa-ae42-69f6-3ec95d122c37" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team-hierarchy-links/6cf86539-2c6e-497e-8cef-0b285ff05514", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6453e612-5ae8-3962-a8a9-439efd6fd387" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/790428f6-10bc-427d-bf36-f53ca3c197e0", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "03667a10-74b0-5151-c93a-8caa250c0b2d" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/d5b049f4-59f1-474d-ad98-5a7342a8961f", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6f791bb8-4f5b-af6e-3abb-6198566110c1" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_SUCCESS_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_SUCCESS_response.freeze new file mode 100644 index 00000000000..e4ed51cc867 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_SUCCESS_response.freeze @@ -0,0 +1 @@ +2025-11-24T15:48:39.900Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_SUCCESS_response.json b/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_SUCCESS_response.json new file mode 100644 index 00000000000..657d9abcc3c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_team_hierarchy_link_returns_SUCCESS_response.json @@ -0,0 +1,155 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-a75ee0b8b483d66f\",\"name\":\"test-name-a75ee0b8b483d66f\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":3,\"created_at\":\"2025-11-24T15:48:40.359260+00:00\",\"description\":null,\"handle\":\"test-handle-a75ee0b8b483d66f\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T15:48:40.359261+00:00\",\"name\":\"test-name-a75ee0b8b483d66f\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd/permission-settings\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "a2753edb-970c-fffe-b922-aed09f6fdbdc" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-2-a75ee0b8b483d66f\",\"name\":\"test-name-2-a75ee0b8b483d66f\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"2d096572-eb6a-4579-ba38-b4247cf75e17\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":8,\"created_at\":\"2025-11-24T15:48:40.893488+00:00\",\"description\":null,\"handle\":\"test-handle-2-a75ee0b8b483d66f\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T15:48:40.893488+00:00\",\"name\":\"test-name-2-a75ee0b8b483d66f\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/2d096572-eb6a-4579-ba38-b4247cf75e17/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/2d096572-eb6a-4579-ba38-b4247cf75e17/permission-settings\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "f158473a-07cd-c089-2d92-0faf55be902d" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"2d096572-eb6a-4579-ba38-b4247cf75e17\",\"type\":\"team\"}}},\"type\":\"team_hierarchy_links\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team-hierarchy-links", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"fb94d43b-fe10-4c5f-ae7c-4ad745428651\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2025-11-24T15:48:41.150923395Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"2d096572-eb6a-4579-ba38-b4247cf75e17\",\"type\":\"team\"}}}},\"included\":[{\"id\":\"b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":3,\"handle\":\"test-handle-a75ee0b8b483d66f\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-a75ee0b8b483d66f\",\"summary\":null,\"user_count\":0}},{\"id\":\"2d096572-eb6a-4579-ba38-b4247cf75e17\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":8,\"handle\":\"test-handle-2-a75ee0b8b483d66f\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-2-a75ee0b8b483d66f\",\"summary\":null,\"user_count\":0}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "8ef0058d-92ab-3007-6975-11d2bed31ad6" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team-hierarchy-links/fb94d43b-fe10-4c5f-ae7c-4ad745428651", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "b586f65c-5e8c-5c75-934c-2310020328b2" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/2d096572-eb6a-4579-ba38-b4247cf75e17", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "df534d51-8851-12f9-7264-0ec13f719086" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "10a7d2f1-489b-3643-d02d-08eeed113a13" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_a_restriction_query_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Delete_a_restriction_query_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..606a5c297d1 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_a_restriction_query_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-11-18T19:17:06.402Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_a_restriction_query_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Delete_a_restriction_query_returns_Bad_Request_response.json new file mode 100644 index 00000000000..105867cc735 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_a_restriction_query_returns_Bad_Request_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/logs/config/restriction_queries/malformed_id", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"uuid is not proper type\"]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "08325a2e-eadf-2ff8-7bc7-b7f250b93938" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_a_restriction_query_returns_Not_found_response.freeze b/src/test/resources/cassettes/features/v2/Delete_a_restriction_query_returns_Not_found_response.freeze new file mode 100644 index 00000000000..b407dce9fca --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_a_restriction_query_returns_Not_found_response.freeze @@ -0,0 +1 @@ +2025-11-18T19:17:06.567Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_a_restriction_query_returns_Not_found_response.json b/src/test/resources/cassettes/features/v2/Delete_a_restriction_query_returns_Not_found_response.json new file mode 100644 index 00000000000..0e4896c9c3f --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_a_restriction_query_returns_Not_found_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/logs/config/restriction_queries/00000000-0000-0000-0000-000000000000", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"Restriction query not found\"]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "d657b298-6cfb-efba-4d5d-555aa72dd8de" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_a_restriction_query_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Delete_a_restriction_query_returns_OK_response.freeze new file mode 100644 index 00000000000..233ffaffa5c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_a_restriction_query_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-11-18T19:17:06.720Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_a_restriction_query_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Delete_a_restriction_query_returns_OK_response.json new file mode 100644 index 00000000000..9d5fec45de3 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_a_restriction_query_returns_OK_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"restriction_query\":\"env:sandbox\"},\"type\":\"logs_restriction_queries\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/logs/config/restriction_queries", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"logs_restriction_queries\",\"id\":\"2c373dc2-c4b3-11f0-8ca7-da7ad0900002\",\"attributes\":{\"restriction_query\":\"env:sandbox\",\"created_at\":\"2025-11-18T19:17:06.848316+00:00\",\"modified_at\":\"2025-11-18T19:17:06.848316+00:00\"}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "eb3b308b-3d56-9ef8-4096-dd7718f5185f" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/logs/config/restriction_queries/2c373dc2-c4b3-11f0-8ca7-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": { + "Content-Type": [ + "text/html; charset=utf-8" + ] + }, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e469cd65-2441-915b-a9f1-716e528faa14" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/logs/config/restriction_queries/2c373dc2-c4b3-11f0-8ca7-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"Restriction query not found\"]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e469cd65-2441-915b-a9f1-716e528faa15" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_restriction_query_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Get_a_restriction_query_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..35466be5038 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_restriction_query_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-11-18T19:17:07.277Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_restriction_query_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Get_a_restriction_query_returns_Bad_Request_response.json new file mode 100644 index 00000000000..3680bf38634 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_restriction_query_returns_Bad_Request_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/logs/config/restriction_queries/malformed_id", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"uuid is not proper type\"]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "075fc7eb-eac9-783a-7a83-a6e011e9ed38" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_restriction_query_returns_Not_found_response.freeze b/src/test/resources/cassettes/features/v2/Get_a_restriction_query_returns_Not_found_response.freeze new file mode 100644 index 00000000000..27aff0c3f07 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_restriction_query_returns_Not_found_response.freeze @@ -0,0 +1 @@ +2025-11-18T19:17:07.461Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_restriction_query_returns_Not_found_response.json b/src/test/resources/cassettes/features/v2/Get_a_restriction_query_returns_Not_found_response.json new file mode 100644 index 00000000000..d4ed05c118e --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_restriction_query_returns_Not_found_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/logs/config/restriction_queries/00000000-0000-0000-0000-000000000000", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"Restriction query not found\"]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "58b5254e-9c84-ea1c-cffc-b472b25d89f6" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_restriction_query_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_a_restriction_query_returns_OK_response.freeze new file mode 100644 index 00000000000..1f267748178 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_restriction_query_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-11-18T19:17:07.622Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_restriction_query_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_a_restriction_query_returns_OK_response.json new file mode 100644 index 00000000000..d76b3217ed0 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_restriction_query_returns_OK_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"restriction_query\":\"env:sandbox\"},\"type\":\"logs_restriction_queries\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/logs/config/restriction_queries", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"logs_restriction_queries\",\"id\":\"2cc39998-c4b3-11f0-8b4b-da7ad0900002\",\"attributes\":{\"restriction_query\":\"env:sandbox\",\"created_at\":\"2025-11-18T19:17:07.768188+00:00\",\"modified_at\":\"2025-11-18T19:17:07.768188+00:00\"}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "eb3b308b-3d56-9ef8-4096-dd7718f51862" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/logs/config/restriction_queries/2cc39998-c4b3-11f0-8b4b-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"logs_restriction_queries\",\"id\":\"2cc39998-c4b3-11f0-8b4b-da7ad0900002\",\"attributes\":{\"restriction_query\":\"env:sandbox\",\"created_at\":\"2025-11-18T19:17:07.768188+00:00\",\"modified_at\":\"2025-11-18T19:17:07.768188+00:00\"},\"relationships\":{\"roles\":{\"data\":[]}}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "948c6128-784a-4600-1adc-61749de3c923" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/logs/config/restriction_queries/2cc39998-c4b3-11f0-8b4b-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": { + "Content-Type": [ + "text/html; charset=utf-8" + ] + }, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "9faae684-66f6-8c18-29cd-17c0deb68739" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_team_hierarchy_link_returns_API_error_response_response.freeze b/src/test/resources/cassettes/features/v2/Get_a_team_hierarchy_link_returns_API_error_response_response.freeze new file mode 100644 index 00000000000..21b6221c0da --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_team_hierarchy_link_returns_API_error_response_response.freeze @@ -0,0 +1 @@ +2025-11-24T13:19:11.816Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_team_hierarchy_link_returns_API_error_response_response.json b/src/test/resources/cassettes/features/v2/Get_a_team_hierarchy_link_returns_API_error_response_response.json new file mode 100644 index 00000000000..5fd85dfe4d2 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_team_hierarchy_link_returns_API_error_response_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/team-hierarchy-links/aaa11111-aa11-aa11-aaaa-aaaaaa111111", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"Not Found: team hierarchy link not found (linkId=aaa11111-aa11-aa11-aaaa-aaaaaa111111)\"]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "c4e82909-dd35-3220-4c88-18e59e6b3249" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_team_hierarchy_link_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_a_team_hierarchy_link_returns_OK_response.freeze new file mode 100644 index 00000000000..be8e0fd4a38 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_team_hierarchy_link_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-11-24T17:07:09.212Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_team_hierarchy_link_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_a_team_hierarchy_link_returns_OK_response.json new file mode 100644 index 00000000000..16c9f0932d5 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_team_hierarchy_link_returns_OK_response.json @@ -0,0 +1,181 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-ae3e76a23be3747a\",\"name\":\"test-name-ae3e76a23be3747a\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"fafeac94-42b4-4469-91e8-0ae5ca3f564b\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":11,\"created_at\":\"2025-11-24T17:07:09.817794+00:00\",\"description\":null,\"handle\":\"test-handle-ae3e76a23be3747a\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T17:07:09.817794+00:00\",\"name\":\"test-name-ae3e76a23be3747a\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/fafeac94-42b4-4469-91e8-0ae5ca3f564b/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/fafeac94-42b4-4469-91e8-0ae5ca3f564b/permission-settings\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "799e86d0-e894-7671-30bc-91ff5c599a26" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-2-ae3e76a23be3747a\",\"name\":\"test-name-2-ae3e76a23be3747a\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"196bcc55-bd30-4cfd-8549-b3d255a0517b\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":4,\"created_at\":\"2025-11-24T17:07:10.381761+00:00\",\"description\":null,\"handle\":\"test-handle-2-ae3e76a23be3747a\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T17:07:10.381761+00:00\",\"name\":\"test-name-2-ae3e76a23be3747a\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/196bcc55-bd30-4cfd-8549-b3d255a0517b/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/196bcc55-bd30-4cfd-8549-b3d255a0517b/permission-settings\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "204f2b1e-ad63-f2cd-7450-28e92c8c13a0" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"fafeac94-42b4-4469-91e8-0ae5ca3f564b\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"196bcc55-bd30-4cfd-8549-b3d255a0517b\",\"type\":\"team\"}}},\"type\":\"team_hierarchy_links\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team-hierarchy-links", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"5401e712-de1b-4deb-ac35-2c6ee1943ad0\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2025-11-24T17:07:10.643798843Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"fafeac94-42b4-4469-91e8-0ae5ca3f564b\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"196bcc55-bd30-4cfd-8549-b3d255a0517b\",\"type\":\"team\"}}}},\"included\":[{\"id\":\"fafeac94-42b4-4469-91e8-0ae5ca3f564b\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":11,\"handle\":\"test-handle-ae3e76a23be3747a\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-ae3e76a23be3747a\",\"summary\":null,\"user_count\":0}},{\"id\":\"196bcc55-bd30-4cfd-8549-b3d255a0517b\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":4,\"handle\":\"test-handle-2-ae3e76a23be3747a\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-2-ae3e76a23be3747a\",\"summary\":null,\"user_count\":0}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e977f4ab-a3b3-ed38-ae02-cab7cdbd1751" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/team-hierarchy-links/5401e712-de1b-4deb-ac35-2c6ee1943ad0", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"5401e712-de1b-4deb-ac35-2c6ee1943ad0\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2025-11-24T17:07:10.643799Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"fafeac94-42b4-4469-91e8-0ae5ca3f564b\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"196bcc55-bd30-4cfd-8549-b3d255a0517b\",\"type\":\"team\"}}}},\"links\":{\"self\":\"https://api.datadoghq.com/api/v2/team-hierarchy-links/5401e712-de1b-4deb-ac35-2c6ee1943ad0\"},\"included\":[{\"id\":\"196bcc55-bd30-4cfd-8549-b3d255a0517b\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":4,\"handle\":\"test-handle-2-ae3e76a23be3747a\",\"is_managed\":false,\"is_open_membership\":true,\"link_count\":0,\"name\":\"test-name-2-ae3e76a23be3747a\",\"summary\":null,\"user_count\":0}},{\"id\":\"fafeac94-42b4-4469-91e8-0ae5ca3f564b\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":11,\"handle\":\"test-handle-ae3e76a23be3747a\",\"is_managed\":false,\"is_open_membership\":true,\"link_count\":0,\"name\":\"test-name-ae3e76a23be3747a\",\"summary\":null,\"user_count\":0}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "cc894026-b05c-6521-1b8e-356dfa0a73eb" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team-hierarchy-links/5401e712-de1b-4deb-ac35-2c6ee1943ad0", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "8056212d-8b1d-a7f5-40ee-5746517e097a" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/196bcc55-bd30-4cfd-8549-b3d255a0517b", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "586f38aa-ff9d-0a61-8099-35af45195b9e" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/fafeac94-42b4-4469-91e8-0ae5ca3f564b", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "a8a73b2a-08ce-e2eb-7d4e-7aaa724beafc" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_all_restriction_queries_for_a_given_user_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Get_all_restriction_queries_for_a_given_user_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..57b32bd8904 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_all_restriction_queries_for_a_given_user_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-11-18T19:17:08.172Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_all_restriction_queries_for_a_given_user_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Get_all_restriction_queries_for_a_given_user_returns_Bad_Request_response.json new file mode 100644 index 00000000000..60ac8fed517 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_all_restriction_queries_for_a_given_user_returns_Bad_Request_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/logs/config/restriction_queries/user/malformed_id", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"uuid is not proper type\"]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "66870579-7b0c-f880-b82a-4ad211d0170c" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_all_restriction_queries_for_a_given_user_returns_Not_found_response.freeze b/src/test/resources/cassettes/features/v2/Get_all_restriction_queries_for_a_given_user_returns_Not_found_response.freeze new file mode 100644 index 00000000000..9ee4a5d5206 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_all_restriction_queries_for_a_given_user_returns_Not_found_response.freeze @@ -0,0 +1 @@ +2025-11-18T19:17:08.336Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_all_restriction_queries_for_a_given_user_returns_Not_found_response.json b/src/test/resources/cassettes/features/v2/Get_all_restriction_queries_for_a_given_user_returns_Not_found_response.json new file mode 100644 index 00000000000..1d9ae197000 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_all_restriction_queries_for_a_given_user_returns_Not_found_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/logs/config/restriction_queries/user/00000000-0000-0000-0000-000000000000", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"user with uuid 00000000-0000-0000-0000-000000000000 doesn't exist\"]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "8559ccc7-0191-5a0b-fd2d-000351160ff4" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_restriction_query_for_a_given_role_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Get_restriction_query_for_a_given_role_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..57897532acf --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_restriction_query_for_a_given_role_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-11-18T19:17:08.604Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_restriction_query_for_a_given_role_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Get_restriction_query_for_a_given_role_returns_Bad_Request_response.json new file mode 100644 index 00000000000..492f418deeb --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_restriction_query_for_a_given_role_returns_Bad_Request_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/logs/config/restriction_queries/role/malformed_id", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"Missing Role malformed_id\"]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "7e0c2f77-efbd-bbdf-6fe6-f91ecb20d116" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_restriction_query_for_a_given_role_returns_Not_found_response.freeze b/src/test/resources/cassettes/features/v2/Get_restriction_query_for_a_given_role_returns_Not_found_response.freeze new file mode 100644 index 00000000000..bd0df2da885 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_restriction_query_for_a_given_role_returns_Not_found_response.freeze @@ -0,0 +1 @@ +2025-11-18T19:17:08.828Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_restriction_query_for_a_given_role_returns_Not_found_response.json b/src/test/resources/cassettes/features/v2/Get_restriction_query_for_a_given_role_returns_Not_found_response.json new file mode 100644 index 00000000000..4c9383ba79d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_restriction_query_for_a_given_role_returns_Not_found_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/logs/config/restriction_queries/role/00000000-0000-0000-0000-000000000000", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"Missing Role 00000000-0000-0000-0000-000000000000\"]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "9e3fe7a4-f5ad-c389-5999-a4c8bad141a1" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_restriction_query_for_a_given_role_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_restriction_query_for_a_given_role_returns_OK_response.freeze new file mode 100644 index 00000000000..8dc9f697b0c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_restriction_query_for_a_given_role_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-11-18T19:17:08.994Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_restriction_query_for_a_given_role_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_restriction_query_for_a_given_role_returns_OK_response.json new file mode 100644 index 00000000000..97d4fde5680 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_restriction_query_for_a_given_role_returns_OK_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"name\":\"Test-Get_restriction_query_for_a_given_role_returns_OK_response-1763493428\"},\"type\":\"roles\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/roles", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"2d925300-c4b3-11f0-a252-da7ad0900002\",\"type\":\"roles\",\"attributes\":{\"created_at\":\"2025-11-18T19:17:09.12367Z\",\"modified_at\":\"2025-11-18T19:17:09.123777Z\",\"name\":\"Test-Get_restriction_query_for_a_given_role_returns_OK_response-1763493428\",\"team_count\":0,\"user_count\":0},\"relationships\":{\"permissions\":{\"data\":[{\"id\":\"d90f6830-d3d8-11e9-a77a-b3404e5e9ee2\",\"type\":\"permissions\"},{\"id\":\"4441648c-d8b1-11e9-a77a-1b899a04b304\",\"type\":\"permissions\"},{\"id\":\"417ba636-2dce-11eb-84c0-6bce5b0d9de0\",\"type\":\"permissions\"},{\"id\":\"12efc20e-d36c-11eb-a9b8-da7ad0900002\",\"type\":\"permissions\"},{\"id\":\"7605ef24-f376-11eb-b90b-da7ad0900002\",\"type\":\"permissions\"},{\"id\":\"b6bf9ac6-9a59-11ec-8480-da7ad0900002\",\"type\":\"permissions\"},{\"id\":\"f8e941cf-e746-11ec-b22d-da7ad0900002\",\"type\":\"permissions\"},{\"id\":\"6c5ad874-7aff-11ed-a5cd-da7ad0900002\",\"type\":\"permissions\"},{\"id\":\"a8b4d6e8-4ea4-11ee-b482-da7ad0900002\",\"type\":\"permissions\"},{\"id\":\"50c270de-69ee-11ee-9151-da7ad0900002\",\"type\":\"permissions\"}]}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "50e8a189-90e4-9e1a-8d56-dd0401b77a22" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/logs/config/restriction_queries/role/2d925300-c4b3-11f0-a252-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[]}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "be62e7e5-75db-3672-1d6b-35336c8f15ff" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/roles/2d925300-c4b3-11f0-a252-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "1dcde7aa-e6bd-d8d6-2dc5-c1f7b67c4cb7" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_team_hierarchy_links_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_team_hierarchy_links_returns_OK_response.freeze new file mode 100644 index 00000000000..1d3731961ea --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_team_hierarchy_links_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-11-24T17:18:13.180Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_team_hierarchy_links_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_team_hierarchy_links_returns_OK_response.json new file mode 100644 index 00000000000..b37bf1a1702 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_team_hierarchy_links_returns_OK_response.json @@ -0,0 +1,195 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-ab0ee85594ae1dfd\",\"name\":\"test-name-ab0ee85594ae1dfd\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"d1baf3de-7316-43b5-8582-dc887acc26ef\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":6,\"created_at\":\"2025-11-24T17:18:13.814865+00:00\",\"description\":null,\"handle\":\"test-handle-ab0ee85594ae1dfd\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T17:18:13.814865+00:00\",\"name\":\"test-name-ab0ee85594ae1dfd\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/d1baf3de-7316-43b5-8582-dc887acc26ef/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/d1baf3de-7316-43b5-8582-dc887acc26ef/permission-settings\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "093aa88f-7ea9-46d8-2113-cff45a47e3d2" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-2-ab0ee85594ae1dfd\",\"name\":\"test-name-2-ab0ee85594ae1dfd\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":13,\"created_at\":\"2025-11-24T17:18:14.383042+00:00\",\"description\":null,\"handle\":\"test-handle-2-ab0ee85594ae1dfd\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T17:18:14.383042+00:00\",\"name\":\"test-name-2-ab0ee85594ae1dfd\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/61b0ab36-c1e5-47fd-898a-ba9bfc860e9d/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/61b0ab36-c1e5-47fd-898a-ba9bfc860e9d/permission-settings\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "cf77824c-0d3e-3bdc-25a9-32a44f937627" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"d1baf3de-7316-43b5-8582-dc887acc26ef\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\",\"type\":\"team\"}}},\"type\":\"team_hierarchy_links\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team-hierarchy-links", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"61509612-5bb0-42c5-a16e-bf4920acf473\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2025-11-24T17:18:14.635205462Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"d1baf3de-7316-43b5-8582-dc887acc26ef\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\",\"type\":\"team\"}}}},\"included\":[{\"id\":\"d1baf3de-7316-43b5-8582-dc887acc26ef\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":6,\"handle\":\"test-handle-ab0ee85594ae1dfd\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-ab0ee85594ae1dfd\",\"summary\":null,\"user_count\":0}},{\"id\":\"61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":13,\"handle\":\"test-handle-2-ab0ee85594ae1dfd\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-2-ab0ee85594ae1dfd\",\"summary\":null,\"user_count\":0}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "438095ff-e9ea-20dc-a602-6521b23a66ff" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/team-hierarchy-links", + "queryStringParameters": { + "filter[parent_team]": [ + "d1baf3de-7316-43b5-8582-dc887acc26ef" + ], + "filter[sub_team]": [ + "61b0ab36-c1e5-47fd-898a-ba9bfc860e9d" + ], + "page[number]": [ + "0" + ], + "page[size]": [ + "100" + ] + }, + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"id\":\"61509612-5bb0-42c5-a16e-bf4920acf473\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2025-11-24T17:18:14.635205Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"d1baf3de-7316-43b5-8582-dc887acc26ef\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\",\"type\":\"team\"}}}}],\"meta\":{\"page\":{\"type\":\"number_size\",\"number\":0,\"size\":100,\"total\":1,\"first_number\":0,\"prev_number\":null,\"next_number\":null,\"last_number\":0}},\"links\":{\"self\":\"https://api.datadoghq.com/api/v2/team-hierarchy-links?filter%5Bparent_team%5D=d1baf3de-7316-43b5-8582-dc887acc26ef\\u0026filter%5Bsub_team%5D=61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\\u0026page%5Bnumber%5D=0\\u0026page%5Bsize%5D=100\",\"first\":\"https://api.datadoghq.com/api/v2/team-hierarchy-links?filter[parent_team]=d1baf3de-7316-43b5-8582-dc887acc26ef\\u0026filter[sub_team]=61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\\u0026page[number]=0\\u0026page[size]=100\",\"last\":\"https://api.datadoghq.com/api/v2/team-hierarchy-links?filter[parent_team]=d1baf3de-7316-43b5-8582-dc887acc26ef\\u0026filter[sub_team]=61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\\u0026page[number]=0\\u0026page[size]=100\"},\"included\":[{\"id\":\"61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":13,\"handle\":\"test-handle-2-ab0ee85594ae1dfd\",\"is_managed\":false,\"is_open_membership\":true,\"link_count\":0,\"name\":\"test-name-2-ab0ee85594ae1dfd\",\"summary\":null,\"user_count\":0}},{\"id\":\"d1baf3de-7316-43b5-8582-dc887acc26ef\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":6,\"handle\":\"test-handle-ab0ee85594ae1dfd\",\"is_managed\":false,\"is_open_membership\":true,\"link_count\":0,\"name\":\"test-name-ab0ee85594ae1dfd\",\"summary\":null,\"user_count\":0}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "30a85d94-f55c-f421-b4cd-9237fe54b4b4" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team-hierarchy-links/61509612-5bb0-42c5-a16e-bf4920acf473", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6328f8cc-535e-dc28-83dc-a930b551cd1b" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/61b0ab36-c1e5-47fd-898a-ba9bfc860e9d", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "55c11b3f-b0bd-6d61-e5cb-f13a96303649" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/d1baf3de-7316-43b5-8582-dc887acc26ef", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "23b646bc-99d2-8db4-7fbb-7c5ccbc4ee00" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Grant_role_to_a_restriction_query_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Grant_role_to_a_restriction_query_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..48cf494a95d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Grant_role_to_a_restriction_query_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-11-18T19:17:09.440Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Grant_role_to_a_restriction_query_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Grant_role_to_a_restriction_query_returns_Bad_Request_response.json new file mode 100644 index 00000000000..e9a7ad5290c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Grant_role_to_a_restriction_query_returns_Bad_Request_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"id\":\"3653d3c6-0c75-11ea-ad28-fb5701eabc7d\",\"type\":\"roles\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/logs/config/restriction_queries/malformed_id/roles", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"Role with id: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d not found\"]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "3277fc7c-e44e-6c88-5bb7-0f4c03288995" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Grant_role_to_a_restriction_query_returns_Not_found_response.freeze b/src/test/resources/cassettes/features/v2/Grant_role_to_a_restriction_query_returns_Not_found_response.freeze new file mode 100644 index 00000000000..f281a86a45c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Grant_role_to_a_restriction_query_returns_Not_found_response.freeze @@ -0,0 +1 @@ +2025-11-18T19:17:09.623Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Grant_role_to_a_restriction_query_returns_Not_found_response.json b/src/test/resources/cassettes/features/v2/Grant_role_to_a_restriction_query_returns_Not_found_response.json new file mode 100644 index 00000000000..6c922bf3d07 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Grant_role_to_a_restriction_query_returns_Not_found_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"id\":\"3653d3c6-0c75-11ea-ad28-fb5701eabc7d\",\"type\":\"roles\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/logs/config/restriction_queries/00000000-0000-0000-0000-000000000000/roles", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"Role with id: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d not found\"]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "cc2e5216-40ba-1e6f-f5d2-047c2f9e5957" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Grant_role_to_a_restriction_query_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Grant_role_to_a_restriction_query_returns_OK_response.freeze new file mode 100644 index 00000000000..ac88614fb58 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Grant_role_to_a_restriction_query_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-11-18T19:17:09.783Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Grant_role_to_a_restriction_query_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Grant_role_to_a_restriction_query_returns_OK_response.json new file mode 100644 index 00000000000..1d634f061da --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Grant_role_to_a_restriction_query_returns_OK_response.json @@ -0,0 +1,137 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"restriction_query\":\"env:sandbox\"},\"type\":\"logs_restriction_queries\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/logs/config/restriction_queries", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"logs_restriction_queries\",\"id\":\"2e0a0abc-c4b3-11f0-9b1d-da7ad0900002\",\"attributes\":{\"restriction_query\":\"env:sandbox\",\"created_at\":\"2025-11-18T19:17:09.907646+00:00\",\"modified_at\":\"2025-11-18T19:17:09.907646+00:00\"}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "eb3b308b-3d56-9ef8-4096-dd7718f51861" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"name\":\"Test-Grant_role_to_a_restriction_query_returns_OK_response-1763493429\"},\"type\":\"roles\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/roles", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"2e209fb6-c4b3-11f0-8483-da7ad0900002\",\"type\":\"roles\",\"attributes\":{\"created_at\":\"2025-11-18T19:17:10.056015Z\",\"modified_at\":\"2025-11-18T19:17:10.056318Z\",\"name\":\"Test-Grant_role_to_a_restriction_query_returns_OK_response-1763493429\",\"team_count\":0,\"user_count\":0},\"relationships\":{\"permissions\":{\"data\":[{\"id\":\"d90f6830-d3d8-11e9-a77a-b3404e5e9ee2\",\"type\":\"permissions\"},{\"id\":\"4441648c-d8b1-11e9-a77a-1b899a04b304\",\"type\":\"permissions\"},{\"id\":\"417ba636-2dce-11eb-84c0-6bce5b0d9de0\",\"type\":\"permissions\"},{\"id\":\"12efc20e-d36c-11eb-a9b8-da7ad0900002\",\"type\":\"permissions\"},{\"id\":\"7605ef24-f376-11eb-b90b-da7ad0900002\",\"type\":\"permissions\"},{\"id\":\"b6bf9ac6-9a59-11ec-8480-da7ad0900002\",\"type\":\"permissions\"},{\"id\":\"f8e941cf-e746-11ec-b22d-da7ad0900002\",\"type\":\"permissions\"},{\"id\":\"6c5ad874-7aff-11ed-a5cd-da7ad0900002\",\"type\":\"permissions\"},{\"id\":\"a8b4d6e8-4ea4-11ee-b482-da7ad0900002\",\"type\":\"permissions\"},{\"id\":\"50c270de-69ee-11ee-9151-da7ad0900002\",\"type\":\"permissions\"}]}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "f9f6e3a6-380c-dfb9-5d65-34b65eec7992" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"id\":\"2e209fb6-c4b3-11f0-8483-da7ad0900002\",\"type\":\"roles\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/logs/config/restriction_queries/2e0a0abc-c4b3-11f0-9b1d-da7ad0900002/roles", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": { + "Content-Type": [ + "text/html; charset=utf-8" + ] + }, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "bdbb4e48-3355-ae59-5775-3f776a25f745" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/roles/2e209fb6-c4b3-11f0-8483-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "b8be476d-cdb6-db62-ec62-963f104df0ce" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/logs/config/restriction_queries/2e0a0abc-c4b3-11f0-9b1d-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": { + "Content-Type": [ + "text/html; charset=utf-8" + ] + }, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "bf0bf275-8ed9-ea1a-f173-5e8afb555b87" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_restriction_queries_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/List_restriction_queries_returns_OK_response.freeze new file mode 100644 index 00000000000..d227ca557fa --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_restriction_queries_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-11-18T19:17:10.912Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_restriction_queries_returns_OK_response.json b/src/test/resources/cassettes/features/v2/List_restriction_queries_returns_OK_response.json new file mode 100644 index 00000000000..a0166064835 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_restriction_queries_returns_OK_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/logs/config/restriction_queries", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"type\":\"logs_restriction_queries\",\"id\":\"6358d012-be7e-11f0-8999-da7ad0900002\",\"attributes\":{\"restriction_query\":\"env:production\",\"created_at\":\"2025-11-10T21:44:09.039708+00:00\",\"modified_at\":\"2025-11-10T21:44:09.164487+00:00\"}}]}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "14b9f3a8-ceae-b71e-bec2-861300148be7" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_roles_for_a_restriction_query_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/List_roles_for_a_restriction_query_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..0badf861112 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_roles_for_a_restriction_query_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-11-18T19:17:11.052Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_roles_for_a_restriction_query_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/List_roles_for_a_restriction_query_returns_Bad_Request_response.json new file mode 100644 index 00000000000..3173cfdada4 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_roles_for_a_restriction_query_returns_Bad_Request_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/logs/config/restriction_queries/malformed_id/roles", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"uuid is not proper type\"]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "b35554b0-ccd2-9908-3db2-7e2e40957984" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_roles_for_a_restriction_query_returns_Not_found_response.freeze b/src/test/resources/cassettes/features/v2/List_roles_for_a_restriction_query_returns_Not_found_response.freeze new file mode 100644 index 00000000000..358663320c3 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_roles_for_a_restriction_query_returns_Not_found_response.freeze @@ -0,0 +1 @@ +2025-11-18T19:17:11.231Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_roles_for_a_restriction_query_returns_Not_found_response.json b/src/test/resources/cassettes/features/v2/List_roles_for_a_restriction_query_returns_Not_found_response.json new file mode 100644 index 00000000000..28c88fb5a97 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_roles_for_a_restriction_query_returns_Not_found_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/logs/config/restriction_queries/00000000-0000-0000-0000-000000000000/roles", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"Restriction query not found\"]}", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "4c44d5c4-28dd-d616-f346-2114737e1ab1" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_roles_for_a_restriction_query_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/List_roles_for_a_restriction_query_returns_OK_response.freeze new file mode 100644 index 00000000000..5e8d0cb60e0 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_roles_for_a_restriction_query_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-11-18T19:17:11.376Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_roles_for_a_restriction_query_returns_OK_response.json b/src/test/resources/cassettes/features/v2/List_roles_for_a_restriction_query_returns_OK_response.json new file mode 100644 index 00000000000..76dcecf2554 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_roles_for_a_restriction_query_returns_OK_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"restriction_query\":\"env:sandbox\"},\"type\":\"logs_restriction_queries\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/logs/config/restriction_queries", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"logs_restriction_queries\",\"id\":\"2efc1406-c4b3-11f0-a6d9-da7ad0900002\",\"attributes\":{\"restriction_query\":\"env:sandbox\",\"created_at\":\"2025-11-18T19:17:11.492694+00:00\",\"modified_at\":\"2025-11-18T19:17:11.492694+00:00\"}}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "eb3b308b-3d56-9ef8-4096-dd7718f5185e" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/logs/config/restriction_queries/2efc1406-c4b3-11f0-a6d9-da7ad0900002/roles", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[]}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "fdc99bb0-9f7d-4162-0557-f6d1f7d8fc16" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/logs/config/restriction_queries/2efc1406-c4b3-11f0-a6d9-da7ad0900002", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": { + "Content-Type": [ + "text/html; charset=utf-8" + ] + }, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "00d51977-70a8-b90b-8c4e-7bd904110c6a" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Remove_a_team_hierarchy_link_returns_API_error_response_response.freeze b/src/test/resources/cassettes/features/v2/Remove_a_team_hierarchy_link_returns_API_error_response_response.freeze new file mode 100644 index 00000000000..73f686747b4 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Remove_a_team_hierarchy_link_returns_API_error_response_response.freeze @@ -0,0 +1 @@ +2025-11-24T13:14:20.481Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Remove_a_team_hierarchy_link_returns_API_error_response_response.json b/src/test/resources/cassettes/features/v2/Remove_a_team_hierarchy_link_returns_API_error_response_response.json new file mode 100644 index 00000000000..cf5e8c45054 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Remove_a_team_hierarchy_link_returns_API_error_response_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team-hierarchy-links/aaa11111-aa11-aa11-aaaa-aaaaaa111111", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"Not Found: link with id aaa11111-aa11-aa11-aaaa-aaaaaa111111 not found\"]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "360527a7-cd17-c12c-763c-534ca0bf2e10" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Remove_a_team_hierarchy_link_returns_No_Content_response.freeze b/src/test/resources/cassettes/features/v2/Remove_a_team_hierarchy_link_returns_No_Content_response.freeze new file mode 100644 index 00000000000..be1311ed7c9 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Remove_a_team_hierarchy_link_returns_No_Content_response.freeze @@ -0,0 +1 @@ +2025-11-24T17:08:01.196Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Remove_a_team_hierarchy_link_returns_No_Content_response.json b/src/test/resources/cassettes/features/v2/Remove_a_team_hierarchy_link_returns_No_Content_response.json new file mode 100644 index 00000000000..6460e4fb5da --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Remove_a_team_hierarchy_link_returns_No_Content_response.json @@ -0,0 +1,181 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-db31819631324305\",\"name\":\"test-name-db31819631324305\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"eaf01981-6b63-41ba-b49f-30449c50e865\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":10,\"created_at\":\"2025-11-24T17:08:01.930314+00:00\",\"description\":null,\"handle\":\"test-handle-db31819631324305\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T17:08:01.930314+00:00\",\"name\":\"test-name-db31819631324305\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/eaf01981-6b63-41ba-b49f-30449c50e865/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/eaf01981-6b63-41ba-b49f-30449c50e865/permission-settings\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "83a592d3-fc05-7f6c-2225-6a804b6cb3fd" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-2-db31819631324305\",\"name\":\"test-name-2-db31819631324305\"},\"type\":\"team\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"120aeb27-ca42-4e38-a9e4-6497b8f9407c\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":6,\"created_at\":\"2025-11-24T17:08:02.174211+00:00\",\"description\":null,\"handle\":\"test-handle-2-db31819631324305\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T17:08:02.174211+00:00\",\"name\":\"test-name-2-db31819631324305\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/120aeb27-ca42-4e38-a9e4-6497b8f9407c/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/120aeb27-ca42-4e38-a9e4-6497b8f9407c/permission-settings\"}}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "60fd2072-6a36-5270-a7ac-420092d128f7" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"eaf01981-6b63-41ba-b49f-30449c50e865\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"120aeb27-ca42-4e38-a9e4-6497b8f9407c\",\"type\":\"team\"}}},\"type\":\"team_hierarchy_links\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/team-hierarchy-links", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"185446b8-1e88-419c-b266-3933f1411b6e\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2025-11-24T17:08:02.736655421Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"eaf01981-6b63-41ba-b49f-30449c50e865\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"120aeb27-ca42-4e38-a9e4-6497b8f9407c\",\"type\":\"team\"}}}},\"included\":[{\"id\":\"eaf01981-6b63-41ba-b49f-30449c50e865\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":10,\"handle\":\"test-handle-db31819631324305\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-db31819631324305\",\"summary\":null,\"user_count\":0}},{\"id\":\"120aeb27-ca42-4e38-a9e4-6497b8f9407c\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":6,\"handle\":\"test-handle-2-db31819631324305\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-2-db31819631324305\",\"summary\":null,\"user_count\":0}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "1ed15f6e-36fe-e51e-ffaa-3009d34464e7" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team-hierarchy-links/185446b8-1e88-419c-b266-3933f1411b6e", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "954ab98a-3b9c-8c13-b2fa-c9692349b4a9" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team-hierarchy-links/185446b8-1e88-419c-b266-3933f1411b6e", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[\"Not Found: link with id 185446b8-1e88-419c-b266-3933f1411b6e not found\"]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "954ab98a-3b9c-8c13-b2fa-c9692349b4aa" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/120aeb27-ca42-4e38-a9e4-6497b8f9407c", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "eab70343-b6b4-67c9-8bcc-3a1ac13f5c75" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/team/eaf01981-6b63-41ba-b49f-30449c50e865", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "d01fd700-c1e5-677d-4032-73e8d5805ab6" + } +] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/given.json b/src/test/resources/com/datadog/api/client/v2/api/given.json index 198c7af1b51..6c6d3bf98f4 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 @@ -679,6 +679,18 @@ "tag": "Logs Metrics", "operationId": "CreateLogsMetric" }, + { + "parameters": [ + { + "name": "body", + "value": "{\"data\": {\"attributes\": {\"restriction_query\": \"env:sandbox\"}, \"type\": \"logs_restriction_queries\"}}" + } + ], + "step": "there is a valid \"restriction_query\" in the system", + "key": "restriction_query", + "tag": "Logs Restriction Queries", + "operationId": "CreateRestrictionQuery" + }, { "parameters": [ { @@ -1169,6 +1181,30 @@ "tag": "Teams", "operationId": "CreateTeam" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"handle\": \"test-handle-2-{{ unique_hash }}\",\n \"name\": \"test-name-2-{{ unique_hash }}\"\n },\n \"type\": \"team\"\n }\n}" + } + ], + "step": "there is a valid \"dd_team_2\" in the system", + "key": "dd_team_2", + "tag": "Teams", + "operationId": "CreateTeam" + }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"team_hierarchy_links\",\n \"relationships\": {\n \"parent_team\": {\n \"data\": {\n \"id\": \"{{ dd_team.data.id }}\",\n \"type\": \"team\"\n }\n },\n \"sub_team\": {\n \"data\": {\n \"id\": \"{{ dd_team_2.data.id }}\",\n \"type\": \"team\"\n }\n }\n }\n }\n}" + } + ], + "step": "there is a valid \"team_hierarchy_link\" in the system", + "key": "team_hierarchy_link", + "tag": "Teams", + "operationId": "AddTeamHierarchyLink" + }, { "source": "data.data[0]", "step": "there is a valid \"team_connection\" in the system", diff --git a/src/test/resources/com/datadog/api/client/v2/api/logs_restriction_queries.feature b/src/test/resources/com/datadog/api/client/v2/api/logs_restriction_queries.feature new file mode 100644 index 00000000000..44d65b92fd5 --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/logs_restriction_queries.feature @@ -0,0 +1,287 @@ +@endpoint(logs-restriction-queries) @endpoint(logs-restriction-queries-v2) +Feature: Logs Restriction Queries + **Note: This endpoint is in public beta. If you have any feedback, contact + [Datadog support](https://docs.datadoghq.com/help/).** A Restriction + Query is a logs query that restricts which logs the `logs_read_data` + permission grants read access to. For users whose roles have Restriction + Queries, any log query they make only returns those log events that also + match one of their Restriction Queries. This is true whether the user + queries log events from any log-related feature, including the log + explorer, Live Tail, re-hydration, or a dashboard widget. Restriction + Queries currently only support use of the following components of log + events: - Reserved attributes - The log message - Tags To restrict read + access on log data, add a team tag to log events to indicate which teams + own them, and then scope Restriction Queries to the relevant values of the + team tag. Tags can be applied to log events in many ways, and a log event + can have multiple tags with the same key (like team) and different values. + This means the same log event can be visible to roles whose restriction + queries are scoped to different team values. See [How to Set Up RBAC for + Logs](https://docs.datadoghq.com/logs/guide/logs-rbac/?tab=api#restrict- + access-to-logs) for details on how to add restriction queries. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "LogsRestrictionQueries" API + + @skip-go @skip-java @skip-python @skip-ruby @skip-rust @skip-terraform-config @skip-typescript @skip-validation @team:DataDog/logs-app + Scenario: Create a restriction query returns "Bad Request" response + Given operation "CreateRestrictionQuery" enabled + And new "CreateRestrictionQuery" request + And body with value {"test": "bad_request"} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/logs-app + Scenario: Create a restriction query returns "OK" response + Given operation "CreateRestrictionQuery" enabled + And new "CreateRestrictionQuery" request + And body with value {"data": {"attributes": {"restriction_query": "env:sandbox"}, "type": "logs_restriction_queries"}} + When the request is sent + Then the response status is 200 OK + + @skip-terraform-config @team:DataDog/logs-app + Scenario: Delete a restriction query returns "Bad Request" response + Given operation "DeleteRestrictionQuery" enabled + And new "DeleteRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "malformed_id" + When the request is sent + Then the response status is 400 Bad Request + + @skip-terraform-config @team:DataDog/logs-app + Scenario: Delete a restriction query returns "Not found" response + Given operation "DeleteRestrictionQuery" enabled + And new "DeleteRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "00000000-0000-0000-0000-000000000000" + When the request is sent + Then the response status is 404 Not found + + @team:DataDog/logs-app + Scenario: Delete a restriction query returns "OK" response + Given operation "DeleteRestrictionQuery" enabled + And there is a valid "restriction_query" in the system + And new "DeleteRestrictionQuery" request + And request contains "restriction_query_id" parameter from "restriction_query.data.id" + When the request is sent + Then the response status is 204 OK + + @skip-terraform-config @team:DataDog/logs-app + Scenario: Get a restriction query returns "Bad Request" response + Given operation "GetRestrictionQuery" enabled + And new "GetRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "malformed_id" + When the request is sent + Then the response status is 400 Bad Request + + @skip-terraform-config @team:DataDog/logs-app + Scenario: Get a restriction query returns "Not found" response + Given operation "GetRestrictionQuery" enabled + And new "GetRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "00000000-0000-0000-0000-000000000000" + When the request is sent + Then the response status is 404 Not found + + @team:DataDog/logs-app + Scenario: Get a restriction query returns "OK" response + Given operation "GetRestrictionQuery" enabled + And there is a valid "restriction_query" in the system + And new "GetRestrictionQuery" request + And request contains "restriction_query_id" parameter from "restriction_query.data.id" + When the request is sent + Then the response status is 200 OK + + @skip-terraform-config @team:DataDog/logs-app + Scenario: Get all restriction queries for a given user returns "Bad Request" response + Given operation "ListUserRestrictionQueries" enabled + And new "ListUserRestrictionQueries" request + And request contains "user_id" parameter with value "malformed_id" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/logs-app + Scenario: Get all restriction queries for a given user returns "Not found" response + Given operation "ListUserRestrictionQueries" enabled + And new "ListUserRestrictionQueries" request + And request contains "user_id" parameter with value "00000000-0000-0000-0000-000000000000" + When the request is sent + Then the response status is 400 Bad Request + + @skip @team:DataDog/logs-app + Scenario: Get all restriction queries for a given user returns "OK" response + Given operation "ListUserRestrictionQueries" enabled + And there is a valid "user" in the system + And new "ListUserRestrictionQueries" request + And request contains "user_id" parameter from "user.data.id" + When the request is sent + Then the response status is 200 OK + + @skip-terraform-config @team:DataDog/logs-app + Scenario: Get restriction query for a given role returns "Bad Request" response + Given operation "GetRoleRestrictionQuery" enabled + And new "GetRoleRestrictionQuery" request + And request contains "role_id" parameter with value "malformed_id" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/logs-app + Scenario: Get restriction query for a given role returns "Not found" response + Given operation "GetRoleRestrictionQuery" enabled + And new "GetRoleRestrictionQuery" request + And request contains "role_id" parameter with value "00000000-0000-0000-0000-000000000000" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/logs-app + Scenario: Get restriction query for a given role returns "OK" response + Given operation "GetRoleRestrictionQuery" enabled + And there is a valid "role" in the system + And new "GetRoleRestrictionQuery" request + And request contains "role_id" parameter from "role.data.id" + When the request is sent + Then the response status is 200 OK + + @skip-terraform-config @team:DataDog/logs-app + Scenario: Grant role to a restriction query returns "Bad Request" response + Given operation "AddRoleToRestrictionQuery" enabled + And new "AddRoleToRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "malformed_id" + And body with value {"data": {"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "type": "roles"}} + When the request is sent + Then the response status is 404 Not found + + @skip-terraform-config @team:DataDog/logs-app + Scenario: Grant role to a restriction query returns "Not found" response + Given operation "AddRoleToRestrictionQuery" enabled + And new "AddRoleToRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "00000000-0000-0000-0000-000000000000" + And body with value {"data": {"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "type": "roles"}} + When the request is sent + Then the response status is 404 Not found + + @team:DataDog/logs-app + Scenario: Grant role to a restriction query returns "OK" response + Given operation "AddRoleToRestrictionQuery" enabled + And there is a valid "restriction_query" in the system + And there is a valid "role" in the system + And new "AddRoleToRestrictionQuery" request + And request contains "restriction_query_id" parameter from "restriction_query.data.id" + And body with value {"data": {"id": "{{ role.data.id }}", "type": "roles"}} + When the request is sent + Then the response status is 204 OK + + @skip-terraform-config @team:DataDog/logs-app + Scenario: List restriction queries returns "OK" response + Given operation "ListRestrictionQueries" enabled + And new "ListRestrictionQueries" request + When the request is sent + Then the response status is 200 OK + + @skip-terraform-config @team:DataDog/logs-app + Scenario: List roles for a restriction query returns "Bad Request" response + Given operation "ListRestrictionQueryRoles" enabled + And new "ListRestrictionQueryRoles" request + And request contains "restriction_query_id" parameter with value "malformed_id" + When the request is sent + Then the response status is 400 Bad Request + + @skip-terraform-config @team:DataDog/logs-app + Scenario: List roles for a restriction query returns "Not found" response + Given operation "ListRestrictionQueryRoles" enabled + And new "ListRestrictionQueryRoles" request + And request contains "restriction_query_id" parameter with value "00000000-0000-0000-0000-000000000000" + When the request is sent + Then the response status is 404 Not found + + @team:DataDog/logs-app + Scenario: List roles for a restriction query returns "OK" response + Given operation "ListRestrictionQueryRoles" enabled + And there is a valid "restriction_query" in the system + And new "ListRestrictionQueryRoles" request + And request contains "restriction_query_id" parameter from "restriction_query.data.id" + When the request is sent + Then the response status is 200 OK + + @skip @team:DataDog/logs-app + Scenario: Replace a restriction query returns "Bad Request" response + Given operation "ReplaceRestrictionQuery" enabled + And new "ReplaceRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "malformed_id" + And body with value {"data": {"attributes": {"restriction_query": "env:sandbox"}, "type": "logs_restriction_queries"}} + When the request is sent + Then the response status is 400 Bad Request + + @skip @team:DataDog/logs-app + Scenario: Replace a restriction query returns "Not found" response + Given operation "ReplaceRestrictionQuery" enabled + And new "ReplaceRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "00000000-0000-0000-0000-000000000000" + And body with value {"data": {"attributes": {"restriction_query": "env:sandbox"}, "type": "logs_restriction_queries"}} + When the request is sent + Then the response status is 404 Not found + + @skip @team:DataDog/logs-app + Scenario: Replace a restriction query returns "OK" response + Given operation "ReplaceRestrictionQuery" enabled + And there is a valid "restriction_query" in the system + And new "ReplaceRestrictionQuery" request + And request contains "restriction_query_id" parameter from "restriction_query.data.id" + And body with value {"data": {"attributes": {"restriction_query": "env:staging"}, "type": "logs_restriction_queries"}} + When the request is sent + Then the response status is 200 OK + + @skip @skip-terraform-config @team:DataDog/logs-app + Scenario: Revoke role from a restriction query returns "Bad Request" response + Given operation "RemoveRoleFromRestrictionQuery" enabled + And new "RemoveRoleFromRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "malformed_id" + And body with value {"data": {"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "type": "roles"}} + When the request is sent + Then the response status is 400 Bad Request + + @skip @skip-terraform-config @team:DataDog/logs-app + Scenario: Revoke role from a restriction query returns "Not found" response + Given operation "RemoveRoleFromRestrictionQuery" enabled + And new "RemoveRoleFromRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "00000000-0000-0000-0000-000000000000" + And body with value {"data": {"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "type": "roles"}} + When the request is sent + Then the response status is 404 Not found + + @skip @team:DataDog/logs-app + Scenario: Revoke role from a restriction query returns "OK" response + Given operation "RemoveRoleFromRestrictionQuery" enabled + And there is a valid "restriction_query" in the system + And there is a valid "role" in the system + And new "RemoveRoleFromRestrictionQuery" request + And request contains "restriction_query_id" parameter from "restriction_query.data.id" + And body with value {"data": {"id": "{{ role.data.id }}", "type": "roles"}} + When the request is sent + Then the response status is 204 OK + + @skip @skip-terraform-config @team:DataDog/logs-app + Scenario: Update a restriction query returns "Bad Request" response + Given operation "UpdateRestrictionQuery" enabled + And new "UpdateRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "malformed_id" + And body with value {"data": {"attributes": {"restriction_query": "env:sandbox"}, "type": "logs_restriction_queries"}} + When the request is sent + Then the response status is 400 Bad Request + + @skip @skip-terraform-config @team:DataDog/logs-app + Scenario: Update a restriction query returns "Not found" response + Given operation "UpdateRestrictionQuery" enabled + And new "UpdateRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "00000000-0000-0000-0000-000000000000" + And body with value {"data": {"attributes": {"restriction_query": "env:sandbox"}, "type": "logs_restriction_queries"}} + When the request is sent + Then the response status is 404 Not found + + @skip @team:DataDog/logs-app + Scenario: Update a restriction query returns "OK" response + Given operation "UpdateRestrictionQuery" enabled + And there is a valid "restriction_query" in the system + And new "UpdateRestrictionQuery" request + And request contains "restriction_query_id" parameter from "restriction_query.data.id" + And body with value {"data": {"attributes": {"restriction_query": "env:production"}, "type": "logs_restriction_queries"}} + When the request is sent + Then the response status is 200 OK 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..faa1ca0889d 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/teams.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/teams.feature @@ -43,6 +43,25 @@ Feature: Teams When the request is sent Then the response status is 200 Represents a user's association to a team + @team:DataDog/aaa-omg + Scenario: Create a team hierarchy link returns "Conflict" response + Given new "AddTeamHierarchyLink" request + And there is a valid "dd_team" in the system + And there is a valid "dd_team_2" in the system + And there is a valid "team_hierarchy_link" in the system + And body with value {"data": {"relationships": {"parent_team": {"data": {"id": "{{team_hierarchy_link.data.relationships.parent_team.data.id}}", "type": "team"}}, "sub_team": {"data": {"id": "{{team_hierarchy_link.data.relationships.sub_team.data.id}}", "type": "team"}}}, "type": "team_hierarchy_links"}} + When the request is sent + Then the response status is 409 Conflict + + @team:DataDog/aaa-omg + Scenario: Create a team hierarchy link returns "OK" response + Given new "AddTeamHierarchyLink" request + And there is a valid "dd_team" in the system + And there is a valid "dd_team_2" in the system + And body with value {"data": {"relationships": {"parent_team": {"data": {"id": "{{dd_team.data.id}}", "type": "team"}}, "sub_team": {"data": {"id": "{{dd_team_2.data.id}}", "type": "team"}}}, "type": "team_hierarchy_links"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/aaa-omg Scenario: Create a team link returns "API error response." response Given new "CreateTeamLink" request @@ -96,6 +115,28 @@ Feature: Teams And the response "data.attributes.visible_modules" is equal to ["m1","m2"] And the response "data.attributes.hidden_modules" is equal to ["m3"] + @team:DataDog/aaa-omg + Scenario: Get a team hierarchy link returns "API error response." response + Given new "GetTeamHierarchyLink" request + And request contains "link_id" parameter with value "aaa11111-aa11-aa11-aaaa-aaaaaa111111" + When the request is sent + Then the response status is 404 API error response. + + @team:DataDog/aaa-omg + Scenario: Get a team hierarchy link returns "OK" response + Given new "GetTeamHierarchyLink" request + And there is a valid "dd_team" in the system + And there is a valid "dd_team_2" in the system + And there is a valid "team_hierarchy_link" in the system + And request contains "link_id" parameter from "team_hierarchy_link.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "{{ team_hierarchy_link.data.id }}" + And the response "data.relationships.parent_team.data.id" is equal to "{{ dd_team.data.id }}" + And the response "data.relationships.sub_team.data.id" is equal to "{{ dd_team_2.data.id }}" + And the response "included" has item with field "id" with value "{{ dd_team.data.id }}" + And the response "included" has item with field "id" with value "{{ dd_team_2.data.id }}" + @team:DataDog/aaa-omg Scenario: Get a team link returns "API error response." response Given new "GetTeamLink" request @@ -211,6 +252,31 @@ Feature: Teams When the request is sent Then the response status is 200 OK + @team:DataDog/aaa-omg + Scenario: Get team hierarchy links returns "OK" response + Given new "ListTeamHierarchyLinks" request + And there is a valid "dd_team" in the system + And there is a valid "dd_team_2" in the system + And there is a valid "team_hierarchy_link" in the system + And request contains "filter[parent_team]" parameter from "team_hierarchy_link.data.relationships.parent_team.data.id" + And request contains "filter[sub_team]" parameter from "team_hierarchy_link.data.relationships.sub_team.data.id" + And request contains "page[number]" parameter with value 0 + And request contains "page[size]" parameter with value 100 + When the request is sent + Then the response status is 200 OK + And the response "data" has length 1 + And the response "data[0].id" is equal to "{{ team_hierarchy_link.data.id }}" + And the response "data[0].relationships.parent_team.data.id" is equal to "{{ dd_team.data.id }}" + And the response "data[0].relationships.sub_team.data.id" is equal to "{{ dd_team_2.data.id }}" + And the response "included" has item with field "id" with value "{{ dd_team.data.id }}" + And the response "included" has item with field "id" with value "{{ dd_team_2.data.id }}" + + @generated @skip @team:DataDog/aaa-omg @with-pagination + Scenario: Get team hierarchy links returns "OK" response with pagination + Given new "ListTeamHierarchyLinks" request + When the request with pagination is sent + Then the response status is 200 OK + @team:DataDog/aaa-omg Scenario: Get team memberships returns "API error response." response Given new "GetTeamMemberships" request @@ -293,6 +359,23 @@ Feature: Teams When the request is sent Then the response status is 204 No Content + @team:DataDog/aaa-omg + Scenario: Remove a team hierarchy link returns "API error response." response + Given new "RemoveTeamHierarchyLink" request + And request contains "link_id" parameter with value "aaa11111-aa11-aa11-aaaa-aaaaaa111111" + When the request is sent + Then the response status is 404 API error response. + + @team:DataDog/aaa-omg + Scenario: Remove a team hierarchy link returns "No Content" response + Given new "RemoveTeamHierarchyLink" request + And there is a valid "dd_team" in the system + And there is a valid "dd_team_2" in the system + And there is a valid "team_hierarchy_link" in the system + And request contains "link_id" parameter from "team_hierarchy_link.data.id" + When the request is sent + Then the response status is 204 No Content + @team:DataDog/aaa-omg Scenario: Remove a team link returns "API error response." response Given new "DeleteTeamLink" request diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 3799e64e630..7c226bf60d3 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 @@ -2443,6 +2443,79 @@ "type": "idempotent" } }, + "ListRestrictionQueries": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "safe" + } + }, + "CreateRestrictionQuery": { + "tag": "Logs Restriction Queries", + "undo": { + "operationId": "DeleteRestrictionQuery", + "parameters": [ + { + "name": "restriction_query_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "GetRoleRestrictionQuery": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "safe" + } + }, + "ListUserRestrictionQueries": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "safe" + } + }, + "DeleteRestrictionQuery": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "idempotent" + } + }, + "GetRestrictionQuery": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "safe" + } + }, + "UpdateRestrictionQuery": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "idempotent" + } + }, + "ReplaceRestrictionQuery": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "idempotent" + } + }, + "RemoveRoleFromRestrictionQuery": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "idempotent" + } + }, + "ListRestrictionQueryRoles": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "safe" + } + }, + "AddRoleToRestrictionQuery": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "safe" + } + }, "ListLogsGet": { "tag": "Logs", "undo": { @@ -4345,6 +4418,37 @@ "type": "unsafe" } }, + "ListTeamHierarchyLinks": { + "tag": "Teams", + "undo": { + "type": "safe" + } + }, + "AddTeamHierarchyLink": { + "tag": "Teams", + "undo": { + "operationId": "RemoveTeamHierarchyLink", + "parameters": [ + { + "name": "link_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "RemoveTeamHierarchyLink": { + "tag": "Teams", + "undo": { + "type": "idempotent" + } + }, + "GetTeamHierarchyLink": { + "tag": "Teams", + "undo": { + "type": "safe" + } + }, "DeleteTeamConnections": { "tag": "Team Connections", "undo": {