From e9331d798787fd649c8777d472184bda23d10170 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 14 Nov 2025 20:38:02 +0000 Subject: [PATCH] Regenerate client from commit b300e04 of spec repo --- .generator/schemas/v2/openapi.yaml | 738 +++++++ .../frozen.json | 1 + .../recording.har | 67 + .../frozen.json | 1 + .../recording.har | 109 + .../frozen.json | 1 + .../recording.har | 57 + .../frozen.json | 1 + .../recording.har | 57 + .../frozen.json | 1 + .../recording.har | 152 ++ .../frozen.json | 1 + .../recording.har | 57 + .../frozen.json | 1 + .../recording.har | 57 + .../frozen.json | 1 + .../recording.har | 152 ++ .../frozen.json | 1 + .../recording.har | 57 + .../frozen.json | 1 + .../recording.har | 57 + .../frozen.json | 1 + .../recording.har | 147 ++ .../frozen.json | 1 + .../recording.har | 57 + .../frozen.json | 1 + .../recording.har | 57 + .../frozen.json | 1 + .../recording.har | 147 ++ .../frozen.json | 1 + .../recording.har | 67 + .../frozen.json | 1 + .../recording.har | 67 + .../frozen.json | 1 + .../recording.har | 251 +++ .../frozen.json | 1 + .../recording.har | 57 + .../frozen.json | 1 + .../recording.har | 57 + .../frozen.json | 1 + .../recording.har | 57 + .../frozen.json | 1 + .../recording.har | 152 ++ features/v2/given.json | 12 + features/v2/logs_restriction_queries.feature | 275 +++ features/v2/undo.json | 73 + packages/datadog-api-client/README.md | 1 + .../src/support/scenarios_model_mapping.ts | 105 + services/logs_restriction_queries/.yarnrc.yml | 1 + services/logs_restriction_queries/README.md | 59 + .../logs_restriction_queries/package.json | 43 + .../logs_restriction_queries/src/index.ts | 3 + .../src/v2/LogsRestrictionQueriesApi.ts | 1772 +++++++++++++++++ .../logs_restriction_queries/src/v2/index.ts | 38 + .../src/v2/models/APIErrorResponse.ts | 45 + .../v2/models/LogsRestrictionQueriesType.ts | 9 + .../src/v2/models/RelationshipToRole.ts | 46 + .../src/v2/models/RelationshipToRoleData.ts | 54 + .../src/v2/models/RelationshipToRoles.ts | 46 + .../v2/models/RestrictionQueryAttributes.ts | 96 + .../RestrictionQueryCreateAttributes.ts | 45 + .../v2/models/RestrictionQueryCreateData.ts | 55 + .../models/RestrictionQueryCreatePayload.ts | 46 + .../v2/models/RestrictionQueryListResponse.ts | 46 + .../RestrictionQueryResponseIncludedItem.ts | 10 + .../src/v2/models/RestrictionQueryRole.ts | 62 + .../models/RestrictionQueryRoleAttribute.ts | 44 + .../models/RestrictionQueryRolesResponse.ts | 46 + .../RestrictionQueryUpdateAttributes.ts | 45 + .../v2/models/RestrictionQueryUpdateData.ts | 55 + .../models/RestrictionQueryUpdatePayload.ts | 46 + .../RestrictionQueryWithRelationships.ts | 72 + ...strictionQueryWithRelationshipsResponse.ts | 55 + .../RestrictionQueryWithoutRelationships.ts | 62 + ...ictionQueryWithoutRelationshipsResponse.ts | 46 + .../src/v2/models/RolesType.ts | 7 + .../src/v2/models/TypingInfo.ts | 56 + .../src/v2/models/UserRelationships.ts | 46 + .../logs_restriction_queries/tsconfig.json | 28 + yarn.lock | 9 + 80 files changed, 6256 insertions(+) create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Create-a-restriction-query-returns-Bad-Request-response_111583348/frozen.json create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Create-a-restriction-query-returns-Bad-Request-response_111583348/recording.har create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Create-a-restriction-query-returns-OK-response_3206923690/frozen.json create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Create-a-restriction-query-returns-OK-response_3206923690/recording.har create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Delete-a-restriction-query-returns-Bad-Request-response_1603149133/frozen.json create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Delete-a-restriction-query-returns-Bad-Request-response_1603149133/recording.har create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Delete-a-restriction-query-returns-Not-found-response_1516544206/frozen.json create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Delete-a-restriction-query-returns-Not-found-response_1516544206/recording.har create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Delete-a-restriction-query-returns-OK-response_4160228625/frozen.json create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Delete-a-restriction-query-returns-OK-response_4160228625/recording.har create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Get-a-restriction-query-returns-Bad-Request-response_2731233454/frozen.json create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Get-a-restriction-query-returns-Bad-Request-response_2731233454/recording.har create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Get-a-restriction-query-returns-Not-found-response_3505229493/frozen.json create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Get-a-restriction-query-returns-Not-found-response_3505229493/recording.har create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Get-a-restriction-query-returns-OK-response_2707069060/frozen.json create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Get-a-restriction-query-returns-OK-response_2707069060/recording.har create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Get-all-restriction-queries-for-a-given-user-returns-Bad-Request-response_1854123842/frozen.json create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Get-all-restriction-queries-for-a-given-user-returns-Bad-Request-response_1854123842/recording.har create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Get-all-restriction-queries-for-a-given-user-returns-Not-found-response_1770807281/frozen.json create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Get-all-restriction-queries-for-a-given-user-returns-Not-found-response_1770807281/recording.har create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Get-all-restriction-queries-for-a-given-user-returns-OK-response_3404968640/frozen.json create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Get-all-restriction-queries-for-a-given-user-returns-OK-response_3404968640/recording.har create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Get-restriction-query-for-a-given-role-returns-Bad-Request-response_2754972360/frozen.json create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Get-restriction-query-for-a-given-role-returns-Bad-Request-response_2754972360/recording.har create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Get-restriction-query-for-a-given-role-returns-Not-found-response_1656319775/frozen.json create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Get-restriction-query-for-a-given-role-returns-Not-found-response_1656319775/recording.har create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Get-restriction-query-for-a-given-role-returns-OK-response_48156390/frozen.json create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Get-restriction-query-for-a-given-role-returns-OK-response_48156390/recording.har create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Grant-role-to-a-restriction-query-returns-Bad-Request-response_2157195683/frozen.json create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Grant-role-to-a-restriction-query-returns-Bad-Request-response_2157195683/recording.har create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Grant-role-to-a-restriction-query-returns-Not-found-response_1872190532/frozen.json create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Grant-role-to-a-restriction-query-returns-Not-found-response_1872190532/recording.har create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Grant-role-to-a-restriction-query-returns-OK-response_4030799143/frozen.json create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/Grant-role-to-a-restriction-query-returns-OK-response_4030799143/recording.har create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/List-restriction-queries-returns-OK-response_3168694309/frozen.json create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/List-restriction-queries-returns-OK-response_3168694309/recording.har create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/List-roles-for-a-restriction-query-returns-Bad-Request-response_3337304138/frozen.json create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/List-roles-for-a-restriction-query-returns-Bad-Request-response_3337304138/recording.har create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/List-roles-for-a-restriction-query-returns-Not-found-response_253155065/frozen.json create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/List-roles-for-a-restriction-query-returns-Not-found-response_253155065/recording.har create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/List-roles-for-a-restriction-query-returns-OK-response_412716376/frozen.json create mode 100644 cassettes/v2/Logs-Restriction-Queries_2746039292/List-roles-for-a-restriction-query-returns-OK-response_412716376/recording.har create mode 100644 features/v2/logs_restriction_queries.feature create mode 100644 services/logs_restriction_queries/.yarnrc.yml create mode 100644 services/logs_restriction_queries/README.md create mode 100644 services/logs_restriction_queries/package.json create mode 100644 services/logs_restriction_queries/src/index.ts create mode 100644 services/logs_restriction_queries/src/v2/LogsRestrictionQueriesApi.ts create mode 100644 services/logs_restriction_queries/src/v2/index.ts create mode 100644 services/logs_restriction_queries/src/v2/models/APIErrorResponse.ts create mode 100644 services/logs_restriction_queries/src/v2/models/LogsRestrictionQueriesType.ts create mode 100644 services/logs_restriction_queries/src/v2/models/RelationshipToRole.ts create mode 100644 services/logs_restriction_queries/src/v2/models/RelationshipToRoleData.ts create mode 100644 services/logs_restriction_queries/src/v2/models/RelationshipToRoles.ts create mode 100644 services/logs_restriction_queries/src/v2/models/RestrictionQueryAttributes.ts create mode 100644 services/logs_restriction_queries/src/v2/models/RestrictionQueryCreateAttributes.ts create mode 100644 services/logs_restriction_queries/src/v2/models/RestrictionQueryCreateData.ts create mode 100644 services/logs_restriction_queries/src/v2/models/RestrictionQueryCreatePayload.ts create mode 100644 services/logs_restriction_queries/src/v2/models/RestrictionQueryListResponse.ts create mode 100644 services/logs_restriction_queries/src/v2/models/RestrictionQueryResponseIncludedItem.ts create mode 100644 services/logs_restriction_queries/src/v2/models/RestrictionQueryRole.ts create mode 100644 services/logs_restriction_queries/src/v2/models/RestrictionQueryRoleAttribute.ts create mode 100644 services/logs_restriction_queries/src/v2/models/RestrictionQueryRolesResponse.ts create mode 100644 services/logs_restriction_queries/src/v2/models/RestrictionQueryUpdateAttributes.ts create mode 100644 services/logs_restriction_queries/src/v2/models/RestrictionQueryUpdateData.ts create mode 100644 services/logs_restriction_queries/src/v2/models/RestrictionQueryUpdatePayload.ts create mode 100644 services/logs_restriction_queries/src/v2/models/RestrictionQueryWithRelationships.ts create mode 100644 services/logs_restriction_queries/src/v2/models/RestrictionQueryWithRelationshipsResponse.ts create mode 100644 services/logs_restriction_queries/src/v2/models/RestrictionQueryWithoutRelationships.ts create mode 100644 services/logs_restriction_queries/src/v2/models/RestrictionQueryWithoutRelationshipsResponse.ts create mode 100644 services/logs_restriction_queries/src/v2/models/RolesType.ts create mode 100644 services/logs_restriction_queries/src/v2/models/TypingInfo.ts create mode 100644 services/logs_restriction_queries/src/v2/models/UserRelationships.ts create mode 100644 services/logs_restriction_queries/tsconfig.json diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 642bfd7423b5..52e01e598923 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 @@ -30115,6 +30136,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: @@ -41436,6 +41466,195 @@ 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. + discriminator: + mapping: + roles: '#/components/schemas/RestrictionQueryRole' + propertyName: type + 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: + default: roles + description: Role resource type. + example: roles + readOnly: true + type: string + 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: @@ -69360,6 +69579,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. @@ -84182,6 +84882,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/cassettes/v2/Logs-Restriction-Queries_2746039292/Create-a-restriction-query-returns-Bad-Request-response_111583348/frozen.json b/cassettes/v2/Logs-Restriction-Queries_2746039292/Create-a-restriction-query-returns-Bad-Request-response_111583348/frozen.json new file mode 100644 index 000000000000..ce79a6cf3ad3 --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Create-a-restriction-query-returns-Bad-Request-response_111583348/frozen.json @@ -0,0 +1 @@ +"2025-11-14T19:44:37.676Z" diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Create-a-restriction-query-returns-Bad-Request-response_111583348/recording.har b/cassettes/v2/Logs-Restriction-Queries_2746039292/Create-a-restriction-query-returns-Bad-Request-response_111583348/recording.har new file mode 100644 index 000000000000..6e9f30d2a58b --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Create-a-restriction-query-returns-Bad-Request-response_111583348/recording.har @@ -0,0 +1,67 @@ +{ + "log": { + "_recordingName": "Logs Restriction Queries/Create a restriction query returns \"Bad Request\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "914ab5642c89f946865164b7d00223f9", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 22, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 568, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"test\":\"bad_request\"}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries" + }, + "response": { + "bodySize": 132, + "content": { + "mimeType": "application/json", + "size": 132, + "text": "{\"errors\":[\"API input validation failed: {'_schema': [{'detail': 'Object must include `data` key.', 'source': {'pointer': '/'}}]}\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 712, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2025-11-14T19:44:38.131Z", + "time": 77 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Create-a-restriction-query-returns-OK-response_3206923690/frozen.json b/cassettes/v2/Logs-Restriction-Queries_2746039292/Create-a-restriction-query-returns-OK-response_3206923690/frozen.json new file mode 100644 index 000000000000..cf43d183d2d1 --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Create-a-restriction-query-returns-OK-response_3206923690/frozen.json @@ -0,0 +1 @@ +"2025-11-14T19:44:38.216Z" diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Create-a-restriction-query-returns-OK-response_3206923690/recording.har b/cassettes/v2/Logs-Restriction-Queries_2746039292/Create-a-restriction-query-returns-OK-response_3206923690/recording.har new file mode 100644 index 000000000000..6761d3a1326a --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Create-a-restriction-query-returns-OK-response_3206923690/recording.har @@ -0,0 +1,109 @@ +{ + "log": { + "_recordingName": "Logs Restriction Queries/Create a restriction query returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "eb3b308b3d569ef84096dd7718f5185e", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 93, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 568, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"restriction_query\":\"env:sandbox\"},\"type\":\"logs_restriction_queries\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries" + }, + "response": { + "bodySize": 235, + "content": { + "mimeType": "application/json", + "size": 235, + "text": "{\"data\":{\"type\":\"logs_restriction_queries\",\"id\":\"5ae59e30-c192-11f0-a911-da7ad0900002\",\"attributes\":{\"restriction_query\":\"env:sandbox\",\"created_at\":\"2025-11-14T19:44:38.285875+00:00\",\"modified_at\":\"2025-11-14T19:44:38.285875+00:00\"}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 712, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-11-14T19:44:38.220Z", + "time": 256 + }, + { + "_id": "f4ce162ca9340da29cb6bc47176f8874", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 542, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/5ae59e30-c192-11f0-a911-da7ad0900002" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/html; charset=utf-8", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/html; charset=utf-8" + } + ], + "headersSize": 699, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-14T19:44:38.493Z", + "time": 148 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Delete-a-restriction-query-returns-Bad-Request-response_1603149133/frozen.json b/cassettes/v2/Logs-Restriction-Queries_2746039292/Delete-a-restriction-query-returns-Bad-Request-response_1603149133/frozen.json new file mode 100644 index 000000000000..dbc14f1f5dd6 --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Delete-a-restriction-query-returns-Bad-Request-response_1603149133/frozen.json @@ -0,0 +1 @@ +"2025-11-14T19:44:38.645Z" diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Delete-a-restriction-query-returns-Bad-Request-response_1603149133/recording.har b/cassettes/v2/Logs-Restriction-Queries_2746039292/Delete-a-restriction-query-returns-Bad-Request-response_1603149133/recording.har new file mode 100644 index 000000000000..1726dad58346 --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Delete-a-restriction-query-returns-Bad-Request-response_1603149133/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Logs Restriction Queries/Delete a restriction query returns \"Bad Request\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "08325a2eeadf2ff87bc7b7f250b93938", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 517, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/malformed_id" + }, + "response": { + "bodySize": 38, + "content": { + "mimeType": "application/json", + "size": 38, + "text": "{\"errors\":[\"uuid is not proper type\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 711, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2025-11-14T19:44:38.647Z", + "time": 99 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Delete-a-restriction-query-returns-Not-found-response_1516544206/frozen.json b/cassettes/v2/Logs-Restriction-Queries_2746039292/Delete-a-restriction-query-returns-Not-found-response_1516544206/frozen.json new file mode 100644 index 000000000000..8e3b0495ac09 --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Delete-a-restriction-query-returns-Not-found-response_1516544206/frozen.json @@ -0,0 +1 @@ +"2025-11-14T19:44:38.752Z" diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Delete-a-restriction-query-returns-Not-found-response_1516544206/recording.har b/cassettes/v2/Logs-Restriction-Queries_2746039292/Delete-a-restriction-query-returns-Not-found-response_1516544206/recording.har new file mode 100644 index 000000000000..5c9ce70a3777 --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Delete-a-restriction-query-returns-Not-found-response_1516544206/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Logs Restriction Queries/Delete a restriction query returns \"Not found\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "d657b2986cfbefba4d5d555aa72dd8de", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 542, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/00000000-0000-0000-0000-000000000000" + }, + "response": { + "bodySize": 42, + "content": { + "mimeType": "application/json", + "size": 42, + "text": "{\"errors\":[\"Restriction query not found\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 711, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2025-11-14T19:44:38.754Z", + "time": 106 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Delete-a-restriction-query-returns-OK-response_4160228625/frozen.json b/cassettes/v2/Logs-Restriction-Queries_2746039292/Delete-a-restriction-query-returns-OK-response_4160228625/frozen.json new file mode 100644 index 000000000000..1dd249f2f07d --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Delete-a-restriction-query-returns-OK-response_4160228625/frozen.json @@ -0,0 +1 @@ +"2025-11-14T19:44:38.865Z" diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Delete-a-restriction-query-returns-OK-response_4160228625/recording.har b/cassettes/v2/Logs-Restriction-Queries_2746039292/Delete-a-restriction-query-returns-OK-response_4160228625/recording.har new file mode 100644 index 000000000000..8592918e31c8 --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Delete-a-restriction-query-returns-OK-response_4160228625/recording.har @@ -0,0 +1,152 @@ +{ + "log": { + "_recordingName": "Logs Restriction Queries/Delete a restriction query returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "eb3b308b3d569ef84096dd7718f5185e", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 93, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 568, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"restriction_query\":\"env:sandbox\"},\"type\":\"logs_restriction_queries\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries" + }, + "response": { + "bodySize": 235, + "content": { + "mimeType": "application/json", + "size": 235, + "text": "{\"data\":{\"type\":\"logs_restriction_queries\",\"id\":\"5b47ab20-c192-11f0-9a03-da7ad0900002\",\"attributes\":{\"restriction_query\":\"env:sandbox\",\"created_at\":\"2025-11-14T19:44:38.928560+00:00\",\"modified_at\":\"2025-11-14T19:44:38.928560+00:00\"}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 712, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-11-14T19:44:38.867Z", + "time": 85 + }, + { + "_id": "90e7bfd82ffc25617b301abf539c77e4", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 541, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/5b47ab20-c192-11f0-9a03-da7ad0900002" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/html; charset=utf-8", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/html; charset=utf-8" + } + ], + "headersSize": 699, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-14T19:44:38.959Z", + "time": 125 + }, + { + "_id": "90e7bfd82ffc25617b301abf539c77e4", + "_order": 1, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 542, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/5b47ab20-c192-11f0-9a03-da7ad0900002" + }, + "response": { + "bodySize": 42, + "content": { + "mimeType": "application/json", + "size": 42, + "text": "{\"errors\":[\"Restriction query not found\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 711, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2025-11-14T19:44:39.089Z", + "time": 78 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-a-restriction-query-returns-Bad-Request-response_2731233454/frozen.json b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-a-restriction-query-returns-Bad-Request-response_2731233454/frozen.json new file mode 100644 index 000000000000..54ff57d95e23 --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-a-restriction-query-returns-Bad-Request-response_2731233454/frozen.json @@ -0,0 +1 @@ +"2025-11-14T19:44:39.172Z" diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-a-restriction-query-returns-Bad-Request-response_2731233454/recording.har b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-a-restriction-query-returns-Bad-Request-response_2731233454/recording.har new file mode 100644 index 000000000000..3fa1089dad3f --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-a-restriction-query-returns-Bad-Request-response_2731233454/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Logs Restriction Queries/Get a restriction query returns \"Bad Request\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "075fc7ebeac9783a7a83a6e011e9ed38", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 524, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/malformed_id" + }, + "response": { + "bodySize": 38, + "content": { + "mimeType": "application/json", + "size": 38, + "text": "{\"errors\":[\"uuid is not proper type\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 713, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2025-11-14T19:44:39.175Z", + "time": 93 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-a-restriction-query-returns-Not-found-response_3505229493/frozen.json b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-a-restriction-query-returns-Not-found-response_3505229493/frozen.json new file mode 100644 index 000000000000..980ba5e9bef3 --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-a-restriction-query-returns-Not-found-response_3505229493/frozen.json @@ -0,0 +1 @@ +"2025-11-14T19:44:39.273Z" diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-a-restriction-query-returns-Not-found-response_3505229493/recording.har b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-a-restriction-query-returns-Not-found-response_3505229493/recording.har new file mode 100644 index 000000000000..363fec362291 --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-a-restriction-query-returns-Not-found-response_3505229493/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Logs Restriction Queries/Get a restriction query returns \"Not found\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "58b5254e9c84ea1ccffcb472b25d89f6", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 547, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/00000000-0000-0000-0000-000000000000" + }, + "response": { + "bodySize": 42, + "content": { + "mimeType": "application/json", + "size": 42, + "text": "{\"errors\":[\"Restriction query not found\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 713, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2025-11-14T19:44:39.275Z", + "time": 74 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-a-restriction-query-returns-OK-response_2707069060/frozen.json b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-a-restriction-query-returns-OK-response_2707069060/frozen.json new file mode 100644 index 000000000000..c7fbf06d3eb0 --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-a-restriction-query-returns-OK-response_2707069060/frozen.json @@ -0,0 +1 @@ +"2025-11-14T19:44:39.353Z" diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-a-restriction-query-returns-OK-response_2707069060/recording.har b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-a-restriction-query-returns-OK-response_2707069060/recording.har new file mode 100644 index 000000000000..0eb0fed8aaa7 --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-a-restriction-query-returns-OK-response_2707069060/recording.har @@ -0,0 +1,152 @@ +{ + "log": { + "_recordingName": "Logs Restriction Queries/Get a restriction query returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "eb3b308b3d569ef84096dd7718f5185e", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 93, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 568, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"restriction_query\":\"env:sandbox\"},\"type\":\"logs_restriction_queries\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries" + }, + "response": { + "bodySize": 235, + "content": { + "mimeType": "application/json", + "size": 235, + "text": "{\"data\":{\"type\":\"logs_restriction_queries\",\"id\":\"5b92c0ce-c192-11f0-8f65-da7ad0900002\",\"attributes\":{\"restriction_query\":\"env:sandbox\",\"created_at\":\"2025-11-14T19:44:39.420652+00:00\",\"modified_at\":\"2025-11-14T19:44:39.420652+00:00\"}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 712, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-11-14T19:44:39.355Z", + "time": 88 + }, + { + "_id": "52a6d818c43fc3a534bc428025f46a57", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 549, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/5b92c0ce-c192-11f0-8f65-da7ad0900002" + }, + "response": { + "bodySize": 273, + "content": { + "mimeType": "application/json", + "size": 273, + "text": "{\"data\":{\"type\":\"logs_restriction_queries\",\"id\":\"5b92c0ce-c192-11f0-8f65-da7ad0900002\",\"attributes\":{\"restriction_query\":\"env:sandbox\",\"created_at\":\"2025-11-14T19:44:39.420652+00:00\",\"modified_at\":\"2025-11-14T19:44:39.420652+00:00\"},\"relationships\":{\"roles\":{\"data\":[]}}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 714, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-11-14T19:44:39.447Z", + "time": 101 + }, + { + "_id": "850bb5685ff00ec177f1bdd7d68ff004", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 542, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/5b92c0ce-c192-11f0-8f65-da7ad0900002" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/html; charset=utf-8", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/html; charset=utf-8" + } + ], + "headersSize": 699, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-14T19:44:39.554Z", + "time": 106 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-all-restriction-queries-for-a-given-user-returns-Bad-Request-response_1854123842/frozen.json b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-all-restriction-queries-for-a-given-user-returns-Bad-Request-response_1854123842/frozen.json new file mode 100644 index 000000000000..7116210fe60d --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-all-restriction-queries-for-a-given-user-returns-Bad-Request-response_1854123842/frozen.json @@ -0,0 +1 @@ +"2025-11-14T19:44:39.664Z" diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-all-restriction-queries-for-a-given-user-returns-Bad-Request-response_1854123842/recording.har b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-all-restriction-queries-for-a-given-user-returns-Bad-Request-response_1854123842/recording.har new file mode 100644 index 000000000000..099ce921ecb5 --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-all-restriction-queries-for-a-given-user-returns-Bad-Request-response_1854123842/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Logs Restriction Queries/Get all restriction queries for a given user returns \"Bad Request\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "668705797b0cf880b82a4ad211d0170c", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 537, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/user/malformed_id" + }, + "response": { + "bodySize": 38, + "content": { + "mimeType": "application/json", + "size": 38, + "text": "{\"errors\":[\"uuid is not proper type\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 713, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2025-11-14T19:44:39.666Z", + "time": 89 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-all-restriction-queries-for-a-given-user-returns-Not-found-response_1770807281/frozen.json b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-all-restriction-queries-for-a-given-user-returns-Not-found-response_1770807281/frozen.json new file mode 100644 index 000000000000..2c40670c5398 --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-all-restriction-queries-for-a-given-user-returns-Not-found-response_1770807281/frozen.json @@ -0,0 +1 @@ +"2025-11-14T19:44:39.759Z" diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-all-restriction-queries-for-a-given-user-returns-Not-found-response_1770807281/recording.har b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-all-restriction-queries-for-a-given-user-returns-Not-found-response_1770807281/recording.har new file mode 100644 index 000000000000..dd52ef77e9c5 --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-all-restriction-queries-for-a-given-user-returns-Not-found-response_1770807281/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Logs Restriction Queries/Get all restriction queries for a given user returns \"Not found\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "8559ccc701915a0bfd2d000351160ff4", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 560, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/user/00000000-0000-0000-0000-000000000000" + }, + "response": { + "bodySize": 80, + "content": { + "mimeType": "application/json", + "size": 80, + "text": "{\"errors\":[\"user with uuid 00000000-0000-0000-0000-000000000000 doesn't exist\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 713, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2025-11-14T19:44:39.761Z", + "time": 59 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-all-restriction-queries-for-a-given-user-returns-OK-response_3404968640/frozen.json b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-all-restriction-queries-for-a-given-user-returns-OK-response_3404968640/frozen.json new file mode 100644 index 000000000000..722f48e3b264 --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-all-restriction-queries-for-a-given-user-returns-OK-response_3404968640/frozen.json @@ -0,0 +1 @@ +"2025-11-14T19:44:39.824Z" diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-all-restriction-queries-for-a-given-user-returns-OK-response_3404968640/recording.har b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-all-restriction-queries-for-a-given-user-returns-OK-response_3404968640/recording.har new file mode 100644 index 000000000000..3ec8b8032df1 --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-all-restriction-queries-for-a-given-user-returns-OK-response_3404968640/recording.har @@ -0,0 +1,147 @@ +{ + "log": { + "_recordingName": "Logs Restriction Queries/Get all restriction queries for a given user returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "b8fe3d2ea18fea088096c2a003119d19", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 166, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 531, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"email\":\"Test-Get_all_restriction_queries_for_a_given_user_returns_OK_response-1763149479@datadoghq.com\",\"title\":\"user title\"},\"type\":\"users\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/users" + }, + "response": { + "bodySize": 756, + "content": { + "mimeType": "application/json", + "size": 756, + "text": "{\"data\":{\"type\":\"users\",\"id\":\"5bde5c10-c192-11f0-924a-766f31fff523\",\"attributes\":{\"name\":null,\"handle\":\"test-get_all_restriction_queries_for_a_given_user_returns_ok_response-1763149479@datadoghq.com\",\"created_at\":\"2025-11-14T19:44:39.917112+00:00\",\"modified_at\":\"2025-11-14T19:44:39.917112+00:00\",\"email\":\"test-get_all_restriction_queries_for_a_given_user_returns_ok_response-1763149479@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/876b69d93fda39b3d7945f71e37894b0?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\",\"last_login_time\":null},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 681, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-11-14T19:44:39.827Z", + "time": 139 + }, + { + "_id": "deb2ac3730fb7855cd3a469dcfba5ebb", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 561, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/user/5bde5c10-c192-11f0-924a-766f31fff523" + }, + "response": { + "bodySize": 12, + "content": { + "mimeType": "application/json", + "size": 12, + "text": "{\"data\":[]}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 690, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-11-14T19:44:39.971Z", + "time": 93 + }, + { + "_id": "844e84398f5b5e709b6c63ba0981fa91", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 505, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/users/5bde5c10-c192-11f0-924a-766f31fff523" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 495, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-14T19:44:40.069Z", + "time": 166 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-restriction-query-for-a-given-role-returns-Bad-Request-response_2754972360/frozen.json b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-restriction-query-for-a-given-role-returns-Bad-Request-response_2754972360/frozen.json new file mode 100644 index 000000000000..24ce76d548a1 --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-restriction-query-for-a-given-role-returns-Bad-Request-response_2754972360/frozen.json @@ -0,0 +1 @@ +"2025-11-14T19:44:40.239Z" diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-restriction-query-for-a-given-role-returns-Bad-Request-response_2754972360/recording.har b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-restriction-query-for-a-given-role-returns-Bad-Request-response_2754972360/recording.har new file mode 100644 index 000000000000..ff837799b40c --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-restriction-query-for-a-given-role-returns-Bad-Request-response_2754972360/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Logs Restriction Queries/Get restriction query for a given role returns \"Bad Request\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "7e0c2f77efbdbbdf6fe6f91ecb20d116", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 534, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/role/malformed_id" + }, + "response": { + "bodySize": 40, + "content": { + "mimeType": "application/json", + "size": 40, + "text": "{\"errors\":[\"Missing Role malformed_id\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 713, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2025-11-14T19:44:40.241Z", + "time": 107 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-restriction-query-for-a-given-role-returns-Not-found-response_1656319775/frozen.json b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-restriction-query-for-a-given-role-returns-Not-found-response_1656319775/frozen.json new file mode 100644 index 000000000000..43708927b49a --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-restriction-query-for-a-given-role-returns-Not-found-response_1656319775/frozen.json @@ -0,0 +1 @@ +"2025-11-14T19:44:40.353Z" diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-restriction-query-for-a-given-role-returns-Not-found-response_1656319775/recording.har b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-restriction-query-for-a-given-role-returns-Not-found-response_1656319775/recording.har new file mode 100644 index 000000000000..cfe4bbb35aa6 --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-restriction-query-for-a-given-role-returns-Not-found-response_1656319775/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Logs Restriction Queries/Get restriction query for a given role returns \"Not found\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "9e3fe7a4f5adc3895999a4c8bad141a1", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 558, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/role/00000000-0000-0000-0000-000000000000" + }, + "response": { + "bodySize": 64, + "content": { + "mimeType": "application/json", + "size": 64, + "text": "{\"errors\":[\"Missing Role 00000000-0000-0000-0000-000000000000\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 713, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2025-11-14T19:44:40.355Z", + "time": 92 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-restriction-query-for-a-given-role-returns-OK-response_48156390/frozen.json b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-restriction-query-for-a-given-role-returns-OK-response_48156390/frozen.json new file mode 100644 index 000000000000..627f85c21bc7 --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-restriction-query-for-a-given-role-returns-OK-response_48156390/frozen.json @@ -0,0 +1 @@ +"2025-11-14T19:44:40.453Z" diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-restriction-query-for-a-given-role-returns-OK-response_48156390/recording.har b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-restriction-query-for-a-given-role-returns-OK-response_48156390/recording.har new file mode 100644 index 000000000000..cdecb216ebbf --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-restriction-query-for-a-given-role-returns-OK-response_48156390/recording.har @@ -0,0 +1,147 @@ +{ + "log": { + "_recordingName": "Logs Restriction Queries/Get restriction query for a given role returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "94ac06f4a7f5c71df059b0f65fea09b5", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 124, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 531, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"name\":\"Test-Get_restriction_query_for_a_given_role_returns_OK_response-1763149480\"},\"type\":\"roles\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/roles" + }, + "response": { + "bodySize": 997, + "content": { + "mimeType": "application/vnd.api+json", + "size": 997, + "text": "{\"data\":{\"id\":\"5c395fa6-c192-11f0-b137-da7ad0900002\",\"type\":\"roles\",\"attributes\":{\"created_at\":\"2025-11-14T19:44:40.513135Z\",\"modified_at\":\"2025-11-14T19:44:40.51331Z\",\"name\":\"Test-Get_restriction_query_for_a_given_role_returns_OK_response-1763149480\",\"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\"}]}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 652, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-11-14T19:44:40.454Z", + "time": 92 + }, + { + "_id": "d439aa2cccb51834a8c94cc05b8d01f6", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 557, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/role/5c395fa6-c192-11f0-b137-da7ad0900002" + }, + "response": { + "bodySize": 12, + "content": { + "mimeType": "application/json", + "size": 12, + "text": "{\"data\":[]}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 690, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-11-14T19:44:40.551Z", + "time": 202 + }, + { + "_id": "026ef34a13e9b1b1358c92bdaf6dc808", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 504, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/roles/5c395fa6-c192-11f0-b137-da7ad0900002" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 591, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-14T19:44:40.757Z", + "time": 58 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Grant-role-to-a-restriction-query-returns-Bad-Request-response_2157195683/frozen.json b/cassettes/v2/Logs-Restriction-Queries_2746039292/Grant-role-to-a-restriction-query-returns-Bad-Request-response_2157195683/frozen.json new file mode 100644 index 000000000000..05095a28644e --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Grant-role-to-a-restriction-query-returns-Bad-Request-response_2157195683/frozen.json @@ -0,0 +1 @@ +"2025-11-14T19:44:40.819Z" diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Grant-role-to-a-restriction-query-returns-Bad-Request-response_2157195683/recording.har b/cassettes/v2/Logs-Restriction-Queries_2746039292/Grant-role-to-a-restriction-query-returns-Bad-Request-response_2157195683/recording.har new file mode 100644 index 000000000000..5a504820730a --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Grant-role-to-a-restriction-query-returns-Bad-Request-response_2157195683/recording.har @@ -0,0 +1,67 @@ +{ + "log": { + "_recordingName": "Logs Restriction Queries/Grant role to a restriction query returns \"Bad Request\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "3277fc7ce44e6c885bb70f4c03288995", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 69, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 577, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"id\":\"3653d3c6-0c75-11ea-ad28-fb5701eabc7d\",\"type\":\"roles\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/malformed_id/roles" + }, + "response": { + "bodySize": 75, + "content": { + "mimeType": "application/json", + "size": 75, + "text": "{\"errors\":[\"Role with id: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d not found\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 712, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2025-11-14T19:44:40.822Z", + "time": 72 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Grant-role-to-a-restriction-query-returns-Not-found-response_1872190532/frozen.json b/cassettes/v2/Logs-Restriction-Queries_2746039292/Grant-role-to-a-restriction-query-returns-Not-found-response_1872190532/frozen.json new file mode 100644 index 000000000000..f2a386e60c01 --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Grant-role-to-a-restriction-query-returns-Not-found-response_1872190532/frozen.json @@ -0,0 +1 @@ +"2025-11-14T19:44:40.899Z" diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Grant-role-to-a-restriction-query-returns-Not-found-response_1872190532/recording.har b/cassettes/v2/Logs-Restriction-Queries_2746039292/Grant-role-to-a-restriction-query-returns-Not-found-response_1872190532/recording.har new file mode 100644 index 000000000000..17f4f35a2b85 --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Grant-role-to-a-restriction-query-returns-Not-found-response_1872190532/recording.har @@ -0,0 +1,67 @@ +{ + "log": { + "_recordingName": "Logs Restriction Queries/Grant role to a restriction query returns \"Not found\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "cc2e521640ba1e6ff5d2047c2f9e5957", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 69, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 601, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"id\":\"3653d3c6-0c75-11ea-ad28-fb5701eabc7d\",\"type\":\"roles\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/00000000-0000-0000-0000-000000000000/roles" + }, + "response": { + "bodySize": 75, + "content": { + "mimeType": "application/json", + "size": 75, + "text": "{\"errors\":[\"Role with id: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d not found\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 712, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2025-11-14T19:44:40.901Z", + "time": 79 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Grant-role-to-a-restriction-query-returns-OK-response_4030799143/frozen.json b/cassettes/v2/Logs-Restriction-Queries_2746039292/Grant-role-to-a-restriction-query-returns-OK-response_4030799143/frozen.json new file mode 100644 index 000000000000..e968ebb652b2 --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Grant-role-to-a-restriction-query-returns-OK-response_4030799143/frozen.json @@ -0,0 +1 @@ +"2025-11-14T19:44:40.985Z" diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/Grant-role-to-a-restriction-query-returns-OK-response_4030799143/recording.har b/cassettes/v2/Logs-Restriction-Queries_2746039292/Grant-role-to-a-restriction-query-returns-OK-response_4030799143/recording.har new file mode 100644 index 000000000000..e5936010cdab --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Grant-role-to-a-restriction-query-returns-OK-response_4030799143/recording.har @@ -0,0 +1,251 @@ +{ + "log": { + "_recordingName": "Logs Restriction Queries/Grant role to a restriction query returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "eb3b308b3d569ef84096dd7718f5185e", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 93, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 568, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"restriction_query\":\"env:sandbox\"},\"type\":\"logs_restriction_queries\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries" + }, + "response": { + "bodySize": 235, + "content": { + "mimeType": "application/json", + "size": 235, + "text": "{\"data\":{\"type\":\"logs_restriction_queries\",\"id\":\"5c8a0b22-c192-11f0-b452-da7ad0900002\",\"attributes\":{\"restriction_query\":\"env:sandbox\",\"created_at\":\"2025-11-14T19:44:41.041145+00:00\",\"modified_at\":\"2025-11-14T19:44:41.041145+00:00\"}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 712, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-11-14T19:44:40.986Z", + "time": 80 + }, + { + "_id": "e77ae64474cb4daf23ea580419ab5c1c", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 119, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 531, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"name\":\"Test-Grant_role_to_a_restriction_query_returns_OK_response-1763149480\"},\"type\":\"roles\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/roles" + }, + "response": { + "bodySize": 993, + "content": { + "mimeType": "application/vnd.api+json", + "size": 993, + "text": "{\"data\":{\"id\":\"5c9cc974-c192-11f0-97d0-da7ad0900002\",\"type\":\"roles\",\"attributes\":{\"created_at\":\"2025-11-14T19:44:41.162895Z\",\"modified_at\":\"2025-11-14T19:44:41.163975Z\",\"name\":\"Test-Grant_role_to_a_restriction_query_returns_OK_response-1763149480\",\"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\"}]}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 652, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-11-14T19:44:41.071Z", + "time": 123 + }, + { + "_id": "dad52cb50c4ed362d976c1211eeb806f", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 69, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 601, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"id\":\"5c9cc974-c192-11f0-97d0-da7ad0900002\",\"type\":\"roles\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/5c8a0b22-c192-11f0-b452-da7ad0900002/roles" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/html; charset=utf-8", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/html; charset=utf-8" + } + ], + "headersSize": 699, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-14T19:44:41.198Z", + "time": 129 + }, + { + "_id": "ec8fa33a5ff1669ebe91e637c3510d78", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 502, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/roles/5c9cc974-c192-11f0-97d0-da7ad0900002" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 591, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-14T19:44:41.332Z", + "time": 70 + }, + { + "_id": "fa54557b97788dba636867dd01667b37", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 542, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/5c8a0b22-c192-11f0-b452-da7ad0900002" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/html; charset=utf-8", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/html; charset=utf-8" + } + ], + "headersSize": 699, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-14T19:44:41.405Z", + "time": 134 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/List-restriction-queries-returns-OK-response_3168694309/frozen.json b/cassettes/v2/Logs-Restriction-Queries_2746039292/List-restriction-queries-returns-OK-response_3168694309/frozen.json new file mode 100644 index 000000000000..2a432d82a831 --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/List-restriction-queries-returns-OK-response_3168694309/frozen.json @@ -0,0 +1 @@ +"2025-11-14T19:44:41.543Z" diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/List-restriction-queries-returns-OK-response_3168694309/recording.har b/cassettes/v2/Logs-Restriction-Queries_2746039292/List-restriction-queries-returns-OK-response_3168694309/recording.har new file mode 100644 index 000000000000..e6135568c512 --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/List-restriction-queries-returns-OK-response_3168694309/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Logs Restriction Queries/List restriction queries returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "14b9f3a8ceaeb71ebec2861300148be7", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 515, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries" + }, + "response": { + "bodySize": 240, + "content": { + "mimeType": "application/json", + "size": 240, + "text": "{\"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" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 714, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-11-14T19:44:41.545Z", + "time": 73 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/List-roles-for-a-restriction-query-returns-Bad-Request-response_3337304138/frozen.json b/cassettes/v2/Logs-Restriction-Queries_2746039292/List-roles-for-a-restriction-query-returns-Bad-Request-response_3337304138/frozen.json new file mode 100644 index 000000000000..b6b59aaf9474 --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/List-roles-for-a-restriction-query-returns-Bad-Request-response_3337304138/frozen.json @@ -0,0 +1 @@ +"2025-11-14T19:44:41.623Z" diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/List-roles-for-a-restriction-query-returns-Bad-Request-response_3337304138/recording.har b/cassettes/v2/Logs-Restriction-Queries_2746039292/List-roles-for-a-restriction-query-returns-Bad-Request-response_3337304138/recording.har new file mode 100644 index 000000000000..a75dd5c5bb8c --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/List-roles-for-a-restriction-query-returns-Bad-Request-response_3337304138/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Logs Restriction Queries/List roles for a restriction query returns \"Bad Request\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "b35554b0ccd299083db27e2e40957984", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 537, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/malformed_id/roles" + }, + "response": { + "bodySize": 38, + "content": { + "mimeType": "application/json", + "size": 38, + "text": "{\"errors\":[\"uuid is not proper type\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 713, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2025-11-14T19:44:41.625Z", + "time": 82 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/List-roles-for-a-restriction-query-returns-Not-found-response_253155065/frozen.json b/cassettes/v2/Logs-Restriction-Queries_2746039292/List-roles-for-a-restriction-query-returns-Not-found-response_253155065/frozen.json new file mode 100644 index 000000000000..e20e2e9419ca --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/List-roles-for-a-restriction-query-returns-Not-found-response_253155065/frozen.json @@ -0,0 +1 @@ +"2025-11-14T19:44:41.711Z" diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/List-roles-for-a-restriction-query-returns-Not-found-response_253155065/recording.har b/cassettes/v2/Logs-Restriction-Queries_2746039292/List-roles-for-a-restriction-query-returns-Not-found-response_253155065/recording.har new file mode 100644 index 000000000000..4e7d761efb09 --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/List-roles-for-a-restriction-query-returns-Not-found-response_253155065/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Logs Restriction Queries/List roles for a restriction query returns \"Not found\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "4c44d5c428ddd616f3462114737e1ab1", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 561, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/00000000-0000-0000-0000-000000000000/roles" + }, + "response": { + "bodySize": 42, + "content": { + "mimeType": "application/json", + "size": 42, + "text": "{\"errors\":[\"Restriction query not found\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 713, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2025-11-14T19:44:41.713Z", + "time": 151 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/List-roles-for-a-restriction-query-returns-OK-response_412716376/frozen.json b/cassettes/v2/Logs-Restriction-Queries_2746039292/List-roles-for-a-restriction-query-returns-OK-response_412716376/frozen.json new file mode 100644 index 000000000000..0ce6a9011d74 --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/List-roles-for-a-restriction-query-returns-OK-response_412716376/frozen.json @@ -0,0 +1 @@ +"2025-11-14T19:44:41.869Z" diff --git a/cassettes/v2/Logs-Restriction-Queries_2746039292/List-roles-for-a-restriction-query-returns-OK-response_412716376/recording.har b/cassettes/v2/Logs-Restriction-Queries_2746039292/List-roles-for-a-restriction-query-returns-OK-response_412716376/recording.har new file mode 100644 index 000000000000..cd01aa925f61 --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/List-roles-for-a-restriction-query-returns-OK-response_412716376/recording.har @@ -0,0 +1,152 @@ +{ + "log": { + "_recordingName": "Logs Restriction Queries/List roles for a restriction query returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "eb3b308b3d569ef84096dd7718f5185e", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 93, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 568, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"restriction_query\":\"env:sandbox\"},\"type\":\"logs_restriction_queries\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries" + }, + "response": { + "bodySize": 235, + "content": { + "mimeType": "application/json", + "size": 235, + "text": "{\"data\":{\"type\":\"logs_restriction_queries\",\"id\":\"5d120216-c192-11f0-8d79-da7ad0900002\",\"attributes\":{\"restriction_query\":\"env:sandbox\",\"created_at\":\"2025-11-14T19:44:41.932327+00:00\",\"modified_at\":\"2025-11-14T19:44:41.932327+00:00\"}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 712, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-11-14T19:44:41.871Z", + "time": 84 + }, + { + "_id": "fd77d879be61bbd308fe93944b27836b", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 561, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/5d120216-c192-11f0-8d79-da7ad0900002/roles" + }, + "response": { + "bodySize": 12, + "content": { + "mimeType": "application/json", + "size": 12, + "text": "{\"data\":[]}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 690, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-11-14T19:44:41.959Z", + "time": 91 + }, + { + "_id": "753e2e440338aac981ef88a273bca29e", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 542, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/5d120216-c192-11f0-8d79-da7ad0900002" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/html; charset=utf-8", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/html; charset=utf-8" + } + ], + "headersSize": 699, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-14T19:44:42.054Z", + "time": 113 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/features/v2/given.json b/features/v2/given.json index 8afb9b89bda5..b1cb0acd3155 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -651,6 +651,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": [ { diff --git a/features/v2/logs_restriction_queries.feature b/features/v2/logs_restriction_queries.feature new file mode 100644 index 000000000000..66f18a96b624 --- /dev/null +++ b/features/v2/logs_restriction_queries.feature @@ -0,0 +1,275 @@ +@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 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 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 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 + + @team:DataDog/logs-app + Scenario: Get all restriction queries for a given user returns "OK" response + Given 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 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 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 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 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 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 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 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 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/features/v2/undo.json b/features/v2/undo.json index d25ca0a4dba2..71fcbe047149 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -2377,6 +2377,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": { diff --git a/packages/datadog-api-client/README.md b/packages/datadog-api-client/README.md index afd9fea69672..a7ea8d46ac19 100644 --- a/packages/datadog-api-client/README.md +++ b/packages/datadog-api-client/README.md @@ -398,6 +398,7 @@ apiInstance | Logs Indexes | @datadog/datadog-api-client-logs-indexes | [README.md](../../services/logs-indexes/README.md) | | Logs Metrics | @datadog/datadog-api-client-logs-metrics | [README.md](../../services/logs-metrics/README.md) | | Logs Pipelines | @datadog/datadog-api-client-logs-pipelines | [README.md](../../services/logs-pipelines/README.md) | +| Logs Restriction Queries | @datadog/datadog-api-client-logs-restriction-queries | [README.md](../../services/logs-restriction-queries/README.md) | | Metrics | @datadog/datadog-api-client-metrics | [README.md](../../services/metrics/README.md) | | Microsoft Teams Integration | @datadog/datadog-api-client-microsoft-teams-integration | [README.md](../../services/microsoft-teams-integration/README.md) | | Monitors | @datadog/datadog-api-client-monitors | [README.md](../../services/monitors/README.md) | diff --git a/private/bdd_runner/src/support/scenarios_model_mapping.ts b/private/bdd_runner/src/support/scenarios_model_mapping.ts index e17570286950..94e5dac65890 100644 --- a/private/bdd_runner/src/support/scenarios_model_mapping.ts +++ b/private/bdd_runner/src/support/scenarios_model_mapping.ts @@ -6677,6 +6677,111 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = { }, operationResponseType: "LogsMetricResponse", }, + "LogsRestrictionQueriesApi.V2.ListRestrictionQueries": { + pageSize: { + type: "number", + format: "int64", + }, + pageNumber: { + type: "number", + format: "int64", + }, + operationResponseType: "RestrictionQueryListResponse", + }, + "LogsRestrictionQueriesApi.V2.CreateRestrictionQuery": { + body: { + type: "RestrictionQueryCreatePayload", + format: "", + }, + operationResponseType: "RestrictionQueryWithoutRelationshipsResponse", + }, + "LogsRestrictionQueriesApi.V2.GetRoleRestrictionQuery": { + roleId: { + type: "string", + format: "", + }, + operationResponseType: "RestrictionQueryListResponse", + }, + "LogsRestrictionQueriesApi.V2.ListUserRestrictionQueries": { + userId: { + type: "string", + format: "", + }, + operationResponseType: "RestrictionQueryListResponse", + }, + "LogsRestrictionQueriesApi.V2.GetRestrictionQuery": { + restrictionQueryId: { + type: "string", + format: "", + }, + operationResponseType: "RestrictionQueryWithRelationshipsResponse", + }, + "LogsRestrictionQueriesApi.V2.ReplaceRestrictionQuery": { + restrictionQueryId: { + type: "string", + format: "", + }, + body: { + type: "RestrictionQueryUpdatePayload", + format: "", + }, + operationResponseType: "RestrictionQueryWithoutRelationshipsResponse", + }, + "LogsRestrictionQueriesApi.V2.DeleteRestrictionQuery": { + restrictionQueryId: { + type: "string", + format: "", + }, + operationResponseType: "{}", + }, + "LogsRestrictionQueriesApi.V2.UpdateRestrictionQuery": { + restrictionQueryId: { + type: "string", + format: "", + }, + body: { + type: "RestrictionQueryUpdatePayload", + format: "", + }, + operationResponseType: "RestrictionQueryWithoutRelationshipsResponse", + }, + "LogsRestrictionQueriesApi.V2.ListRestrictionQueryRoles": { + restrictionQueryId: { + type: "string", + format: "", + }, + pageSize: { + type: "number", + format: "int64", + }, + pageNumber: { + type: "number", + format: "int64", + }, + operationResponseType: "RestrictionQueryRolesResponse", + }, + "LogsRestrictionQueriesApi.V2.AddRoleToRestrictionQuery": { + restrictionQueryId: { + type: "string", + format: "", + }, + body: { + type: "RelationshipToRole", + format: "", + }, + operationResponseType: "{}", + }, + "LogsRestrictionQueriesApi.V2.RemoveRoleFromRestrictionQuery": { + restrictionQueryId: { + type: "string", + format: "", + }, + body: { + type: "RelationshipToRole", + format: "", + }, + operationResponseType: "{}", + }, "MetricsApi.V2.ListTagConfigurations": { filterConfigured: { type: "boolean", diff --git a/services/logs_restriction_queries/.yarnrc.yml b/services/logs_restriction_queries/.yarnrc.yml new file mode 100644 index 000000000000..3186f3f0795a --- /dev/null +++ b/services/logs_restriction_queries/.yarnrc.yml @@ -0,0 +1 @@ +nodeLinker: node-modules diff --git a/services/logs_restriction_queries/README.md b/services/logs_restriction_queries/README.md new file mode 100644 index 000000000000..14bd896c27f4 --- /dev/null +++ b/services/logs_restriction_queries/README.md @@ -0,0 +1,59 @@ +# @datadog/datadog-api-client-logs-restriction-queries + +## 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. + +## Navigation + +- [Installation](#installation) +- [Getting Started](#getting-started) + +## Installation + +```sh +# NPM +npm install @datadog/datadog-api-client-logs-restriction-queries +# Yarn +yarn add @datadog/datadog-api-client-logs-restriction-queries +``` + +## Getting Started +```ts +import { createConfiguration } from "@datadog/datadog-api-client"; +import { LogsRestrictionQueriesApiV2 } from "@datadog/datadog-api-client-logs-restriction-queries"; +import { v2 } from "@datadog/datadog-api-client-logs-restriction-queries"; + +const configuration = createConfiguration(); +// Enable unstable operations +const configurationOpts = { + unstableOperations: { + "LogsRestrictionQueriesApi.v2.listRestrictionQueries": true + } +} + +const configuration = createConfiguration(configurationOpts); +const apiInstance = new LogsRestrictionQueriesApiV2(configuration); +const params = {/* parameters */}; + +apiInstance.listRestrictionQueries(params).then((data) => { + console.log("API called successfully. Returned data: " + JSON.stringify(data)); +}).catch((error) => { + console.error("Error calling API: " + error); +}); +``` \ No newline at end of file diff --git a/services/logs_restriction_queries/package.json b/services/logs_restriction_queries/package.json new file mode 100644 index 000000000000..077db08be102 --- /dev/null +++ b/services/logs_restriction_queries/package.json @@ -0,0 +1,43 @@ +{ + "name": "@datadog/datadog-api-client-logs-restriction-queries", + "description": "", + "author": "", + "keywords": [ + "api", + "fetch", + "typescript" + ], + "license": "Apache-2.0", + "licenses": [ + { + "type": "Apache-2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/DataDog/datadog-api-client-typescript.git", + "directory": "services/logs-restriction-queries" + }, + "files": [ + "dist/**/*" + ], + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "scripts": { + "prepack": "yarn workspace @datadog/datadog-api-client build && yarn build", + "build": "yarn generate-version-files && tsc", + "generate-version-files": "node -p \"'export const version = ' + JSON.stringify(require('./package.json').version)\" > src/version.ts" + }, + "dependencies": { + "@datadog/datadog-api-client": "^2.0.0-beta.0" + }, + "devDependencies": { + "typescript": "5.8.3" + }, + "engines": { + "node": ">=18.0.0" + }, + "version": "0.0.1", + "packageManager": "yarn@4.9.1" +} diff --git a/services/logs_restriction_queries/src/index.ts b/services/logs_restriction_queries/src/index.ts new file mode 100644 index 000000000000..1800b19a0407 --- /dev/null +++ b/services/logs_restriction_queries/src/index.ts @@ -0,0 +1,3 @@ +export * as v2 from "./v2"; + +export { LogsRestrictionQueriesApi as LogsRestrictionQueriesApiV2 } from "./v2/LogsRestrictionQueriesApi"; diff --git a/services/logs_restriction_queries/src/v2/LogsRestrictionQueriesApi.ts b/services/logs_restriction_queries/src/v2/LogsRestrictionQueriesApi.ts new file mode 100644 index 000000000000..ba7b360317e7 --- /dev/null +++ b/services/logs_restriction_queries/src/v2/LogsRestrictionQueriesApi.ts @@ -0,0 +1,1772 @@ +import { + ApiException, + BaseAPIRequestFactory, + BaseServerConfiguration, + buildUserAgent, + Configuration, + createConfiguration, + deserialize, + getPreferredMediaType, + HttpMethod, + isBrowser, + logger, + normalizeMediaType, + parse, + RequiredError, + RequestContext, + ResponseContext, + serialize, + ServerConfiguration, + stringify, + applySecurityAuthentication, +} from "@datadog/datadog-api-client"; + +import { TypingInfo } from "./models/TypingInfo"; +import { APIErrorResponse } from "./models/APIErrorResponse"; +import { RelationshipToRole } from "./models/RelationshipToRole"; +import { RestrictionQueryCreatePayload } from "./models/RestrictionQueryCreatePayload"; +import { RestrictionQueryListResponse } from "./models/RestrictionQueryListResponse"; +import { RestrictionQueryRolesResponse } from "./models/RestrictionQueryRolesResponse"; +import { RestrictionQueryUpdatePayload } from "./models/RestrictionQueryUpdatePayload"; +import { RestrictionQueryWithoutRelationshipsResponse } from "./models/RestrictionQueryWithoutRelationshipsResponse"; +import { RestrictionQueryWithRelationshipsResponse } from "./models/RestrictionQueryWithRelationshipsResponse"; +import { version } from "../version"; + +export class LogsRestrictionQueriesApiRequestFactory extends BaseAPIRequestFactory { + public userAgent: string | undefined; + + public constructor(configuration: Configuration) { + super(configuration); + if (!isBrowser) { + this.userAgent = buildUserAgent("logs-restriction-queries", version); + } + } + public async addRoleToRestrictionQuery( + restrictionQueryId: string, + body: RelationshipToRole, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if ( + !_config.unstableOperations[ + "LogsRestrictionQueriesApi.v2.addRoleToRestrictionQuery" + ] + ) { + throw new Error( + "Unstable operation 'addRoleToRestrictionQuery' is disabled. Enable it by setting `configuration.unstableOperations['LogsRestrictionQueriesApi.v2.addRoleToRestrictionQuery'] = true`", + ); + } + + // verify required parameter 'restrictionQueryId' is not null or undefined + if (restrictionQueryId === null || restrictionQueryId === undefined) { + throw new RequiredError( + "restrictionQueryId", + "addRoleToRestrictionQuery", + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "addRoleToRestrictionQuery"); + } + + // Path Params + const localVarPath = + "/api/v2/logs/config/restriction_queries/{restriction_query_id}/roles".replace( + "{restriction_query_id}", + encodeURIComponent(String(restrictionQueryId)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "LogsRestrictionQueriesApi.v2.addRoleToRestrictionQuery", + LogsRestrictionQueriesApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.POST, + overrides, + ); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Body Params + const contentType = getPreferredMediaType(["application/json"]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = stringify( + serialize(body, TypingInfo, "RelationshipToRole", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async createRestrictionQuery( + body: RestrictionQueryCreatePayload, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if ( + !_config.unstableOperations[ + "LogsRestrictionQueriesApi.v2.createRestrictionQuery" + ] + ) { + throw new Error( + "Unstable operation 'createRestrictionQuery' is disabled. Enable it by setting `configuration.unstableOperations['LogsRestrictionQueriesApi.v2.createRestrictionQuery'] = true`", + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createRestrictionQuery"); + } + + // Path Params + const localVarPath = "/api/v2/logs/config/restriction_queries"; + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "LogsRestrictionQueriesApi.v2.createRestrictionQuery", + LogsRestrictionQueriesApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.POST, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Body Params + const contentType = getPreferredMediaType(["application/json"]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = stringify( + serialize(body, TypingInfo, "RestrictionQueryCreatePayload", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async deleteRestrictionQuery( + restrictionQueryId: string, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if ( + !_config.unstableOperations[ + "LogsRestrictionQueriesApi.v2.deleteRestrictionQuery" + ] + ) { + throw new Error( + "Unstable operation 'deleteRestrictionQuery' is disabled. Enable it by setting `configuration.unstableOperations['LogsRestrictionQueriesApi.v2.deleteRestrictionQuery'] = true`", + ); + } + + // verify required parameter 'restrictionQueryId' is not null or undefined + if (restrictionQueryId === null || restrictionQueryId === undefined) { + throw new RequiredError("restrictionQueryId", "deleteRestrictionQuery"); + } + + // Path Params + const localVarPath = + "/api/v2/logs/config/restriction_queries/{restriction_query_id}".replace( + "{restriction_query_id}", + encodeURIComponent(String(restrictionQueryId)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "LogsRestrictionQueriesApi.v2.deleteRestrictionQuery", + LogsRestrictionQueriesApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.DELETE, + overrides, + ); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async getRestrictionQuery( + restrictionQueryId: string, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if ( + !_config.unstableOperations[ + "LogsRestrictionQueriesApi.v2.getRestrictionQuery" + ] + ) { + throw new Error( + "Unstable operation 'getRestrictionQuery' is disabled. Enable it by setting `configuration.unstableOperations['LogsRestrictionQueriesApi.v2.getRestrictionQuery'] = true`", + ); + } + + // verify required parameter 'restrictionQueryId' is not null or undefined + if (restrictionQueryId === null || restrictionQueryId === undefined) { + throw new RequiredError("restrictionQueryId", "getRestrictionQuery"); + } + + // Path Params + const localVarPath = + "/api/v2/logs/config/restriction_queries/{restriction_query_id}".replace( + "{restriction_query_id}", + encodeURIComponent(String(restrictionQueryId)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "LogsRestrictionQueriesApi.v2.getRestrictionQuery", + LogsRestrictionQueriesApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.GET, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async getRoleRestrictionQuery( + roleId: string, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if ( + !_config.unstableOperations[ + "LogsRestrictionQueriesApi.v2.getRoleRestrictionQuery" + ] + ) { + throw new Error( + "Unstable operation 'getRoleRestrictionQuery' is disabled. Enable it by setting `configuration.unstableOperations['LogsRestrictionQueriesApi.v2.getRoleRestrictionQuery'] = true`", + ); + } + + // verify required parameter 'roleId' is not null or undefined + if (roleId === null || roleId === undefined) { + throw new RequiredError("roleId", "getRoleRestrictionQuery"); + } + + // Path Params + const localVarPath = + "/api/v2/logs/config/restriction_queries/role/{role_id}".replace( + "{role_id}", + encodeURIComponent(String(roleId)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "LogsRestrictionQueriesApi.v2.getRoleRestrictionQuery", + LogsRestrictionQueriesApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.GET, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async listRestrictionQueries( + pageSize?: number, + pageNumber?: number, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if ( + !_config.unstableOperations[ + "LogsRestrictionQueriesApi.v2.listRestrictionQueries" + ] + ) { + throw new Error( + "Unstable operation 'listRestrictionQueries' is disabled. Enable it by setting `configuration.unstableOperations['LogsRestrictionQueriesApi.v2.listRestrictionQueries'] = true`", + ); + } + + // Path Params + const localVarPath = "/api/v2/logs/config/restriction_queries"; + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "LogsRestrictionQueriesApi.v2.listRestrictionQueries", + LogsRestrictionQueriesApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.GET, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Query Params + if (pageSize !== undefined) { + requestContext.setQueryParam( + "page[size]", + serialize(pageSize, TypingInfo, "number", "int64"), + "", + ); + } + if (pageNumber !== undefined) { + requestContext.setQueryParam( + "page[number]", + serialize(pageNumber, TypingInfo, "number", "int64"), + "", + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async listRestrictionQueryRoles( + restrictionQueryId: string, + pageSize?: number, + pageNumber?: number, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if ( + !_config.unstableOperations[ + "LogsRestrictionQueriesApi.v2.listRestrictionQueryRoles" + ] + ) { + throw new Error( + "Unstable operation 'listRestrictionQueryRoles' is disabled. Enable it by setting `configuration.unstableOperations['LogsRestrictionQueriesApi.v2.listRestrictionQueryRoles'] = true`", + ); + } + + // verify required parameter 'restrictionQueryId' is not null or undefined + if (restrictionQueryId === null || restrictionQueryId === undefined) { + throw new RequiredError( + "restrictionQueryId", + "listRestrictionQueryRoles", + ); + } + + // Path Params + const localVarPath = + "/api/v2/logs/config/restriction_queries/{restriction_query_id}/roles".replace( + "{restriction_query_id}", + encodeURIComponent(String(restrictionQueryId)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "LogsRestrictionQueriesApi.v2.listRestrictionQueryRoles", + LogsRestrictionQueriesApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.GET, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Query Params + if (pageSize !== undefined) { + requestContext.setQueryParam( + "page[size]", + serialize(pageSize, TypingInfo, "number", "int64"), + "", + ); + } + if (pageNumber !== undefined) { + requestContext.setQueryParam( + "page[number]", + serialize(pageNumber, TypingInfo, "number", "int64"), + "", + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async listUserRestrictionQueries( + userId: string, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if ( + !_config.unstableOperations[ + "LogsRestrictionQueriesApi.v2.listUserRestrictionQueries" + ] + ) { + throw new Error( + "Unstable operation 'listUserRestrictionQueries' is disabled. Enable it by setting `configuration.unstableOperations['LogsRestrictionQueriesApi.v2.listUserRestrictionQueries'] = true`", + ); + } + + // verify required parameter 'userId' is not null or undefined + if (userId === null || userId === undefined) { + throw new RequiredError("userId", "listUserRestrictionQueries"); + } + + // Path Params + const localVarPath = + "/api/v2/logs/config/restriction_queries/user/{user_id}".replace( + "{user_id}", + encodeURIComponent(String(userId)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "LogsRestrictionQueriesApi.v2.listUserRestrictionQueries", + LogsRestrictionQueriesApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.GET, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async removeRoleFromRestrictionQuery( + restrictionQueryId: string, + body: RelationshipToRole, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if ( + !_config.unstableOperations[ + "LogsRestrictionQueriesApi.v2.removeRoleFromRestrictionQuery" + ] + ) { + throw new Error( + "Unstable operation 'removeRoleFromRestrictionQuery' is disabled. Enable it by setting `configuration.unstableOperations['LogsRestrictionQueriesApi.v2.removeRoleFromRestrictionQuery'] = true`", + ); + } + + // verify required parameter 'restrictionQueryId' is not null or undefined + if (restrictionQueryId === null || restrictionQueryId === undefined) { + throw new RequiredError( + "restrictionQueryId", + "removeRoleFromRestrictionQuery", + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "removeRoleFromRestrictionQuery"); + } + + // Path Params + const localVarPath = + "/api/v2/logs/config/restriction_queries/{restriction_query_id}/roles".replace( + "{restriction_query_id}", + encodeURIComponent(String(restrictionQueryId)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "LogsRestrictionQueriesApi.v2.removeRoleFromRestrictionQuery", + LogsRestrictionQueriesApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.DELETE, + overrides, + ); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Body Params + const contentType = getPreferredMediaType(["application/json"]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = stringify( + serialize(body, TypingInfo, "RelationshipToRole", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async replaceRestrictionQuery( + restrictionQueryId: string, + body: RestrictionQueryUpdatePayload, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if ( + !_config.unstableOperations[ + "LogsRestrictionQueriesApi.v2.replaceRestrictionQuery" + ] + ) { + throw new Error( + "Unstable operation 'replaceRestrictionQuery' is disabled. Enable it by setting `configuration.unstableOperations['LogsRestrictionQueriesApi.v2.replaceRestrictionQuery'] = true`", + ); + } + + // verify required parameter 'restrictionQueryId' is not null or undefined + if (restrictionQueryId === null || restrictionQueryId === undefined) { + throw new RequiredError("restrictionQueryId", "replaceRestrictionQuery"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "replaceRestrictionQuery"); + } + + // Path Params + const localVarPath = + "/api/v2/logs/config/restriction_queries/{restriction_query_id}".replace( + "{restriction_query_id}", + encodeURIComponent(String(restrictionQueryId)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "LogsRestrictionQueriesApi.v2.replaceRestrictionQuery", + LogsRestrictionQueriesApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.PUT, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Body Params + const contentType = getPreferredMediaType(["application/json"]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = stringify( + serialize(body, TypingInfo, "RestrictionQueryUpdatePayload", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async updateRestrictionQuery( + restrictionQueryId: string, + body: RestrictionQueryUpdatePayload, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if ( + !_config.unstableOperations[ + "LogsRestrictionQueriesApi.v2.updateRestrictionQuery" + ] + ) { + throw new Error( + "Unstable operation 'updateRestrictionQuery' is disabled. Enable it by setting `configuration.unstableOperations['LogsRestrictionQueriesApi.v2.updateRestrictionQuery'] = true`", + ); + } + + // verify required parameter 'restrictionQueryId' is not null or undefined + if (restrictionQueryId === null || restrictionQueryId === undefined) { + throw new RequiredError("restrictionQueryId", "updateRestrictionQuery"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "updateRestrictionQuery"); + } + + // Path Params + const localVarPath = + "/api/v2/logs/config/restriction_queries/{restriction_query_id}".replace( + "{restriction_query_id}", + encodeURIComponent(String(restrictionQueryId)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "LogsRestrictionQueriesApi.v2.updateRestrictionQuery", + LogsRestrictionQueriesApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.PATCH, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Body Params + const contentType = getPreferredMediaType(["application/json"]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = stringify( + serialize(body, TypingInfo, "RestrictionQueryUpdatePayload", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } +} + +export class LogsRestrictionQueriesApiResponseProcessor { + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to addRoleToRestrictionQuery + * @throws ApiException if the response code was not in [200, 299] + */ + public async addRoleToRestrictionQuery( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 204) { + return; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + return; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createRestrictionQuery + * @throws ApiException if the response code was not in [200, 299] + */ + public async createRestrictionQuery( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: RestrictionQueryWithoutRelationshipsResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "RestrictionQueryWithoutRelationshipsResponse", + ) as RestrictionQueryWithoutRelationshipsResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: RestrictionQueryWithoutRelationshipsResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "RestrictionQueryWithoutRelationshipsResponse", + "", + ) as RestrictionQueryWithoutRelationshipsResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to deleteRestrictionQuery + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteRestrictionQuery( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 204) { + return; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + return; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getRestrictionQuery + * @throws ApiException if the response code was not in [200, 299] + */ + public async getRestrictionQuery( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: RestrictionQueryWithRelationshipsResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "RestrictionQueryWithRelationshipsResponse", + ) as RestrictionQueryWithRelationshipsResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: RestrictionQueryWithRelationshipsResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "RestrictionQueryWithRelationshipsResponse", + "", + ) as RestrictionQueryWithRelationshipsResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getRoleRestrictionQuery + * @throws ApiException if the response code was not in [200, 299] + */ + public async getRoleRestrictionQuery( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: RestrictionQueryListResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "RestrictionQueryListResponse", + ) as RestrictionQueryListResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: RestrictionQueryListResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "RestrictionQueryListResponse", + "", + ) as RestrictionQueryListResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to listRestrictionQueries + * @throws ApiException if the response code was not in [200, 299] + */ + public async listRestrictionQueries( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: RestrictionQueryListResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "RestrictionQueryListResponse", + ) as RestrictionQueryListResponse; + return body; + } + if (response.httpStatusCode === 403 || response.httpStatusCode === 429) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: RestrictionQueryListResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "RestrictionQueryListResponse", + "", + ) as RestrictionQueryListResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to listRestrictionQueryRoles + * @throws ApiException if the response code was not in [200, 299] + */ + public async listRestrictionQueryRoles( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: RestrictionQueryRolesResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "RestrictionQueryRolesResponse", + ) as RestrictionQueryRolesResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: RestrictionQueryRolesResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "RestrictionQueryRolesResponse", + "", + ) as RestrictionQueryRolesResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to listUserRestrictionQueries + * @throws ApiException if the response code was not in [200, 299] + */ + public async listUserRestrictionQueries( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: RestrictionQueryListResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "RestrictionQueryListResponse", + ) as RestrictionQueryListResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: RestrictionQueryListResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "RestrictionQueryListResponse", + "", + ) as RestrictionQueryListResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to removeRoleFromRestrictionQuery + * @throws ApiException if the response code was not in [200, 299] + */ + public async removeRoleFromRestrictionQuery( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 204) { + return; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + return; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to replaceRestrictionQuery + * @throws ApiException if the response code was not in [200, 299] + */ + public async replaceRestrictionQuery( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: RestrictionQueryWithoutRelationshipsResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "RestrictionQueryWithoutRelationshipsResponse", + ) as RestrictionQueryWithoutRelationshipsResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: RestrictionQueryWithoutRelationshipsResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "RestrictionQueryWithoutRelationshipsResponse", + "", + ) as RestrictionQueryWithoutRelationshipsResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to updateRestrictionQuery + * @throws ApiException if the response code was not in [200, 299] + */ + public async updateRestrictionQuery( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: RestrictionQueryWithoutRelationshipsResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "RestrictionQueryWithoutRelationshipsResponse", + ) as RestrictionQueryWithoutRelationshipsResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: RestrictionQueryWithoutRelationshipsResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "RestrictionQueryWithoutRelationshipsResponse", + "", + ) as RestrictionQueryWithoutRelationshipsResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } +} + +export interface LogsRestrictionQueriesApiAddRoleToRestrictionQueryRequest { + /** + * The ID of the restriction query. + * @type string + */ + restrictionQueryId: string; + /** + * @type RelationshipToRole + */ + body: RelationshipToRole; +} + +export interface LogsRestrictionQueriesApiCreateRestrictionQueryRequest { + /** + * @type RestrictionQueryCreatePayload + */ + body: RestrictionQueryCreatePayload; +} + +export interface LogsRestrictionQueriesApiDeleteRestrictionQueryRequest { + /** + * The ID of the restriction query. + * @type string + */ + restrictionQueryId: string; +} + +export interface LogsRestrictionQueriesApiGetRestrictionQueryRequest { + /** + * The ID of the restriction query. + * @type string + */ + restrictionQueryId: string; +} + +export interface LogsRestrictionQueriesApiGetRoleRestrictionQueryRequest { + /** + * The ID of the role. + * @type string + */ + roleId: string; +} + +export interface LogsRestrictionQueriesApiListRestrictionQueriesRequest { + /** + * Size for a given page. The maximum allowed value is 100. + * @type number + */ + pageSize?: number; + /** + * Specific page number to return. + * @type number + */ + pageNumber?: number; +} + +export interface LogsRestrictionQueriesApiListRestrictionQueryRolesRequest { + /** + * The ID of the restriction query. + * @type string + */ + restrictionQueryId: string; + /** + * Size for a given page. The maximum allowed value is 100. + * @type number + */ + pageSize?: number; + /** + * Specific page number to return. + * @type number + */ + pageNumber?: number; +} + +export interface LogsRestrictionQueriesApiListUserRestrictionQueriesRequest { + /** + * The ID of the user. + * @type string + */ + userId: string; +} + +export interface LogsRestrictionQueriesApiRemoveRoleFromRestrictionQueryRequest { + /** + * The ID of the restriction query. + * @type string + */ + restrictionQueryId: string; + /** + * @type RelationshipToRole + */ + body: RelationshipToRole; +} + +export interface LogsRestrictionQueriesApiReplaceRestrictionQueryRequest { + /** + * The ID of the restriction query. + * @type string + */ + restrictionQueryId: string; + /** + * @type RestrictionQueryUpdatePayload + */ + body: RestrictionQueryUpdatePayload; +} + +export interface LogsRestrictionQueriesApiUpdateRestrictionQueryRequest { + /** + * The ID of the restriction query. + * @type string + */ + restrictionQueryId: string; + /** + * @type RestrictionQueryUpdatePayload + */ + body: RestrictionQueryUpdatePayload; +} + +export class LogsRestrictionQueriesApi { + private requestFactory: LogsRestrictionQueriesApiRequestFactory; + private responseProcessor: LogsRestrictionQueriesApiResponseProcessor; + private configuration: Configuration; + + static operationServers: { [key: string]: BaseServerConfiguration[] } = {}; + + public constructor( + configuration?: Configuration, + requestFactory?: LogsRestrictionQueriesApiRequestFactory, + responseProcessor?: LogsRestrictionQueriesApiResponseProcessor, + ) { + this.configuration = configuration || createConfiguration(); + this.requestFactory = + requestFactory || + new LogsRestrictionQueriesApiRequestFactory(this.configuration); + this.responseProcessor = + responseProcessor || new LogsRestrictionQueriesApiResponseProcessor(); + } + + /** + * 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 param The request object + */ + public addRoleToRestrictionQuery( + param: LogsRestrictionQueriesApiAddRoleToRestrictionQueryRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.addRoleToRestrictionQuery( + param.restrictionQueryId, + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.addRoleToRestrictionQuery( + responseContext, + ); + }); + }); + } + + /** + * Create a new restriction query for your organization. + * @param param The request object + */ + public createRestrictionQuery( + param: LogsRestrictionQueriesApiCreateRestrictionQueryRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.createRestrictionQuery( + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createRestrictionQuery(responseContext); + }); + }); + } + + /** + * Deletes a restriction query. + * @param param The request object + */ + public deleteRestrictionQuery( + param: LogsRestrictionQueriesApiDeleteRestrictionQueryRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.deleteRestrictionQuery( + param.restrictionQueryId, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.deleteRestrictionQuery(responseContext); + }); + }); + } + + /** + * Get a restriction query in the organization specified by the restriction query's `restriction_query_id`. + * @param param The request object + */ + public getRestrictionQuery( + param: LogsRestrictionQueriesApiGetRestrictionQueryRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.getRestrictionQuery( + param.restrictionQueryId, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getRestrictionQuery(responseContext); + }); + }); + } + + /** + * Get restriction query for a given role. + * @param param The request object + */ + public getRoleRestrictionQuery( + param: LogsRestrictionQueriesApiGetRoleRestrictionQueryRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.getRoleRestrictionQuery( + param.roleId, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getRoleRestrictionQuery( + responseContext, + ); + }); + }); + } + + /** + * Returns all restriction queries, including their names and IDs. + * @param param The request object + */ + public listRestrictionQueries( + param: LogsRestrictionQueriesApiListRestrictionQueriesRequest = {}, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.listRestrictionQueries( + param.pageSize, + param.pageNumber, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listRestrictionQueries(responseContext); + }); + }); + } + + /** + * Returns all roles that have a given restriction query. + * @param param The request object + */ + public listRestrictionQueryRoles( + param: LogsRestrictionQueriesApiListRestrictionQueryRolesRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.listRestrictionQueryRoles( + param.restrictionQueryId, + param.pageSize, + param.pageNumber, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listRestrictionQueryRoles( + responseContext, + ); + }); + }); + } + + /** + * Get all restriction queries for a given user. + * @param param The request object + */ + public listUserRestrictionQueries( + param: LogsRestrictionQueriesApiListUserRestrictionQueriesRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = + this.requestFactory.listUserRestrictionQueries(param.userId, options); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listUserRestrictionQueries( + responseContext, + ); + }); + }); + } + + /** + * Removes a role from a restriction query. + * @param param The request object + */ + public removeRoleFromRestrictionQuery( + param: LogsRestrictionQueriesApiRemoveRoleFromRestrictionQueryRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = + this.requestFactory.removeRoleFromRestrictionQuery( + param.restrictionQueryId, + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.removeRoleFromRestrictionQuery( + responseContext, + ); + }); + }); + } + + /** + * Replace a restriction query. + * @param param The request object + */ + public replaceRestrictionQuery( + param: LogsRestrictionQueriesApiReplaceRestrictionQueryRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.replaceRestrictionQuery( + param.restrictionQueryId, + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.replaceRestrictionQuery( + responseContext, + ); + }); + }); + } + + /** + * Edit a restriction query. + * @param param The request object + */ + public updateRestrictionQuery( + param: LogsRestrictionQueriesApiUpdateRestrictionQueryRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.updateRestrictionQuery( + param.restrictionQueryId, + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.updateRestrictionQuery(responseContext); + }); + }); + } +} diff --git a/services/logs_restriction_queries/src/v2/index.ts b/services/logs_restriction_queries/src/v2/index.ts new file mode 100644 index 000000000000..4f742138f428 --- /dev/null +++ b/services/logs_restriction_queries/src/v2/index.ts @@ -0,0 +1,38 @@ +export { + LogsRestrictionQueriesApiAddRoleToRestrictionQueryRequest, + LogsRestrictionQueriesApiCreateRestrictionQueryRequest, + LogsRestrictionQueriesApiDeleteRestrictionQueryRequest, + LogsRestrictionQueriesApiGetRestrictionQueryRequest, + LogsRestrictionQueriesApiGetRoleRestrictionQueryRequest, + LogsRestrictionQueriesApiListRestrictionQueriesRequest, + LogsRestrictionQueriesApiListRestrictionQueryRolesRequest, + LogsRestrictionQueriesApiListUserRestrictionQueriesRequest, + LogsRestrictionQueriesApiRemoveRoleFromRestrictionQueryRequest, + LogsRestrictionQueriesApiReplaceRestrictionQueryRequest, + LogsRestrictionQueriesApiUpdateRestrictionQueryRequest, + LogsRestrictionQueriesApi, +} from "./LogsRestrictionQueriesApi"; + +export { APIErrorResponse } from "./models/APIErrorResponse"; +export { LogsRestrictionQueriesType } from "./models/LogsRestrictionQueriesType"; +export { RelationshipToRole } from "./models/RelationshipToRole"; +export { RelationshipToRoleData } from "./models/RelationshipToRoleData"; +export { RelationshipToRoles } from "./models/RelationshipToRoles"; +export { RestrictionQueryAttributes } from "./models/RestrictionQueryAttributes"; +export { RestrictionQueryCreateAttributes } from "./models/RestrictionQueryCreateAttributes"; +export { RestrictionQueryCreateData } from "./models/RestrictionQueryCreateData"; +export { RestrictionQueryCreatePayload } from "./models/RestrictionQueryCreatePayload"; +export { RestrictionQueryListResponse } from "./models/RestrictionQueryListResponse"; +export { RestrictionQueryResponseIncludedItem } from "./models/RestrictionQueryResponseIncludedItem"; +export { RestrictionQueryRole } from "./models/RestrictionQueryRole"; +export { RestrictionQueryRoleAttribute } from "./models/RestrictionQueryRoleAttribute"; +export { RestrictionQueryRolesResponse } from "./models/RestrictionQueryRolesResponse"; +export { RestrictionQueryUpdateAttributes } from "./models/RestrictionQueryUpdateAttributes"; +export { RestrictionQueryUpdateData } from "./models/RestrictionQueryUpdateData"; +export { RestrictionQueryUpdatePayload } from "./models/RestrictionQueryUpdatePayload"; +export { RestrictionQueryWithoutRelationships } from "./models/RestrictionQueryWithoutRelationships"; +export { RestrictionQueryWithoutRelationshipsResponse } from "./models/RestrictionQueryWithoutRelationshipsResponse"; +export { RestrictionQueryWithRelationships } from "./models/RestrictionQueryWithRelationships"; +export { RestrictionQueryWithRelationshipsResponse } from "./models/RestrictionQueryWithRelationshipsResponse"; +export { RolesType } from "./models/RolesType"; +export { UserRelationships } from "./models/UserRelationships"; diff --git a/services/logs_restriction_queries/src/v2/models/APIErrorResponse.ts b/services/logs_restriction_queries/src/v2/models/APIErrorResponse.ts new file mode 100644 index 000000000000..58d6c35b80f0 --- /dev/null +++ b/services/logs_restriction_queries/src/v2/models/APIErrorResponse.ts @@ -0,0 +1,45 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * API error response. + */ +export class APIErrorResponse { + /** + * A list of errors. + */ + "errors": Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + errors: { + baseName: "errors", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return APIErrorResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/logs_restriction_queries/src/v2/models/LogsRestrictionQueriesType.ts b/services/logs_restriction_queries/src/v2/models/LogsRestrictionQueriesType.ts new file mode 100644 index 000000000000..41732fce320c --- /dev/null +++ b/services/logs_restriction_queries/src/v2/models/LogsRestrictionQueriesType.ts @@ -0,0 +1,9 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * Restriction query resource type. + */ +export type LogsRestrictionQueriesType = + | typeof LOGS_RESTRICTION_QUERIES + | UnparsedObject; +export const LOGS_RESTRICTION_QUERIES = "logs_restriction_queries"; diff --git a/services/logs_restriction_queries/src/v2/models/RelationshipToRole.ts b/services/logs_restriction_queries/src/v2/models/RelationshipToRole.ts new file mode 100644 index 000000000000..464660d0ebd2 --- /dev/null +++ b/services/logs_restriction_queries/src/v2/models/RelationshipToRole.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { RelationshipToRoleData } from "./RelationshipToRoleData"; + +/** + * Relationship to role. + */ +export class RelationshipToRole { + /** + * Relationship to role object. + */ + "data"?: RelationshipToRoleData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "RelationshipToRoleData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RelationshipToRole.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/logs_restriction_queries/src/v2/models/RelationshipToRoleData.ts b/services/logs_restriction_queries/src/v2/models/RelationshipToRoleData.ts new file mode 100644 index 000000000000..c0c1ab4f0ca4 --- /dev/null +++ b/services/logs_restriction_queries/src/v2/models/RelationshipToRoleData.ts @@ -0,0 +1,54 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { RolesType } from "./RolesType"; + +/** + * Relationship to role object. + */ +export class RelationshipToRoleData { + /** + * The unique identifier of the role. + */ + "id"?: string; + /** + * Roles type. + */ + "type"?: RolesType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "RolesType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RelationshipToRoleData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/logs_restriction_queries/src/v2/models/RelationshipToRoles.ts b/services/logs_restriction_queries/src/v2/models/RelationshipToRoles.ts new file mode 100644 index 000000000000..af3ecd62c7a2 --- /dev/null +++ b/services/logs_restriction_queries/src/v2/models/RelationshipToRoles.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { RelationshipToRoleData } from "./RelationshipToRoleData"; + +/** + * Relationship to roles. + */ +export class RelationshipToRoles { + /** + * An array containing type and the unique identifier of a role. + */ + "data"?: Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RelationshipToRoles.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/logs_restriction_queries/src/v2/models/RestrictionQueryAttributes.ts b/services/logs_restriction_queries/src/v2/models/RestrictionQueryAttributes.ts new file mode 100644 index 000000000000..10f03d41d9f1 --- /dev/null +++ b/services/logs_restriction_queries/src/v2/models/RestrictionQueryAttributes.ts @@ -0,0 +1,96 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Attributes of the restriction query. + */ +export class RestrictionQueryAttributes { + /** + * Creation time of the restriction query. + */ + "createdAt"?: Date; + /** + * Email of the user who last modified this restriction query. + */ + "lastModifierEmail"?: string; + /** + * Name of the user who last modified this restriction query. + */ + "lastModifierName"?: string; + /** + * Time of last restriction query modification. + */ + "modifiedAt"?: Date; + /** + * The query that defines the restriction. Only the content matching the query can be returned. + */ + "restrictionQuery"?: string; + /** + * Number of roles associated with this restriction query. + */ + "roleCount"?: number; + /** + * Number of users associated with this restriction query. + */ + "userCount"?: number; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + createdAt: { + baseName: "created_at", + type: "Date", + format: "date-time", + }, + lastModifierEmail: { + baseName: "last_modifier_email", + type: "string", + }, + lastModifierName: { + baseName: "last_modifier_name", + type: "string", + }, + modifiedAt: { + baseName: "modified_at", + type: "Date", + format: "date-time", + }, + restrictionQuery: { + baseName: "restriction_query", + type: "string", + }, + roleCount: { + baseName: "role_count", + type: "number", + format: "int64", + }, + userCount: { + baseName: "user_count", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RestrictionQueryAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/logs_restriction_queries/src/v2/models/RestrictionQueryCreateAttributes.ts b/services/logs_restriction_queries/src/v2/models/RestrictionQueryCreateAttributes.ts new file mode 100644 index 000000000000..10ed5f10476d --- /dev/null +++ b/services/logs_restriction_queries/src/v2/models/RestrictionQueryCreateAttributes.ts @@ -0,0 +1,45 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Attributes of the created restriction query. + */ +export class RestrictionQueryCreateAttributes { + /** + * The restriction query. + */ + "restrictionQuery": string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + restrictionQuery: { + baseName: "restriction_query", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RestrictionQueryCreateAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/logs_restriction_queries/src/v2/models/RestrictionQueryCreateData.ts b/services/logs_restriction_queries/src/v2/models/RestrictionQueryCreateData.ts new file mode 100644 index 000000000000..f82de14dbf03 --- /dev/null +++ b/services/logs_restriction_queries/src/v2/models/RestrictionQueryCreateData.ts @@ -0,0 +1,55 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { LogsRestrictionQueriesType } from "./LogsRestrictionQueriesType"; +import { RestrictionQueryCreateAttributes } from "./RestrictionQueryCreateAttributes"; + +/** + * Data related to the creation of a restriction query. + */ +export class RestrictionQueryCreateData { + /** + * Attributes of the created restriction query. + */ + "attributes"?: RestrictionQueryCreateAttributes; + /** + * Restriction query resource type. + */ + "type"?: LogsRestrictionQueriesType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "RestrictionQueryCreateAttributes", + }, + type: { + baseName: "type", + type: "LogsRestrictionQueriesType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RestrictionQueryCreateData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/logs_restriction_queries/src/v2/models/RestrictionQueryCreatePayload.ts b/services/logs_restriction_queries/src/v2/models/RestrictionQueryCreatePayload.ts new file mode 100644 index 000000000000..b6e52e2d8115 --- /dev/null +++ b/services/logs_restriction_queries/src/v2/models/RestrictionQueryCreatePayload.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { RestrictionQueryCreateData } from "./RestrictionQueryCreateData"; + +/** + * Create a restriction query. + */ +export class RestrictionQueryCreatePayload { + /** + * Data related to the creation of a restriction query. + */ + "data"?: RestrictionQueryCreateData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "RestrictionQueryCreateData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RestrictionQueryCreatePayload.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/logs_restriction_queries/src/v2/models/RestrictionQueryListResponse.ts b/services/logs_restriction_queries/src/v2/models/RestrictionQueryListResponse.ts new file mode 100644 index 000000000000..ea7badfae39a --- /dev/null +++ b/services/logs_restriction_queries/src/v2/models/RestrictionQueryListResponse.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { RestrictionQueryWithoutRelationships } from "./RestrictionQueryWithoutRelationships"; + +/** + * Response containing information about multiple restriction queries. + */ +export class RestrictionQueryListResponse { + /** + * Array of returned restriction queries. + */ + "data"?: Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RestrictionQueryListResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/logs_restriction_queries/src/v2/models/RestrictionQueryResponseIncludedItem.ts b/services/logs_restriction_queries/src/v2/models/RestrictionQueryResponseIncludedItem.ts new file mode 100644 index 000000000000..d2f9825494bb --- /dev/null +++ b/services/logs_restriction_queries/src/v2/models/RestrictionQueryResponseIncludedItem.ts @@ -0,0 +1,10 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +import { RestrictionQueryRole } from "./RestrictionQueryRole"; + +/** + * An object related to a restriction query. + */ +export type RestrictionQueryResponseIncludedItem = + | RestrictionQueryRole + | UnparsedObject; diff --git a/services/logs_restriction_queries/src/v2/models/RestrictionQueryRole.ts b/services/logs_restriction_queries/src/v2/models/RestrictionQueryRole.ts new file mode 100644 index 000000000000..c5b194653805 --- /dev/null +++ b/services/logs_restriction_queries/src/v2/models/RestrictionQueryRole.ts @@ -0,0 +1,62 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { RestrictionQueryRoleAttribute } from "./RestrictionQueryRoleAttribute"; + +/** + * Partial role object. + */ +export class RestrictionQueryRole { + /** + * Attributes of the role for a restriction query. + */ + "attributes"?: RestrictionQueryRoleAttribute; + /** + * ID of the role. + */ + "id"?: string; + /** + * Role resource type. + */ + "type"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "RestrictionQueryRoleAttribute", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RestrictionQueryRole.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/logs_restriction_queries/src/v2/models/RestrictionQueryRoleAttribute.ts b/services/logs_restriction_queries/src/v2/models/RestrictionQueryRoleAttribute.ts new file mode 100644 index 000000000000..6970362e13df --- /dev/null +++ b/services/logs_restriction_queries/src/v2/models/RestrictionQueryRoleAttribute.ts @@ -0,0 +1,44 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Attributes of the role for a restriction query. + */ +export class RestrictionQueryRoleAttribute { + /** + * The role name. + */ + "name"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + name: { + baseName: "name", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RestrictionQueryRoleAttribute.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/logs_restriction_queries/src/v2/models/RestrictionQueryRolesResponse.ts b/services/logs_restriction_queries/src/v2/models/RestrictionQueryRolesResponse.ts new file mode 100644 index 000000000000..7cb7486c6cd7 --- /dev/null +++ b/services/logs_restriction_queries/src/v2/models/RestrictionQueryRolesResponse.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { RestrictionQueryRole } from "./RestrictionQueryRole"; + +/** + * Response containing information about roles attached to a restriction query. + */ +export class RestrictionQueryRolesResponse { + /** + * Array of roles. + */ + "data"?: Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RestrictionQueryRolesResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/logs_restriction_queries/src/v2/models/RestrictionQueryUpdateAttributes.ts b/services/logs_restriction_queries/src/v2/models/RestrictionQueryUpdateAttributes.ts new file mode 100644 index 000000000000..daa0a039fe64 --- /dev/null +++ b/services/logs_restriction_queries/src/v2/models/RestrictionQueryUpdateAttributes.ts @@ -0,0 +1,45 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Attributes of the edited restriction query. + */ +export class RestrictionQueryUpdateAttributes { + /** + * The restriction query. + */ + "restrictionQuery": string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + restrictionQuery: { + baseName: "restriction_query", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RestrictionQueryUpdateAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/logs_restriction_queries/src/v2/models/RestrictionQueryUpdateData.ts b/services/logs_restriction_queries/src/v2/models/RestrictionQueryUpdateData.ts new file mode 100644 index 000000000000..e562b8bc97fd --- /dev/null +++ b/services/logs_restriction_queries/src/v2/models/RestrictionQueryUpdateData.ts @@ -0,0 +1,55 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { LogsRestrictionQueriesType } from "./LogsRestrictionQueriesType"; +import { RestrictionQueryUpdateAttributes } from "./RestrictionQueryUpdateAttributes"; + +/** + * Data related to the update of a restriction query. + */ +export class RestrictionQueryUpdateData { + /** + * Attributes of the edited restriction query. + */ + "attributes"?: RestrictionQueryUpdateAttributes; + /** + * Restriction query resource type. + */ + "type"?: LogsRestrictionQueriesType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "RestrictionQueryUpdateAttributes", + }, + type: { + baseName: "type", + type: "LogsRestrictionQueriesType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RestrictionQueryUpdateData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/logs_restriction_queries/src/v2/models/RestrictionQueryUpdatePayload.ts b/services/logs_restriction_queries/src/v2/models/RestrictionQueryUpdatePayload.ts new file mode 100644 index 000000000000..f9d29fed9f16 --- /dev/null +++ b/services/logs_restriction_queries/src/v2/models/RestrictionQueryUpdatePayload.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { RestrictionQueryUpdateData } from "./RestrictionQueryUpdateData"; + +/** + * Update a restriction query. + */ +export class RestrictionQueryUpdatePayload { + /** + * Data related to the update of a restriction query. + */ + "data"?: RestrictionQueryUpdateData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "RestrictionQueryUpdateData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RestrictionQueryUpdatePayload.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/logs_restriction_queries/src/v2/models/RestrictionQueryWithRelationships.ts b/services/logs_restriction_queries/src/v2/models/RestrictionQueryWithRelationships.ts new file mode 100644 index 000000000000..3fa5d8b667e1 --- /dev/null +++ b/services/logs_restriction_queries/src/v2/models/RestrictionQueryWithRelationships.ts @@ -0,0 +1,72 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { LogsRestrictionQueriesType } from "./LogsRestrictionQueriesType"; +import { RestrictionQueryAttributes } from "./RestrictionQueryAttributes"; +import { UserRelationships } from "./UserRelationships"; + +/** + * Restriction query object returned by the API. + */ +export class RestrictionQueryWithRelationships { + /** + * Attributes of the restriction query. + */ + "attributes"?: RestrictionQueryAttributes; + /** + * ID of the restriction query. + */ + "id"?: string; + /** + * Relationships of the user object. + */ + "relationships"?: UserRelationships; + /** + * Restriction query resource type. + */ + "type"?: LogsRestrictionQueriesType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "RestrictionQueryAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + relationships: { + baseName: "relationships", + type: "UserRelationships", + }, + type: { + baseName: "type", + type: "LogsRestrictionQueriesType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RestrictionQueryWithRelationships.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/logs_restriction_queries/src/v2/models/RestrictionQueryWithRelationshipsResponse.ts b/services/logs_restriction_queries/src/v2/models/RestrictionQueryWithRelationshipsResponse.ts new file mode 100644 index 000000000000..7311577c95bb --- /dev/null +++ b/services/logs_restriction_queries/src/v2/models/RestrictionQueryWithRelationshipsResponse.ts @@ -0,0 +1,55 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { RestrictionQueryResponseIncludedItem } from "./RestrictionQueryResponseIncludedItem"; +import { RestrictionQueryWithRelationships } from "./RestrictionQueryWithRelationships"; + +/** + * Response containing information about a single restriction query. + */ +export class RestrictionQueryWithRelationshipsResponse { + /** + * Restriction query object returned by the API. + */ + "data"?: RestrictionQueryWithRelationships; + /** + * Array of objects related to the restriction query. + */ + "included"?: Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "RestrictionQueryWithRelationships", + }, + included: { + baseName: "included", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RestrictionQueryWithRelationshipsResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/logs_restriction_queries/src/v2/models/RestrictionQueryWithoutRelationships.ts b/services/logs_restriction_queries/src/v2/models/RestrictionQueryWithoutRelationships.ts new file mode 100644 index 000000000000..39c9dc67e8f4 --- /dev/null +++ b/services/logs_restriction_queries/src/v2/models/RestrictionQueryWithoutRelationships.ts @@ -0,0 +1,62 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { RestrictionQueryAttributes } from "./RestrictionQueryAttributes"; + +/** + * Restriction query object returned by the API. + */ +export class RestrictionQueryWithoutRelationships { + /** + * Attributes of the restriction query. + */ + "attributes"?: RestrictionQueryAttributes; + /** + * ID of the restriction query. + */ + "id"?: string; + /** + * Restriction queries type. + */ + "type"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "RestrictionQueryAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RestrictionQueryWithoutRelationships.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/logs_restriction_queries/src/v2/models/RestrictionQueryWithoutRelationshipsResponse.ts b/services/logs_restriction_queries/src/v2/models/RestrictionQueryWithoutRelationshipsResponse.ts new file mode 100644 index 000000000000..3ec28803d8c6 --- /dev/null +++ b/services/logs_restriction_queries/src/v2/models/RestrictionQueryWithoutRelationshipsResponse.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { RestrictionQueryWithoutRelationships } from "./RestrictionQueryWithoutRelationships"; + +/** + * Response containing information about a single restriction query. + */ +export class RestrictionQueryWithoutRelationshipsResponse { + /** + * Restriction query object returned by the API. + */ + "data"?: RestrictionQueryWithoutRelationships; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "RestrictionQueryWithoutRelationships", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RestrictionQueryWithoutRelationshipsResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/logs_restriction_queries/src/v2/models/RolesType.ts b/services/logs_restriction_queries/src/v2/models/RolesType.ts new file mode 100644 index 000000000000..c3a741e281fc --- /dev/null +++ b/services/logs_restriction_queries/src/v2/models/RolesType.ts @@ -0,0 +1,7 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * Roles type. + */ +export type RolesType = typeof ROLES | UnparsedObject; +export const ROLES = "roles"; diff --git a/services/logs_restriction_queries/src/v2/models/TypingInfo.ts b/services/logs_restriction_queries/src/v2/models/TypingInfo.ts new file mode 100644 index 000000000000..cbe339a37a29 --- /dev/null +++ b/services/logs_restriction_queries/src/v2/models/TypingInfo.ts @@ -0,0 +1,56 @@ +import { ModelTypingInfo } from "@datadog/datadog-api-client"; + +import { APIErrorResponse } from "./APIErrorResponse"; +import { RelationshipToRole } from "./RelationshipToRole"; +import { RelationshipToRoleData } from "./RelationshipToRoleData"; +import { RelationshipToRoles } from "./RelationshipToRoles"; +import { RestrictionQueryAttributes } from "./RestrictionQueryAttributes"; +import { RestrictionQueryCreateAttributes } from "./RestrictionQueryCreateAttributes"; +import { RestrictionQueryCreateData } from "./RestrictionQueryCreateData"; +import { RestrictionQueryCreatePayload } from "./RestrictionQueryCreatePayload"; +import { RestrictionQueryListResponse } from "./RestrictionQueryListResponse"; +import { RestrictionQueryRole } from "./RestrictionQueryRole"; +import { RestrictionQueryRoleAttribute } from "./RestrictionQueryRoleAttribute"; +import { RestrictionQueryRolesResponse } from "./RestrictionQueryRolesResponse"; +import { RestrictionQueryUpdateAttributes } from "./RestrictionQueryUpdateAttributes"; +import { RestrictionQueryUpdateData } from "./RestrictionQueryUpdateData"; +import { RestrictionQueryUpdatePayload } from "./RestrictionQueryUpdatePayload"; +import { RestrictionQueryWithRelationships } from "./RestrictionQueryWithRelationships"; +import { RestrictionQueryWithRelationshipsResponse } from "./RestrictionQueryWithRelationshipsResponse"; +import { RestrictionQueryWithoutRelationships } from "./RestrictionQueryWithoutRelationships"; +import { RestrictionQueryWithoutRelationshipsResponse } from "./RestrictionQueryWithoutRelationshipsResponse"; +import { UserRelationships } from "./UserRelationships"; + +export const TypingInfo: ModelTypingInfo = { + enumsMap: { + LogsRestrictionQueriesType: ["logs_restriction_queries"], + RolesType: ["roles"], + }, + oneOfMap: { + RestrictionQueryResponseIncludedItem: ["RestrictionQueryRole"], + }, + typeMap: { + APIErrorResponse: APIErrorResponse, + RelationshipToRole: RelationshipToRole, + RelationshipToRoleData: RelationshipToRoleData, + RelationshipToRoles: RelationshipToRoles, + RestrictionQueryAttributes: RestrictionQueryAttributes, + RestrictionQueryCreateAttributes: RestrictionQueryCreateAttributes, + RestrictionQueryCreateData: RestrictionQueryCreateData, + RestrictionQueryCreatePayload: RestrictionQueryCreatePayload, + RestrictionQueryListResponse: RestrictionQueryListResponse, + RestrictionQueryRole: RestrictionQueryRole, + RestrictionQueryRoleAttribute: RestrictionQueryRoleAttribute, + RestrictionQueryRolesResponse: RestrictionQueryRolesResponse, + RestrictionQueryUpdateAttributes: RestrictionQueryUpdateAttributes, + RestrictionQueryUpdateData: RestrictionQueryUpdateData, + RestrictionQueryUpdatePayload: RestrictionQueryUpdatePayload, + RestrictionQueryWithRelationships: RestrictionQueryWithRelationships, + RestrictionQueryWithRelationshipsResponse: + RestrictionQueryWithRelationshipsResponse, + RestrictionQueryWithoutRelationships: RestrictionQueryWithoutRelationships, + RestrictionQueryWithoutRelationshipsResponse: + RestrictionQueryWithoutRelationshipsResponse, + UserRelationships: UserRelationships, + }, +}; diff --git a/services/logs_restriction_queries/src/v2/models/UserRelationships.ts b/services/logs_restriction_queries/src/v2/models/UserRelationships.ts new file mode 100644 index 000000000000..cead0932edc2 --- /dev/null +++ b/services/logs_restriction_queries/src/v2/models/UserRelationships.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { RelationshipToRoles } from "./RelationshipToRoles"; + +/** + * Relationships of the user object. + */ +export class UserRelationships { + /** + * Relationship to roles. + */ + "roles"?: RelationshipToRoles; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + roles: { + baseName: "roles", + type: "RelationshipToRoles", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return UserRelationships.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/logs_restriction_queries/tsconfig.json b/services/logs_restriction_queries/tsconfig.json new file mode 100644 index 000000000000..d6c32bfb893c --- /dev/null +++ b/services/logs_restriction_queries/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "strict": true, + /* Basic Options */ + "target": "es6", + "module": "commonjs", + "moduleResolution": "node", + "declaration": true, + + "esModuleInterop": true, + "resolveJsonModule": true, + + "noImplicitAny": true, + "noImplicitThis": true, + + /* Additional Checks */ + "noUnusedLocals": false /* Report errors on unused locals. */, // TODO: reenable (unused imports!) + "noUnusedParameters": false /* Report errors on unused parameters. */, // TODO: set to true again + "noImplicitReturns": true /* Report error when not all code paths in function return a value. */, + "noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */, + + "sourceMap": true, + "outDir": "./dist", + "lib": ["es6", "es7"] + }, + "exclude": ["dist", "node_modules", "tests"], + "include": ["src"] +} diff --git a/yarn.lock b/yarn.lock index 4092bd31e9f2..2106ebdc6bd3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -712,6 +712,15 @@ __metadata: languageName: unknown linkType: soft +"@datadog/datadog-api-client-logs-restriction-queries@workspace:services/logs_restriction_queries": + version: 0.0.0-use.local + resolution: "@datadog/datadog-api-client-logs-restriction-queries@workspace:services/logs_restriction_queries" + dependencies: + "@datadog/datadog-api-client": "npm:^2.0.0-beta.0" + typescript: "npm:5.8.3" + languageName: unknown + linkType: soft + "@datadog/datadog-api-client-logs@workspace:services/logs": version: 0.0.0-use.local resolution: "@datadog/datadog-api-client-logs@workspace:services/logs"