From 45ebc650ee050d21b8a4394b3b61b8c866c1fac6 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 1 Dec 2025 14:58:03 +0000 Subject: [PATCH] Regenerate client from commit 979bb6b of spec repo --- .generator/schemas/v2/openapi.yaml | 1204 +++++++++++- .../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 | 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 ++ .../frozen.json | 1 + .../recording.har | 284 +++ .../frozen.json | 1 + .../recording.har | 337 ++++ .../frozen.json | 1 + .../recording.har | 284 +++ .../frozen.json | 1 + .../recording.har | 284 +++ .../frozen.json | 1 + .../recording.har | 57 + .../frozen.json | 1 + .../recording.har | 327 ++++ .../frozen.json | 1 + .../recording.har | 342 ++++ .../frozen.json | 1 + .../recording.har | 57 + .../frozen.json | 1 + .../recording.har | 327 ++++ .../AddRoleToRestrictionQuery.ts | 35 + .../CreateRestrictionQuery.ts | 29 + .../DeleteRestrictionQuery.ts | 26 + .../GetRestrictionQuery.ts | 26 + .../GetRoleRestrictionQuery.ts | 25 + .../ListRestrictionQueries.ts | 18 + .../ListRestrictionQueryRoles.ts | 26 + .../ListUserRestrictionQueries.ts | 25 + .../RemoveRoleFromRestrictionQuery.ts | 36 + .../ReplaceRestrictionQuery.ts | 34 + .../UpdateRestrictionQuery.ts | 34 + examples/v2/teams/AddTeamHierarchyLink.ts | 45 + examples/v2/teams/GetTeamHierarchyLink.ts | 25 + examples/v2/teams/ListTeamHierarchyLinks.ts | 30 + .../ListTeamHierarchyLinks_3360757486.ts | 18 + examples/v2/teams/RemoveTeamHierarchyLink.ts | 25 + features/support/scenarios_model_mapping.ts | 145 ++ features/v2/given.json | 36 + features/v2/logs_restriction_queries.feature | 287 +++ features/v2/teams.feature | 83 + features/v2/undo.json | 104 ++ .../configuration.ts | 11 + .../apis/LogsRestrictionQueriesApi.ts | 1645 +++++++++++++++++ .../datadog-api-client-v2/apis/TeamsApi.ts | 593 ++++++ packages/datadog-api-client-v2/index.ts | 53 + .../models/LogsRestrictionQueriesType.ts | 16 + .../models/ObjectSerializer.ts | 68 + .../models/RestrictionQueryAttributes.ts | 104 ++ .../RestrictionQueryCreateAttributes.ts | 53 + .../models/RestrictionQueryCreateData.ts | 62 + .../models/RestrictionQueryCreatePayload.ts | 53 + .../models/RestrictionQueryListResponse.ts | 53 + .../RestrictionQueryResponseIncludedItem.ts | 16 + .../models/RestrictionQueryRole.ts | 73 + .../models/RestrictionQueryRoleAttribute.ts | 52 + .../models/RestrictionQueryRolesResponse.ts | 53 + .../RestrictionQueryUpdateAttributes.ts | 53 + .../models/RestrictionQueryUpdateData.ts | 62 + .../models/RestrictionQueryUpdatePayload.ts | 53 + .../RestrictionQueryWithRelationships.ts | 79 + ...strictionQueryWithRelationshipsResponse.ts | 62 + .../RestrictionQueryWithoutRelationships.ts | 69 + ...ictionQueryWithoutRelationshipsResponse.ts | 53 + .../models/TeamAttributes.ts | 8 + .../models/TeamHierarchyLink.ts | 82 + .../models/TeamHierarchyLinkAttributes.ts | 63 + .../models/TeamHierarchyLinkCreate.ts | 64 + .../TeamHierarchyLinkCreateRelationships.ts | 63 + .../models/TeamHierarchyLinkCreateRequest.ts | 54 + .../models/TeamHierarchyLinkCreateTeam.ts | 63 + ...TeamHierarchyLinkCreateTeamRelationship.ts | 54 + .../models/TeamHierarchyLinkRelationships.ts | 63 + .../models/TeamHierarchyLinkResponse.ts | 71 + .../models/TeamHierarchyLinkTeam.ts | 72 + .../models/TeamHierarchyLinkTeamAttributes.ts | 121 ++ .../TeamHierarchyLinkTeamRelationship.ts | 54 + .../models/TeamHierarchyLinkType.ts | 16 + .../models/TeamHierarchyLinksResponse.ts | 80 + .../TeamsHierarchyLinksResponseLinks.ts | 84 + .../models/TeamsHierarchyLinksResponseMeta.ts | 53 + .../TeamsHierarchyLinksResponseMetaPage.ts | 115 ++ 120 files changed, 10948 insertions(+), 3 deletions(-) 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-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 cassettes/v2/Teams_3116892301/Create-a-team-hierarchy-link-returns-CREATED-response_1596980754/frozen.json create mode 100644 cassettes/v2/Teams_3116892301/Create-a-team-hierarchy-link-returns-CREATED-response_1596980754/recording.har create mode 100644 cassettes/v2/Teams_3116892301/Create-a-team-hierarchy-link-returns-Conflict-response_2009282886/frozen.json create mode 100644 cassettes/v2/Teams_3116892301/Create-a-team-hierarchy-link-returns-Conflict-response_2009282886/recording.har create mode 100644 cassettes/v2/Teams_3116892301/Create-a-team-hierarchy-link-returns-OK-response_398884198/frozen.json create mode 100644 cassettes/v2/Teams_3116892301/Create-a-team-hierarchy-link-returns-OK-response_398884198/recording.har create mode 100644 cassettes/v2/Teams_3116892301/Create-a-team-hierarchy-link-returns-SUCCESS-response_1402025629/frozen.json create mode 100644 cassettes/v2/Teams_3116892301/Create-a-team-hierarchy-link-returns-SUCCESS-response_1402025629/recording.har create mode 100644 cassettes/v2/Teams_3116892301/Get-a-team-hierarchy-link-returns-API-error-response-response_3395612101/frozen.json create mode 100644 cassettes/v2/Teams_3116892301/Get-a-team-hierarchy-link-returns-API-error-response-response_3395612101/recording.har create mode 100644 cassettes/v2/Teams_3116892301/Get-a-team-hierarchy-link-returns-OK-response_4031746224/frozen.json create mode 100644 cassettes/v2/Teams_3116892301/Get-a-team-hierarchy-link-returns-OK-response_4031746224/recording.har create mode 100644 cassettes/v2/Teams_3116892301/Get-team-hierarchy-links-returns-OK-response_543093888/frozen.json create mode 100644 cassettes/v2/Teams_3116892301/Get-team-hierarchy-links-returns-OK-response_543093888/recording.har create mode 100644 cassettes/v2/Teams_3116892301/Remove-a-team-hierarchy-link-returns-API-error-response-response_1350392815/frozen.json create mode 100644 cassettes/v2/Teams_3116892301/Remove-a-team-hierarchy-link-returns-API-error-response-response_1350392815/recording.har create mode 100644 cassettes/v2/Teams_3116892301/Remove-a-team-hierarchy-link-returns-No-Content-response_2718623318/frozen.json create mode 100644 cassettes/v2/Teams_3116892301/Remove-a-team-hierarchy-link-returns-No-Content-response_2718623318/recording.har create mode 100644 examples/v2/logs-restriction-queries/AddRoleToRestrictionQuery.ts create mode 100644 examples/v2/logs-restriction-queries/CreateRestrictionQuery.ts create mode 100644 examples/v2/logs-restriction-queries/DeleteRestrictionQuery.ts create mode 100644 examples/v2/logs-restriction-queries/GetRestrictionQuery.ts create mode 100644 examples/v2/logs-restriction-queries/GetRoleRestrictionQuery.ts create mode 100644 examples/v2/logs-restriction-queries/ListRestrictionQueries.ts create mode 100644 examples/v2/logs-restriction-queries/ListRestrictionQueryRoles.ts create mode 100644 examples/v2/logs-restriction-queries/ListUserRestrictionQueries.ts create mode 100644 examples/v2/logs-restriction-queries/RemoveRoleFromRestrictionQuery.ts create mode 100644 examples/v2/logs-restriction-queries/ReplaceRestrictionQuery.ts create mode 100644 examples/v2/logs-restriction-queries/UpdateRestrictionQuery.ts create mode 100644 examples/v2/teams/AddTeamHierarchyLink.ts create mode 100644 examples/v2/teams/GetTeamHierarchyLink.ts create mode 100644 examples/v2/teams/ListTeamHierarchyLinks.ts create mode 100644 examples/v2/teams/ListTeamHierarchyLinks_3360757486.ts create mode 100644 examples/v2/teams/RemoveTeamHierarchyLink.ts create mode 100644 features/v2/logs_restriction_queries.feature create mode 100644 packages/datadog-api-client-v2/apis/LogsRestrictionQueriesApi.ts create mode 100644 packages/datadog-api-client-v2/models/LogsRestrictionQueriesType.ts create mode 100644 packages/datadog-api-client-v2/models/RestrictionQueryAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/RestrictionQueryCreateAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/RestrictionQueryCreateData.ts create mode 100644 packages/datadog-api-client-v2/models/RestrictionQueryCreatePayload.ts create mode 100644 packages/datadog-api-client-v2/models/RestrictionQueryListResponse.ts create mode 100644 packages/datadog-api-client-v2/models/RestrictionQueryResponseIncludedItem.ts create mode 100644 packages/datadog-api-client-v2/models/RestrictionQueryRole.ts create mode 100644 packages/datadog-api-client-v2/models/RestrictionQueryRoleAttribute.ts create mode 100644 packages/datadog-api-client-v2/models/RestrictionQueryRolesResponse.ts create mode 100644 packages/datadog-api-client-v2/models/RestrictionQueryUpdateAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/RestrictionQueryUpdateData.ts create mode 100644 packages/datadog-api-client-v2/models/RestrictionQueryUpdatePayload.ts create mode 100644 packages/datadog-api-client-v2/models/RestrictionQueryWithRelationships.ts create mode 100644 packages/datadog-api-client-v2/models/RestrictionQueryWithRelationshipsResponse.ts create mode 100644 packages/datadog-api-client-v2/models/RestrictionQueryWithoutRelationships.ts create mode 100644 packages/datadog-api-client-v2/models/RestrictionQueryWithoutRelationshipsResponse.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyLink.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyLinkAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyLinkCreate.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyLinkCreateRelationships.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyLinkCreateRequest.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyLinkCreateTeam.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyLinkCreateTeamRelationship.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyLinkRelationships.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyLinkResponse.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyLinkTeam.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyLinkTeamAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyLinkTeamRelationship.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyLinkType.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyLinksResponse.ts create mode 100644 packages/datadog-api-client-v2/models/TeamsHierarchyLinksResponseLinks.ts create mode 100644 packages/datadog-api-client-v2/models/TeamsHierarchyLinksResponseMeta.ts create mode 100644 packages/datadog-api-client-v2/models/TeamsHierarchyLinksResponseMetaPage.ts diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 9bceb715496a..6bc8997cfde4 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -945,6 +945,27 @@ components: required: true schema: type: string + RestrictionQueryID: + description: The ID of the restriction query. + in: path + name: restriction_query_id + required: true + schema: + type: string + RestrictionQueryRoleID: + description: The ID of the role. + in: path + name: role_id + required: true + schema: + type: string + RestrictionQueryUserID: + description: The ID of the user. + in: path + name: user_id + required: true + schema: + type: string RetentionFilterIdParam: description: The ID of the retention filter. in: path @@ -30501,6 +30522,15 @@ components: example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== type: string type: object + LogsRestrictionQueriesType: + default: logs_restriction_queries + description: Restriction query resource type. + enum: + - logs_restriction_queries + example: logs_restriction_queries + type: string + x-enum-varnames: + - LOGS_RESTRICTION_QUERIES LogsSort: description: Sort parameters when querying logs. enum: @@ -41410,6 +41440,7 @@ components: type: object RelationshipToUserTeamPermissionData: description: Related user team permission data + nullable: true properties: id: description: The ID of the user team permission @@ -41838,6 +41869,191 @@ components: required: - data type: object + RestrictionQueryAttributes: + description: Attributes of the restriction query. + properties: + created_at: + description: Creation time of the restriction query. + example: '2020-03-17T21:06:44.000Z' + format: date-time + readOnly: true + type: string + last_modifier_email: + description: Email of the user who last modified this restriction query. + example: user@example.com + readOnly: true + type: string + last_modifier_name: + description: Name of the user who last modified this restriction query. + example: John Doe + readOnly: true + type: string + modified_at: + description: Time of last restriction query modification. + example: '2020-03-17T21:15:15.000Z' + format: date-time + readOnly: true + type: string + restriction_query: + description: The query that defines the restriction. Only the content matching + the query can be returned. + example: env:sandbox + type: string + role_count: + description: Number of roles associated with this restriction query. + example: 3 + format: int64 + readOnly: true + type: integer + user_count: + description: Number of users associated with this restriction query. + example: 5 + format: int64 + readOnly: true + type: integer + type: object + RestrictionQueryCreateAttributes: + description: Attributes of the created restriction query. + properties: + restriction_query: + description: The restriction query. + example: env:sandbox + type: string + required: + - restriction_query + type: object + RestrictionQueryCreateData: + description: Data related to the creation of a restriction query. + properties: + attributes: + $ref: '#/components/schemas/RestrictionQueryCreateAttributes' + type: + $ref: '#/components/schemas/LogsRestrictionQueriesType' + type: object + RestrictionQueryCreatePayload: + description: Create a restriction query. + properties: + data: + $ref: '#/components/schemas/RestrictionQueryCreateData' + type: object + RestrictionQueryListResponse: + description: Response containing information about multiple restriction queries. + properties: + data: + description: Array of returned restriction queries. + items: + $ref: '#/components/schemas/RestrictionQueryWithoutRelationships' + type: array + type: object + RestrictionQueryResponseIncludedItem: + description: An object related to a restriction query. + oneOf: + - $ref: '#/components/schemas/RestrictionQueryRole' + RestrictionQueryRole: + description: Partial role object. + properties: + attributes: + $ref: '#/components/schemas/RestrictionQueryRoleAttribute' + id: + description: ID of the role. + example: + type: string + type: + $ref: '#/components/schemas/RolesType' + required: + - type + - id + - attributes + type: object + RestrictionQueryRoleAttribute: + description: Attributes of the role for a restriction query. + properties: + name: + description: The role name. + example: Datadog Admin Role + type: string + type: object + RestrictionQueryRolesResponse: + description: Response containing information about roles attached to a restriction + query. + properties: + data: + description: Array of roles. + items: + $ref: '#/components/schemas/RestrictionQueryRole' + type: array + type: object + RestrictionQueryUpdateAttributes: + description: Attributes of the edited restriction query. + properties: + restriction_query: + description: The restriction query. + example: env:sandbox + type: string + required: + - restriction_query + type: object + RestrictionQueryUpdateData: + description: Data related to the update of a restriction query. + properties: + attributes: + $ref: '#/components/schemas/RestrictionQueryUpdateAttributes' + type: + $ref: '#/components/schemas/LogsRestrictionQueriesType' + type: object + RestrictionQueryUpdatePayload: + description: Update a restriction query. + properties: + data: + $ref: '#/components/schemas/RestrictionQueryUpdateData' + type: object + RestrictionQueryWithRelationships: + description: Restriction query object returned by the API. + properties: + attributes: + $ref: '#/components/schemas/RestrictionQueryAttributes' + id: + description: ID of the restriction query. + example: 79a0e60a-644a-11ea-ad29-43329f7f58b5 + type: string + relationships: + $ref: '#/components/schemas/UserRelationships' + type: + $ref: '#/components/schemas/LogsRestrictionQueriesType' + type: object + RestrictionQueryWithRelationshipsResponse: + description: Response containing information about a single restriction query. + properties: + data: + $ref: '#/components/schemas/RestrictionQueryWithRelationships' + included: + description: Array of objects related to the restriction query. + items: + $ref: '#/components/schemas/RestrictionQueryResponseIncludedItem' + type: array + type: object + RestrictionQueryWithoutRelationships: + description: Restriction query object returned by the API. + properties: + attributes: + $ref: '#/components/schemas/RestrictionQueryAttributes' + id: + description: ID of the restriction query. + example: 79a0e60a-644a-11ea-ad29-43329f7f58b5 + type: string + type: + default: logs_restriction_queries + description: Restriction queries type. + example: logs_restriction_queries + readOnly: true + type: string + type: object + RestrictionQueryWithoutRelationshipsResponse: + description: Response containing information about a single restriction query. + properties: + data: + $ref: '#/components/schemas/RestrictionQueryWithoutRelationships' + type: object RetentionFilter: description: The definition of the retention filter. properties: @@ -51804,7 +52020,11 @@ components: items: description: String identifier of the module type: string + nullable: true type: array + is_managed: + description: Whether the team is managed from an external source + type: boolean link_count: description: The number of links belonging to the team format: int32 @@ -51836,6 +52056,7 @@ components: items: description: String identifier of the module type: string + nullable: true type: array required: - handle @@ -52016,6 +52237,211 @@ components: required: - data type: object + TeamHierarchyLink: + description: Team hierarchy link + properties: + attributes: + $ref: '#/components/schemas/TeamHierarchyLinkAttributes' + id: + description: The team hierarchy link's identifier + example: b8626d7e-cedd-11eb-abf5-da7ad0900001 + type: string + relationships: + $ref: '#/components/schemas/TeamHierarchyLinkRelationships' + type: + $ref: '#/components/schemas/TeamHierarchyLinkType' + required: + - attributes + - id + - type + type: object + TeamHierarchyLinkAttributes: + description: Team hierarchy link attributes + properties: + created_at: + description: Timestamp when the team hierarchy link was created + example: '' + format: date-time + type: string + provisioned_by: + description: The provisioner of the team hierarchy link + example: system + type: string + required: + - provisioned_by + - created_at + type: object + TeamHierarchyLinkCreate: + description: Data provided when creating a team hierarchy link + properties: + relationships: + $ref: '#/components/schemas/TeamHierarchyLinkCreateRelationships' + type: + $ref: '#/components/schemas/TeamHierarchyLinkType' + required: + - relationships + - type + type: object + TeamHierarchyLinkCreateRelationships: + description: The related teams that will be connected by the team hierarchy + link + properties: + parent_team: + $ref: '#/components/schemas/TeamHierarchyLinkCreateTeamRelationship' + sub_team: + $ref: '#/components/schemas/TeamHierarchyLinkCreateTeamRelationship' + required: + - parent_team + - sub_team + type: object + TeamHierarchyLinkCreateRequest: + description: Request to create a team hierarchy link + properties: + data: + $ref: '#/components/schemas/TeamHierarchyLinkCreate' + required: + - data + type: object + TeamHierarchyLinkCreateTeam: + description: This schema defines the attributes about each team that has to + be provided when creating a team hierarchy link + properties: + id: + description: The team's identifier + example: 692e8073-12c4-4c71-8408-5090bd44c9c8 + type: string + type: + $ref: '#/components/schemas/TeamType' + required: + - id + - type + type: object + TeamHierarchyLinkCreateTeamRelationship: + description: Data about each team that will be connected by the team hierarchy + link + properties: + data: + $ref: '#/components/schemas/TeamHierarchyLinkCreateTeam' + required: + - data + type: object + TeamHierarchyLinkRelationships: + description: Team hierarchy link relationships + properties: + parent_team: + $ref: '#/components/schemas/TeamHierarchyLinkTeamRelationship' + sub_team: + $ref: '#/components/schemas/TeamHierarchyLinkTeamRelationship' + required: + - parent_team + - sub_team + type: object + TeamHierarchyLinkResponse: + description: Team hierarchy link response + properties: + data: + $ref: '#/components/schemas/TeamHierarchyLink' + included: + description: Included teams + items: + $ref: '#/components/schemas/TeamHierarchyLinkTeam' + type: array + links: + $ref: '#/components/schemas/TeamsHierarchyLinksResponseLinks' + type: object + TeamHierarchyLinkTeam: + description: Team hierarchy links connect different teams. This represents team + objects that are connected by the team hierarchy link. + properties: + attributes: + $ref: '#/components/schemas/TeamHierarchyLinkTeamAttributes' + id: + description: The team's identifier + example: 692e8073-12c4-4c71-8408-5090bd44c9c8 + type: string + type: + $ref: '#/components/schemas/TeamType' + required: + - id + - type + type: object + TeamHierarchyLinkTeamAttributes: + description: Team hierarchy links connect different teams. This represents attributes + from teams that are connected by the team hierarchy link. + properties: + avatar: + description: The team's avatar + nullable: true + type: string + banner: + description: The team's banner + format: int64 + type: integer + handle: + description: The team's handle + example: team-handle + type: string + is_managed: + description: Whether the team is managed + type: boolean + is_open_membership: + description: Whether the team has open membership + type: boolean + link_count: + description: The number of links for the team + format: int64 + type: integer + name: + description: The team's name + example: Team Name + type: string + summary: + description: The team's summary + nullable: true + type: string + user_count: + description: The number of users in the team + format: int64 + type: integer + required: + - handle + - name + type: object + TeamHierarchyLinkTeamRelationship: + description: Team hierarchy link team relationship + properties: + data: + $ref: '#/components/schemas/TeamHierarchyLinkTeam' + required: + - data + type: object + TeamHierarchyLinkType: + default: team_hierarchy_links + description: Team hierarchy link type + enum: + - team_hierarchy_links + example: team_hierarchy_links + type: string + x-enum-varnames: + - TEAM_HIERARCHY_LINKS + TeamHierarchyLinksResponse: + description: Team hierarchy links response + properties: + data: + description: Team hierarchy links response data + items: + $ref: '#/components/schemas/TeamHierarchyLink' + type: array + included: + description: Included teams + items: + $ref: '#/components/schemas/TeamHierarchyLinkTeam' + type: array + links: + $ref: '#/components/schemas/TeamsHierarchyLinksResponseLinks' + meta: + $ref: '#/components/schemas/TeamsHierarchyLinksResponseMeta' + type: object TeamIncluded: description: Included resources related to the team oneOf: @@ -52895,6 +53321,76 @@ components: - LINK_COUNT - TEAM_LINKS - USER_TEAM_PERMISSIONS + TeamsHierarchyLinksResponseLinks: + description: When querying team hierarchy links, a set of links for navigation + between different pages is included + properties: + first: + description: Link to the first page. + nullable: true + type: string + last: + description: Link to the last page. + nullable: true + type: string + next: + description: Link to the next page. + nullable: true + type: string + prev: + description: Link to the previous page. + nullable: true + type: string + self: + description: Link to the current object. + type: string + type: object + TeamsHierarchyLinksResponseMeta: + description: Metadata that is included in the response when querying the team + hierarchy links + properties: + page: + $ref: '#/components/schemas/TeamsHierarchyLinksResponseMetaPage' + type: object + TeamsHierarchyLinksResponseMetaPage: + description: Metadata related to paging information that is included in the + response when querying the team hierarchy links + properties: + first_number: + description: First page number. + format: int64 + type: integer + last_number: + description: Last page number. + format: int64 + type: integer + next_number: + description: Next page number. + format: int64 + nullable: true + type: integer + number: + description: Page number. + format: int64 + type: integer + prev_number: + description: Previous page number. + format: int64 + nullable: true + type: integer + size: + description: Page size. + format: int64 + type: integer + total: + description: Total number of results. + format: int64 + type: integer + type: + description: Pagination type. + example: number_size + type: string + type: object TeamsResponse: description: Response with multiple teams properties: @@ -70264,6 +70760,487 @@ paths: operator: OR permissions: - logs_generate_metrics + /api/v2/logs/config/restriction_queries: + get: + description: Returns all restriction queries, including their names and IDs. + operationId: ListRestrictionQueries + parameters: + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/PageNumber' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryListResponse' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List restriction queries + tags: + - Logs Restriction Queries + x-permission: + operator: OR + permissions: + - logs_read_config + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Create a new restriction query for your organization. + operationId: CreateRestrictionQuery + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryCreatePayload' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryWithoutRelationshipsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create a restriction query + tags: + - Logs Restriction Queries + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - user_access_manage + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/logs/config/restriction_queries/role/{role_id}: + get: + description: Get restriction query for a given role. + operationId: GetRoleRestrictionQuery + parameters: + - $ref: '#/components/parameters/RestrictionQueryRoleID' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryListResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get restriction query for a given role + tags: + - Logs Restriction Queries + x-permission: + operator: OR + permissions: + - logs_read_config + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/logs/config/restriction_queries/user/{user_id}: + get: + description: Get all restriction queries for a given user. + operationId: ListUserRestrictionQueries + parameters: + - $ref: '#/components/parameters/RestrictionQueryUserID' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryListResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get all restriction queries for a given user + tags: + - Logs Restriction Queries + x-permission: + operator: OR + permissions: + - logs_read_config + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/logs/config/restriction_queries/{restriction_query_id}: + delete: + description: Deletes a restriction query. + operationId: DeleteRestrictionQuery + parameters: + - $ref: '#/components/parameters/RestrictionQueryID' + responses: + '204': + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete a restriction query + tags: + - Logs Restriction Queries + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - user_access_manage + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + get: + description: Get a restriction query in the organization specified by the restriction + query's `restriction_query_id`. + operationId: GetRestrictionQuery + parameters: + - $ref: '#/components/parameters/RestrictionQueryID' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryWithRelationshipsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get a restriction query + tags: + - Logs Restriction Queries + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - logs_read_config + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + patch: + description: Edit a restriction query. + operationId: UpdateRestrictionQuery + parameters: + - $ref: '#/components/parameters/RestrictionQueryID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryUpdatePayload' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryWithoutRelationshipsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update a restriction query + tags: + - Logs Restriction Queries + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - user_access_manage + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + put: + description: Replace a restriction query. + operationId: ReplaceRestrictionQuery + parameters: + - $ref: '#/components/parameters/RestrictionQueryID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryUpdatePayload' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryWithoutRelationshipsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Replace a restriction query + tags: + - Logs Restriction Queries + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - user_access_manage + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/logs/config/restriction_queries/{restriction_query_id}/roles: + delete: + description: Removes a role from a restriction query. + operationId: RemoveRoleFromRestrictionQuery + parameters: + - $ref: '#/components/parameters/RestrictionQueryID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RelationshipToRole' + required: true + responses: + '204': + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Revoke role from a restriction query + tags: + - Logs Restriction Queries + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - user_access_manage + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + get: + description: Returns all roles that have a given restriction query. + operationId: ListRestrictionQueryRoles + parameters: + - $ref: '#/components/parameters/RestrictionQueryID' + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/PageNumber' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryRolesResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List roles for a restriction query + tags: + - Logs Restriction Queries + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - logs_read_config + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: 'Adds a role to a restriction query. + + + **Note**: This operation automatically grants the `logs_read_data` permission + to the role if it doesn''t already have it.' + operationId: AddRoleToRestrictionQuery + parameters: + - $ref: '#/components/parameters/RestrictionQueryID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RelationshipToRole' + required: true + responses: + '204': + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Grant role to a restriction query + tags: + - Logs Restriction Queries + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - user_access_manage + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/logs/events: get: description: 'List endpoint returns logs that match a log search query. @@ -81999,6 +82976,170 @@ paths: permissions: - teams_read - teams_manage + /api/v2/team-hierarchy-links: + get: + description: List all team hierarchy links that match the provided filters. + operationId: ListTeamHierarchyLinks + parameters: + - $ref: '#/components/parameters/PageNumber' + - $ref: '#/components/parameters/PageSize' + - description: Filter by parent team ID + in: query + name: filter[parent_team] + required: false + schema: + type: string + - description: Filter by sub team ID + in: query + name: filter[sub_team] + required: false + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamHierarchyLinksResponse' + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Get team hierarchy links + tags: + - Teams + x-pagination: + limitParam: page[size] + pageParam: page[number] + resultsPath: data + x-permission: + operator: OR + permissions: + - teams_read + post: + description: Create a new team hierarchy link between a parent team and a sub + team. + operationId: AddTeamHierarchyLink + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TeamHierarchyLinkCreateRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamHierarchyLinkResponse' + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Conflict + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + - teams_manage + summary: Create a team hierarchy link + tags: + - Teams + x-permission: + operator: AND + permissions: + - teams_read + - teams_manage + /api/v2/team-hierarchy-links/{link_id}: + delete: + description: Remove a team hierarchy link by the given link_id. + operationId: RemoveTeamHierarchyLink + parameters: + - description: The team hierarchy link's identifier + in: path + name: link_id + required: true + schema: + type: string + responses: + '204': + description: No Content + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + - teams_manage + summary: Remove a team hierarchy link + tags: + - Teams + x-permission: + operator: AND + permissions: + - teams_read + - teams_manage + get: + description: Get a single team hierarchy link for the given link_id. + operationId: GetTeamHierarchyLink + parameters: + - description: The team hierarchy link's identifier + in: path + name: link_id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamHierarchyLinkResponse' + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Get a team hierarchy link + tags: + - Teams + x-permission: + operator: OR + permissions: + - teams_read /api/v2/team/connections: delete: description: Delete multiple team connections. @@ -82273,7 +83414,13 @@ paths: If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/team/{super_team_id}/member_teams: get: - description: Get all member teams. + deprecated: true + description: 'Get all member teams. + + + **Note**: This API is deprecated. For team hierarchy relationships (parent-child + + teams), use the team hierarchy links API: `GET /api/v2/team-hierarchy-links`.' operationId: ListMemberTeams parameters: - description: None @@ -82326,14 +83473,20 @@ paths: operator: OR permissions: - teams_read + x-sunset: '2026-06-01' x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' post: + deprecated: true description: 'Add a member team. Adds the team given by the `id` in the body as a member team of the super - team.' + team. + + + **Note**: This API is deprecated. For creating team hierarchy links, use the + team hierarchy links API: `POST /api/v2/team-hierarchy-links`.' operationId: AddMemberTeam parameters: - description: None @@ -82373,12 +83526,18 @@ paths: operator: OR permissions: - teams_read + x-sunset: '2026-06-01' x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/team/{super_team_id}/member_teams/{member_team_id}: delete: - description: Remove a super team's member team identified by `member_team_id`. + deprecated: true + description: 'Remove a super team''s member team identified by `member_team_id`. + + + **Note**: This API is deprecated. For deleting team hierarchy links, use the + team hierarchy links API: `DELETE /api/v2/team-hierarchy-links/{link_id}`.' operationId: RemoveMemberTeam parameters: - description: None @@ -82418,6 +83577,7 @@ paths: operator: OR permissions: - teams_read + x-sunset: '2026-06-01' x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' @@ -85210,6 +86370,44 @@ tags: description: Find out more at url: https://docs.datadoghq.com/logs/logs_to_metrics/ name: Logs Metrics +- description: '**Note: This endpoint is in public beta. If you have any feedback, + contact [Datadog support](https://docs.datadoghq.com/help/).** + + + A Restriction Query is a logs query that restricts which logs the `logs_read_data` + permission grants read access to. + + For users whose roles have Restriction Queries, any log query they make only returns + those log events that also match + + one of their Restriction Queries. This is true whether the user queries log events + from any log-related feature, including + + the log explorer, Live Tail, re-hydration, or a dashboard widget. + + + Restriction Queries currently only support use of the following components of + log events: + + + - Reserved attributes + + - The log message + + - Tags + + + To restrict read access on log data, add a team tag to log events to indicate + which teams own them, and then scope Restriction Queries to the relevant values + of the team tag. Tags can be applied to log events in many ways, and a log event + can have multiple tags with the same key (like team) and different values. This + means the same log event can be visible to roles whose restriction queries are + scoped to different team values. + + + See [How to Set Up RBAC for Logs](https://docs.datadoghq.com/logs/guide/logs-rbac/?tab=api#restrict-access-to-logs) + for details on how to add restriction queries.' + name: Logs Restriction Queries - description: "The metrics endpoint allows you to:\n\n- Post metrics data so it can be graphed on Datadog\u2019s dashboards\n- Query metrics from any time period (timeseries and scalar)\n- Modify tag configurations for metrics\n- View tags diff --git a/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..1551821fb964 --- /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-18T19:17:04.509Z" 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..82b336630c54 --- /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.5" + }, + "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": 587, + "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-18T19:17:04.971Z", + "time": 150 + } + ], + "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..f8b2e627daab --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Create-a-restriction-query-returns-OK-response_3206923690/frozen.json @@ -0,0 +1 @@ +"2025-11-18T19:17:05.128Z" 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..dcdd2e388a0f --- /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.5" + }, + "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": 586, + "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\":\"2b5594f8-c4b3-11f0-a05d-da7ad0900002\",\"attributes\":{\"restriction_query\":\"env:sandbox\",\"created_at\":\"2025-11-18T19:17:05.370176+00:00\",\"modified_at\":\"2025-11-18T19:17:05.370176+00:00\"}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 712, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-11-18T19:17:05.132Z", + "time": 270 + }, + { + "_id": "f32260509fe50df19cfd969a56c74aac", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 561, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/2b5594f8-c4b3-11f0-a05d-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-18T19:17:05.408Z", + "time": 990 + } + ], + "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..ea429fa95720 --- /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-18T19:17:06.402Z" 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..f210a48ba302 --- /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.5" + }, + "entries": [ + { + "_id": "08325a2eeadf2ff87bc7b7f250b93938", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 537, + "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-18T19:17:06.405Z", + "time": 157 + } + ], + "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..a8aeea249907 --- /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-18T19:17:06.567Z" 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..b2b302cebf11 --- /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.5" + }, + "entries": [ + { + "_id": "d657b2986cfbefba4d5d555aa72dd8de", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 559, + "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-18T19:17:06.570Z", + "time": 145 + } + ], + "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..a550765038fb --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Delete-a-restriction-query-returns-OK-response_4160228625/frozen.json @@ -0,0 +1 @@ +"2025-11-18T19:17:06.720Z" 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..62983ca23d27 --- /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.5" + }, + "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": 587, + "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\":\"2c373dc2-c4b3-11f0-8ca7-da7ad0900002\",\"attributes\":{\"restriction_query\":\"env:sandbox\",\"created_at\":\"2025-11-18T19:17:06.848316+00:00\",\"modified_at\":\"2025-11-18T19:17:06.848316+00:00\"}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 712, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-11-18T19:17:06.723Z", + "time": 159 + }, + { + "_id": "e469cd652441915ba9f1716e528faa14", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 561, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/2c373dc2-c4b3-11f0-8ca7-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-18T19:17:06.891Z", + "time": 221 + }, + { + "_id": "e469cd652441915ba9f1716e528faa14", + "_order": 1, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 561, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/2c373dc2-c4b3-11f0-8ca7-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-18T19:17:07.118Z", + "time": 154 + } + ], + "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..07413758778e --- /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-18T19:17:07.277Z" 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..ae3b55b7886b --- /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.5" + }, + "entries": [ + { + "_id": "075fc7ebeac9783a7a83a6e011e9ed38", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 544, + "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-18T19:17:07.280Z", + "time": 176 + } + ], + "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..08bcddb63346 --- /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-18T19:17:07.461Z" 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..3c5cfc204248 --- /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.5" + }, + "entries": [ + { + "_id": "58b5254e9c84ea1ccffcb472b25d89f6", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 568, + "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-18T19:17:07.464Z", + "time": 153 + } + ], + "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..41e56a654ad2 --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/Get-a-restriction-query-returns-OK-response_2707069060/frozen.json @@ -0,0 +1 @@ +"2025-11-18T19:17:07.622Z" 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..1d45d8206e51 --- /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.5" + }, + "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": 587, + "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\":\"2cc39998-c4b3-11f0-8b4b-da7ad0900002\",\"attributes\":{\"restriction_query\":\"env:sandbox\",\"created_at\":\"2025-11-18T19:17:07.768188+00:00\",\"modified_at\":\"2025-11-18T19:17:07.768188+00:00\"}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 712, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-11-18T19:17:07.626Z", + "time": 177 + }, + { + "_id": "948c6128784a46001adc61749de3c923", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 568, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/2cc39998-c4b3-11f0-8b4b-da7ad0900002" + }, + "response": { + "bodySize": 273, + "content": { + "mimeType": "application/json", + "size": 273, + "text": "{\"data\":{\"type\":\"logs_restriction_queries\",\"id\":\"2cc39998-c4b3-11f0-8b4b-da7ad0900002\",\"attributes\":{\"restriction_query\":\"env:sandbox\",\"created_at\":\"2025-11-18T19:17:07.768188+00:00\",\"modified_at\":\"2025-11-18T19:17:07.768188+00:00\"},\"relationships\":{\"roles\":{\"data\":[]}}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 714, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-11-18T19:17:07.808Z", + "time": 147 + }, + { + "_id": "9faae68466f68c1829cd17c0deb68739", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 561, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/2cc39998-c4b3-11f0-8b4b-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-18T19:17:07.960Z", + "time": 208 + } + ], + "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..aff9340a8409 --- /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-18T19:17:08.172Z" 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..ac5cdd92a8f2 --- /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.5" + }, + "entries": [ + { + "_id": "668705797b0cf880b82a4ad211d0170c", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 555, + "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-18T19:17:08.176Z", + "time": 155 + } + ], + "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..30c8ff40122f --- /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-18T19:17:08.336Z" 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..b80a077bd103 --- /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.5" + }, + "entries": [ + { + "_id": "8559ccc701915a0bfd2d000351160ff4", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 580, + "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-18T19:17:08.339Z", + "time": 260 + } + ], + "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..03d33be64c43 --- /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-18T19:17:08.604Z" 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..1df00223be98 --- /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.5" + }, + "entries": [ + { + "_id": "7e0c2f77efbdbbdf6fe6f91ecb20d116", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 553, + "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-18T19:17:08.618Z", + "time": 205 + } + ], + "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..188a8bbed7bc --- /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-18T19:17:08.828Z" 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..7e440670311d --- /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.5" + }, + "entries": [ + { + "_id": "9e3fe7a4f5adc3895999a4c8bad141a1", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 577, + "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-18T19:17:08.830Z", + "time": 159 + } + ], + "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..f09b5ce3a9b2 --- /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-18T19:17:08.994Z" 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..96ccdf6159b8 --- /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.5" + }, + "entries": [ + { + "_id": "50e8a18990e49e1a8d56dd0401b77a22", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 124, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 550, + "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-1763493428\"},\"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\":\"2d925300-c4b3-11f0-a252-da7ad0900002\",\"type\":\"roles\",\"attributes\":{\"created_at\":\"2025-11-18T19:17:09.12367Z\",\"modified_at\":\"2025-11-18T19:17:09.123777Z\",\"name\":\"Test-Get_restriction_query_for_a_given_role_returns_OK_response-1763493428\",\"team_count\":0,\"user_count\":0},\"relationships\":{\"permissions\":{\"data\":[{\"id\":\"d90f6830-d3d8-11e9-a77a-b3404e5e9ee2\",\"type\":\"permissions\"},{\"id\":\"4441648c-d8b1-11e9-a77a-1b899a04b304\",\"type\":\"permissions\"},{\"id\":\"417ba636-2dce-11eb-84c0-6bce5b0d9de0\",\"type\":\"permissions\"},{\"id\":\"12efc20e-d36c-11eb-a9b8-da7ad0900002\",\"type\":\"permissions\"},{\"id\":\"7605ef24-f376-11eb-b90b-da7ad0900002\",\"type\":\"permissions\"},{\"id\":\"b6bf9ac6-9a59-11ec-8480-da7ad0900002\",\"type\":\"permissions\"},{\"id\":\"f8e941cf-e746-11ec-b22d-da7ad0900002\",\"type\":\"permissions\"},{\"id\":\"6c5ad874-7aff-11ed-a5cd-da7ad0900002\",\"type\":\"permissions\"},{\"id\":\"a8b4d6e8-4ea4-11ee-b482-da7ad0900002\",\"type\":\"permissions\"},{\"id\":\"50c270de-69ee-11ee-9151-da7ad0900002\",\"type\":\"permissions\"}]}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 652, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-11-18T19:17:08.996Z", + "time": 164 + }, + { + "_id": "be62e7e575db36721d6b35336c8f15ff", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 577, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/role/2d925300-c4b3-11f0-a252-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-18T19:17:09.165Z", + "time": 141 + }, + { + "_id": "1dcde7aae6bdd8d62dc5c1f7b67c4cb7", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 521, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/roles/2d925300-c4b3-11f0-a252-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-18T19:17:09.310Z", + "time": 126 + } + ], + "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..5527545e24f0 --- /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-18T19:17:09.440Z" 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..3df96963a7b0 --- /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.5" + }, + "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": 596, + "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": 711, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2025-11-18T19:17:09.442Z", + "time": 176 + } + ], + "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..ca4b723ce671 --- /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-18T19:17:09.623Z" 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..ecc3e81735bf --- /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.5" + }, + "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": 620, + "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": 711, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2025-11-18T19:17:09.626Z", + "time": 152 + } + ], + "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..c01c3356ed9d --- /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-18T19:17:09.783Z" 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..0c1fc4bdf296 --- /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.5" + }, + "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": 587, + "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\":\"2e0a0abc-c4b3-11f0-9b1d-da7ad0900002\",\"attributes\":{\"restriction_query\":\"env:sandbox\",\"created_at\":\"2025-11-18T19:17:09.907646+00:00\",\"modified_at\":\"2025-11-18T19:17:09.907646+00:00\"}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 712, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-11-18T19:17:09.785Z", + "time": 157 + }, + { + "_id": "f9f6e3a6380cdfb95d6534b65eec7992", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 119, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 550, + "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-1763493429\"},\"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\":\"2e209fb6-c4b3-11f0-8483-da7ad0900002\",\"type\":\"roles\",\"attributes\":{\"created_at\":\"2025-11-18T19:17:10.056015Z\",\"modified_at\":\"2025-11-18T19:17:10.056318Z\",\"name\":\"Test-Grant_role_to_a_restriction_query_returns_OK_response-1763493429\",\"team_count\":0,\"user_count\":0},\"relationships\":{\"permissions\":{\"data\":[{\"id\":\"d90f6830-d3d8-11e9-a77a-b3404e5e9ee2\",\"type\":\"permissions\"},{\"id\":\"4441648c-d8b1-11e9-a77a-1b899a04b304\",\"type\":\"permissions\"},{\"id\":\"417ba636-2dce-11eb-84c0-6bce5b0d9de0\",\"type\":\"permissions\"},{\"id\":\"12efc20e-d36c-11eb-a9b8-da7ad0900002\",\"type\":\"permissions\"},{\"id\":\"7605ef24-f376-11eb-b90b-da7ad0900002\",\"type\":\"permissions\"},{\"id\":\"b6bf9ac6-9a59-11ec-8480-da7ad0900002\",\"type\":\"permissions\"},{\"id\":\"f8e941cf-e746-11ec-b22d-da7ad0900002\",\"type\":\"permissions\"},{\"id\":\"6c5ad874-7aff-11ed-a5cd-da7ad0900002\",\"type\":\"permissions\"},{\"id\":\"a8b4d6e8-4ea4-11ee-b482-da7ad0900002\",\"type\":\"permissions\"},{\"id\":\"50c270de-69ee-11ee-9151-da7ad0900002\",\"type\":\"permissions\"}]}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 652, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-11-18T19:17:09.945Z", + "time": 144 + }, + { + "_id": "bdbb4e483355ae5957753f776a25f745", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 69, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 619, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"id\":\"2e209fb6-c4b3-11f0-8483-da7ad0900002\",\"type\":\"roles\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/2e0a0abc-c4b3-11f0-9b1d-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": 700, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-18T19:17:10.092Z", + "time": 409 + }, + { + "_id": "b8be476dcdb6db62ec62963f104df0ce", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 523, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/roles/2e209fb6-c4b3-11f0-8483-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-18T19:17:10.506Z", + "time": 136 + }, + { + "_id": "bf0bf2758ed9ea1af1735e8afb555b87", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 561, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/2e0a0abc-c4b3-11f0-9b1d-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": 700, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-18T19:17:10.645Z", + "time": 263 + } + ], + "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..e16a560441b7 --- /dev/null +++ b/cassettes/v2/Logs-Restriction-Queries_2746039292/List-restriction-queries-returns-OK-response_3168694309/frozen.json @@ -0,0 +1 @@ +"2025-11-18T19:17:10.912Z" 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..c02ace8aeaf6 --- /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.5" + }, + "entries": [ + { + "_id": "14b9f3a8ceaeb71ebec2861300148be7", + "_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" + }, + "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-18T19:17:10.914Z", + "time": 132 + } + ], + "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..53ab439ee746 --- /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-18T19:17:11.052Z" 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..62419091bdbc --- /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.5" + }, + "entries": [ + { + "_id": "b35554b0ccd299083db27e2e40957984", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 556, + "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-18T19:17:11.054Z", + "time": 173 + } + ], + "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..2d57ae44170f --- /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-18T19:17:11.231Z" 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..555b16e5f57f --- /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.5" + }, + "entries": [ + { + "_id": "4c44d5c428ddd616f3462114737e1ab1", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 579, + "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-18T19:17:11.234Z", + "time": 138 + } + ], + "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..63283fcd145a --- /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-18T19:17:11.376Z" 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..2c937d1fe8d2 --- /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.5" + }, + "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": 587, + "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\":\"2efc1406-c4b3-11f0-a6d9-da7ad0900002\",\"attributes\":{\"restriction_query\":\"env:sandbox\",\"created_at\":\"2025-11-18T19:17:11.492694+00:00\",\"modified_at\":\"2025-11-18T19:17:11.492694+00:00\"}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 712, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-11-18T19:17:11.378Z", + "time": 150 + }, + { + "_id": "fdc99bb09f7d41620557f6d1f7d8fc16", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 579, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/2efc1406-c4b3-11f0-a6d9-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-18T19:17:11.533Z", + "time": 175 + }, + { + "_id": "00d5197770a8b90b8c4e7bd904110c6a", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 561, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/logs/config/restriction_queries/2efc1406-c4b3-11f0-a6d9-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-18T19:17:11.712Z", + "time": 225 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Teams_3116892301/Create-a-team-hierarchy-link-returns-CREATED-response_1596980754/frozen.json b/cassettes/v2/Teams_3116892301/Create-a-team-hierarchy-link-returns-CREATED-response_1596980754/frozen.json new file mode 100644 index 000000000000..aa3ff920aebf --- /dev/null +++ b/cassettes/v2/Teams_3116892301/Create-a-team-hierarchy-link-returns-CREATED-response_1596980754/frozen.json @@ -0,0 +1 @@ +"2025-11-24T14:29:58.684Z" diff --git a/cassettes/v2/Teams_3116892301/Create-a-team-hierarchy-link-returns-CREATED-response_1596980754/recording.har b/cassettes/v2/Teams_3116892301/Create-a-team-hierarchy-link-returns-CREATED-response_1596980754/recording.har new file mode 100644 index 000000000000..538d2672f8e3 --- /dev/null +++ b/cassettes/v2/Teams_3116892301/Create-a-team-hierarchy-link-returns-CREATED-response_1596980754/recording.har @@ -0,0 +1,284 @@ +{ + "log": { + "_recordingName": "Teams/Create a team hierarchy link returns \"CREATED\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "b6efdccebeff203fe451c6d279b6f1c8", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 115, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 549, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-34095e00d70ee50a\",\"name\":\"test-name-34095e00d70ee50a\"},\"type\":\"team\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team" + }, + "response": { + "bodySize": 660, + "content": { + "mimeType": "application/vnd.api+json", + "size": 660, + "text": "{\"data\":{\"id\":\"551c947a-0f0f-4ff0-8c41-0ceddabe3551\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":3,\"created_at\":\"2025-11-24T14:29:59.195740+00:00\",\"description\":null,\"handle\":\"test-handle-34095e00d70ee50a\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T14:29:59.195740+00:00\",\"name\":\"test-name-34095e00d70ee50a\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/551c947a-0f0f-4ff0-8c41-0ceddabe3551/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/551c947a-0f0f-4ff0-8c41-0ceddabe3551/permission-settings\"}}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 699, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-11-24T14:29:58.687Z", + "time": 565 + }, + { + "_id": "14ff047933ab31db16c6c7cd6b0624ea", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 119, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 549, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-2-34095e00d70ee50a\",\"name\":\"test-name-2-34095e00d70ee50a\"},\"type\":\"team\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team" + }, + "response": { + "bodySize": 665, + "content": { + "mimeType": "application/vnd.api+json", + "size": 665, + "text": "{\"data\":{\"id\":\"e1c6ab08-0325-4df7-aea1-6bec76692d55\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":14,\"created_at\":\"2025-11-24T14:29:59.754699+00:00\",\"description\":null,\"handle\":\"test-handle-2-34095e00d70ee50a\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T14:29:59.754699+00:00\",\"name\":\"test-name-2-34095e00d70ee50a\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/e1c6ab08-0325-4df7-aea1-6bec76692d55/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/e1c6ab08-0325-4df7-aea1-6bec76692d55/permission-settings\"}}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 699, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-11-24T14:29:59.261Z", + "time": 572 + }, + { + "_id": "ebb0e177162bd93464de74ac3cef2e38", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 221, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 575, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"551c947a-0f0f-4ff0-8c41-0ceddabe3551\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"e1c6ab08-0325-4df7-aea1-6bec76692d55\",\"type\":\"team\"}}},\"type\":\"team_hierarchy_links\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team-hierarchy-links" + }, + "response": { + "bodySize": 898, + "content": { + "mimeType": "application/vnd.api+json", + "size": 898, + "text": "{\"data\":{\"id\":\"c53bed14-1c0a-4895-b845-1c04be086ba0\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2025-11-24T14:30:00.032477595Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"551c947a-0f0f-4ff0-8c41-0ceddabe3551\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"e1c6ab08-0325-4df7-aea1-6bec76692d55\",\"type\":\"team\"}}}},\"included\":[{\"id\":\"551c947a-0f0f-4ff0-8c41-0ceddabe3551\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":3,\"handle\":\"test-handle-34095e00d70ee50a\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-34095e00d70ee50a\",\"summary\":null,\"user_count\":0}},{\"id\":\"e1c6ab08-0325-4df7-aea1-6bec76692d55\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":14,\"handle\":\"test-handle-2-34095e00d70ee50a\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-2-34095e00d70ee50a\",\"summary\":null,\"user_count\":0}}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 676, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-11-24T14:29:59.847Z", + "time": 201 + }, + { + "_id": "d75ce0dbfd36b7bbaf8abdb42e98c73e", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 551, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team-hierarchy-links/c53bed14-1c0a-4895-b845-1c04be086ba0" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 616, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-24T14:30:00.070Z", + "time": 498 + }, + { + "_id": "6d81924bf5b8653f44e5ac1455978289", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 522, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team/e1c6ab08-0325-4df7-aea1-6bec76692d55" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 632, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-24T14:30:00.574Z", + "time": 580 + }, + { + "_id": "bc39bebdacee3cfea04d975a22d8bd87", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 522, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team/551c947a-0f0f-4ff0-8c41-0ceddabe3551" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 632, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-24T14:30:01.159Z", + "time": 624 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Teams_3116892301/Create-a-team-hierarchy-link-returns-Conflict-response_2009282886/frozen.json b/cassettes/v2/Teams_3116892301/Create-a-team-hierarchy-link-returns-Conflict-response_2009282886/frozen.json new file mode 100644 index 000000000000..ec8a279ce064 --- /dev/null +++ b/cassettes/v2/Teams_3116892301/Create-a-team-hierarchy-link-returns-Conflict-response_2009282886/frozen.json @@ -0,0 +1 @@ +"2025-11-24T17:06:46.856Z" diff --git a/cassettes/v2/Teams_3116892301/Create-a-team-hierarchy-link-returns-Conflict-response_2009282886/recording.har b/cassettes/v2/Teams_3116892301/Create-a-team-hierarchy-link-returns-Conflict-response_2009282886/recording.har new file mode 100644 index 000000000000..422253cda6ae --- /dev/null +++ b/cassettes/v2/Teams_3116892301/Create-a-team-hierarchy-link-returns-Conflict-response_2009282886/recording.har @@ -0,0 +1,337 @@ +{ + "log": { + "_recordingName": "Teams/Create a team hierarchy link returns \"Conflict\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "adf5deff6dc2c965d6479abfd55aaf51", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 115, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 549, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-6c891437b748aea8\",\"name\":\"test-name-6c891437b748aea8\"},\"type\":\"team\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team" + }, + "response": { + "bodySize": 660, + "content": { + "mimeType": "application/vnd.api+json", + "size": 660, + "text": "{\"data\":{\"id\":\"4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":0,\"created_at\":\"2025-11-24T17:06:47.453319+00:00\",\"description\":null,\"handle\":\"test-handle-6c891437b748aea8\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T17:06:47.453319+00:00\",\"name\":\"test-name-6c891437b748aea8\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87/permission-settings\"}}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 700, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-11-24T17:06:46.860Z", + "time": 570 + }, + { + "_id": "37f9b24b2c323ffb9c5963c23ea57a89", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 119, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 549, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-2-6c891437b748aea8\",\"name\":\"test-name-2-6c891437b748aea8\"},\"type\":\"team\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team" + }, + "response": { + "bodySize": 664, + "content": { + "mimeType": "application/vnd.api+json", + "size": 664, + "text": "{\"data\":{\"id\":\"21296c73-c9e2-4889-a33f-417d2974b2bd\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":2,\"created_at\":\"2025-11-24T17:06:48.020887+00:00\",\"description\":null,\"handle\":\"test-handle-2-6c891437b748aea8\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T17:06:48.020887+00:00\",\"name\":\"test-name-2-6c891437b748aea8\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/21296c73-c9e2-4889-a33f-417d2974b2bd/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/21296c73-c9e2-4889-a33f-417d2974b2bd/permission-settings\"}}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 700, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-11-24T17:06:47.438Z", + "time": 547 + }, + { + "_id": "267eba7d17100a4821689df14ad63c61", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 221, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 575, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"21296c73-c9e2-4889-a33f-417d2974b2bd\",\"type\":\"team\"}}},\"type\":\"team_hierarchy_links\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team-hierarchy-links" + }, + "response": { + "bodySize": 897, + "content": { + "mimeType": "application/vnd.api+json", + "size": 897, + "text": "{\"data\":{\"id\":\"e980108e-d535-4bdf-84ca-5e8f84a68480\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2025-11-24T17:06:48.279316439Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"21296c73-c9e2-4889-a33f-417d2974b2bd\",\"type\":\"team\"}}}},\"included\":[{\"id\":\"4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":0,\"handle\":\"test-handle-6c891437b748aea8\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-6c891437b748aea8\",\"summary\":null,\"user_count\":0}},{\"id\":\"21296c73-c9e2-4889-a33f-417d2974b2bd\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":2,\"handle\":\"test-handle-2-6c891437b748aea8\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-2-6c891437b748aea8\",\"summary\":null,\"user_count\":0}}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 677, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-11-24T17:06:47.994Z", + "time": 210 + }, + { + "_id": "267eba7d17100a4821689df14ad63c61", + "_order": 1, + "cache": {}, + "request": { + "bodySize": 221, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 575, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"21296c73-c9e2-4889-a33f-417d2974b2bd\",\"type\":\"team\"}}},\"type\":\"team_hierarchy_links\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team-hierarchy-links" + }, + "response": { + "bodySize": 315, + "content": { + "mimeType": "application/vnd.api+json", + "size": 315, + "text": "{\"errors\":[\"Conflict: could not add team 21296c73-c9e2-4889-a33f-417d2974b2bd as a member team of team 4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87 in org 321813: team hierarchy link between super team 4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87 and member team 21296c73-c9e2-4889-a33f-417d2974b2bd already exists in org 321813\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 677, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 409, + "statusText": "Conflict" + }, + "startedDateTime": "2025-11-24T17:06:48.213Z", + "time": 519 + }, + { + "_id": "43a96ba1e2d1511186d4d9cc8c497fed", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 551, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team-hierarchy-links/e980108e-d535-4bdf-84ca-5e8f84a68480" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 616, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-24T17:06:48.742Z", + "time": 495 + }, + { + "_id": "47b09fbf2ee13d4cd9b88682d56a87a1", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 522, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team/21296c73-c9e2-4889-a33f-417d2974b2bd" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 632, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-24T17:06:49.243Z", + "time": 597 + }, + { + "_id": "0b87c8a41da268e8f81761e5b6974c1e", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 522, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team/4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 632, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-24T17:06:49.844Z", + "time": 569 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Teams_3116892301/Create-a-team-hierarchy-link-returns-OK-response_398884198/frozen.json b/cassettes/v2/Teams_3116892301/Create-a-team-hierarchy-link-returns-OK-response_398884198/frozen.json new file mode 100644 index 000000000000..593fd5467555 --- /dev/null +++ b/cassettes/v2/Teams_3116892301/Create-a-team-hierarchy-link-returns-OK-response_398884198/frozen.json @@ -0,0 +1 @@ +"2025-11-24T16:01:16.053Z" diff --git a/cassettes/v2/Teams_3116892301/Create-a-team-hierarchy-link-returns-OK-response_398884198/recording.har b/cassettes/v2/Teams_3116892301/Create-a-team-hierarchy-link-returns-OK-response_398884198/recording.har new file mode 100644 index 000000000000..f30a91a11527 --- /dev/null +++ b/cassettes/v2/Teams_3116892301/Create-a-team-hierarchy-link-returns-OK-response_398884198/recording.har @@ -0,0 +1,284 @@ +{ + "log": { + "_recordingName": "Teams/Create a team hierarchy link returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "f51dc8b1f646051d30172e2e4672585c", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 115, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 549, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-4d8084da4dfa4ed8\",\"name\":\"test-name-4d8084da4dfa4ed8\"},\"type\":\"team\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team" + }, + "response": { + "bodySize": 661, + "content": { + "mimeType": "application/vnd.api+json", + "size": 661, + "text": "{\"data\":{\"id\":\"d5b049f4-59f1-474d-ad98-5a7342a8961f\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":11,\"created_at\":\"2025-11-24T16:01:16.149673+00:00\",\"description\":null,\"handle\":\"test-handle-4d8084da4dfa4ed8\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T16:01:16.149673+00:00\",\"name\":\"test-name-4d8084da4dfa4ed8\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/d5b049f4-59f1-474d-ad98-5a7342a8961f/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/d5b049f4-59f1-474d-ad98-5a7342a8961f/permission-settings\"}}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 700, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-11-24T16:01:16.055Z", + "time": 156 + }, + { + "_id": "e7e795a9a0a40b1f3108a95eb0c0845a", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 119, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 548, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-2-4d8084da4dfa4ed8\",\"name\":\"test-name-2-4d8084da4dfa4ed8\"},\"type\":\"team\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team" + }, + "response": { + "bodySize": 664, + "content": { + "mimeType": "application/vnd.api+json", + "size": 664, + "text": "{\"data\":{\"id\":\"790428f6-10bc-427d-bf36-f53ca3c197e0\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":4,\"created_at\":\"2025-11-24T16:01:16.315013+00:00\",\"description\":null,\"handle\":\"test-handle-2-4d8084da4dfa4ed8\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T16:01:16.315013+00:00\",\"name\":\"test-name-2-4d8084da4dfa4ed8\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/790428f6-10bc-427d-bf36-f53ca3c197e0/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/790428f6-10bc-427d-bf36-f53ca3c197e0/permission-settings\"}}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 700, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-11-24T16:01:16.215Z", + "time": 146 + }, + { + "_id": "cbc1af8bd3faae4269f63ec95d122c37", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 221, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 573, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"d5b049f4-59f1-474d-ad98-5a7342a8961f\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"790428f6-10bc-427d-bf36-f53ca3c197e0\",\"type\":\"team\"}}},\"type\":\"team_hierarchy_links\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team-hierarchy-links" + }, + "response": { + "bodySize": 898, + "content": { + "mimeType": "application/vnd.api+json", + "size": 898, + "text": "{\"data\":{\"id\":\"6cf86539-2c6e-497e-8cef-0b285ff05514\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2025-11-24T16:01:16.460042023Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"d5b049f4-59f1-474d-ad98-5a7342a8961f\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"790428f6-10bc-427d-bf36-f53ca3c197e0\",\"type\":\"team\"}}}},\"included\":[{\"id\":\"d5b049f4-59f1-474d-ad98-5a7342a8961f\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":11,\"handle\":\"test-handle-4d8084da4dfa4ed8\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-4d8084da4dfa4ed8\",\"summary\":null,\"user_count\":0}},{\"id\":\"790428f6-10bc-427d-bf36-f53ca3c197e0\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":4,\"handle\":\"test-handle-2-4d8084da4dfa4ed8\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-2-4d8084da4dfa4ed8\",\"summary\":null,\"user_count\":0}}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 677, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-11-24T16:01:16.365Z", + "time": 107 + }, + { + "_id": "6453e6125ae83962a8a9439efd6fd387", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 551, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team-hierarchy-links/6cf86539-2c6e-497e-8cef-0b285ff05514" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 616, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-24T16:01:16.477Z", + "time": 111 + }, + { + "_id": "03667a1074b05151c93a8caa250c0b2d", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 521, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team/790428f6-10bc-427d-bf36-f53ca3c197e0" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 632, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-24T16:01:16.590Z", + "time": 191 + }, + { + "_id": "6f791bb84f5baf6e3abb6198566110c1", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 522, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team/d5b049f4-59f1-474d-ad98-5a7342a8961f" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 632, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-24T16:01:16.783Z", + "time": 209 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Teams_3116892301/Create-a-team-hierarchy-link-returns-SUCCESS-response_1402025629/frozen.json b/cassettes/v2/Teams_3116892301/Create-a-team-hierarchy-link-returns-SUCCESS-response_1402025629/frozen.json new file mode 100644 index 000000000000..413a99b97c12 --- /dev/null +++ b/cassettes/v2/Teams_3116892301/Create-a-team-hierarchy-link-returns-SUCCESS-response_1402025629/frozen.json @@ -0,0 +1 @@ +"2025-11-24T15:48:39.900Z" diff --git a/cassettes/v2/Teams_3116892301/Create-a-team-hierarchy-link-returns-SUCCESS-response_1402025629/recording.har b/cassettes/v2/Teams_3116892301/Create-a-team-hierarchy-link-returns-SUCCESS-response_1402025629/recording.har new file mode 100644 index 000000000000..f0d727a9c2da --- /dev/null +++ b/cassettes/v2/Teams_3116892301/Create-a-team-hierarchy-link-returns-SUCCESS-response_1402025629/recording.har @@ -0,0 +1,284 @@ +{ + "log": { + "_recordingName": "Teams/Create a team hierarchy link returns \"SUCCESS\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "a2753edb970cfffeb922aed09f6fdbdc", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 115, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 549, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-a75ee0b8b483d66f\",\"name\":\"test-name-a75ee0b8b483d66f\"},\"type\":\"team\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team" + }, + "response": { + "bodySize": 660, + "content": { + "mimeType": "application/vnd.api+json", + "size": 660, + "text": "{\"data\":{\"id\":\"b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":3,\"created_at\":\"2025-11-24T15:48:40.359260+00:00\",\"description\":null,\"handle\":\"test-handle-a75ee0b8b483d66f\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T15:48:40.359261+00:00\",\"name\":\"test-name-a75ee0b8b483d66f\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd/permission-settings\"}}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 700, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-11-24T15:48:39.905Z", + "time": 534 + }, + { + "_id": "f158473a07cdc0892d920faf55be902d", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 119, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 549, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-2-a75ee0b8b483d66f\",\"name\":\"test-name-2-a75ee0b8b483d66f\"},\"type\":\"team\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team" + }, + "response": { + "bodySize": 664, + "content": { + "mimeType": "application/vnd.api+json", + "size": 664, + "text": "{\"data\":{\"id\":\"2d096572-eb6a-4579-ba38-b4247cf75e17\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":8,\"created_at\":\"2025-11-24T15:48:40.893488+00:00\",\"description\":null,\"handle\":\"test-handle-2-a75ee0b8b483d66f\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T15:48:40.893488+00:00\",\"name\":\"test-name-2-a75ee0b8b483d66f\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/2d096572-eb6a-4579-ba38-b4247cf75e17/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/2d096572-eb6a-4579-ba38-b4247cf75e17/permission-settings\"}}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 700, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-11-24T15:48:40.447Z", + "time": 527 + }, + { + "_id": "8ef0058d92ab3007697511d2bed31ad6", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 221, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 575, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"2d096572-eb6a-4579-ba38-b4247cf75e17\",\"type\":\"team\"}}},\"type\":\"team_hierarchy_links\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team-hierarchy-links" + }, + "response": { + "bodySize": 897, + "content": { + "mimeType": "application/vnd.api+json", + "size": 897, + "text": "{\"data\":{\"id\":\"fb94d43b-fe10-4c5f-ae7c-4ad745428651\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2025-11-24T15:48:41.150923395Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"2d096572-eb6a-4579-ba38-b4247cf75e17\",\"type\":\"team\"}}}},\"included\":[{\"id\":\"b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":3,\"handle\":\"test-handle-a75ee0b8b483d66f\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-a75ee0b8b483d66f\",\"summary\":null,\"user_count\":0}},{\"id\":\"2d096572-eb6a-4579-ba38-b4247cf75e17\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":8,\"handle\":\"test-handle-2-a75ee0b8b483d66f\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-2-a75ee0b8b483d66f\",\"summary\":null,\"user_count\":0}}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 677, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-11-24T15:48:40.984Z", + "time": 219 + }, + { + "_id": "b586f65c5e8c5c75934c2310020328b2", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 551, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team-hierarchy-links/fb94d43b-fe10-4c5f-ae7c-4ad745428651" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 616, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-24T15:48:41.213Z", + "time": 525 + }, + { + "_id": "df534d51885112f972640ec13f719086", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 522, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team/2d096572-eb6a-4579-ba38-b4247cf75e17" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 632, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-24T15:48:41.744Z", + "time": 621 + }, + { + "_id": "10a7d2f1489b3643d02d08eeed113a13", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 522, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team/b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 632, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-24T15:48:42.370Z", + "time": 592 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Teams_3116892301/Get-a-team-hierarchy-link-returns-API-error-response-response_3395612101/frozen.json b/cassettes/v2/Teams_3116892301/Get-a-team-hierarchy-link-returns-API-error-response-response_3395612101/frozen.json new file mode 100644 index 000000000000..6629a1699d19 --- /dev/null +++ b/cassettes/v2/Teams_3116892301/Get-a-team-hierarchy-link-returns-API-error-response-response_3395612101/frozen.json @@ -0,0 +1 @@ +"2025-11-24T13:19:11.816Z" diff --git a/cassettes/v2/Teams_3116892301/Get-a-team-hierarchy-link-returns-API-error-response-response_3395612101/recording.har b/cassettes/v2/Teams_3116892301/Get-a-team-hierarchy-link-returns-API-error-response-response_3395612101/recording.har new file mode 100644 index 000000000000..36f63a7342e4 --- /dev/null +++ b/cassettes/v2/Teams_3116892301/Get-a-team-hierarchy-link-returns-API-error-response-response_3395612101/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Teams/Get a team hierarchy link returns \"API error response.\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "c4e82909dd3532204c8818e59e6b3249", + "_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/team-hierarchy-links/aaa11111-aa11-aa11-aaaa-aaaaaa111111" + }, + "response": { + "bodySize": 101, + "content": { + "mimeType": "application/vnd.api+json", + "size": 101, + "text": "{\"errors\":[\"Not Found: team hierarchy link not found (linkId=aaa11111-aa11-aa11-aaaa-aaaaaa111111)\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 677, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2025-11-24T13:19:11.819Z", + "time": 470 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Teams_3116892301/Get-a-team-hierarchy-link-returns-OK-response_4031746224/frozen.json b/cassettes/v2/Teams_3116892301/Get-a-team-hierarchy-link-returns-OK-response_4031746224/frozen.json new file mode 100644 index 000000000000..8bdd2db1ad26 --- /dev/null +++ b/cassettes/v2/Teams_3116892301/Get-a-team-hierarchy-link-returns-OK-response_4031746224/frozen.json @@ -0,0 +1 @@ +"2025-11-24T17:07:09.212Z" diff --git a/cassettes/v2/Teams_3116892301/Get-a-team-hierarchy-link-returns-OK-response_4031746224/recording.har b/cassettes/v2/Teams_3116892301/Get-a-team-hierarchy-link-returns-OK-response_4031746224/recording.har new file mode 100644 index 000000000000..f26b024b10f1 --- /dev/null +++ b/cassettes/v2/Teams_3116892301/Get-a-team-hierarchy-link-returns-OK-response_4031746224/recording.har @@ -0,0 +1,327 @@ +{ + "log": { + "_recordingName": "Teams/Get a team hierarchy link returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "799e86d0e894767130bc91ff5c599a26", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 115, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 549, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-ae3e76a23be3747a\",\"name\":\"test-name-ae3e76a23be3747a\"},\"type\":\"team\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team" + }, + "response": { + "bodySize": 661, + "content": { + "mimeType": "application/vnd.api+json", + "size": 661, + "text": "{\"data\":{\"id\":\"fafeac94-42b4-4469-91e8-0ae5ca3f564b\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":11,\"created_at\":\"2025-11-24T17:07:09.817794+00:00\",\"description\":null,\"handle\":\"test-handle-ae3e76a23be3747a\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T17:07:09.817794+00:00\",\"name\":\"test-name-ae3e76a23be3747a\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/fafeac94-42b4-4469-91e8-0ae5ca3f564b/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/fafeac94-42b4-4469-91e8-0ae5ca3f564b/permission-settings\"}}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 700, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-11-24T17:07:09.215Z", + "time": 570 + }, + { + "_id": "204f2b1ead63f2cd745028e92c8c13a0", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 119, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 549, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-2-ae3e76a23be3747a\",\"name\":\"test-name-2-ae3e76a23be3747a\"},\"type\":\"team\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team" + }, + "response": { + "bodySize": 664, + "content": { + "mimeType": "application/vnd.api+json", + "size": 664, + "text": "{\"data\":{\"id\":\"196bcc55-bd30-4cfd-8549-b3d255a0517b\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":4,\"created_at\":\"2025-11-24T17:07:10.381761+00:00\",\"description\":null,\"handle\":\"test-handle-2-ae3e76a23be3747a\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T17:07:10.381761+00:00\",\"name\":\"test-name-2-ae3e76a23be3747a\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/196bcc55-bd30-4cfd-8549-b3d255a0517b/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/196bcc55-bd30-4cfd-8549-b3d255a0517b/permission-settings\"}}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 700, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-11-24T17:07:09.805Z", + "time": 550 + }, + { + "_id": "e977f4aba3b3ed38ae02cab7cdbd1751", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 221, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 575, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"fafeac94-42b4-4469-91e8-0ae5ca3f564b\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"196bcc55-bd30-4cfd-8549-b3d255a0517b\",\"type\":\"team\"}}},\"type\":\"team_hierarchy_links\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team-hierarchy-links" + }, + "response": { + "bodySize": 898, + "content": { + "mimeType": "application/vnd.api+json", + "size": 898, + "text": "{\"data\":{\"id\":\"5401e712-de1b-4deb-ac35-2c6ee1943ad0\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2025-11-24T17:07:10.643798843Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"fafeac94-42b4-4469-91e8-0ae5ca3f564b\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"196bcc55-bd30-4cfd-8549-b3d255a0517b\",\"type\":\"team\"}}}},\"included\":[{\"id\":\"fafeac94-42b4-4469-91e8-0ae5ca3f564b\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":11,\"handle\":\"test-handle-ae3e76a23be3747a\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-ae3e76a23be3747a\",\"summary\":null,\"user_count\":0}},{\"id\":\"196bcc55-bd30-4cfd-8549-b3d255a0517b\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":4,\"handle\":\"test-handle-2-ae3e76a23be3747a\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-2-ae3e76a23be3747a\",\"summary\":null,\"user_count\":0}}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 677, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-11-24T17:07:10.363Z", + "time": 206 + }, + { + "_id": "cc894026b05c65211b8e356dfa0a73eb", + "_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/team-hierarchy-links/5401e712-de1b-4deb-ac35-2c6ee1943ad0" + }, + "response": { + "bodySize": 1003, + "content": { + "mimeType": "application/vnd.api+json", + "size": 1003, + "text": "{\"data\":{\"id\":\"5401e712-de1b-4deb-ac35-2c6ee1943ad0\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2025-11-24T17:07:10.643799Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"fafeac94-42b4-4469-91e8-0ae5ca3f564b\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"196bcc55-bd30-4cfd-8549-b3d255a0517b\",\"type\":\"team\"}}}},\"links\":{\"self\":\"https://api.datadoghq.com/api/v2/team-hierarchy-links/5401e712-de1b-4deb-ac35-2c6ee1943ad0\"},\"included\":[{\"id\":\"196bcc55-bd30-4cfd-8549-b3d255a0517b\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":4,\"handle\":\"test-handle-2-ae3e76a23be3747a\",\"is_managed\":false,\"is_open_membership\":true,\"link_count\":0,\"name\":\"test-name-2-ae3e76a23be3747a\",\"summary\":null,\"user_count\":0}},{\"id\":\"fafeac94-42b4-4469-91e8-0ae5ca3f564b\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":11,\"handle\":\"test-handle-ae3e76a23be3747a\",\"is_managed\":false,\"is_open_membership\":true,\"link_count\":0,\"name\":\"test-name-ae3e76a23be3747a\",\"summary\":null,\"user_count\":0}}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 678, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-11-24T17:07:10.581Z", + "time": 477 + }, + { + "_id": "8056212d8b1da7f540ee5746517e097a", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 551, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team-hierarchy-links/5401e712-de1b-4deb-ac35-2c6ee1943ad0" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 616, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-24T17:07:11.073Z", + "time": 507 + }, + { + "_id": "586f38aaff9d0a61809935af45195b9e", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 522, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team/196bcc55-bd30-4cfd-8549-b3d255a0517b" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 632, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-24T17:07:11.587Z", + "time": 569 + }, + { + "_id": "a8a73b2a08cee2eb7d4e7aaa724beafc", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 522, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team/fafeac94-42b4-4469-91e8-0ae5ca3f564b" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 632, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-24T17:07:12.161Z", + "time": 565 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Teams_3116892301/Get-team-hierarchy-links-returns-OK-response_543093888/frozen.json b/cassettes/v2/Teams_3116892301/Get-team-hierarchy-links-returns-OK-response_543093888/frozen.json new file mode 100644 index 000000000000..2353e83e8576 --- /dev/null +++ b/cassettes/v2/Teams_3116892301/Get-team-hierarchy-links-returns-OK-response_543093888/frozen.json @@ -0,0 +1 @@ +"2025-11-24T17:18:13.180Z" diff --git a/cassettes/v2/Teams_3116892301/Get-team-hierarchy-links-returns-OK-response_543093888/recording.har b/cassettes/v2/Teams_3116892301/Get-team-hierarchy-links-returns-OK-response_543093888/recording.har new file mode 100644 index 000000000000..e0635140fff8 --- /dev/null +++ b/cassettes/v2/Teams_3116892301/Get-team-hierarchy-links-returns-OK-response_543093888/recording.har @@ -0,0 +1,342 @@ +{ + "log": { + "_recordingName": "Teams/Get team hierarchy links returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "093aa88f7ea946d82113cff45a47e3d2", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 115, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 549, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-ab0ee85594ae1dfd\",\"name\":\"test-name-ab0ee85594ae1dfd\"},\"type\":\"team\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team" + }, + "response": { + "bodySize": 660, + "content": { + "mimeType": "application/vnd.api+json", + "size": 660, + "text": "{\"data\":{\"id\":\"d1baf3de-7316-43b5-8582-dc887acc26ef\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":6,\"created_at\":\"2025-11-24T17:18:13.814865+00:00\",\"description\":null,\"handle\":\"test-handle-ab0ee85594ae1dfd\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T17:18:13.814865+00:00\",\"name\":\"test-name-ab0ee85594ae1dfd\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/d1baf3de-7316-43b5-8582-dc887acc26ef/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/d1baf3de-7316-43b5-8582-dc887acc26ef/permission-settings\"}}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 700, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-11-24T17:18:13.183Z", + "time": 589 + }, + { + "_id": "cf77824c0d3e3bdc25a932a44f937627", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 119, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 549, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-2-ab0ee85594ae1dfd\",\"name\":\"test-name-2-ab0ee85594ae1dfd\"},\"type\":\"team\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team" + }, + "response": { + "bodySize": 665, + "content": { + "mimeType": "application/vnd.api+json", + "size": 665, + "text": "{\"data\":{\"id\":\"61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":13,\"created_at\":\"2025-11-24T17:18:14.383042+00:00\",\"description\":null,\"handle\":\"test-handle-2-ab0ee85594ae1dfd\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T17:18:14.383042+00:00\",\"name\":\"test-name-2-ab0ee85594ae1dfd\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/61b0ab36-c1e5-47fd-898a-ba9bfc860e9d/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/61b0ab36-c1e5-47fd-898a-ba9bfc860e9d/permission-settings\"}}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 700, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-11-24T17:18:13.784Z", + "time": 544 + }, + { + "_id": "438095ffe9ea20dca6026521b23a66ff", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 221, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 575, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"d1baf3de-7316-43b5-8582-dc887acc26ef\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\",\"type\":\"team\"}}},\"type\":\"team_hierarchy_links\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team-hierarchy-links" + }, + "response": { + "bodySize": 898, + "content": { + "mimeType": "application/vnd.api+json", + "size": 898, + "text": "{\"data\":{\"id\":\"61509612-5bb0-42c5-a16e-bf4920acf473\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2025-11-24T17:18:14.635205462Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"d1baf3de-7316-43b5-8582-dc887acc26ef\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\",\"type\":\"team\"}}}},\"included\":[{\"id\":\"d1baf3de-7316-43b5-8582-dc887acc26ef\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":6,\"handle\":\"test-handle-ab0ee85594ae1dfd\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-ab0ee85594ae1dfd\",\"summary\":null,\"user_count\":0}},{\"id\":\"61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":13,\"handle\":\"test-handle-2-ab0ee85594ae1dfd\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-2-ab0ee85594ae1dfd\",\"summary\":null,\"user_count\":0}}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 677, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-11-24T17:18:14.335Z", + "time": 213 + }, + { + "_id": "30a85d94f55cf421b4cd9237fe54b4b4", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 679, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "filter", + "value": { + "parent_team": "d1baf3de-7316-43b5-8582-dc887acc26ef", + "sub_team": "61b0ab36-c1e5-47fd-898a-ba9bfc860e9d" + } + }, + { + "name": "page", + "value": { + "number": "0", + "size": "100" + } + } + ], + "url": "https://api.datadoghq.com/api/v2/team-hierarchy-links?filter%5Bparent_team%5D=d1baf3de-7316-43b5-8582-dc887acc26ef&filter%5Bsub_team%5D=61b0ab36-c1e5-47fd-898a-ba9bfc860e9d&page%5Bnumber%5D=0&page%5Bsize%5D=100" + }, + "response": { + "bodySize": 1721, + "content": { + "mimeType": "application/vnd.api+json", + "size": 1721, + "text": "{\"data\":[{\"id\":\"61509612-5bb0-42c5-a16e-bf4920acf473\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2025-11-24T17:18:14.635205Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"d1baf3de-7316-43b5-8582-dc887acc26ef\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\",\"type\":\"team\"}}}}],\"meta\":{\"page\":{\"type\":\"number_size\",\"number\":0,\"size\":100,\"total\":1,\"first_number\":0,\"prev_number\":null,\"next_number\":null,\"last_number\":0}},\"links\":{\"self\":\"https://api.datadoghq.com/api/v2/team-hierarchy-links?filter%5Bparent_team%5D=d1baf3de-7316-43b5-8582-dc887acc26ef\\u0026filter%5Bsub_team%5D=61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\\u0026page%5Bnumber%5D=0\\u0026page%5Bsize%5D=100\",\"first\":\"https://api.datadoghq.com/api/v2/team-hierarchy-links?filter[parent_team]=d1baf3de-7316-43b5-8582-dc887acc26ef\\u0026filter[sub_team]=61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\\u0026page[number]=0\\u0026page[size]=100\",\"last\":\"https://api.datadoghq.com/api/v2/team-hierarchy-links?filter[parent_team]=d1baf3de-7316-43b5-8582-dc887acc26ef\\u0026filter[sub_team]=61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\\u0026page[number]=0\\u0026page[size]=100\"},\"included\":[{\"id\":\"61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":13,\"handle\":\"test-handle-2-ab0ee85594ae1dfd\",\"is_managed\":false,\"is_open_membership\":true,\"link_count\":0,\"name\":\"test-name-2-ab0ee85594ae1dfd\",\"summary\":null,\"user_count\":0}},{\"id\":\"d1baf3de-7316-43b5-8582-dc887acc26ef\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":6,\"handle\":\"test-handle-ab0ee85594ae1dfd\",\"is_managed\":false,\"is_open_membership\":true,\"link_count\":0,\"name\":\"test-name-ab0ee85594ae1dfd\",\"summary\":null,\"user_count\":0}}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 678, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-11-24T17:18:14.565Z", + "time": 475 + }, + { + "_id": "6328f8cc535edc2883dca930b551cd1b", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 551, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team-hierarchy-links/61509612-5bb0-42c5-a16e-bf4920acf473" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 616, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-24T17:18:15.059Z", + "time": 517 + }, + { + "_id": "55c11b3fb0bd6d61e5cbf13a96303649", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 522, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team/61b0ab36-c1e5-47fd-898a-ba9bfc860e9d" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 632, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-24T17:18:15.581Z", + "time": 579 + }, + { + "_id": "23b646bc99d28db47fbb7c5ccbc4ee00", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 522, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team/d1baf3de-7316-43b5-8582-dc887acc26ef" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 632, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-24T17:18:16.166Z", + "time": 629 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Teams_3116892301/Remove-a-team-hierarchy-link-returns-API-error-response-response_1350392815/frozen.json b/cassettes/v2/Teams_3116892301/Remove-a-team-hierarchy-link-returns-API-error-response-response_1350392815/frozen.json new file mode 100644 index 000000000000..d55b872755c7 --- /dev/null +++ b/cassettes/v2/Teams_3116892301/Remove-a-team-hierarchy-link-returns-API-error-response-response_1350392815/frozen.json @@ -0,0 +1 @@ +"2025-11-24T13:14:20.481Z" diff --git a/cassettes/v2/Teams_3116892301/Remove-a-team-hierarchy-link-returns-API-error-response-response_1350392815/recording.har b/cassettes/v2/Teams_3116892301/Remove-a-team-hierarchy-link-returns-API-error-response-response_1350392815/recording.har new file mode 100644 index 000000000000..92427efdf9a7 --- /dev/null +++ b/cassettes/v2/Teams_3116892301/Remove-a-team-hierarchy-link-returns-API-error-response-response_1350392815/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Teams/Remove a team hierarchy link returns \"API error response.\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "360527a7cd17c12c763c534ca0bf2e10", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 549, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team-hierarchy-links/aaa11111-aa11-aa11-aaaa-aaaaaa111111" + }, + "response": { + "bodySize": 85, + "content": { + "mimeType": "application/vnd.api+json", + "size": 85, + "text": "{\"errors\":[\"Not Found: link with id aaa11111-aa11-aa11-aaaa-aaaaaa111111 not found\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 676, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2025-11-24T13:14:20.484Z", + "time": 465 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Teams_3116892301/Remove-a-team-hierarchy-link-returns-No-Content-response_2718623318/frozen.json b/cassettes/v2/Teams_3116892301/Remove-a-team-hierarchy-link-returns-No-Content-response_2718623318/frozen.json new file mode 100644 index 000000000000..b4576f3f55c7 --- /dev/null +++ b/cassettes/v2/Teams_3116892301/Remove-a-team-hierarchy-link-returns-No-Content-response_2718623318/frozen.json @@ -0,0 +1 @@ +"2025-11-24T17:08:01.196Z" diff --git a/cassettes/v2/Teams_3116892301/Remove-a-team-hierarchy-link-returns-No-Content-response_2718623318/recording.har b/cassettes/v2/Teams_3116892301/Remove-a-team-hierarchy-link-returns-No-Content-response_2718623318/recording.har new file mode 100644 index 000000000000..0e59de2736a6 --- /dev/null +++ b/cassettes/v2/Teams_3116892301/Remove-a-team-hierarchy-link-returns-No-Content-response_2718623318/recording.har @@ -0,0 +1,327 @@ +{ + "log": { + "_recordingName": "Teams/Remove a team hierarchy link returns \"No Content\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "83a592d3fc057f6c22256a804b6cb3fd", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 115, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 549, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-db31819631324305\",\"name\":\"test-name-db31819631324305\"},\"type\":\"team\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team" + }, + "response": { + "bodySize": 661, + "content": { + "mimeType": "application/vnd.api+json", + "size": 661, + "text": "{\"data\":{\"id\":\"eaf01981-6b63-41ba-b49f-30449c50e865\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":10,\"created_at\":\"2025-11-24T17:08:01.930314+00:00\",\"description\":null,\"handle\":\"test-handle-db31819631324305\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T17:08:01.930314+00:00\",\"name\":\"test-name-db31819631324305\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/eaf01981-6b63-41ba-b49f-30449c50e865/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/eaf01981-6b63-41ba-b49f-30449c50e865/permission-settings\"}}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 700, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-11-24T17:08:01.200Z", + "time": 697 + }, + { + "_id": "60fd20726a365270a7ac420092d128f7", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 119, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 549, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"handle\":\"test-handle-2-db31819631324305\",\"name\":\"test-name-2-db31819631324305\"},\"type\":\"team\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team" + }, + "response": { + "bodySize": 664, + "content": { + "mimeType": "application/vnd.api+json", + "size": 664, + "text": "{\"data\":{\"id\":\"120aeb27-ca42-4e38-a9e4-6497b8f9407c\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":6,\"created_at\":\"2025-11-24T17:08:02.174211+00:00\",\"description\":null,\"handle\":\"test-handle-2-db31819631324305\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2025-11-24T17:08:02.174211+00:00\",\"name\":\"test-name-2-db31819631324305\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/120aeb27-ca42-4e38-a9e4-6497b8f9407c/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/120aeb27-ca42-4e38-a9e4-6497b8f9407c/permission-settings\"}}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 700, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2025-11-24T17:08:01.909Z", + "time": 223 + }, + { + "_id": "1ed15f6e36fee51effaa3009d34464e7", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 221, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 575, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"eaf01981-6b63-41ba-b49f-30449c50e865\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"120aeb27-ca42-4e38-a9e4-6497b8f9407c\",\"type\":\"team\"}}},\"type\":\"team_hierarchy_links\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team-hierarchy-links" + }, + "response": { + "bodySize": 898, + "content": { + "mimeType": "application/vnd.api+json", + "size": 898, + "text": "{\"data\":{\"id\":\"185446b8-1e88-419c-b266-3933f1411b6e\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2025-11-24T17:08:02.736655421Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"eaf01981-6b63-41ba-b49f-30449c50e865\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"120aeb27-ca42-4e38-a9e4-6497b8f9407c\",\"type\":\"team\"}}}},\"included\":[{\"id\":\"eaf01981-6b63-41ba-b49f-30449c50e865\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":10,\"handle\":\"test-handle-db31819631324305\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-db31819631324305\",\"summary\":null,\"user_count\":0}},{\"id\":\"120aeb27-ca42-4e38-a9e4-6497b8f9407c\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":6,\"handle\":\"test-handle-2-db31819631324305\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-2-db31819631324305\",\"summary\":null,\"user_count\":0}}]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 677, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-11-24T17:08:02.142Z", + "time": 519 + }, + { + "_id": "954ab98a3b9c8c13b2fac9692349b4a9", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 551, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team-hierarchy-links/185446b8-1e88-419c-b266-3933f1411b6e" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 616, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-24T17:08:02.672Z", + "time": 501 + }, + { + "_id": "954ab98a3b9c8c13b2fac9692349b4a9", + "_order": 1, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 551, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team-hierarchy-links/185446b8-1e88-419c-b266-3933f1411b6e" + }, + "response": { + "bodySize": 85, + "content": { + "mimeType": "application/vnd.api+json", + "size": 85, + "text": "{\"errors\":[\"Not Found: link with id 185446b8-1e88-419c-b266-3933f1411b6e not found\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.api+json" + } + ], + "headersSize": 676, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2025-11-24T17:08:03.184Z", + "time": 445 + }, + { + "_id": "eab70343b6b467c98bcc3a1ac13f5c75", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 522, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team/120aeb27-ca42-4e38-a9e4-6497b8f9407c" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 632, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-24T17:08:03.637Z", + "time": 594 + }, + { + "_id": "d01fd700c1e5677d403273e8d5805ab6", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 522, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/team/eaf01981-6b63-41ba-b49f-30449c50e865" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 632, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2025-11-24T17:08:04.241Z", + "time": 563 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/examples/v2/logs-restriction-queries/AddRoleToRestrictionQuery.ts b/examples/v2/logs-restriction-queries/AddRoleToRestrictionQuery.ts new file mode 100644 index 000000000000..34a6c62b4e17 --- /dev/null +++ b/examples/v2/logs-restriction-queries/AddRoleToRestrictionQuery.ts @@ -0,0 +1,35 @@ +/** + * Grant role to a restriction query returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.addRoleToRestrictionQuery"] = true; +const apiInstance = new v2.LogsRestrictionQueriesApi(configuration); + +// there is a valid "restriction_query" in the system +const RESTRICTION_QUERY_DATA_ID = process.env + .RESTRICTION_QUERY_DATA_ID as string; + +// there is a valid "role" in the system +const ROLE_DATA_ID = process.env.ROLE_DATA_ID as string; + +const params: v2.LogsRestrictionQueriesApiAddRoleToRestrictionQueryRequest = { + body: { + data: { + id: ROLE_DATA_ID, + type: "roles", + }, + }, + restrictionQueryId: RESTRICTION_QUERY_DATA_ID, +}; + +apiInstance + .addRoleToRestrictionQuery(params) + .then((data: any) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/logs-restriction-queries/CreateRestrictionQuery.ts b/examples/v2/logs-restriction-queries/CreateRestrictionQuery.ts new file mode 100644 index 000000000000..3393ffa6df3c --- /dev/null +++ b/examples/v2/logs-restriction-queries/CreateRestrictionQuery.ts @@ -0,0 +1,29 @@ +/** + * Create a restriction query returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.createRestrictionQuery"] = true; +const apiInstance = new v2.LogsRestrictionQueriesApi(configuration); + +const params: v2.LogsRestrictionQueriesApiCreateRestrictionQueryRequest = { + body: { + data: { + attributes: { + restrictionQuery: "env:sandbox", + }, + type: "logs_restriction_queries", + }, + }, +}; + +apiInstance + .createRestrictionQuery(params) + .then((data: v2.RestrictionQueryWithoutRelationshipsResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/logs-restriction-queries/DeleteRestrictionQuery.ts b/examples/v2/logs-restriction-queries/DeleteRestrictionQuery.ts new file mode 100644 index 000000000000..3fe62927aa6e --- /dev/null +++ b/examples/v2/logs-restriction-queries/DeleteRestrictionQuery.ts @@ -0,0 +1,26 @@ +/** + * Delete a restriction query returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.deleteRestrictionQuery"] = true; +const apiInstance = new v2.LogsRestrictionQueriesApi(configuration); + +// there is a valid "restriction_query" in the system +const RESTRICTION_QUERY_DATA_ID = process.env + .RESTRICTION_QUERY_DATA_ID as string; + +const params: v2.LogsRestrictionQueriesApiDeleteRestrictionQueryRequest = { + restrictionQueryId: RESTRICTION_QUERY_DATA_ID, +}; + +apiInstance + .deleteRestrictionQuery(params) + .then((data: any) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/logs-restriction-queries/GetRestrictionQuery.ts b/examples/v2/logs-restriction-queries/GetRestrictionQuery.ts new file mode 100644 index 000000000000..bba81970d7ed --- /dev/null +++ b/examples/v2/logs-restriction-queries/GetRestrictionQuery.ts @@ -0,0 +1,26 @@ +/** + * Get a restriction query returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.getRestrictionQuery"] = true; +const apiInstance = new v2.LogsRestrictionQueriesApi(configuration); + +// there is a valid "restriction_query" in the system +const RESTRICTION_QUERY_DATA_ID = process.env + .RESTRICTION_QUERY_DATA_ID as string; + +const params: v2.LogsRestrictionQueriesApiGetRestrictionQueryRequest = { + restrictionQueryId: RESTRICTION_QUERY_DATA_ID, +}; + +apiInstance + .getRestrictionQuery(params) + .then((data: v2.RestrictionQueryWithRelationshipsResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/logs-restriction-queries/GetRoleRestrictionQuery.ts b/examples/v2/logs-restriction-queries/GetRoleRestrictionQuery.ts new file mode 100644 index 000000000000..cba4d42569f4 --- /dev/null +++ b/examples/v2/logs-restriction-queries/GetRoleRestrictionQuery.ts @@ -0,0 +1,25 @@ +/** + * Get restriction query for a given role returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.getRoleRestrictionQuery"] = true; +const apiInstance = new v2.LogsRestrictionQueriesApi(configuration); + +// there is a valid "role" in the system +const ROLE_DATA_ID = process.env.ROLE_DATA_ID as string; + +const params: v2.LogsRestrictionQueriesApiGetRoleRestrictionQueryRequest = { + roleId: ROLE_DATA_ID, +}; + +apiInstance + .getRoleRestrictionQuery(params) + .then((data: v2.RestrictionQueryListResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/logs-restriction-queries/ListRestrictionQueries.ts b/examples/v2/logs-restriction-queries/ListRestrictionQueries.ts new file mode 100644 index 000000000000..3a2e4a7077f0 --- /dev/null +++ b/examples/v2/logs-restriction-queries/ListRestrictionQueries.ts @@ -0,0 +1,18 @@ +/** + * List restriction queries returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.listRestrictionQueries"] = true; +const apiInstance = new v2.LogsRestrictionQueriesApi(configuration); + +apiInstance + .listRestrictionQueries() + .then((data: v2.RestrictionQueryListResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/logs-restriction-queries/ListRestrictionQueryRoles.ts b/examples/v2/logs-restriction-queries/ListRestrictionQueryRoles.ts new file mode 100644 index 000000000000..8aa29a50db81 --- /dev/null +++ b/examples/v2/logs-restriction-queries/ListRestrictionQueryRoles.ts @@ -0,0 +1,26 @@ +/** + * List roles for a restriction query returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.listRestrictionQueryRoles"] = true; +const apiInstance = new v2.LogsRestrictionQueriesApi(configuration); + +// there is a valid "restriction_query" in the system +const RESTRICTION_QUERY_DATA_ID = process.env + .RESTRICTION_QUERY_DATA_ID as string; + +const params: v2.LogsRestrictionQueriesApiListRestrictionQueryRolesRequest = { + restrictionQueryId: RESTRICTION_QUERY_DATA_ID, +}; + +apiInstance + .listRestrictionQueryRoles(params) + .then((data: v2.RestrictionQueryRolesResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/logs-restriction-queries/ListUserRestrictionQueries.ts b/examples/v2/logs-restriction-queries/ListUserRestrictionQueries.ts new file mode 100644 index 000000000000..08f4ff1e0769 --- /dev/null +++ b/examples/v2/logs-restriction-queries/ListUserRestrictionQueries.ts @@ -0,0 +1,25 @@ +/** + * Get all restriction queries for a given user returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.listUserRestrictionQueries"] = true; +const apiInstance = new v2.LogsRestrictionQueriesApi(configuration); + +// there is a valid "user" in the system +const USER_DATA_ID = process.env.USER_DATA_ID as string; + +const params: v2.LogsRestrictionQueriesApiListUserRestrictionQueriesRequest = { + userId: USER_DATA_ID, +}; + +apiInstance + .listUserRestrictionQueries(params) + .then((data: v2.RestrictionQueryListResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/logs-restriction-queries/RemoveRoleFromRestrictionQuery.ts b/examples/v2/logs-restriction-queries/RemoveRoleFromRestrictionQuery.ts new file mode 100644 index 000000000000..35cb48ba14ae --- /dev/null +++ b/examples/v2/logs-restriction-queries/RemoveRoleFromRestrictionQuery.ts @@ -0,0 +1,36 @@ +/** + * Revoke role from a restriction query returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.removeRoleFromRestrictionQuery"] = true; +const apiInstance = new v2.LogsRestrictionQueriesApi(configuration); + +// there is a valid "restriction_query" in the system +const RESTRICTION_QUERY_DATA_ID = process.env + .RESTRICTION_QUERY_DATA_ID as string; + +// there is a valid "role" in the system +const ROLE_DATA_ID = process.env.ROLE_DATA_ID as string; + +const params: v2.LogsRestrictionQueriesApiRemoveRoleFromRestrictionQueryRequest = + { + body: { + data: { + id: ROLE_DATA_ID, + type: "roles", + }, + }, + restrictionQueryId: RESTRICTION_QUERY_DATA_ID, + }; + +apiInstance + .removeRoleFromRestrictionQuery(params) + .then((data: any) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/logs-restriction-queries/ReplaceRestrictionQuery.ts b/examples/v2/logs-restriction-queries/ReplaceRestrictionQuery.ts new file mode 100644 index 000000000000..565efad9076c --- /dev/null +++ b/examples/v2/logs-restriction-queries/ReplaceRestrictionQuery.ts @@ -0,0 +1,34 @@ +/** + * Replace a restriction query returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.replaceRestrictionQuery"] = true; +const apiInstance = new v2.LogsRestrictionQueriesApi(configuration); + +// there is a valid "restriction_query" in the system +const RESTRICTION_QUERY_DATA_ID = process.env + .RESTRICTION_QUERY_DATA_ID as string; + +const params: v2.LogsRestrictionQueriesApiReplaceRestrictionQueryRequest = { + body: { + data: { + attributes: { + restrictionQuery: "env:staging", + }, + type: "logs_restriction_queries", + }, + }, + restrictionQueryId: RESTRICTION_QUERY_DATA_ID, +}; + +apiInstance + .replaceRestrictionQuery(params) + .then((data: v2.RestrictionQueryWithoutRelationshipsResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/logs-restriction-queries/UpdateRestrictionQuery.ts b/examples/v2/logs-restriction-queries/UpdateRestrictionQuery.ts new file mode 100644 index 000000000000..662185589626 --- /dev/null +++ b/examples/v2/logs-restriction-queries/UpdateRestrictionQuery.ts @@ -0,0 +1,34 @@ +/** + * Update a restriction query returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.updateRestrictionQuery"] = true; +const apiInstance = new v2.LogsRestrictionQueriesApi(configuration); + +// there is a valid "restriction_query" in the system +const RESTRICTION_QUERY_DATA_ID = process.env + .RESTRICTION_QUERY_DATA_ID as string; + +const params: v2.LogsRestrictionQueriesApiUpdateRestrictionQueryRequest = { + body: { + data: { + attributes: { + restrictionQuery: "env:production", + }, + type: "logs_restriction_queries", + }, + }, + restrictionQueryId: RESTRICTION_QUERY_DATA_ID, +}; + +apiInstance + .updateRestrictionQuery(params) + .then((data: v2.RestrictionQueryWithoutRelationshipsResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/teams/AddTeamHierarchyLink.ts b/examples/v2/teams/AddTeamHierarchyLink.ts new file mode 100644 index 000000000000..b93288d0e0a7 --- /dev/null +++ b/examples/v2/teams/AddTeamHierarchyLink.ts @@ -0,0 +1,45 @@ +/** + * Create a team hierarchy link returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.TeamsApi(configuration); + +// there is a valid "dd_team" in the system +const DD_TEAM_DATA_ID = process.env.DD_TEAM_DATA_ID as string; + +// there is a valid "dd_team_2" in the system +const DD_TEAM_2_DATA_ID = process.env.DD_TEAM_2_DATA_ID as string; + +const params: v2.TeamsApiAddTeamHierarchyLinkRequest = { + body: { + data: { + relationships: { + parentTeam: { + data: { + id: DD_TEAM_DATA_ID, + type: "team", + }, + }, + subTeam: { + data: { + id: DD_TEAM_2_DATA_ID, + type: "team", + }, + }, + }, + type: "team_hierarchy_links", + }, + }, +}; + +apiInstance + .addTeamHierarchyLink(params) + .then((data: v2.TeamHierarchyLinkResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/teams/GetTeamHierarchyLink.ts b/examples/v2/teams/GetTeamHierarchyLink.ts new file mode 100644 index 000000000000..b025029cf839 --- /dev/null +++ b/examples/v2/teams/GetTeamHierarchyLink.ts @@ -0,0 +1,25 @@ +/** + * Get a team hierarchy link returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.TeamsApi(configuration); + +// there is a valid "team_hierarchy_link" in the system +const TEAM_HIERARCHY_LINK_DATA_ID = process.env + .TEAM_HIERARCHY_LINK_DATA_ID as string; + +const params: v2.TeamsApiGetTeamHierarchyLinkRequest = { + linkId: TEAM_HIERARCHY_LINK_DATA_ID, +}; + +apiInstance + .getTeamHierarchyLink(params) + .then((data: v2.TeamHierarchyLinkResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/teams/ListTeamHierarchyLinks.ts b/examples/v2/teams/ListTeamHierarchyLinks.ts new file mode 100644 index 000000000000..c88e8f0bb3b9 --- /dev/null +++ b/examples/v2/teams/ListTeamHierarchyLinks.ts @@ -0,0 +1,30 @@ +/** + * Get team hierarchy links returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.TeamsApi(configuration); + +// there is a valid "team_hierarchy_link" in the system +const TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_PARENT_TEAM_DATA_ID = process.env + .TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_PARENT_TEAM_DATA_ID as string; +const TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_SUB_TEAM_DATA_ID = process.env + .TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_SUB_TEAM_DATA_ID as string; + +const params: v2.TeamsApiListTeamHierarchyLinksRequest = { + pageNumber: 0, + pageSize: 100, + filterParentTeam: TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_PARENT_TEAM_DATA_ID, + filterSubTeam: TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_SUB_TEAM_DATA_ID, +}; + +apiInstance + .listTeamHierarchyLinks(params) + .then((data: v2.TeamHierarchyLinksResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/teams/ListTeamHierarchyLinks_3360757486.ts b/examples/v2/teams/ListTeamHierarchyLinks_3360757486.ts new file mode 100644 index 000000000000..f8366413e8de --- /dev/null +++ b/examples/v2/teams/ListTeamHierarchyLinks_3360757486.ts @@ -0,0 +1,18 @@ +/** + * Get team hierarchy links returns "OK" response with pagination + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.TeamsApi(configuration); + +(async () => { + try { + for await (const item of apiInstance.listTeamHierarchyLinksWithPagination()) { + console.log(item); + } + } catch (error) { + console.error(error); + } +})(); diff --git a/examples/v2/teams/RemoveTeamHierarchyLink.ts b/examples/v2/teams/RemoveTeamHierarchyLink.ts new file mode 100644 index 000000000000..9a1f420916c4 --- /dev/null +++ b/examples/v2/teams/RemoveTeamHierarchyLink.ts @@ -0,0 +1,25 @@ +/** + * Remove a team hierarchy link returns "No Content" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.TeamsApi(configuration); + +// there is a valid "team_hierarchy_link" in the system +const TEAM_HIERARCHY_LINK_DATA_ID = process.env + .TEAM_HIERARCHY_LINK_DATA_ID as string; + +const params: v2.TeamsApiRemoveTeamHierarchyLinkRequest = { + linkId: TEAM_HIERARCHY_LINK_DATA_ID, +}; + +apiInstance + .removeTeamHierarchyLink(params) + .then((data: any) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index 7bfe6adf50be..d08324066f90 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -6747,6 +6747,111 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "LogsMetricResponse", }, + "v2.ListRestrictionQueries": { + "pageSize": { + "type": "number", + "format": "int64", + }, + "pageNumber": { + "type": "number", + "format": "int64", + }, + "operationResponseType": "RestrictionQueryListResponse", + }, + "v2.CreateRestrictionQuery": { + "body": { + "type": "RestrictionQueryCreatePayload", + "format": "", + }, + "operationResponseType": "RestrictionQueryWithoutRelationshipsResponse", + }, + "v2.GetRoleRestrictionQuery": { + "roleId": { + "type": "string", + "format": "", + }, + "operationResponseType": "RestrictionQueryListResponse", + }, + "v2.ListUserRestrictionQueries": { + "userId": { + "type": "string", + "format": "", + }, + "operationResponseType": "RestrictionQueryListResponse", + }, + "v2.GetRestrictionQuery": { + "restrictionQueryId": { + "type": "string", + "format": "", + }, + "operationResponseType": "RestrictionQueryWithRelationshipsResponse", + }, + "v2.ReplaceRestrictionQuery": { + "restrictionQueryId": { + "type": "string", + "format": "", + }, + "body": { + "type": "RestrictionQueryUpdatePayload", + "format": "", + }, + "operationResponseType": "RestrictionQueryWithoutRelationshipsResponse", + }, + "v2.DeleteRestrictionQuery": { + "restrictionQueryId": { + "type": "string", + "format": "", + }, + "operationResponseType": "{}", + }, + "v2.UpdateRestrictionQuery": { + "restrictionQueryId": { + "type": "string", + "format": "", + }, + "body": { + "type": "RestrictionQueryUpdatePayload", + "format": "", + }, + "operationResponseType": "RestrictionQueryWithoutRelationshipsResponse", + }, + "v2.ListRestrictionQueryRoles": { + "restrictionQueryId": { + "type": "string", + "format": "", + }, + "pageSize": { + "type": "number", + "format": "int64", + }, + "pageNumber": { + "type": "number", + "format": "int64", + }, + "operationResponseType": "RestrictionQueryRolesResponse", + }, + "v2.AddRoleToRestrictionQuery": { + "restrictionQueryId": { + "type": "string", + "format": "", + }, + "body": { + "type": "RelationshipToRole", + "format": "", + }, + "operationResponseType": "{}", + }, + "v2.RemoveRoleFromRestrictionQuery": { + "restrictionQueryId": { + "type": "string", + "format": "", + }, + "body": { + "type": "RelationshipToRole", + "format": "", + }, + "operationResponseType": "{}", + }, "v2.ListTagConfigurations": { "filterConfigured": { "type": "boolean", @@ -8763,6 +8868,46 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "TeamResponse", }, + "v2.ListTeamHierarchyLinks": { + "pageNumber": { + "type": "number", + "format": "int64", + }, + "pageSize": { + "type": "number", + "format": "int64", + }, + "filterParentTeam": { + "type": "string", + "format": "", + }, + "filterSubTeam": { + "type": "string", + "format": "", + }, + "operationResponseType": "TeamHierarchyLinksResponse", + }, + "v2.AddTeamHierarchyLink": { + "body": { + "type": "TeamHierarchyLinkCreateRequest", + "format": "", + }, + "operationResponseType": "TeamHierarchyLinkResponse", + }, + "v2.GetTeamHierarchyLink": { + "linkId": { + "type": "string", + "format": "", + }, + "operationResponseType": "TeamHierarchyLinkResponse", + }, + "v2.RemoveTeamHierarchyLink": { + "linkId": { + "type": "string", + "format": "", + }, + "operationResponseType": "{}", + }, "v2.GetTeamSync": { "filterSource": { "type": "TeamSyncAttributesSource", diff --git a/features/v2/given.json b/features/v2/given.json index 198c7af1b51d..6c6d3bf98f4c 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -679,6 +679,18 @@ "tag": "Logs Metrics", "operationId": "CreateLogsMetric" }, + { + "parameters": [ + { + "name": "body", + "value": "{\"data\": {\"attributes\": {\"restriction_query\": \"env:sandbox\"}, \"type\": \"logs_restriction_queries\"}}" + } + ], + "step": "there is a valid \"restriction_query\" in the system", + "key": "restriction_query", + "tag": "Logs Restriction Queries", + "operationId": "CreateRestrictionQuery" + }, { "parameters": [ { @@ -1169,6 +1181,30 @@ "tag": "Teams", "operationId": "CreateTeam" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"handle\": \"test-handle-2-{{ unique_hash }}\",\n \"name\": \"test-name-2-{{ unique_hash }}\"\n },\n \"type\": \"team\"\n }\n}" + } + ], + "step": "there is a valid \"dd_team_2\" in the system", + "key": "dd_team_2", + "tag": "Teams", + "operationId": "CreateTeam" + }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"team_hierarchy_links\",\n \"relationships\": {\n \"parent_team\": {\n \"data\": {\n \"id\": \"{{ dd_team.data.id }}\",\n \"type\": \"team\"\n }\n },\n \"sub_team\": {\n \"data\": {\n \"id\": \"{{ dd_team_2.data.id }}\",\n \"type\": \"team\"\n }\n }\n }\n }\n}" + } + ], + "step": "there is a valid \"team_hierarchy_link\" in the system", + "key": "team_hierarchy_link", + "tag": "Teams", + "operationId": "AddTeamHierarchyLink" + }, { "source": "data.data[0]", "step": "there is a valid \"team_connection\" in the system", diff --git a/features/v2/logs_restriction_queries.feature b/features/v2/logs_restriction_queries.feature new file mode 100644 index 000000000000..44d65b92fd5c --- /dev/null +++ b/features/v2/logs_restriction_queries.feature @@ -0,0 +1,287 @@ +@endpoint(logs-restriction-queries) @endpoint(logs-restriction-queries-v2) +Feature: Logs Restriction Queries + **Note: This endpoint is in public beta. If you have any feedback, contact + [Datadog support](https://docs.datadoghq.com/help/).** A Restriction + Query is a logs query that restricts which logs the `logs_read_data` + permission grants read access to. For users whose roles have Restriction + Queries, any log query they make only returns those log events that also + match one of their Restriction Queries. This is true whether the user + queries log events from any log-related feature, including the log + explorer, Live Tail, re-hydration, or a dashboard widget. Restriction + Queries currently only support use of the following components of log + events: - Reserved attributes - The log message - Tags To restrict read + access on log data, add a team tag to log events to indicate which teams + own them, and then scope Restriction Queries to the relevant values of the + team tag. Tags can be applied to log events in many ways, and a log event + can have multiple tags with the same key (like team) and different values. + This means the same log event can be visible to roles whose restriction + queries are scoped to different team values. See [How to Set Up RBAC for + Logs](https://docs.datadoghq.com/logs/guide/logs-rbac/?tab=api#restrict- + access-to-logs) for details on how to add restriction queries. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "LogsRestrictionQueries" API + + @skip-go @skip-java @skip-python @skip-ruby @skip-rust @skip-terraform-config @skip-typescript @skip-validation @team:DataDog/logs-app + Scenario: Create a restriction query returns "Bad Request" response + Given operation "CreateRestrictionQuery" enabled + And new "CreateRestrictionQuery" request + And body with value {"test": "bad_request"} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/logs-app + Scenario: Create a restriction query returns "OK" response + Given operation "CreateRestrictionQuery" enabled + And new "CreateRestrictionQuery" request + And body with value {"data": {"attributes": {"restriction_query": "env:sandbox"}, "type": "logs_restriction_queries"}} + When the request is sent + Then the response status is 200 OK + + @skip-terraform-config @team:DataDog/logs-app + Scenario: Delete a restriction query returns "Bad Request" response + Given operation "DeleteRestrictionQuery" enabled + And new "DeleteRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "malformed_id" + When the request is sent + Then the response status is 400 Bad Request + + @skip-terraform-config @team:DataDog/logs-app + Scenario: Delete a restriction query returns "Not found" response + Given operation "DeleteRestrictionQuery" enabled + And new "DeleteRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "00000000-0000-0000-0000-000000000000" + When the request is sent + Then the response status is 404 Not found + + @team:DataDog/logs-app + Scenario: Delete a restriction query returns "OK" response + Given operation "DeleteRestrictionQuery" enabled + And there is a valid "restriction_query" in the system + And new "DeleteRestrictionQuery" request + And request contains "restriction_query_id" parameter from "restriction_query.data.id" + When the request is sent + Then the response status is 204 OK + + @skip-terraform-config @team:DataDog/logs-app + Scenario: Get a restriction query returns "Bad Request" response + Given operation "GetRestrictionQuery" enabled + And new "GetRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "malformed_id" + When the request is sent + Then the response status is 400 Bad Request + + @skip-terraform-config @team:DataDog/logs-app + Scenario: Get a restriction query returns "Not found" response + Given operation "GetRestrictionQuery" enabled + And new "GetRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "00000000-0000-0000-0000-000000000000" + When the request is sent + Then the response status is 404 Not found + + @team:DataDog/logs-app + Scenario: Get a restriction query returns "OK" response + Given operation "GetRestrictionQuery" enabled + And there is a valid "restriction_query" in the system + And new "GetRestrictionQuery" request + And request contains "restriction_query_id" parameter from "restriction_query.data.id" + When the request is sent + Then the response status is 200 OK + + @skip-terraform-config @team:DataDog/logs-app + Scenario: Get all restriction queries for a given user returns "Bad Request" response + Given operation "ListUserRestrictionQueries" enabled + And new "ListUserRestrictionQueries" request + And request contains "user_id" parameter with value "malformed_id" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/logs-app + Scenario: Get all restriction queries for a given user returns "Not found" response + Given operation "ListUserRestrictionQueries" enabled + And new "ListUserRestrictionQueries" request + And request contains "user_id" parameter with value "00000000-0000-0000-0000-000000000000" + When the request is sent + Then the response status is 400 Bad Request + + @skip @team:DataDog/logs-app + Scenario: Get all restriction queries for a given user returns "OK" response + Given operation "ListUserRestrictionQueries" enabled + And there is a valid "user" in the system + And new "ListUserRestrictionQueries" request + And request contains "user_id" parameter from "user.data.id" + When the request is sent + Then the response status is 200 OK + + @skip-terraform-config @team:DataDog/logs-app + Scenario: Get restriction query for a given role returns "Bad Request" response + Given operation "GetRoleRestrictionQuery" enabled + And new "GetRoleRestrictionQuery" request + And request contains "role_id" parameter with value "malformed_id" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/logs-app + Scenario: Get restriction query for a given role returns "Not found" response + Given operation "GetRoleRestrictionQuery" enabled + And new "GetRoleRestrictionQuery" request + And request contains "role_id" parameter with value "00000000-0000-0000-0000-000000000000" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/logs-app + Scenario: Get restriction query for a given role returns "OK" response + Given operation "GetRoleRestrictionQuery" enabled + And there is a valid "role" in the system + And new "GetRoleRestrictionQuery" request + And request contains "role_id" parameter from "role.data.id" + When the request is sent + Then the response status is 200 OK + + @skip-terraform-config @team:DataDog/logs-app + Scenario: Grant role to a restriction query returns "Bad Request" response + Given operation "AddRoleToRestrictionQuery" enabled + And new "AddRoleToRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "malformed_id" + And body with value {"data": {"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "type": "roles"}} + When the request is sent + Then the response status is 404 Not found + + @skip-terraform-config @team:DataDog/logs-app + Scenario: Grant role to a restriction query returns "Not found" response + Given operation "AddRoleToRestrictionQuery" enabled + And new "AddRoleToRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "00000000-0000-0000-0000-000000000000" + And body with value {"data": {"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "type": "roles"}} + When the request is sent + Then the response status is 404 Not found + + @team:DataDog/logs-app + Scenario: Grant role to a restriction query returns "OK" response + Given operation "AddRoleToRestrictionQuery" enabled + And there is a valid "restriction_query" in the system + And there is a valid "role" in the system + And new "AddRoleToRestrictionQuery" request + And request contains "restriction_query_id" parameter from "restriction_query.data.id" + And body with value {"data": {"id": "{{ role.data.id }}", "type": "roles"}} + When the request is sent + Then the response status is 204 OK + + @skip-terraform-config @team:DataDog/logs-app + Scenario: List restriction queries returns "OK" response + Given operation "ListRestrictionQueries" enabled + And new "ListRestrictionQueries" request + When the request is sent + Then the response status is 200 OK + + @skip-terraform-config @team:DataDog/logs-app + Scenario: List roles for a restriction query returns "Bad Request" response + Given operation "ListRestrictionQueryRoles" enabled + And new "ListRestrictionQueryRoles" request + And request contains "restriction_query_id" parameter with value "malformed_id" + When the request is sent + Then the response status is 400 Bad Request + + @skip-terraform-config @team:DataDog/logs-app + Scenario: List roles for a restriction query returns "Not found" response + Given operation "ListRestrictionQueryRoles" enabled + And new "ListRestrictionQueryRoles" request + And request contains "restriction_query_id" parameter with value "00000000-0000-0000-0000-000000000000" + When the request is sent + Then the response status is 404 Not found + + @team:DataDog/logs-app + Scenario: List roles for a restriction query returns "OK" response + Given operation "ListRestrictionQueryRoles" enabled + And there is a valid "restriction_query" in the system + And new "ListRestrictionQueryRoles" request + And request contains "restriction_query_id" parameter from "restriction_query.data.id" + When the request is sent + Then the response status is 200 OK + + @skip @team:DataDog/logs-app + Scenario: Replace a restriction query returns "Bad Request" response + Given operation "ReplaceRestrictionQuery" enabled + And new "ReplaceRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "malformed_id" + And body with value {"data": {"attributes": {"restriction_query": "env:sandbox"}, "type": "logs_restriction_queries"}} + When the request is sent + Then the response status is 400 Bad Request + + @skip @team:DataDog/logs-app + Scenario: Replace a restriction query returns "Not found" response + Given operation "ReplaceRestrictionQuery" enabled + And new "ReplaceRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "00000000-0000-0000-0000-000000000000" + And body with value {"data": {"attributes": {"restriction_query": "env:sandbox"}, "type": "logs_restriction_queries"}} + When the request is sent + Then the response status is 404 Not found + + @skip @team:DataDog/logs-app + Scenario: Replace a restriction query returns "OK" response + Given operation "ReplaceRestrictionQuery" enabled + And there is a valid "restriction_query" in the system + And new "ReplaceRestrictionQuery" request + And request contains "restriction_query_id" parameter from "restriction_query.data.id" + And body with value {"data": {"attributes": {"restriction_query": "env:staging"}, "type": "logs_restriction_queries"}} + When the request is sent + Then the response status is 200 OK + + @skip @skip-terraform-config @team:DataDog/logs-app + Scenario: Revoke role from a restriction query returns "Bad Request" response + Given operation "RemoveRoleFromRestrictionQuery" enabled + And new "RemoveRoleFromRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "malformed_id" + And body with value {"data": {"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "type": "roles"}} + When the request is sent + Then the response status is 400 Bad Request + + @skip @skip-terraform-config @team:DataDog/logs-app + Scenario: Revoke role from a restriction query returns "Not found" response + Given operation "RemoveRoleFromRestrictionQuery" enabled + And new "RemoveRoleFromRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "00000000-0000-0000-0000-000000000000" + And body with value {"data": {"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "type": "roles"}} + When the request is sent + Then the response status is 404 Not found + + @skip @team:DataDog/logs-app + Scenario: Revoke role from a restriction query returns "OK" response + Given operation "RemoveRoleFromRestrictionQuery" enabled + And there is a valid "restriction_query" in the system + And there is a valid "role" in the system + And new "RemoveRoleFromRestrictionQuery" request + And request contains "restriction_query_id" parameter from "restriction_query.data.id" + And body with value {"data": {"id": "{{ role.data.id }}", "type": "roles"}} + When the request is sent + Then the response status is 204 OK + + @skip @skip-terraform-config @team:DataDog/logs-app + Scenario: Update a restriction query returns "Bad Request" response + Given operation "UpdateRestrictionQuery" enabled + And new "UpdateRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "malformed_id" + And body with value {"data": {"attributes": {"restriction_query": "env:sandbox"}, "type": "logs_restriction_queries"}} + When the request is sent + Then the response status is 400 Bad Request + + @skip @skip-terraform-config @team:DataDog/logs-app + Scenario: Update a restriction query returns "Not found" response + Given operation "UpdateRestrictionQuery" enabled + And new "UpdateRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "00000000-0000-0000-0000-000000000000" + And body with value {"data": {"attributes": {"restriction_query": "env:sandbox"}, "type": "logs_restriction_queries"}} + When the request is sent + Then the response status is 404 Not found + + @skip @team:DataDog/logs-app + Scenario: Update a restriction query returns "OK" response + Given operation "UpdateRestrictionQuery" enabled + And there is a valid "restriction_query" in the system + And new "UpdateRestrictionQuery" request + And request contains "restriction_query_id" parameter from "restriction_query.data.id" + And body with value {"data": {"attributes": {"restriction_query": "env:production"}, "type": "logs_restriction_queries"}} + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/teams.feature b/features/v2/teams.feature index bf11bd0316d6..faa1ca0889d5 100644 --- a/features/v2/teams.feature +++ b/features/v2/teams.feature @@ -43,6 +43,25 @@ Feature: Teams When the request is sent Then the response status is 200 Represents a user's association to a team + @team:DataDog/aaa-omg + Scenario: Create a team hierarchy link returns "Conflict" response + Given new "AddTeamHierarchyLink" request + And there is a valid "dd_team" in the system + And there is a valid "dd_team_2" in the system + And there is a valid "team_hierarchy_link" in the system + And body with value {"data": {"relationships": {"parent_team": {"data": {"id": "{{team_hierarchy_link.data.relationships.parent_team.data.id}}", "type": "team"}}, "sub_team": {"data": {"id": "{{team_hierarchy_link.data.relationships.sub_team.data.id}}", "type": "team"}}}, "type": "team_hierarchy_links"}} + When the request is sent + Then the response status is 409 Conflict + + @team:DataDog/aaa-omg + Scenario: Create a team hierarchy link returns "OK" response + Given new "AddTeamHierarchyLink" request + And there is a valid "dd_team" in the system + And there is a valid "dd_team_2" in the system + And body with value {"data": {"relationships": {"parent_team": {"data": {"id": "{{dd_team.data.id}}", "type": "team"}}, "sub_team": {"data": {"id": "{{dd_team_2.data.id}}", "type": "team"}}}, "type": "team_hierarchy_links"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/aaa-omg Scenario: Create a team link returns "API error response." response Given new "CreateTeamLink" request @@ -96,6 +115,28 @@ Feature: Teams And the response "data.attributes.visible_modules" is equal to ["m1","m2"] And the response "data.attributes.hidden_modules" is equal to ["m3"] + @team:DataDog/aaa-omg + Scenario: Get a team hierarchy link returns "API error response." response + Given new "GetTeamHierarchyLink" request + And request contains "link_id" parameter with value "aaa11111-aa11-aa11-aaaa-aaaaaa111111" + When the request is sent + Then the response status is 404 API error response. + + @team:DataDog/aaa-omg + Scenario: Get a team hierarchy link returns "OK" response + Given new "GetTeamHierarchyLink" request + And there is a valid "dd_team" in the system + And there is a valid "dd_team_2" in the system + And there is a valid "team_hierarchy_link" in the system + And request contains "link_id" parameter from "team_hierarchy_link.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "{{ team_hierarchy_link.data.id }}" + And the response "data.relationships.parent_team.data.id" is equal to "{{ dd_team.data.id }}" + And the response "data.relationships.sub_team.data.id" is equal to "{{ dd_team_2.data.id }}" + And the response "included" has item with field "id" with value "{{ dd_team.data.id }}" + And the response "included" has item with field "id" with value "{{ dd_team_2.data.id }}" + @team:DataDog/aaa-omg Scenario: Get a team link returns "API error response." response Given new "GetTeamLink" request @@ -211,6 +252,31 @@ Feature: Teams When the request is sent Then the response status is 200 OK + @team:DataDog/aaa-omg + Scenario: Get team hierarchy links returns "OK" response + Given new "ListTeamHierarchyLinks" request + And there is a valid "dd_team" in the system + And there is a valid "dd_team_2" in the system + And there is a valid "team_hierarchy_link" in the system + And request contains "filter[parent_team]" parameter from "team_hierarchy_link.data.relationships.parent_team.data.id" + And request contains "filter[sub_team]" parameter from "team_hierarchy_link.data.relationships.sub_team.data.id" + And request contains "page[number]" parameter with value 0 + And request contains "page[size]" parameter with value 100 + When the request is sent + Then the response status is 200 OK + And the response "data" has length 1 + And the response "data[0].id" is equal to "{{ team_hierarchy_link.data.id }}" + And the response "data[0].relationships.parent_team.data.id" is equal to "{{ dd_team.data.id }}" + And the response "data[0].relationships.sub_team.data.id" is equal to "{{ dd_team_2.data.id }}" + And the response "included" has item with field "id" with value "{{ dd_team.data.id }}" + And the response "included" has item with field "id" with value "{{ dd_team_2.data.id }}" + + @generated @skip @team:DataDog/aaa-omg @with-pagination + Scenario: Get team hierarchy links returns "OK" response with pagination + Given new "ListTeamHierarchyLinks" request + When the request with pagination is sent + Then the response status is 200 OK + @team:DataDog/aaa-omg Scenario: Get team memberships returns "API error response." response Given new "GetTeamMemberships" request @@ -293,6 +359,23 @@ Feature: Teams When the request is sent Then the response status is 204 No Content + @team:DataDog/aaa-omg + Scenario: Remove a team hierarchy link returns "API error response." response + Given new "RemoveTeamHierarchyLink" request + And request contains "link_id" parameter with value "aaa11111-aa11-aa11-aaaa-aaaaaa111111" + When the request is sent + Then the response status is 404 API error response. + + @team:DataDog/aaa-omg + Scenario: Remove a team hierarchy link returns "No Content" response + Given new "RemoveTeamHierarchyLink" request + And there is a valid "dd_team" in the system + And there is a valid "dd_team_2" in the system + And there is a valid "team_hierarchy_link" in the system + And request contains "link_id" parameter from "team_hierarchy_link.data.id" + When the request is sent + Then the response status is 204 No Content + @team:DataDog/aaa-omg Scenario: Remove a team link returns "API error response." response Given new "DeleteTeamLink" request diff --git a/features/v2/undo.json b/features/v2/undo.json index 3799e64e630d..7c226bf60d33 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -2443,6 +2443,79 @@ "type": "idempotent" } }, + "ListRestrictionQueries": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "safe" + } + }, + "CreateRestrictionQuery": { + "tag": "Logs Restriction Queries", + "undo": { + "operationId": "DeleteRestrictionQuery", + "parameters": [ + { + "name": "restriction_query_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "GetRoleRestrictionQuery": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "safe" + } + }, + "ListUserRestrictionQueries": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "safe" + } + }, + "DeleteRestrictionQuery": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "idempotent" + } + }, + "GetRestrictionQuery": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "safe" + } + }, + "UpdateRestrictionQuery": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "idempotent" + } + }, + "ReplaceRestrictionQuery": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "idempotent" + } + }, + "RemoveRoleFromRestrictionQuery": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "idempotent" + } + }, + "ListRestrictionQueryRoles": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "safe" + } + }, + "AddRoleToRestrictionQuery": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "safe" + } + }, "ListLogsGet": { "tag": "Logs", "undo": { @@ -4345,6 +4418,37 @@ "type": "unsafe" } }, + "ListTeamHierarchyLinks": { + "tag": "Teams", + "undo": { + "type": "safe" + } + }, + "AddTeamHierarchyLink": { + "tag": "Teams", + "undo": { + "operationId": "RemoveTeamHierarchyLink", + "parameters": [ + { + "name": "link_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "RemoveTeamHierarchyLink": { + "tag": "Teams", + "undo": { + "type": "idempotent" + } + }, + "GetTeamHierarchyLink": { + "tag": "Teams", + "undo": { + "type": "safe" + } + }, "DeleteTeamConnections": { "tag": "Team Connections", "undo": { diff --git a/packages/datadog-api-client-common/configuration.ts b/packages/datadog-api-client-common/configuration.ts index 89150931a146..d41aa2d59ddd 100644 --- a/packages/datadog-api-client-common/configuration.ts +++ b/packages/datadog-api-client-common/configuration.ts @@ -312,6 +312,17 @@ export function createConfiguration( "v2.updateIncidentNotificationTemplate": false, "v2.updateIncidentTodo": false, "v2.updateIncidentType": false, + "v2.addRoleToRestrictionQuery": false, + "v2.createRestrictionQuery": false, + "v2.deleteRestrictionQuery": false, + "v2.getRestrictionQuery": false, + "v2.getRoleRestrictionQuery": false, + "v2.listRestrictionQueries": false, + "v2.listRestrictionQueryRoles": false, + "v2.listUserRestrictionQueries": false, + "v2.removeRoleFromRestrictionQuery": false, + "v2.replaceRestrictionQuery": false, + "v2.updateRestrictionQuery": false, "v2.createMonitorUserTemplate": false, "v2.deleteMonitorUserTemplate": false, "v2.getMonitorUserTemplate": false, diff --git a/packages/datadog-api-client-v2/apis/LogsRestrictionQueriesApi.ts b/packages/datadog-api-client-v2/apis/LogsRestrictionQueriesApi.ts new file mode 100644 index 000000000000..4adf8155adb9 --- /dev/null +++ b/packages/datadog-api-client-v2/apis/LogsRestrictionQueriesApi.ts @@ -0,0 +1,1645 @@ +import { + BaseAPIRequestFactory, + RequiredError, +} from "../../datadog-api-client-common/baseapi"; +import { + Configuration, + applySecurityAuthentication, +} from "../../datadog-api-client-common/configuration"; +import { + RequestContext, + HttpMethod, + ResponseContext, +} from "../../datadog-api-client-common/http/http"; + +import { logger } from "../../../logger"; +import { ObjectSerializer } from "../models/ObjectSerializer"; +import { ApiException } from "../../datadog-api-client-common/exception"; + +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"; + +export class LogsRestrictionQueriesApiRequestFactory extends BaseAPIRequestFactory { + public async addRoleToRestrictionQuery( + restrictionQueryId: string, + body: RelationshipToRole, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'addRoleToRestrictionQuery'"); + if (!_config.unstableOperations["v2.addRoleToRestrictionQuery"]) { + throw new Error( + "Unstable operation 'addRoleToRestrictionQuery' is disabled" + ); + } + + // 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 requestContext = _config + .getServer("v2.LogsRestrictionQueriesApi.addRoleToRestrictionQuery") + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "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; + + logger.warn("Using unstable operation 'createRestrictionQuery'"); + if (!_config.unstableOperations["v2.createRestrictionQuery"]) { + throw new Error( + "Unstable operation 'createRestrictionQuery' is disabled" + ); + } + + // 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 requestContext = _config + .getServer("v2.LogsRestrictionQueriesApi.createRestrictionQuery") + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "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; + + logger.warn("Using unstable operation 'deleteRestrictionQuery'"); + if (!_config.unstableOperations["v2.deleteRestrictionQuery"]) { + throw new Error( + "Unstable operation 'deleteRestrictionQuery' is disabled" + ); + } + + // 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 requestContext = _config + .getServer("v2.LogsRestrictionQueriesApi.deleteRestrictionQuery") + .makeRequestContext(localVarPath, HttpMethod.DELETE); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async getRestrictionQuery( + restrictionQueryId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'getRestrictionQuery'"); + if (!_config.unstableOperations["v2.getRestrictionQuery"]) { + throw new Error("Unstable operation 'getRestrictionQuery' is disabled"); + } + + // 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 requestContext = _config + .getServer("v2.LogsRestrictionQueriesApi.getRestrictionQuery") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async getRoleRestrictionQuery( + roleId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'getRoleRestrictionQuery'"); + if (!_config.unstableOperations["v2.getRoleRestrictionQuery"]) { + throw new Error( + "Unstable operation 'getRoleRestrictionQuery' is disabled" + ); + } + + // 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 requestContext = _config + .getServer("v2.LogsRestrictionQueriesApi.getRoleRestrictionQuery") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // 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; + + logger.warn("Using unstable operation 'listRestrictionQueries'"); + if (!_config.unstableOperations["v2.listRestrictionQueries"]) { + throw new Error( + "Unstable operation 'listRestrictionQueries' is disabled" + ); + } + + // Path Params + const localVarPath = "/api/v2/logs/config/restriction_queries"; + + // Make Request Context + const requestContext = _config + .getServer("v2.LogsRestrictionQueriesApi.listRestrictionQueries") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (pageSize !== undefined) { + requestContext.setQueryParam( + "page[size]", + ObjectSerializer.serialize(pageSize, "number", "int64"), + "" + ); + } + if (pageNumber !== undefined) { + requestContext.setQueryParam( + "page[number]", + ObjectSerializer.serialize(pageNumber, "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; + + logger.warn("Using unstable operation 'listRestrictionQueryRoles'"); + if (!_config.unstableOperations["v2.listRestrictionQueryRoles"]) { + throw new Error( + "Unstable operation 'listRestrictionQueryRoles' is disabled" + ); + } + + // 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 requestContext = _config + .getServer("v2.LogsRestrictionQueriesApi.listRestrictionQueryRoles") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (pageSize !== undefined) { + requestContext.setQueryParam( + "page[size]", + ObjectSerializer.serialize(pageSize, "number", "int64"), + "" + ); + } + if (pageNumber !== undefined) { + requestContext.setQueryParam( + "page[number]", + ObjectSerializer.serialize(pageNumber, "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; + + logger.warn("Using unstable operation 'listUserRestrictionQueries'"); + if (!_config.unstableOperations["v2.listUserRestrictionQueries"]) { + throw new Error( + "Unstable operation 'listUserRestrictionQueries' is disabled" + ); + } + + // 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 requestContext = _config + .getServer("v2.LogsRestrictionQueriesApi.listUserRestrictionQueries") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // 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; + + logger.warn("Using unstable operation 'removeRoleFromRestrictionQuery'"); + if (!_config.unstableOperations["v2.removeRoleFromRestrictionQuery"]) { + throw new Error( + "Unstable operation 'removeRoleFromRestrictionQuery' is disabled" + ); + } + + // 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 requestContext = _config + .getServer("v2.LogsRestrictionQueriesApi.removeRoleFromRestrictionQuery") + .makeRequestContext(localVarPath, HttpMethod.DELETE); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "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; + + logger.warn("Using unstable operation 'replaceRestrictionQuery'"); + if (!_config.unstableOperations["v2.replaceRestrictionQuery"]) { + throw new Error( + "Unstable operation 'replaceRestrictionQuery' is disabled" + ); + } + + // 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 requestContext = _config + .getServer("v2.LogsRestrictionQueriesApi.replaceRestrictionQuery") + .makeRequestContext(localVarPath, HttpMethod.PUT); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "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; + + logger.warn("Using unstable operation 'updateRestrictionQuery'"); + if (!_config.unstableOperations["v2.updateRestrictionQuery"]) { + throw new Error( + "Unstable operation 'updateRestrictionQuery' is disabled" + ); + } + + // 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 requestContext = _config + .getServer("v2.LogsRestrictionQueriesApi.updateRestrictionQuery") + .makeRequestContext(localVarPath, HttpMethod.PATCH); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "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 = ObjectSerializer.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 = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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 = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: RestrictionQueryWithoutRelationshipsResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "RestrictionQueryWithoutRelationshipsResponse" + ) as RestrictionQueryWithoutRelationshipsResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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 = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "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 = ObjectSerializer.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 = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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 = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: RestrictionQueryWithRelationshipsResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "RestrictionQueryWithRelationshipsResponse" + ) as RestrictionQueryWithRelationshipsResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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 = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "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 = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: RestrictionQueryListResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "RestrictionQueryListResponse" + ) as RestrictionQueryListResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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 = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "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 = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: RestrictionQueryListResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "RestrictionQueryListResponse" + ) as RestrictionQueryListResponse; + return body; + } + if (response.httpStatusCode === 403 || response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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 = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "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 = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: RestrictionQueryRolesResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "RestrictionQueryRolesResponse" + ) as RestrictionQueryRolesResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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 = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "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 = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: RestrictionQueryListResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "RestrictionQueryListResponse" + ) as RestrictionQueryListResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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 = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "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 = ObjectSerializer.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 = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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 = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: RestrictionQueryWithoutRelationshipsResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "RestrictionQueryWithoutRelationshipsResponse" + ) as RestrictionQueryWithoutRelationshipsResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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 = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "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 = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: RestrictionQueryWithoutRelationshipsResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "RestrictionQueryWithoutRelationshipsResponse" + ) as RestrictionQueryWithoutRelationshipsResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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 = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "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; + + public constructor( + configuration: Configuration, + requestFactory?: LogsRestrictionQueriesApiRequestFactory, + responseProcessor?: LogsRestrictionQueriesApiResponseProcessor + ) { + this.configuration = configuration; + this.requestFactory = + requestFactory || + new LogsRestrictionQueriesApiRequestFactory(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/packages/datadog-api-client-v2/apis/TeamsApi.ts b/packages/datadog-api-client-v2/apis/TeamsApi.ts index 182850b2c905..a09d88a2dfd0 100644 --- a/packages/datadog-api-client-v2/apis/TeamsApi.ts +++ b/packages/datadog-api-client-v2/apis/TeamsApi.ts @@ -23,6 +23,10 @@ import { ListTeamsInclude } from "../models/ListTeamsInclude"; import { ListTeamsSort } from "../models/ListTeamsSort"; import { Team } from "../models/Team"; import { TeamCreateRequest } from "../models/TeamCreateRequest"; +import { TeamHierarchyLink } from "../models/TeamHierarchyLink"; +import { TeamHierarchyLinkCreateRequest } from "../models/TeamHierarchyLinkCreateRequest"; +import { TeamHierarchyLinkResponse } from "../models/TeamHierarchyLinkResponse"; +import { TeamHierarchyLinksResponse } from "../models/TeamHierarchyLinksResponse"; import { TeamLinkCreateRequest } from "../models/TeamLinkCreateRequest"; import { TeamLinkResponse } from "../models/TeamLinkResponse"; import { TeamLinksResponse } from "../models/TeamLinksResponse"; @@ -99,6 +103,48 @@ export class TeamsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async addTeamHierarchyLink( + body: TeamHierarchyLinkCreateRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "addTeamHierarchyLink"); + } + + // Path Params + const localVarPath = "/api/v2/team-hierarchy-links"; + + // Make Request Context + const requestContext = _config + .getServer("v2.TeamsApi.addTeamHierarchyLink") + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "TeamHierarchyLinkCreateRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async createTeam( body: TeamCreateRequest, _options?: Configuration @@ -389,6 +435,40 @@ export class TeamsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async getTeamHierarchyLink( + linkId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'linkId' is not null or undefined + if (linkId === null || linkId === undefined) { + throw new RequiredError("linkId", "getTeamHierarchyLink"); + } + + // Path Params + const localVarPath = "/api/v2/team-hierarchy-links/{link_id}".replace( + "{link_id}", + encodeURIComponent(String(linkId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.TeamsApi.getTeamHierarchyLink") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async getTeamLink( teamId: string, linkId: string, @@ -712,6 +792,65 @@ export class TeamsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async listTeamHierarchyLinks( + pageNumber?: number, + pageSize?: number, + filterParentTeam?: string, + filterSubTeam?: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // Path Params + const localVarPath = "/api/v2/team-hierarchy-links"; + + // Make Request Context + const requestContext = _config + .getServer("v2.TeamsApi.listTeamHierarchyLinks") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (pageNumber !== undefined) { + requestContext.setQueryParam( + "page[number]", + ObjectSerializer.serialize(pageNumber, "number", "int64"), + "" + ); + } + if (pageSize !== undefined) { + requestContext.setQueryParam( + "page[size]", + ObjectSerializer.serialize(pageSize, "number", "int64"), + "" + ); + } + if (filterParentTeam !== undefined) { + requestContext.setQueryParam( + "filter[parent_team]", + ObjectSerializer.serialize(filterParentTeam, "string", ""), + "" + ); + } + if (filterSubTeam !== undefined) { + requestContext.setQueryParam( + "filter[sub_team]", + ObjectSerializer.serialize(filterSubTeam, "string", ""), + "" + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async listTeams( pageNumber?: number, pageSize?: number, @@ -840,6 +979,40 @@ export class TeamsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async removeTeamHierarchyLink( + linkId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'linkId' is not null or undefined + if (linkId === null || linkId === undefined) { + throw new RequiredError("linkId", "removeTeamHierarchyLink"); + } + + // Path Params + const localVarPath = "/api/v2/team-hierarchy-links/{link_id}".replace( + "{link_id}", + encodeURIComponent(String(linkId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.TeamsApi.removeTeamHierarchyLink") + .makeRequestContext(localVarPath, HttpMethod.DELETE); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async syncTeams( body: TeamSyncRequest, _options?: Configuration @@ -1163,6 +1336,68 @@ export class TeamsApiResponseProcessor { ); } + /** + * 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 addTeamHierarchyLink + * @throws ApiException if the response code was not in [200, 299] + */ + public async addTeamHierarchyLink( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: TeamHierarchyLinkResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "TeamHierarchyLinkResponse" + ) as TeamHierarchyLinkResponse; + return body; + } + if ( + response.httpStatusCode === 403 || + response.httpStatusCode === 409 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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: TeamHierarchyLinkResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "TeamHierarchyLinkResponse", + "" + ) as TeamHierarchyLinkResponse; + 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 @@ -1562,6 +1797,68 @@ export class TeamsApiResponseProcessor { ); } + /** + * 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 getTeamHierarchyLink + * @throws ApiException if the response code was not in [200, 299] + */ + public async getTeamHierarchyLink( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: TeamHierarchyLinkResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "TeamHierarchyLinkResponse" + ) as TeamHierarchyLinkResponse; + return body; + } + if ( + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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: TeamHierarchyLinkResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "TeamHierarchyLinkResponse", + "" + ) as TeamHierarchyLinkResponse; + 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 @@ -1992,6 +2289,64 @@ export class TeamsApiResponseProcessor { ); } + /** + * 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 listTeamHierarchyLinks + * @throws ApiException if the response code was not in [200, 299] + */ + public async listTeamHierarchyLinks( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: TeamHierarchyLinksResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "TeamHierarchyLinksResponse" + ) as TeamHierarchyLinksResponse; + return body; + } + if (response.httpStatusCode === 403 || response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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: TeamHierarchyLinksResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "TeamHierarchyLinksResponse", + "" + ) as TeamHierarchyLinksResponse; + 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 @@ -2099,6 +2454,59 @@ export class TeamsApiResponseProcessor { ); } + /** + * 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 removeTeamHierarchyLink + * @throws ApiException if the response code was not in [200, 299] + */ + public async removeTeamHierarchyLink( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 204) { + return; + } + if ( + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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 @@ -2411,6 +2819,13 @@ export interface TeamsApiAddMemberTeamRequest { body: AddMemberTeamRequest; } +export interface TeamsApiAddTeamHierarchyLinkRequest { + /** + * @type TeamHierarchyLinkCreateRequest + */ + body: TeamHierarchyLinkCreateRequest; +} + export interface TeamsApiCreateTeamRequest { /** * @type TeamCreateRequest @@ -2484,6 +2899,14 @@ export interface TeamsApiGetTeamRequest { teamId: string; } +export interface TeamsApiGetTeamHierarchyLinkRequest { + /** + * The team hierarchy link's identifier + * @type string + */ + linkId: string; +} + export interface TeamsApiGetTeamLinkRequest { /** * None @@ -2580,6 +3003,29 @@ export interface TeamsApiListMemberTeamsRequest { fieldsTeam?: Array; } +export interface TeamsApiListTeamHierarchyLinksRequest { + /** + * Specific page number to return. + * @type number + */ + pageNumber?: number; + /** + * Size for a given page. The maximum allowed value is 100. + * @type number + */ + pageSize?: number; + /** + * Filter by parent team ID + * @type string + */ + filterParentTeam?: string; + /** + * Filter by sub team ID + * @type string + */ + filterSubTeam?: string; +} + export interface TeamsApiListTeamsRequest { /** * Specific page number to return. @@ -2631,6 +3077,14 @@ export interface TeamsApiRemoveMemberTeamRequest { memberTeamId: string; } +export interface TeamsApiRemoveTeamHierarchyLinkRequest { + /** + * The team hierarchy link's identifier + * @type string + */ + linkId: string; +} + export interface TeamsApiSyncTeamsRequest { /** * @type TeamSyncRequest @@ -2721,6 +3175,8 @@ export class TeamsApi { /** * Add a member team. * Adds the team given by the `id` in the body as a member team of the super team. + * + * **Note**: This API is deprecated. For creating team hierarchy links, use the team hierarchy links API: `POST /api/v2/team-hierarchy-links`. * @param param The request object */ public addMemberTeam( @@ -2741,6 +3197,27 @@ export class TeamsApi { }); } + /** + * Create a new team hierarchy link between a parent team and a sub team. + * @param param The request object + */ + public addTeamHierarchyLink( + param: TeamsApiAddTeamHierarchyLinkRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.addTeamHierarchyLink( + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.addTeamHierarchyLink(responseContext); + }); + }); + } + /** * Create a new team. * User IDs passed through the `users` relationship field are added to the team. @@ -2893,6 +3370,27 @@ export class TeamsApi { }); } + /** + * Get a single team hierarchy link for the given link_id. + * @param param The request object + */ + public getTeamHierarchyLink( + param: TeamsApiGetTeamHierarchyLinkRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.getTeamHierarchyLink( + param.linkId, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getTeamHierarchyLink(responseContext); + }); + }); + } + /** * Get a single link for a team. * @param param The request object @@ -3073,6 +3571,9 @@ export class TeamsApi { /** * Get all member teams. + * + * **Note**: This API is deprecated. For team hierarchy relationships (parent-child + * teams), use the team hierarchy links API: `GET /api/v2/team-hierarchy-links`. * @param param The request object */ public listMemberTeams( @@ -3138,6 +3639,73 @@ export class TeamsApi { } } + /** + * List all team hierarchy links that match the provided filters. + * @param param The request object + */ + public listTeamHierarchyLinks( + param: TeamsApiListTeamHierarchyLinksRequest = {}, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.listTeamHierarchyLinks( + param.pageNumber, + param.pageSize, + param.filterParentTeam, + param.filterSubTeam, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listTeamHierarchyLinks(responseContext); + }); + }); + } + + /** + * Provide a paginated version of listTeamHierarchyLinks returning a generator with all the items. + */ + public async *listTeamHierarchyLinksWithPagination( + param: TeamsApiListTeamHierarchyLinksRequest = {}, + options?: Configuration + ): AsyncGenerator { + let pageSize = 10; + if (param.pageSize !== undefined) { + pageSize = param.pageSize; + } + param.pageSize = pageSize; + param.pageNumber = 0; + while (true) { + const requestContext = await this.requestFactory.listTeamHierarchyLinks( + param.pageNumber, + param.pageSize, + param.filterParentTeam, + param.filterSubTeam, + options + ); + const responseContext = await this.configuration.httpApi.send( + requestContext + ); + + const response = await this.responseProcessor.listTeamHierarchyLinks( + responseContext + ); + const responseData = response.data; + if (responseData === undefined) { + break; + } + const results = responseData; + for (const item of results) { + yield item; + } + if (results.length < pageSize) { + break; + } + param.pageNumber = param.pageNumber + 1; + } + } + /** * Get all teams. * Can be used to search for teams using the `filter[keyword]` and `filter[me]` query parameters. @@ -3212,6 +3780,8 @@ export class TeamsApi { /** * Remove a super team's member team identified by `member_team_id`. + * + * **Note**: This API is deprecated. For deleting team hierarchy links, use the team hierarchy links API: `DELETE /api/v2/team-hierarchy-links/{link_id}`. * @param param The request object */ public removeMemberTeam( @@ -3232,6 +3802,29 @@ export class TeamsApi { }); } + /** + * Remove a team hierarchy link by the given link_id. + * @param param The request object + */ + public removeTeamHierarchyLink( + param: TeamsApiRemoveTeamHierarchyLinkRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.removeTeamHierarchyLink( + param.linkId, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.removeTeamHierarchyLink( + responseContext + ); + }); + }); + } + /** * This endpoint attempts to link your existing Datadog teams with GitHub teams by matching their names. * It evaluates all current Datadog teams and compares them against teams in the GitHub organization diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index 00bee8317f47..13fdd69b64b0 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -490,6 +490,21 @@ export { LogsMetricsApi, } from "./apis/LogsMetricsApi"; +export { + LogsRestrictionQueriesApiAddRoleToRestrictionQueryRequest, + LogsRestrictionQueriesApiCreateRestrictionQueryRequest, + LogsRestrictionQueriesApiDeleteRestrictionQueryRequest, + LogsRestrictionQueriesApiGetRestrictionQueryRequest, + LogsRestrictionQueriesApiGetRoleRestrictionQueryRequest, + LogsRestrictionQueriesApiListRestrictionQueriesRequest, + LogsRestrictionQueriesApiListRestrictionQueryRolesRequest, + LogsRestrictionQueriesApiListUserRestrictionQueriesRequest, + LogsRestrictionQueriesApiRemoveRoleFromRestrictionQueryRequest, + LogsRestrictionQueriesApiReplaceRestrictionQueryRequest, + LogsRestrictionQueriesApiUpdateRestrictionQueryRequest, + LogsRestrictionQueriesApi, +} from "./apis/LogsRestrictionQueriesApi"; + export { MetricsApiCreateBulkTagsMetricsConfigurationRequest, MetricsApiCreateTagConfigurationRequest, @@ -870,6 +885,7 @@ export { export { TeamsApiAddMemberTeamRequest, + TeamsApiAddTeamHierarchyLinkRequest, TeamsApiCreateTeamRequest, TeamsApiCreateTeamLinkRequest, TeamsApiCreateTeamMembershipRequest, @@ -877,6 +893,7 @@ export { TeamsApiDeleteTeamLinkRequest, TeamsApiDeleteTeamMembershipRequest, TeamsApiGetTeamRequest, + TeamsApiGetTeamHierarchyLinkRequest, TeamsApiGetTeamLinkRequest, TeamsApiGetTeamLinksRequest, TeamsApiGetTeamMembershipsRequest, @@ -884,8 +901,10 @@ export { TeamsApiGetTeamSyncRequest, TeamsApiGetUserMembershipsRequest, TeamsApiListMemberTeamsRequest, + TeamsApiListTeamHierarchyLinksRequest, TeamsApiListTeamsRequest, TeamsApiRemoveMemberTeamRequest, + TeamsApiRemoveTeamHierarchyLinkRequest, TeamsApiSyncTeamsRequest, TeamsApiUpdateTeamRequest, TeamsApiUpdateTeamLinkRequest, @@ -2806,6 +2825,7 @@ export { LogsQueryFilter } from "./models/LogsQueryFilter"; export { LogsQueryOptions } from "./models/LogsQueryOptions"; export { LogsResponseMetadata } from "./models/LogsResponseMetadata"; export { LogsResponseMetadataPage } from "./models/LogsResponseMetadataPage"; +export { LogsRestrictionQueriesType } from "./models/LogsRestrictionQueriesType"; export { LogsSort } from "./models/LogsSort"; export { LogsSortOrder } from "./models/LogsSortOrder"; export { LogsStorageTier } from "./models/LogsStorageTier"; @@ -3523,6 +3543,22 @@ export { RestrictionPolicyBinding } from "./models/RestrictionPolicyBinding"; export { RestrictionPolicyResponse } from "./models/RestrictionPolicyResponse"; export { RestrictionPolicyType } from "./models/RestrictionPolicyType"; export { RestrictionPolicyUpdateRequest } from "./models/RestrictionPolicyUpdateRequest"; +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 { RetentionFilter } from "./models/RetentionFilter"; export { RetentionFilterAll } from "./models/RetentionFilterAll"; export { RetentionFilterAllAttributes } from "./models/RetentionFilterAllAttributes"; @@ -4195,6 +4231,20 @@ export { TeamCreate } from "./models/TeamCreate"; export { TeamCreateAttributes } from "./models/TeamCreateAttributes"; export { TeamCreateRelationships } from "./models/TeamCreateRelationships"; export { TeamCreateRequest } from "./models/TeamCreateRequest"; +export { TeamHierarchyLink } from "./models/TeamHierarchyLink"; +export { TeamHierarchyLinkAttributes } from "./models/TeamHierarchyLinkAttributes"; +export { TeamHierarchyLinkCreate } from "./models/TeamHierarchyLinkCreate"; +export { TeamHierarchyLinkCreateRelationships } from "./models/TeamHierarchyLinkCreateRelationships"; +export { TeamHierarchyLinkCreateRequest } from "./models/TeamHierarchyLinkCreateRequest"; +export { TeamHierarchyLinkCreateTeam } from "./models/TeamHierarchyLinkCreateTeam"; +export { TeamHierarchyLinkCreateTeamRelationship } from "./models/TeamHierarchyLinkCreateTeamRelationship"; +export { TeamHierarchyLinkRelationships } from "./models/TeamHierarchyLinkRelationships"; +export { TeamHierarchyLinkResponse } from "./models/TeamHierarchyLinkResponse"; +export { TeamHierarchyLinksResponse } from "./models/TeamHierarchyLinksResponse"; +export { TeamHierarchyLinkTeam } from "./models/TeamHierarchyLinkTeam"; +export { TeamHierarchyLinkTeamAttributes } from "./models/TeamHierarchyLinkTeamAttributes"; +export { TeamHierarchyLinkTeamRelationship } from "./models/TeamHierarchyLinkTeamRelationship"; +export { TeamHierarchyLinkType } from "./models/TeamHierarchyLinkType"; export { TeamIncluded } from "./models/TeamIncluded"; export { TeamLink } from "./models/TeamLink"; export { TeamLinkAttributes } from "./models/TeamLinkAttributes"; @@ -4247,6 +4297,9 @@ export { TeamRoutingRulesRequestDataAttributes } from "./models/TeamRoutingRules export { TeamRoutingRulesRequestDataType } from "./models/TeamRoutingRulesRequestDataType"; export { TeamRoutingRulesRequestRule } from "./models/TeamRoutingRulesRequestRule"; export { TeamsField } from "./models/TeamsField"; +export { TeamsHierarchyLinksResponseLinks } from "./models/TeamsHierarchyLinksResponseLinks"; +export { TeamsHierarchyLinksResponseMeta } from "./models/TeamsHierarchyLinksResponseMeta"; +export { TeamsHierarchyLinksResponseMetaPage } from "./models/TeamsHierarchyLinksResponseMetaPage"; export { TeamsResponse } from "./models/TeamsResponse"; export { TeamsResponseLinks } from "./models/TeamsResponseLinks"; export { TeamsResponseMeta } from "./models/TeamsResponseMeta"; diff --git a/packages/datadog-api-client-v2/models/LogsRestrictionQueriesType.ts b/packages/datadog-api-client-v2/models/LogsRestrictionQueriesType.ts new file mode 100644 index 000000000000..a0f096c5fc50 --- /dev/null +++ b/packages/datadog-api-client-v2/models/LogsRestrictionQueriesType.ts @@ -0,0 +1,16 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Restriction query resource type. + */ + +export type LogsRestrictionQueriesType = + | typeof LOGS_RESTRICTION_QUERIES + | UnparsedObject; +export const LOGS_RESTRICTION_QUERIES = "logs_restriction_queries"; diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index df5aaf40e489..c932daa46156 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -1960,6 +1960,21 @@ import { RestrictionPolicyAttributes } from "./RestrictionPolicyAttributes"; import { RestrictionPolicyBinding } from "./RestrictionPolicyBinding"; import { RestrictionPolicyResponse } from "./RestrictionPolicyResponse"; import { RestrictionPolicyUpdateRequest } from "./RestrictionPolicyUpdateRequest"; +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 { RetentionFilter } from "./RetentionFilter"; import { RetentionFilterAll } from "./RetentionFilterAll"; import { RetentionFilterAllAttributes } from "./RetentionFilterAllAttributes"; @@ -2429,6 +2444,19 @@ import { TeamCreate } from "./TeamCreate"; import { TeamCreateAttributes } from "./TeamCreateAttributes"; import { TeamCreateRelationships } from "./TeamCreateRelationships"; import { TeamCreateRequest } from "./TeamCreateRequest"; +import { TeamHierarchyLink } from "./TeamHierarchyLink"; +import { TeamHierarchyLinkAttributes } from "./TeamHierarchyLinkAttributes"; +import { TeamHierarchyLinkCreate } from "./TeamHierarchyLinkCreate"; +import { TeamHierarchyLinkCreateRelationships } from "./TeamHierarchyLinkCreateRelationships"; +import { TeamHierarchyLinkCreateRequest } from "./TeamHierarchyLinkCreateRequest"; +import { TeamHierarchyLinkCreateTeam } from "./TeamHierarchyLinkCreateTeam"; +import { TeamHierarchyLinkCreateTeamRelationship } from "./TeamHierarchyLinkCreateTeamRelationship"; +import { TeamHierarchyLinkRelationships } from "./TeamHierarchyLinkRelationships"; +import { TeamHierarchyLinkResponse } from "./TeamHierarchyLinkResponse"; +import { TeamHierarchyLinkTeam } from "./TeamHierarchyLinkTeam"; +import { TeamHierarchyLinkTeamAttributes } from "./TeamHierarchyLinkTeamAttributes"; +import { TeamHierarchyLinkTeamRelationship } from "./TeamHierarchyLinkTeamRelationship"; +import { TeamHierarchyLinksResponse } from "./TeamHierarchyLinksResponse"; import { TeamLink } from "./TeamLink"; import { TeamLinkAttributes } from "./TeamLinkAttributes"; import { TeamLinkCreate } from "./TeamLinkCreate"; @@ -2474,6 +2502,9 @@ import { TeamUpdate } from "./TeamUpdate"; import { TeamUpdateAttributes } from "./TeamUpdateAttributes"; import { TeamUpdateRelationships } from "./TeamUpdateRelationships"; import { TeamUpdateRequest } from "./TeamUpdateRequest"; +import { TeamsHierarchyLinksResponseLinks } from "./TeamsHierarchyLinksResponseLinks"; +import { TeamsHierarchyLinksResponseMeta } from "./TeamsHierarchyLinksResponseMeta"; +import { TeamsHierarchyLinksResponseMetaPage } from "./TeamsHierarchyLinksResponseMetaPage"; import { TeamsResponse } from "./TeamsResponse"; import { TeamsResponseLinks } from "./TeamsResponseLinks"; import { TeamsResponseMeta } from "./TeamsResponseMeta"; @@ -3399,6 +3430,7 @@ const enumsMap: { [key: string]: any[] } = { LogsMetricComputeAggregationType: ["count", "distribution"], LogsMetricResponseComputeAggregationType: ["count", "distribution"], LogsMetricType: ["logs_metrics"], + LogsRestrictionQueriesType: ["logs_restriction_queries"], LogsSort: ["timestamp", "-timestamp"], LogsSortOrder: ["asc", "desc"], LogsStorageTier: ["indexes", "online-archives", "flex"], @@ -4120,6 +4152,7 @@ const enumsMap: { [key: string]: any[] } = { TableResultV2DataType: ["reference_table"], TableRowResourceDataType: ["row"], TeamConnectionType: ["team_connection"], + TeamHierarchyLinkType: ["team_hierarchy_links"], TeamLinkType: ["team_links"], TeamOnCallRespondersDataRelationshipsEscalationsDataItemsType: [ "escalation_policy_steps", @@ -6625,6 +6658,23 @@ const typeMap: { [index: string]: any } = { RestrictionPolicyBinding: RestrictionPolicyBinding, RestrictionPolicyResponse: RestrictionPolicyResponse, RestrictionPolicyUpdateRequest: RestrictionPolicyUpdateRequest, + 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, RetentionFilter: RetentionFilter, RetentionFilterAll: RetentionFilterAll, RetentionFilterAllAttributes: RetentionFilterAllAttributes, @@ -7188,6 +7238,20 @@ const typeMap: { [index: string]: any } = { TeamCreateAttributes: TeamCreateAttributes, TeamCreateRelationships: TeamCreateRelationships, TeamCreateRequest: TeamCreateRequest, + TeamHierarchyLink: TeamHierarchyLink, + TeamHierarchyLinkAttributes: TeamHierarchyLinkAttributes, + TeamHierarchyLinkCreate: TeamHierarchyLinkCreate, + TeamHierarchyLinkCreateRelationships: TeamHierarchyLinkCreateRelationships, + TeamHierarchyLinkCreateRequest: TeamHierarchyLinkCreateRequest, + TeamHierarchyLinkCreateTeam: TeamHierarchyLinkCreateTeam, + TeamHierarchyLinkCreateTeamRelationship: + TeamHierarchyLinkCreateTeamRelationship, + TeamHierarchyLinkRelationships: TeamHierarchyLinkRelationships, + TeamHierarchyLinkResponse: TeamHierarchyLinkResponse, + TeamHierarchyLinkTeam: TeamHierarchyLinkTeam, + TeamHierarchyLinkTeamAttributes: TeamHierarchyLinkTeamAttributes, + TeamHierarchyLinkTeamRelationship: TeamHierarchyLinkTeamRelationship, + TeamHierarchyLinksResponse: TeamHierarchyLinksResponse, TeamLink: TeamLink, TeamLinkAttributes: TeamLinkAttributes, TeamLinkCreate: TeamLinkCreate, @@ -7239,6 +7303,9 @@ const typeMap: { [index: string]: any } = { TeamUpdateAttributes: TeamUpdateAttributes, TeamUpdateRelationships: TeamUpdateRelationships, TeamUpdateRequest: TeamUpdateRequest, + TeamsHierarchyLinksResponseLinks: TeamsHierarchyLinksResponseLinks, + TeamsHierarchyLinksResponseMeta: TeamsHierarchyLinksResponseMeta, + TeamsHierarchyLinksResponseMetaPage: TeamsHierarchyLinksResponseMetaPage, TeamsResponse: TeamsResponse, TeamsResponseLinks: TeamsResponseLinks, TeamsResponseMeta: TeamsResponseMeta, @@ -7833,6 +7900,7 @@ const oneOfMap: { [index: string]: string[] } = { ], RUMGroupByMissing: ["string", "number"], RUMGroupByTotal: ["boolean", "string", "number"], + RestrictionQueryResponseIncludedItem: ["RestrictionQueryRole"], RoutingRuleAction: ["SendSlackMessageAction", "SendTeamsMessageAction"], ScalarColumn: ["GroupScalarColumn", "DataScalarColumn"], ScalarQuery: ["MetricsScalarQuery", "EventsScalarQuery"], diff --git a/packages/datadog-api-client-v2/models/RestrictionQueryAttributes.ts b/packages/datadog-api-client-v2/models/RestrictionQueryAttributes.ts new file mode 100644 index 000000000000..9e973b420eb6 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RestrictionQueryAttributes.ts @@ -0,0 +1,104 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/RestrictionQueryCreateAttributes.ts b/packages/datadog-api-client-v2/models/RestrictionQueryCreateAttributes.ts new file mode 100644 index 000000000000..cd09f96defc4 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RestrictionQueryCreateAttributes.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/RestrictionQueryCreateData.ts b/packages/datadog-api-client-v2/models/RestrictionQueryCreateData.ts new file mode 100644 index 000000000000..fcebc569e4cf --- /dev/null +++ b/packages/datadog-api-client-v2/models/RestrictionQueryCreateData.ts @@ -0,0 +1,62 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { LogsRestrictionQueriesType } from "./LogsRestrictionQueriesType"; +import { RestrictionQueryCreateAttributes } from "./RestrictionQueryCreateAttributes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/RestrictionQueryCreatePayload.ts b/packages/datadog-api-client-v2/models/RestrictionQueryCreatePayload.ts new file mode 100644 index 000000000000..57fdc194ac5d --- /dev/null +++ b/packages/datadog-api-client-v2/models/RestrictionQueryCreatePayload.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RestrictionQueryCreateData } from "./RestrictionQueryCreateData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/RestrictionQueryListResponse.ts b/packages/datadog-api-client-v2/models/RestrictionQueryListResponse.ts new file mode 100644 index 000000000000..43c3359a770d --- /dev/null +++ b/packages/datadog-api-client-v2/models/RestrictionQueryListResponse.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RestrictionQueryWithoutRelationships } from "./RestrictionQueryWithoutRelationships"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/RestrictionQueryResponseIncludedItem.ts b/packages/datadog-api-client-v2/models/RestrictionQueryResponseIncludedItem.ts new file mode 100644 index 000000000000..4241a1ad6dcf --- /dev/null +++ b/packages/datadog-api-client-v2/models/RestrictionQueryResponseIncludedItem.ts @@ -0,0 +1,16 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RestrictionQueryRole } from "./RestrictionQueryRole"; + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * An object related to a restriction query. + */ + +export type RestrictionQueryResponseIncludedItem = + | RestrictionQueryRole + | UnparsedObject; diff --git a/packages/datadog-api-client-v2/models/RestrictionQueryRole.ts b/packages/datadog-api-client-v2/models/RestrictionQueryRole.ts new file mode 100644 index 000000000000..a2e15b3320c1 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RestrictionQueryRole.ts @@ -0,0 +1,73 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RestrictionQueryRoleAttribute } from "./RestrictionQueryRoleAttribute"; +import { RolesType } from "./RolesType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Partial role object. + */ +export class RestrictionQueryRole { + /** + * Attributes of the role for a restriction query. + */ + "attributes": RestrictionQueryRoleAttribute; + /** + * ID 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 = { + attributes: { + baseName: "attributes", + type: "RestrictionQueryRoleAttribute", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "RolesType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RestrictionQueryRole.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RestrictionQueryRoleAttribute.ts b/packages/datadog-api-client-v2/models/RestrictionQueryRoleAttribute.ts new file mode 100644 index 000000000000..7c5e418aef54 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RestrictionQueryRoleAttribute.ts @@ -0,0 +1,52 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/RestrictionQueryRolesResponse.ts b/packages/datadog-api-client-v2/models/RestrictionQueryRolesResponse.ts new file mode 100644 index 000000000000..f3b56104c247 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RestrictionQueryRolesResponse.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RestrictionQueryRole } from "./RestrictionQueryRole"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/RestrictionQueryUpdateAttributes.ts b/packages/datadog-api-client-v2/models/RestrictionQueryUpdateAttributes.ts new file mode 100644 index 000000000000..5981c30fb3db --- /dev/null +++ b/packages/datadog-api-client-v2/models/RestrictionQueryUpdateAttributes.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/RestrictionQueryUpdateData.ts b/packages/datadog-api-client-v2/models/RestrictionQueryUpdateData.ts new file mode 100644 index 000000000000..bed0081139d8 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RestrictionQueryUpdateData.ts @@ -0,0 +1,62 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { LogsRestrictionQueriesType } from "./LogsRestrictionQueriesType"; +import { RestrictionQueryUpdateAttributes } from "./RestrictionQueryUpdateAttributes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/RestrictionQueryUpdatePayload.ts b/packages/datadog-api-client-v2/models/RestrictionQueryUpdatePayload.ts new file mode 100644 index 000000000000..be0d40aefa7d --- /dev/null +++ b/packages/datadog-api-client-v2/models/RestrictionQueryUpdatePayload.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RestrictionQueryUpdateData } from "./RestrictionQueryUpdateData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/RestrictionQueryWithRelationships.ts b/packages/datadog-api-client-v2/models/RestrictionQueryWithRelationships.ts new file mode 100644 index 000000000000..ca1f6f759df7 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RestrictionQueryWithRelationships.ts @@ -0,0 +1,79 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { LogsRestrictionQueriesType } from "./LogsRestrictionQueriesType"; +import { RestrictionQueryAttributes } from "./RestrictionQueryAttributes"; +import { UserRelationships } from "./UserRelationships"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/RestrictionQueryWithRelationshipsResponse.ts b/packages/datadog-api-client-v2/models/RestrictionQueryWithRelationshipsResponse.ts new file mode 100644 index 000000000000..b34b32588668 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RestrictionQueryWithRelationshipsResponse.ts @@ -0,0 +1,62 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RestrictionQueryResponseIncludedItem } from "./RestrictionQueryResponseIncludedItem"; +import { RestrictionQueryWithRelationships } from "./RestrictionQueryWithRelationships"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/RestrictionQueryWithoutRelationships.ts b/packages/datadog-api-client-v2/models/RestrictionQueryWithoutRelationships.ts new file mode 100644 index 000000000000..e176f018b89d --- /dev/null +++ b/packages/datadog-api-client-v2/models/RestrictionQueryWithoutRelationships.ts @@ -0,0 +1,69 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RestrictionQueryAttributes } from "./RestrictionQueryAttributes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/RestrictionQueryWithoutRelationshipsResponse.ts b/packages/datadog-api-client-v2/models/RestrictionQueryWithoutRelationshipsResponse.ts new file mode 100644 index 000000000000..5a47caf6a906 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RestrictionQueryWithoutRelationshipsResponse.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { RestrictionQueryWithoutRelationships } from "./RestrictionQueryWithoutRelationships"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/TeamAttributes.ts b/packages/datadog-api-client-v2/models/TeamAttributes.ts index e99c17ae3138..58771d64dc0c 100644 --- a/packages/datadog-api-client-v2/models/TeamAttributes.ts +++ b/packages/datadog-api-client-v2/models/TeamAttributes.ts @@ -34,6 +34,10 @@ export class TeamAttributes { * Collection of hidden modules for the team */ "hiddenModules"?: Array; + /** + * Whether the team is managed from an external source + */ + "isManaged"?: boolean; /** * The number of links belonging to the team */ @@ -102,6 +106,10 @@ export class TeamAttributes { baseName: "hidden_modules", type: "Array", }, + isManaged: { + baseName: "is_managed", + type: "boolean", + }, linkCount: { baseName: "link_count", type: "number", diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyLink.ts b/packages/datadog-api-client-v2/models/TeamHierarchyLink.ts new file mode 100644 index 000000000000..070cb397907d --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyLink.ts @@ -0,0 +1,82 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamHierarchyLinkAttributes } from "./TeamHierarchyLinkAttributes"; +import { TeamHierarchyLinkRelationships } from "./TeamHierarchyLinkRelationships"; +import { TeamHierarchyLinkType } from "./TeamHierarchyLinkType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Team hierarchy link + */ +export class TeamHierarchyLink { + /** + * Team hierarchy link attributes + */ + "attributes": TeamHierarchyLinkAttributes; + /** + * The team hierarchy link's identifier + */ + "id": string; + /** + * Team hierarchy link relationships + */ + "relationships"?: TeamHierarchyLinkRelationships; + /** + * Team hierarchy link type + */ + "type": TeamHierarchyLinkType; + + /** + * 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: "TeamHierarchyLinkAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + relationships: { + baseName: "relationships", + type: "TeamHierarchyLinkRelationships", + }, + type: { + baseName: "type", + type: "TeamHierarchyLinkType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamHierarchyLink.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyLinkAttributes.ts b/packages/datadog-api-client-v2/models/TeamHierarchyLinkAttributes.ts new file mode 100644 index 000000000000..0efb82e581c4 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyLinkAttributes.ts @@ -0,0 +1,63 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Team hierarchy link attributes + */ +export class TeamHierarchyLinkAttributes { + /** + * Timestamp when the team hierarchy link was created + */ + "createdAt": Date; + /** + * The provisioner of the team hierarchy link + */ + "provisionedBy": 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 = { + createdAt: { + baseName: "created_at", + type: "Date", + required: true, + format: "date-time", + }, + provisionedBy: { + baseName: "provisioned_by", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamHierarchyLinkAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyLinkCreate.ts b/packages/datadog-api-client-v2/models/TeamHierarchyLinkCreate.ts new file mode 100644 index 000000000000..f4e6a5157efa --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyLinkCreate.ts @@ -0,0 +1,64 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamHierarchyLinkCreateRelationships } from "./TeamHierarchyLinkCreateRelationships"; +import { TeamHierarchyLinkType } from "./TeamHierarchyLinkType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data provided when creating a team hierarchy link + */ +export class TeamHierarchyLinkCreate { + /** + * The related teams that will be connected by the team hierarchy link + */ + "relationships": TeamHierarchyLinkCreateRelationships; + /** + * Team hierarchy link type + */ + "type": TeamHierarchyLinkType; + + /** + * 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 = { + relationships: { + baseName: "relationships", + type: "TeamHierarchyLinkCreateRelationships", + required: true, + }, + type: { + baseName: "type", + type: "TeamHierarchyLinkType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamHierarchyLinkCreate.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyLinkCreateRelationships.ts b/packages/datadog-api-client-v2/models/TeamHierarchyLinkCreateRelationships.ts new file mode 100644 index 000000000000..cb0a8385134f --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyLinkCreateRelationships.ts @@ -0,0 +1,63 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamHierarchyLinkCreateTeamRelationship } from "./TeamHierarchyLinkCreateTeamRelationship"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The related teams that will be connected by the team hierarchy link + */ +export class TeamHierarchyLinkCreateRelationships { + /** + * Data about each team that will be connected by the team hierarchy link + */ + "parentTeam": TeamHierarchyLinkCreateTeamRelationship; + /** + * Data about each team that will be connected by the team hierarchy link + */ + "subTeam": TeamHierarchyLinkCreateTeamRelationship; + + /** + * 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 = { + parentTeam: { + baseName: "parent_team", + type: "TeamHierarchyLinkCreateTeamRelationship", + required: true, + }, + subTeam: { + baseName: "sub_team", + type: "TeamHierarchyLinkCreateTeamRelationship", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamHierarchyLinkCreateRelationships.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyLinkCreateRequest.ts b/packages/datadog-api-client-v2/models/TeamHierarchyLinkCreateRequest.ts new file mode 100644 index 000000000000..0d4e17572086 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyLinkCreateRequest.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamHierarchyLinkCreate } from "./TeamHierarchyLinkCreate"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Request to create a team hierarchy link + */ +export class TeamHierarchyLinkCreateRequest { + /** + * Data provided when creating a team hierarchy link + */ + "data": TeamHierarchyLinkCreate; + + /** + * 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: "TeamHierarchyLinkCreate", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamHierarchyLinkCreateRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyLinkCreateTeam.ts b/packages/datadog-api-client-v2/models/TeamHierarchyLinkCreateTeam.ts new file mode 100644 index 000000000000..cc15b532fdfb --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyLinkCreateTeam.ts @@ -0,0 +1,63 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamType } from "./TeamType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * This schema defines the attributes about each team that has to be provided when creating a team hierarchy link + */ +export class TeamHierarchyLinkCreateTeam { + /** + * The team's identifier + */ + "id": string; + /** + * Team type + */ + "type": TeamType; + + /** + * 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", + required: true, + }, + type: { + baseName: "type", + type: "TeamType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamHierarchyLinkCreateTeam.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyLinkCreateTeamRelationship.ts b/packages/datadog-api-client-v2/models/TeamHierarchyLinkCreateTeamRelationship.ts new file mode 100644 index 000000000000..0b0b7a64afb6 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyLinkCreateTeamRelationship.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamHierarchyLinkCreateTeam } from "./TeamHierarchyLinkCreateTeam"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data about each team that will be connected by the team hierarchy link + */ +export class TeamHierarchyLinkCreateTeamRelationship { + /** + * This schema defines the attributes about each team that has to be provided when creating a team hierarchy link + */ + "data": TeamHierarchyLinkCreateTeam; + + /** + * 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: "TeamHierarchyLinkCreateTeam", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamHierarchyLinkCreateTeamRelationship.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyLinkRelationships.ts b/packages/datadog-api-client-v2/models/TeamHierarchyLinkRelationships.ts new file mode 100644 index 000000000000..5388764e215c --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyLinkRelationships.ts @@ -0,0 +1,63 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamHierarchyLinkTeamRelationship } from "./TeamHierarchyLinkTeamRelationship"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Team hierarchy link relationships + */ +export class TeamHierarchyLinkRelationships { + /** + * Team hierarchy link team relationship + */ + "parentTeam": TeamHierarchyLinkTeamRelationship; + /** + * Team hierarchy link team relationship + */ + "subTeam": TeamHierarchyLinkTeamRelationship; + + /** + * 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 = { + parentTeam: { + baseName: "parent_team", + type: "TeamHierarchyLinkTeamRelationship", + required: true, + }, + subTeam: { + baseName: "sub_team", + type: "TeamHierarchyLinkTeamRelationship", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamHierarchyLinkRelationships.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyLinkResponse.ts b/packages/datadog-api-client-v2/models/TeamHierarchyLinkResponse.ts new file mode 100644 index 000000000000..3713258cc53a --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyLinkResponse.ts @@ -0,0 +1,71 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamHierarchyLink } from "./TeamHierarchyLink"; +import { TeamHierarchyLinkTeam } from "./TeamHierarchyLinkTeam"; +import { TeamsHierarchyLinksResponseLinks } from "./TeamsHierarchyLinksResponseLinks"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Team hierarchy link response + */ +export class TeamHierarchyLinkResponse { + /** + * Team hierarchy link + */ + "data"?: TeamHierarchyLink; + /** + * Included teams + */ + "included"?: Array; + /** + * When querying team hierarchy links, a set of links for navigation between different pages is included + */ + "links"?: TeamsHierarchyLinksResponseLinks; + + /** + * 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: "TeamHierarchyLink", + }, + included: { + baseName: "included", + type: "Array", + }, + links: { + baseName: "links", + type: "TeamsHierarchyLinksResponseLinks", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamHierarchyLinkResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyLinkTeam.ts b/packages/datadog-api-client-v2/models/TeamHierarchyLinkTeam.ts new file mode 100644 index 000000000000..061f7b0c4c0b --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyLinkTeam.ts @@ -0,0 +1,72 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamHierarchyLinkTeamAttributes } from "./TeamHierarchyLinkTeamAttributes"; +import { TeamType } from "./TeamType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Team hierarchy links connect different teams. This represents team objects that are connected by the team hierarchy link. + */ +export class TeamHierarchyLinkTeam { + /** + * Team hierarchy links connect different teams. This represents attributes from teams that are connected by the team hierarchy link. + */ + "attributes"?: TeamHierarchyLinkTeamAttributes; + /** + * The team's identifier + */ + "id": string; + /** + * Team type + */ + "type": TeamType; + + /** + * 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: "TeamHierarchyLinkTeamAttributes", + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "TeamType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamHierarchyLinkTeam.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyLinkTeamAttributes.ts b/packages/datadog-api-client-v2/models/TeamHierarchyLinkTeamAttributes.ts new file mode 100644 index 000000000000..d1eb693a1003 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyLinkTeamAttributes.ts @@ -0,0 +1,121 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Team hierarchy links connect different teams. This represents attributes from teams that are connected by the team hierarchy link. + */ +export class TeamHierarchyLinkTeamAttributes { + /** + * The team's avatar + */ + "avatar"?: string; + /** + * The team's banner + */ + "banner"?: number; + /** + * The team's handle + */ + "handle": string; + /** + * Whether the team is managed + */ + "isManaged"?: boolean; + /** + * Whether the team has open membership + */ + "isOpenMembership"?: boolean; + /** + * The number of links for the team + */ + "linkCount"?: number; + /** + * The team's name + */ + "name": string; + /** + * The team's summary + */ + "summary"?: string; + /** + * The number of users in the team + */ + "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 = { + avatar: { + baseName: "avatar", + type: "string", + }, + banner: { + baseName: "banner", + type: "number", + format: "int64", + }, + handle: { + baseName: "handle", + type: "string", + required: true, + }, + isManaged: { + baseName: "is_managed", + type: "boolean", + }, + isOpenMembership: { + baseName: "is_open_membership", + type: "boolean", + }, + linkCount: { + baseName: "link_count", + type: "number", + format: "int64", + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + summary: { + baseName: "summary", + type: "string", + }, + userCount: { + baseName: "user_count", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamHierarchyLinkTeamAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyLinkTeamRelationship.ts b/packages/datadog-api-client-v2/models/TeamHierarchyLinkTeamRelationship.ts new file mode 100644 index 000000000000..b61ce6586ccd --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyLinkTeamRelationship.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamHierarchyLinkTeam } from "./TeamHierarchyLinkTeam"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Team hierarchy link team relationship + */ +export class TeamHierarchyLinkTeamRelationship { + /** + * Team hierarchy links connect different teams. This represents team objects that are connected by the team hierarchy link. + */ + "data": TeamHierarchyLinkTeam; + + /** + * 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: "TeamHierarchyLinkTeam", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamHierarchyLinkTeamRelationship.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyLinkType.ts b/packages/datadog-api-client-v2/models/TeamHierarchyLinkType.ts new file mode 100644 index 000000000000..ced519178932 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyLinkType.ts @@ -0,0 +1,16 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Team hierarchy link type + */ + +export type TeamHierarchyLinkType = + | typeof TEAM_HIERARCHY_LINKS + | UnparsedObject; +export const TEAM_HIERARCHY_LINKS = "team_hierarchy_links"; diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyLinksResponse.ts b/packages/datadog-api-client-v2/models/TeamHierarchyLinksResponse.ts new file mode 100644 index 000000000000..e5b3bf010ad2 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyLinksResponse.ts @@ -0,0 +1,80 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamHierarchyLink } from "./TeamHierarchyLink"; +import { TeamHierarchyLinkTeam } from "./TeamHierarchyLinkTeam"; +import { TeamsHierarchyLinksResponseLinks } from "./TeamsHierarchyLinksResponseLinks"; +import { TeamsHierarchyLinksResponseMeta } from "./TeamsHierarchyLinksResponseMeta"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Team hierarchy links response + */ +export class TeamHierarchyLinksResponse { + /** + * Team hierarchy links response data + */ + "data"?: Array; + /** + * Included teams + */ + "included"?: Array; + /** + * When querying team hierarchy links, a set of links for navigation between different pages is included + */ + "links"?: TeamsHierarchyLinksResponseLinks; + /** + * Metadata that is included in the response when querying the team hierarchy links + */ + "meta"?: TeamsHierarchyLinksResponseMeta; + + /** + * 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", + }, + included: { + baseName: "included", + type: "Array", + }, + links: { + baseName: "links", + type: "TeamsHierarchyLinksResponseLinks", + }, + meta: { + baseName: "meta", + type: "TeamsHierarchyLinksResponseMeta", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamHierarchyLinksResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamsHierarchyLinksResponseLinks.ts b/packages/datadog-api-client-v2/models/TeamsHierarchyLinksResponseLinks.ts new file mode 100644 index 000000000000..260662fa611e --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamsHierarchyLinksResponseLinks.ts @@ -0,0 +1,84 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * When querying team hierarchy links, a set of links for navigation between different pages is included + */ +export class TeamsHierarchyLinksResponseLinks { + /** + * Link to the first page. + */ + "first"?: string; + /** + * Link to the last page. + */ + "last"?: string; + /** + * Link to the next page. + */ + "next"?: string; + /** + * Link to the previous page. + */ + "prev"?: string; + /** + * Link to the current object. + */ + "self"?: 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 = { + first: { + baseName: "first", + type: "string", + }, + last: { + baseName: "last", + type: "string", + }, + next: { + baseName: "next", + type: "string", + }, + prev: { + baseName: "prev", + type: "string", + }, + self: { + baseName: "self", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamsHierarchyLinksResponseLinks.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamsHierarchyLinksResponseMeta.ts b/packages/datadog-api-client-v2/models/TeamsHierarchyLinksResponseMeta.ts new file mode 100644 index 000000000000..c84f28da174a --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamsHierarchyLinksResponseMeta.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamsHierarchyLinksResponseMetaPage } from "./TeamsHierarchyLinksResponseMetaPage"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Metadata that is included in the response when querying the team hierarchy links + */ +export class TeamsHierarchyLinksResponseMeta { + /** + * Metadata related to paging information that is included in the response when querying the team hierarchy links + */ + "page"?: TeamsHierarchyLinksResponseMetaPage; + + /** + * 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 = { + page: { + baseName: "page", + type: "TeamsHierarchyLinksResponseMetaPage", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamsHierarchyLinksResponseMeta.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamsHierarchyLinksResponseMetaPage.ts b/packages/datadog-api-client-v2/models/TeamsHierarchyLinksResponseMetaPage.ts new file mode 100644 index 000000000000..23500f0c41da --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamsHierarchyLinksResponseMetaPage.ts @@ -0,0 +1,115 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Metadata related to paging information that is included in the response when querying the team hierarchy links + */ +export class TeamsHierarchyLinksResponseMetaPage { + /** + * First page number. + */ + "firstNumber"?: number; + /** + * Last page number. + */ + "lastNumber"?: number; + /** + * Next page number. + */ + "nextNumber"?: number; + /** + * Page number. + */ + "number"?: number; + /** + * Previous page number. + */ + "prevNumber"?: number; + /** + * Page size. + */ + "size"?: number; + /** + * Total number of results. + */ + "total"?: number; + /** + * Pagination 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 = { + firstNumber: { + baseName: "first_number", + type: "number", + format: "int64", + }, + lastNumber: { + baseName: "last_number", + type: "number", + format: "int64", + }, + nextNumber: { + baseName: "next_number", + type: "number", + format: "int64", + }, + number: { + baseName: "number", + type: "number", + format: "int64", + }, + prevNumber: { + baseName: "prev_number", + type: "number", + format: "int64", + }, + size: { + baseName: "size", + type: "number", + format: "int64", + }, + total: { + baseName: "total", + type: "number", + format: "int64", + }, + type: { + baseName: "type", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamsHierarchyLinksResponseMetaPage.attributeTypeMap; + } + + public constructor() {} +}