From 6db836297e3f98f98eb2da7d0db0fa46c47bf862 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 26 Oct 2026 15:40:02 +0000 Subject: [PATCH] Regenerate client from commit e2bc5f3 of spec repo --- .generator/schemas/v2/openapi.yaml | 616 +++ examples/v2/teams/ListTeamHierarchyMembers.ts | 37 + .../ListTeamHierarchyMembers_1000871040.ts | 35 + .../ListTeamHierarchyMembers_2494043793.ts | 32 + .../ListTeamHierarchyMembers_3103330950.ts | 33 + .../ListTeamHierarchyMembers_3197180671.ts | 34 + .../ListTeamHierarchyMembers_3330810309.ts | 33 + .../ListTeamHierarchyMembers_3355644561.ts | 34 + .../ListTeamHierarchyMembers_3685423949.ts | 33 + .../ListTeamHierarchyMembers_4182775736.ts | 36 + .../test-runner-data/manifest.json | 84 + ...cates-direct-and-inherited-membership.json | 83 + ...rarchy-members-filters-direct-members.json | 83 + ...bers-filters-names-case-insensitively.json | 51 + ...-with-null-root-membership-attributes.json | 67 + ...-members-paginates-by-number-and-size.json | 99 + ...-members-rejects-unsupported-includes.json | 51 + ...-members-returns-bad-request-response.json | 51 + ...erarchy-members-returns-empty-results.json | 67 + ...hy-members-returns-not-found-response.json | 35 + ...s-returns-ok-response-with-pagination.json | 67 + ...hierarchy-members-returns-ok-response.json | 67 + ...herited-members-before-direct-members.json | 67 + .../test-server-data/v2/teams.json | 3648 +++++++++++++++++ features/support/scenarios_model_mapping.ts | 35 + features/v2/given.json | 44 + features/v2/teams.feature | 227 + features/v2/undo.json | 6 + .../configuration.ts | 1 + .../datadog-api-client-v2/apis/TeamsApi.ts | 318 ++ packages/datadog-api-client-v2/index.ts | 22 + .../models/ObjectSerializer.ts | 42 + .../models/TeamHierarchyMember.ts | 83 + .../models/TeamHierarchyMemberAttributes.ts | 80 + .../models/TeamHierarchyMemberIncluded.ts | 18 + .../TeamHierarchyMemberRelationships.ts | 64 + .../models/TeamHierarchyMemberTeam.ts | 73 + .../TeamHierarchyMemberTeamAttributes.ts | 60 + .../models/TeamHierarchyMemberTeamData.ts | 64 + .../TeamHierarchyMemberTeamRelationship.ts | 54 + .../models/TeamHierarchyMemberTeamType.ts | 14 + .../models/TeamHierarchyMemberType.ts | 16 + .../models/TeamHierarchyMemberUser.ts | 74 + .../models/TeamHierarchyMemberUserData.ts | 64 + .../TeamHierarchyMemberUserRelationship.ts | 54 + .../models/TeamHierarchyMembersNumberPage.ts | 124 + .../TeamHierarchyMembersNumberPageType.ts | 16 + .../models/TeamHierarchyMembersOffsetPage.ts | 124 + .../TeamHierarchyMembersOffsetPageType.ts | 16 + .../models/TeamHierarchyMembersPage.ts | 18 + .../models/TeamHierarchyMembersResponse.ts | 83 + .../TeamHierarchyMembersResponseLinks.ts | 84 + .../TeamHierarchyMembersResponseMeta.ts | 54 + 53 files changed, 7375 insertions(+) create mode 100644 examples/v2/teams/ListTeamHierarchyMembers.ts create mode 100644 examples/v2/teams/ListTeamHierarchyMembers_1000871040.ts create mode 100644 examples/v2/teams/ListTeamHierarchyMembers_2494043793.ts create mode 100644 examples/v2/teams/ListTeamHierarchyMembers_3103330950.ts create mode 100644 examples/v2/teams/ListTeamHierarchyMembers_3197180671.ts create mode 100644 examples/v2/teams/ListTeamHierarchyMembers_3330810309.ts create mode 100644 examples/v2/teams/ListTeamHierarchyMembers_3355644561.ts create mode 100644 examples/v2/teams/ListTeamHierarchyMembers_3685423949.ts create mode 100644 examples/v2/teams/ListTeamHierarchyMembers_4182775736.ts create mode 100644 features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-deduplicates-direct-and-inherited-membership.json create mode 100644 features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-filters-direct-members.json create mode 100644 features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-filters-names-case-insensitively.json create mode 100644 features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-includes-inherited-users-with-null-root-membership-attributes.json create mode 100644 features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-paginates-by-number-and-size.json create mode 100644 features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-rejects-unsupported-includes.json create mode 100644 features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-returns-bad-request-response.json create mode 100644 features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-returns-empty-results.json create mode 100644 features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-returns-not-found-response.json create mode 100644 features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-returns-ok-response-with-pagination.json create mode 100644 features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-returns-ok-response.json create mode 100644 features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-sorts-inherited-members-before-direct-members.json create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyMember.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyMemberAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyMemberIncluded.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyMemberRelationships.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyMemberTeam.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyMemberTeamAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyMemberTeamData.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyMemberTeamRelationship.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyMemberTeamType.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyMemberType.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyMemberUser.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyMemberUserData.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyMemberUserRelationship.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyMembersNumberPage.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyMembersNumberPageType.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyMembersOffsetPage.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyMembersOffsetPageType.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyMembersPage.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyMembersResponse.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyMembersResponseLinks.ts create mode 100644 packages/datadog-api-client-v2/models/TeamHierarchyMembersResponseMeta.ts diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index f61e8f9228f7..9f8db4652043 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -131810,6 +131810,360 @@ components: meta: $ref: "#/components/schemas/TeamsHierarchyLinksResponseMeta" type: object + TeamHierarchyMember: + description: A user relationship to the requested team. + properties: + attributes: + $ref: "#/components/schemas/TeamHierarchyMemberAttributes" + id: + description: Relationship identifier containing the team UUID and user UUID. + example: UserTeamRelationship:692e8073-12c4-4c71-8408-5090bd44c9c8:00000000-0000-0000-0000-000000000001 + type: string + relationships: + $ref: "#/components/schemas/TeamHierarchyMemberRelationships" + type: + $ref: "#/components/schemas/TeamHierarchyMemberType" + required: + - id + - type + - attributes + - relationships + type: object + TeamHierarchyMemberAttributes: + description: Membership attributes relative to the requested team. + properties: + direct_role: + description: "Role on the requested team: admin or member. Null for inherited members." + example: member + nullable: true + type: string + is_direct: + description: Whether the user belongs directly to the requested team. + example: true + type: boolean + provisioned_by: + description: Membership provisioner. Null for inherited members. + example: manual + nullable: true + type: string + provisioned_by_id: + description: Identifier supplied by the membership provisioner. Null when unavailable or for inherited members. + example: 00000000-0000-0000-0000-000000000003 + nullable: true + type: string + required: + - is_direct + - direct_role + - provisioned_by + - provisioned_by_id + type: object + TeamHierarchyMemberIncluded: + description: An included user or the requested team, distinguished by resource type. + oneOf: + - $ref: "#/components/schemas/TeamHierarchyMemberUser" + - $ref: "#/components/schemas/TeamHierarchyMemberTeam" + TeamHierarchyMemberRelationships: + description: User and requested team linkage. + properties: + team: + $ref: "#/components/schemas/TeamHierarchyMemberTeamRelationship" + user: + $ref: "#/components/schemas/TeamHierarchyMemberUserRelationship" + required: + - user + - team + type: object + TeamHierarchyMemberTeam: + description: The requested team, included at most once. Descendant teams are not included. + properties: + attributes: + $ref: "#/components/schemas/TeamHierarchyMemberTeamAttributes" + id: + description: UUID of the requested team. + example: 692e8073-12c4-4c71-8408-5090bd44c9c8 + format: uuid + type: string + type: + $ref: "#/components/schemas/TeamHierarchyMemberTeamType" + required: + - id + - type + type: object + TeamHierarchyMemberTeamAttributes: + description: Available attributes of the requested team. + properties: + handle: + description: Handle of the team. + example: platform + type: string + name: + description: Name of the team. + example: Platform + type: string + type: object + TeamHierarchyMemberTeamData: + description: Team resource identifier. + properties: + id: + description: UUID of the team. + example: 692e8073-12c4-4c71-8408-5090bd44c9c8 + format: uuid + type: string + type: + $ref: "#/components/schemas/TeamHierarchyMemberTeamType" + required: + - id + - type + type: object + TeamHierarchyMemberTeamRelationship: + description: Linkage to the requested team. + properties: + data: + $ref: "#/components/schemas/TeamHierarchyMemberTeamData" + required: + - data + type: object + TeamHierarchyMemberTeamType: + default: teams + description: Requested team resource type. + enum: + - teams + example: teams + type: string + x-enum-varnames: + - TEAMS + TeamHierarchyMemberType: + default: user_team_relationship + description: Team hierarchy membership resource type. + enum: + - user_team_relationship + example: user_team_relationship + type: string + x-enum-varnames: + - USER_TEAM_RELATIONSHIP + TeamHierarchyMemberUser: + description: A user included in the hierarchy members response. + properties: + attributes: + $ref: "#/components/schemas/UserAttributes" + id: + description: UUID of the user. + example: 00000000-0000-0000-0000-000000000001 + format: uuid + type: string + type: + $ref: "#/components/schemas/UsersType" + required: + - id + - type + - attributes + type: object + TeamHierarchyMemberUserData: + description: User resource identifier. + properties: + id: + description: UUID of the user. + example: 00000000-0000-0000-0000-000000000001 + format: uuid + type: string + type: + $ref: "#/components/schemas/UsersType" + required: + - id + - type + type: object + TeamHierarchyMemberUserRelationship: + description: Linkage to the user. + properties: + data: + $ref: "#/components/schemas/TeamHierarchyMemberUserData" + required: + - data + type: object + TeamHierarchyMembersNumberPage: + description: Pagination metadata using number and size. + properties: + first_number: + description: First page number. + example: 0 + format: int64 + type: integer + last_number: + description: Last page number. Null when unavailable. + example: 0 + format: int64 + nullable: true + type: integer + next_number: + description: Next page number. Null when unavailable. + example: + format: int64 + nullable: true + type: integer + number: + description: Current zero-based page number. + example: 0 + format: int64 + type: integer + prev_number: + description: Previous page number. Null when unavailable. + example: + format: int64 + nullable: true + type: integer + size: + description: Maximum number of members per page. + example: 100 + format: int64 + type: integer + total: + description: Total number of members matching the filters. + example: 2 + format: int64 + type: integer + type: + $ref: "#/components/schemas/TeamHierarchyMembersNumberPageType" + required: + - type + - number + - size + - total + - first_number + - prev_number + - next_number + - last_number + type: object + TeamHierarchyMembersNumberPageType: + default: number_size + description: Pagination mode. + enum: + - number_size + example: number_size + type: string + x-enum-varnames: + - NUMBER_SIZE + TeamHierarchyMembersOffsetPage: + description: Pagination metadata using offset and limit. + properties: + first_offset: + description: First offset. + example: 0 + format: int64 + type: integer + last_offset: + description: Last offset. Null when unavailable. + example: 0 + format: int64 + nullable: true + type: integer + limit: + description: Maximum number of members per page. + example: 100 + format: int64 + type: integer + next_offset: + description: Next offset. Null when unavailable. + example: + format: int64 + nullable: true + type: integer + offset: + description: Current offset. + example: 0 + format: int64 + type: integer + prev_offset: + description: Previous offset. Null when unavailable. + example: + format: int64 + nullable: true + type: integer + total: + description: Total number of members matching the filters. + example: 2 + format: int64 + type: integer + type: + $ref: "#/components/schemas/TeamHierarchyMembersOffsetPageType" + required: + - type + - offset + - limit + - total + - first_offset + - prev_offset + - next_offset + - last_offset + type: object + TeamHierarchyMembersOffsetPageType: + default: offset_limit + description: Pagination mode. + enum: + - offset_limit + example: offset_limit + type: string + x-enum-varnames: + - OFFSET_LIMIT + TeamHierarchyMembersPage: + description: Pagination metadata for the selected pagination mode. + oneOf: + - $ref: "#/components/schemas/TeamHierarchyMembersOffsetPage" + - $ref: "#/components/schemas/TeamHierarchyMembersNumberPage" + TeamHierarchyMembersResponse: + description: Direct and inherited members of the requested team. + properties: + data: + description: >- + Membership relationships for users who belong to the requested team or inherit membership through its descendant teams. Each user appears once, even if they belong to multiple teams in the hierarchy. Each relationship identifies the user and requested team, and indicates whether the user is a direct member of the requested team. + items: + $ref: "#/components/schemas/TeamHierarchyMember" + type: array + included: + description: Requested users and the team. May be absent when the result is empty, even if requested. + items: + $ref: "#/components/schemas/TeamHierarchyMemberIncluded" + type: array + links: + $ref: "#/components/schemas/TeamHierarchyMembersResponseLinks" + meta: + $ref: "#/components/schemas/TeamHierarchyMembersResponseMeta" + required: + - data + - meta + - links + type: object + TeamHierarchyMembersResponseLinks: + description: Page navigation links. Unavailable links are omitted. + properties: + first: + description: First page URL. + example: https://api.datadoghq.com/api/v2/team/692e8073-12c4-4c71-8408-5090bd44c9c8/members?page%5Bnumber%5D=0&page%5Bsize%5D=100 + type: string + last: + description: Last page URL. + example: https://api.datadoghq.com/api/v2/team/692e8073-12c4-4c71-8408-5090bd44c9c8/members?page%5Bnumber%5D=0&page%5Bsize%5D=100 + type: string + next: + description: Next page URL. + example: https://api.datadoghq.com/api/v2/team/692e8073-12c4-4c71-8408-5090bd44c9c8/members?page%5Bnumber%5D=0&page%5Bsize%5D=100 + type: string + prev: + description: Previous page URL. + example: https://api.datadoghq.com/api/v2/team/692e8073-12c4-4c71-8408-5090bd44c9c8/members?page%5Bnumber%5D=0&page%5Bsize%5D=100 + type: string + self: + description: Current page URL. + example: https://api.datadoghq.com/api/v2/team/692e8073-12c4-4c71-8408-5090bd44c9c8/members?page%5Bnumber%5D=0&page%5Bsize%5D=100 + type: string + type: object + TeamHierarchyMembersResponseMeta: + description: Pagination metadata for the filtered members. + properties: + page: + $ref: "#/components/schemas/TeamHierarchyMembersPage" + required: + - page + type: object TeamIncluded: description: Included resources related to the team oneOf: @@ -246837,6 +247191,268 @@ paths: operator: OR permissions: - teams_read + /api/v2/team/{team_id}/members: + get: + description: |- + List the direct and inherited members of a team, deduplicated by user. + Members of descendant teams are included unless `filter[is_direct_only]` is true. + Datadog support users are always excluded. + + Use `page[number]` and `page[size]` to paginate through the results. + Invalid query parameters return a JSON:API error with status 400. + Invalid or unknown team UUIDs return status 404. + operationId: ListTeamHierarchyMembers + parameters: + - description: UUID of the requested root team. + in: path + name: team_id + required: true + schema: + example: 692e8073-12c4-4c71-8408-5090bd44c9c8 + type: string + - description: Return only direct members. By default, members inherited from descendant teams are also returned. + in: query + name: filter[is_direct_only] + required: false + schema: + default: false + example: false + type: boolean + - description: Include service accounts. Datadog support users are always excluded. + in: query + name: filter[include_service_accounts] + required: false + schema: + default: true + example: true + type: boolean + - description: Filter by a case-insensitive substring of the user name, handle, or email. + in: query + name: filter[keyword] + required: false + schema: + example: alice + type: string + - description: "Comma-separated resources to include: `user` and `team`. The included team is the requested team. Whitespace is trimmed, and duplicate or empty entries are ignored." + in: query + name: include + required: false + schema: + example: user,team + pattern: ^\s*((user|team)\s*)?(,\s*((user|team)\s*)?)*$ + type: string + - description: "Comma-separated sort fields: `name`, `handle`, `is_direct`, and `provisioned_by`. Fields are applied in order, each optionally prefixed with `-` for descending order. By default, team admins come first, followed by other direct members, then inherited members, sorted by name within each group." + in: query + name: sort + required: false + schema: + example: is_direct,-name + type: string + - description: Zero-based page number. Negative values become 0. Defaults to 0. + in: query + name: page[number] + required: false + schema: + default: 0 + example: 0 + format: int64 + type: integer + - description: Requested number of members per page. Defaults to and maxes out at 100. + in: query + name: page[size] + required: false + schema: + default: 100 + example: 100 + format: int64 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + summary: Direct and inherited members with number pagination + value: + data: + - attributes: + direct_role: admin + is_direct: true + provisioned_by: manual + provisioned_by_id: + id: UserTeamRelationship:692e8073-12c4-4c71-8408-5090bd44c9c8:00000000-0000-0000-0000-000000000001 + relationships: + team: + data: + id: 692e8073-12c4-4c71-8408-5090bd44c9c8 + type: teams + user: + data: + id: 00000000-0000-0000-0000-000000000001 + type: users + type: user_team_relationship + - attributes: + direct_role: + is_direct: false + provisioned_by: + provisioned_by_id: + id: UserTeamRelationship:692e8073-12c4-4c71-8408-5090bd44c9c8:00000000-0000-0000-0000-000000000002 + relationships: + team: + data: + id: 692e8073-12c4-4c71-8408-5090bd44c9c8 + type: teams + user: + data: + id: 00000000-0000-0000-0000-000000000002 + type: users + type: user_team_relationship + links: + first: https://api.datadoghq.com/api/v2/team/692e8073-12c4-4c71-8408-5090bd44c9c8/members?page%5Bnumber%5D=0&page%5Bsize%5D=100 + last: https://api.datadoghq.com/api/v2/team/692e8073-12c4-4c71-8408-5090bd44c9c8/members?page%5Bnumber%5D=0&page%5Bsize%5D=100 + self: https://api.datadoghq.com/api/v2/team/692e8073-12c4-4c71-8408-5090bd44c9c8/members?page%5Bnumber%5D=0&page%5Bsize%5D=100 + meta: + page: + first_number: 0 + last_number: 0 + next_number: + number: 0 + prev_number: + size: 100 + total: 2 + type: number_size + empty: + summary: No matching members, with included resources omitted + value: + data: [] + links: + first: https://api.datadoghq.com/api/v2/team/692e8073-12c4-4c71-8408-5090bd44c9c8/members?page%5Bnumber%5D=0&page%5Bsize%5D=100 + last: https://api.datadoghq.com/api/v2/team/692e8073-12c4-4c71-8408-5090bd44c9c8/members?page%5Bnumber%5D=0&page%5Bsize%5D=100 + self: https://api.datadoghq.com/api/v2/team/692e8073-12c4-4c71-8408-5090bd44c9c8/members?page%5Bnumber%5D=0&page%5Bsize%5D=100 + meta: + page: + first_number: 0 + last_number: 0 + next_number: + number: 0 + prev_number: + size: 100 + total: 0 + type: number_size + included_resources: + summary: Users and the team with number pagination + value: + data: + - attributes: + direct_role: admin + is_direct: true + provisioned_by: manual + provisioned_by_id: + id: UserTeamRelationship:692e8073-12c4-4c71-8408-5090bd44c9c8:00000000-0000-0000-0000-000000000001 + relationships: + team: + data: + id: 692e8073-12c4-4c71-8408-5090bd44c9c8 + type: teams + user: + data: + id: 00000000-0000-0000-0000-000000000001 + type: users + type: user_team_relationship + - attributes: + direct_role: + is_direct: false + provisioned_by: + provisioned_by_id: + id: UserTeamRelationship:692e8073-12c4-4c71-8408-5090bd44c9c8:00000000-0000-0000-0000-000000000002 + relationships: + team: + data: + id: 692e8073-12c4-4c71-8408-5090bd44c9c8 + type: teams + user: + data: + id: 00000000-0000-0000-0000-000000000002 + type: users + type: user_team_relationship + included: + - attributes: + email: alice@example.com + handle: alice@example.com + name: Alice + title: + id: 00000000-0000-0000-0000-000000000001 + type: users + - attributes: + email: bob@example.com + handle: bob@example.com + name: + title: + id: 00000000-0000-0000-0000-000000000002 + type: users + - attributes: + handle: platform + name: Platform + id: 692e8073-12c4-4c71-8408-5090bd44c9c8 + type: teams + links: + first: https://api.datadoghq.com/api/v2/team/692e8073-12c4-4c71-8408-5090bd44c9c8/members?include=user%2Cteam&page%5Bnumber%5D=0&page%5Bsize%5D=100 + last: https://api.datadoghq.com/api/v2/team/692e8073-12c4-4c71-8408-5090bd44c9c8/members?include=user%2Cteam&page%5Bnumber%5D=0&page%5Bsize%5D=100 + self: https://api.datadoghq.com/api/v2/team/692e8073-12c4-4c71-8408-5090bd44c9c8/members?include=user%2Cteam&page%5Bnumber%5D=0&page%5Bsize%5D=100 + meta: + page: + first_number: 0 + last_number: 0 + next_number: + number: 0 + prev_number: + size: 100 + total: 2 + type: number_size + schema: + $ref: "#/components/schemas/TeamHierarchyMembersResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Get team hierarchy members + tags: + - Teams + x-pagination: + limitParam: page[size] + pageParam: page[number] + resultsPath: data + x-permission: + operator: OR + permissions: + - teams_read + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/team/{team_id}/memberships: get: description: Get a paginated list of members for a team diff --git a/examples/v2/teams/ListTeamHierarchyMembers.ts b/examples/v2/teams/ListTeamHierarchyMembers.ts new file mode 100644 index 000000000000..505cfad29d21 --- /dev/null +++ b/examples/v2/teams/ListTeamHierarchyMembers.ts @@ -0,0 +1,37 @@ +/** + * Get team hierarchy members returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration({ + authMethods: { + AuthZ: { + accessToken: process.env.DD_BEARER_TOKEN as string, + }, + }, +}); +configuration.unstableOperations["v2.listTeamHierarchyMembers"] = true; +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 "user" in the system +const USER_DATA_ATTRIBUTES_EMAIL = process.env + .USER_DATA_ATTRIBUTES_EMAIL as string; + +const params: v2.TeamsApiListTeamHierarchyMembersRequest = { + teamId: DD_TEAM_DATA_ID, + filterKeyword: USER_DATA_ATTRIBUTES_EMAIL, + include: "user,team", +}; + +apiInstance + .listTeamHierarchyMembers(params) + .then((data: v2.TeamHierarchyMembersResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/teams/ListTeamHierarchyMembers_1000871040.ts b/examples/v2/teams/ListTeamHierarchyMembers_1000871040.ts new file mode 100644 index 000000000000..6da06656d2ec --- /dev/null +++ b/examples/v2/teams/ListTeamHierarchyMembers_1000871040.ts @@ -0,0 +1,35 @@ +/** + * Get team hierarchy members paginates by number and size + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration({ + authMethods: { + AuthZ: { + accessToken: process.env.DD_BEARER_TOKEN as string, + }, + }, +}); +configuration.unstableOperations["v2.listTeamHierarchyMembers"] = true; +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; + +const params: v2.TeamsApiListTeamHierarchyMembersRequest = { + teamId: DD_TEAM_DATA_ID, + filterKeyword: "Example-Team", + sort: "-is_direct", + pageNumber: 1, + pageSize: 1, +}; + +apiInstance + .listTeamHierarchyMembers(params) + .then((data: v2.TeamHierarchyMembersResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/teams/ListTeamHierarchyMembers_2494043793.ts b/examples/v2/teams/ListTeamHierarchyMembers_2494043793.ts new file mode 100644 index 000000000000..0b9815d89001 --- /dev/null +++ b/examples/v2/teams/ListTeamHierarchyMembers_2494043793.ts @@ -0,0 +1,32 @@ +/** + * Get team hierarchy members filters names case insensitively + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration({ + authMethods: { + AuthZ: { + accessToken: process.env.DD_BEARER_TOKEN as string, + }, + }, +}); +configuration.unstableOperations["v2.listTeamHierarchyMembers"] = true; +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; + +const params: v2.TeamsApiListTeamHierarchyMembersRequest = { + teamId: DD_TEAM_DATA_ID, + filterKeyword: "hIeRaRcHy MeMbEr", +}; + +apiInstance + .listTeamHierarchyMembers(params) + .then((data: v2.TeamHierarchyMembersResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/teams/ListTeamHierarchyMembers_3103330950.ts b/examples/v2/teams/ListTeamHierarchyMembers_3103330950.ts new file mode 100644 index 000000000000..2b60091d410e --- /dev/null +++ b/examples/v2/teams/ListTeamHierarchyMembers_3103330950.ts @@ -0,0 +1,33 @@ +/** + * Get team hierarchy members returns empty results + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration({ + authMethods: { + AuthZ: { + accessToken: process.env.DD_BEARER_TOKEN as string, + }, + }, +}); +configuration.unstableOperations["v2.listTeamHierarchyMembers"] = true; +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; + +const params: v2.TeamsApiListTeamHierarchyMembersRequest = { + teamId: DD_TEAM_DATA_ID, + filterKeyword: "no-matching-member-Example-Team", + include: "user,team", +}; + +apiInstance + .listTeamHierarchyMembers(params) + .then((data: v2.TeamHierarchyMembersResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/teams/ListTeamHierarchyMembers_3197180671.ts b/examples/v2/teams/ListTeamHierarchyMembers_3197180671.ts new file mode 100644 index 000000000000..112d5daf85e9 --- /dev/null +++ b/examples/v2/teams/ListTeamHierarchyMembers_3197180671.ts @@ -0,0 +1,34 @@ +/** + * Get team hierarchy members deduplicates direct and inherited membership + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration({ + authMethods: { + AuthZ: { + accessToken: process.env.DD_BEARER_TOKEN as string, + }, + }, +}); +configuration.unstableOperations["v2.listTeamHierarchyMembers"] = true; +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; + +const params: v2.TeamsApiListTeamHierarchyMembersRequest = { + teamId: DD_TEAM_DATA_ID, + filterKeyword: "Example-Team", + include: "team", + sort: "-is_direct,handle", +}; + +apiInstance + .listTeamHierarchyMembers(params) + .then((data: v2.TeamHierarchyMembersResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/teams/ListTeamHierarchyMembers_3330810309.ts b/examples/v2/teams/ListTeamHierarchyMembers_3330810309.ts new file mode 100644 index 000000000000..6db9d2d87785 --- /dev/null +++ b/examples/v2/teams/ListTeamHierarchyMembers_3330810309.ts @@ -0,0 +1,33 @@ +/** + * Get team hierarchy members includes inherited users with null root membership attributes + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration({ + authMethods: { + AuthZ: { + accessToken: process.env.DD_BEARER_TOKEN as string, + }, + }, +}); +configuration.unstableOperations["v2.listTeamHierarchyMembers"] = true; +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; + +const params: v2.TeamsApiListTeamHierarchyMembersRequest = { + teamId: DD_TEAM_DATA_ID, + filterKeyword: "Example-Team", + include: "user,team", +}; + +apiInstance + .listTeamHierarchyMembers(params) + .then((data: v2.TeamHierarchyMembersResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/teams/ListTeamHierarchyMembers_3355644561.ts b/examples/v2/teams/ListTeamHierarchyMembers_3355644561.ts new file mode 100644 index 000000000000..f761728b6124 --- /dev/null +++ b/examples/v2/teams/ListTeamHierarchyMembers_3355644561.ts @@ -0,0 +1,34 @@ +/** + * Get team hierarchy members filters direct members + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration({ + authMethods: { + AuthZ: { + accessToken: process.env.DD_BEARER_TOKEN as string, + }, + }, +}); +configuration.unstableOperations["v2.listTeamHierarchyMembers"] = true; +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; + +const params: v2.TeamsApiListTeamHierarchyMembersRequest = { + teamId: DD_TEAM_DATA_ID, + filterIsDirectOnly: true, + filterIncludeServiceAccounts: false, + filterKeyword: "Example-Team", +}; + +apiInstance + .listTeamHierarchyMembers(params) + .then((data: v2.TeamHierarchyMembersResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/teams/ListTeamHierarchyMembers_3685423949.ts b/examples/v2/teams/ListTeamHierarchyMembers_3685423949.ts new file mode 100644 index 000000000000..08d0f4d442d3 --- /dev/null +++ b/examples/v2/teams/ListTeamHierarchyMembers_3685423949.ts @@ -0,0 +1,33 @@ +/** + * Get team hierarchy members sorts inherited members before direct members + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration({ + authMethods: { + AuthZ: { + accessToken: process.env.DD_BEARER_TOKEN as string, + }, + }, +}); +configuration.unstableOperations["v2.listTeamHierarchyMembers"] = true; +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; + +const params: v2.TeamsApiListTeamHierarchyMembersRequest = { + teamId: DD_TEAM_DATA_ID, + filterKeyword: "Example-Team", + sort: "is_direct,-name", +}; + +apiInstance + .listTeamHierarchyMembers(params) + .then((data: v2.TeamHierarchyMembersResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/teams/ListTeamHierarchyMembers_4182775736.ts b/examples/v2/teams/ListTeamHierarchyMembers_4182775736.ts new file mode 100644 index 000000000000..3e99722a2b6f --- /dev/null +++ b/examples/v2/teams/ListTeamHierarchyMembers_4182775736.ts @@ -0,0 +1,36 @@ +/** + * Get team hierarchy members returns "OK" response with pagination + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration({ + authMethods: { + AuthZ: { + accessToken: process.env.DD_BEARER_TOKEN as string, + }, + }, +}); +configuration.unstableOperations["v2.listTeamHierarchyMembers"] = true; +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; + +const params: v2.TeamsApiListTeamHierarchyMembersRequest = { + teamId: DD_TEAM_DATA_ID, + filterKeyword: "Example-Team", + pageSize: 1, +}; + +(async () => { + try { + for await (const item of apiInstance.listTeamHierarchyMembersWithPagination( + params + )) { + console.log(item); + } + } catch (error) { + console.error(error); + } +})(); diff --git a/features/generated-test/test-runner-data/manifest.json b/features/generated-test/test-runner-data/manifest.json index 8fe00afb78ca..68e62ba49369 100644 --- a/features/generated-test/test-runner-data/manifest.json +++ b/features/generated-test/test-runner-data/manifest.json @@ -12306,6 +12306,90 @@ "scenario": "Get team hierarchy links returns \"OK\" response", "version": "v2" }, + { + "feature": "Teams", + "feature_file": "../../v2/teams.feature", + "file": "v2/teams/get-team-hierarchy-members-deduplicates-direct-and-inherited-membership.json", + "scenario": "Get team hierarchy members deduplicates direct and inherited membership", + "version": "v2" + }, + { + "feature": "Teams", + "feature_file": "../../v2/teams.feature", + "file": "v2/teams/get-team-hierarchy-members-filters-direct-members.json", + "scenario": "Get team hierarchy members filters direct members", + "version": "v2" + }, + { + "feature": "Teams", + "feature_file": "../../v2/teams.feature", + "file": "v2/teams/get-team-hierarchy-members-filters-names-case-insensitively.json", + "scenario": "Get team hierarchy members filters names case insensitively", + "version": "v2" + }, + { + "feature": "Teams", + "feature_file": "../../v2/teams.feature", + "file": "v2/teams/get-team-hierarchy-members-includes-inherited-users-with-null-root-membership-attributes.json", + "scenario": "Get team hierarchy members includes inherited users with null root membership attributes", + "version": "v2" + }, + { + "feature": "Teams", + "feature_file": "../../v2/teams.feature", + "file": "v2/teams/get-team-hierarchy-members-paginates-by-number-and-size.json", + "scenario": "Get team hierarchy members paginates by number and size", + "version": "v2" + }, + { + "feature": "Teams", + "feature_file": "../../v2/teams.feature", + "file": "v2/teams/get-team-hierarchy-members-rejects-unsupported-includes.json", + "scenario": "Get team hierarchy members rejects unsupported includes", + "version": "v2" + }, + { + "feature": "Teams", + "feature_file": "../../v2/teams.feature", + "file": "v2/teams/get-team-hierarchy-members-returns-bad-request-response.json", + "scenario": "Get team hierarchy members returns \"Bad Request\" response", + "version": "v2" + }, + { + "feature": "Teams", + "feature_file": "../../v2/teams.feature", + "file": "v2/teams/get-team-hierarchy-members-returns-not-found-response.json", + "scenario": "Get team hierarchy members returns \"Not Found\" response", + "version": "v2" + }, + { + "feature": "Teams", + "feature_file": "../../v2/teams.feature", + "file": "v2/teams/get-team-hierarchy-members-returns-ok-response.json", + "scenario": "Get team hierarchy members returns \"OK\" response", + "version": "v2" + }, + { + "feature": "Teams", + "feature_file": "../../v2/teams.feature", + "file": "v2/teams/get-team-hierarchy-members-returns-ok-response-with-pagination.json", + "scenario": "Get team hierarchy members returns \"OK\" response with pagination", + "version": "v2" + }, + { + "feature": "Teams", + "feature_file": "../../v2/teams.feature", + "file": "v2/teams/get-team-hierarchy-members-returns-empty-results.json", + "scenario": "Get team hierarchy members returns empty results", + "version": "v2" + }, + { + "feature": "Teams", + "feature_file": "../../v2/teams.feature", + "file": "v2/teams/get-team-hierarchy-members-sorts-inherited-members-before-direct-members.json", + "scenario": "Get team hierarchy members sorts inherited members before direct members", + "version": "v2" + }, { "feature": "Teams", "feature_file": "../../v2/teams.feature", diff --git a/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-deduplicates-direct-and-inherited-membership.json b/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-deduplicates-direct-and-inherited-membership.json new file mode 100644 index 000000000000..689768d33fa0 --- /dev/null +++ b/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-deduplicates-direct-and-inherited-membership.json @@ -0,0 +1,83 @@ +{ + "api": "Teams", + "expected_status": 200, + "feature": "Teams", + "id": "v2/Teams/Get team hierarchy members deduplicates direct and inherited membership", + "operation_id": "ListTeamHierarchyMembers", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "team_id", + "required": true, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "path": "dd_team.data.id", + "type": "fixture" + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "filter[keyword]", + "required": false, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "{{ unique }}" + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "sort", + "required": false, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "-is_direct,handle" + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "include", + "required": false, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "team" + }, + "style": null + } + ], + "path": "/api/v2/team/{team_id}/members" + }, + "scenario": "Get team hierarchy members deduplicates direct and inherited membership", + "schema_version": 1, + "version": "v2" +} diff --git a/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-filters-direct-members.json b/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-filters-direct-members.json new file mode 100644 index 000000000000..7bc6e79275ec --- /dev/null +++ b/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-filters-direct-members.json @@ -0,0 +1,83 @@ +{ + "api": "Teams", + "expected_status": 200, + "feature": "Teams", + "id": "v2/Teams/Get team hierarchy members filters direct members", + "operation_id": "ListTeamHierarchyMembers", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "team_id", + "required": true, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "path": "dd_team.data.id", + "type": "fixture" + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "filter[keyword]", + "required": false, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "{{ unique }}" + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "filter[is_direct_only]", + "required": false, + "schema": { + "format": null, + "ref": null, + "type": "boolean" + }, + "source": { + "type": "literal", + "value": true + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "filter[include_service_accounts]", + "required": false, + "schema": { + "format": null, + "ref": null, + "type": "boolean" + }, + "source": { + "type": "literal", + "value": false + }, + "style": null + } + ], + "path": "/api/v2/team/{team_id}/members" + }, + "scenario": "Get team hierarchy members filters direct members", + "schema_version": 1, + "version": "v2" +} diff --git a/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-filters-names-case-insensitively.json b/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-filters-names-case-insensitively.json new file mode 100644 index 000000000000..7f9744612929 --- /dev/null +++ b/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-filters-names-case-insensitively.json @@ -0,0 +1,51 @@ +{ + "api": "Teams", + "expected_status": 200, + "feature": "Teams", + "id": "v2/Teams/Get team hierarchy members filters names case insensitively", + "operation_id": "ListTeamHierarchyMembers", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "team_id", + "required": true, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "path": "dd_team.data.id", + "type": "fixture" + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "filter[keyword]", + "required": false, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "hIeRaRcHy MeMbEr" + }, + "style": null + } + ], + "path": "/api/v2/team/{team_id}/members" + }, + "scenario": "Get team hierarchy members filters names case insensitively", + "schema_version": 1, + "version": "v2" +} diff --git a/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-includes-inherited-users-with-null-root-membership-attributes.json b/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-includes-inherited-users-with-null-root-membership-attributes.json new file mode 100644 index 000000000000..4f78587a4835 --- /dev/null +++ b/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-includes-inherited-users-with-null-root-membership-attributes.json @@ -0,0 +1,67 @@ +{ + "api": "Teams", + "expected_status": 200, + "feature": "Teams", + "id": "v2/Teams/Get team hierarchy members includes inherited users with null root membership attributes", + "operation_id": "ListTeamHierarchyMembers", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "team_id", + "required": true, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "path": "dd_team.data.id", + "type": "fixture" + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "filter[keyword]", + "required": false, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "{{ unique }}" + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "include", + "required": false, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "user,team" + }, + "style": null + } + ], + "path": "/api/v2/team/{team_id}/members" + }, + "scenario": "Get team hierarchy members includes inherited users with null root membership attributes", + "schema_version": 1, + "version": "v2" +} diff --git a/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-paginates-by-number-and-size.json b/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-paginates-by-number-and-size.json new file mode 100644 index 000000000000..a99d33b2af54 --- /dev/null +++ b/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-paginates-by-number-and-size.json @@ -0,0 +1,99 @@ +{ + "api": "Teams", + "expected_status": 200, + "feature": "Teams", + "id": "v2/Teams/Get team hierarchy members paginates by number and size", + "operation_id": "ListTeamHierarchyMembers", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "team_id", + "required": true, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "path": "dd_team.data.id", + "type": "fixture" + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "filter[keyword]", + "required": false, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "{{ unique }}" + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "sort", + "required": false, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "-is_direct" + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "page[number]", + "required": false, + "schema": { + "format": "int64", + "ref": null, + "type": "integer" + }, + "source": { + "type": "literal", + "value": 1 + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "page[size]", + "required": false, + "schema": { + "format": "int64", + "ref": null, + "type": "integer" + }, + "source": { + "type": "literal", + "value": 1 + }, + "style": null + } + ], + "path": "/api/v2/team/{team_id}/members" + }, + "scenario": "Get team hierarchy members paginates by number and size", + "schema_version": 1, + "version": "v2" +} diff --git a/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-rejects-unsupported-includes.json b/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-rejects-unsupported-includes.json new file mode 100644 index 000000000000..a1f419ed3028 --- /dev/null +++ b/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-rejects-unsupported-includes.json @@ -0,0 +1,51 @@ +{ + "api": "Teams", + "expected_status": 400, + "feature": "Teams", + "id": "v2/Teams/Get team hierarchy members rejects unsupported includes", + "operation_id": "ListTeamHierarchyMembers", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "team_id", + "required": true, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "path": "dd_team.data.id", + "type": "fixture" + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "include", + "required": false, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "descendants" + }, + "style": null + } + ], + "path": "/api/v2/team/{team_id}/members" + }, + "scenario": "Get team hierarchy members rejects unsupported includes", + "schema_version": 1, + "version": "v2" +} diff --git a/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-returns-bad-request-response.json b/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-returns-bad-request-response.json new file mode 100644 index 000000000000..c3082efdec3f --- /dev/null +++ b/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-returns-bad-request-response.json @@ -0,0 +1,51 @@ +{ + "api": "Teams", + "expected_status": 400, + "feature": "Teams", + "id": "v2/Teams/Get team hierarchy members returns \"Bad Request\" response", + "operation_id": "ListTeamHierarchyMembers", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "team_id", + "required": true, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "path": "dd_team.data.id", + "type": "fixture" + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "sort", + "required": false, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "invalid" + }, + "style": null + } + ], + "path": "/api/v2/team/{team_id}/members" + }, + "scenario": "Get team hierarchy members returns \"Bad Request\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-returns-empty-results.json b/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-returns-empty-results.json new file mode 100644 index 000000000000..4f5c4090df70 --- /dev/null +++ b/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-returns-empty-results.json @@ -0,0 +1,67 @@ +{ + "api": "Teams", + "expected_status": 200, + "feature": "Teams", + "id": "v2/Teams/Get team hierarchy members returns empty results", + "operation_id": "ListTeamHierarchyMembers", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "team_id", + "required": true, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "path": "dd_team.data.id", + "type": "fixture" + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "filter[keyword]", + "required": false, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "no-matching-member-{{ unique }}" + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "include", + "required": false, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "user,team" + }, + "style": null + } + ], + "path": "/api/v2/team/{team_id}/members" + }, + "scenario": "Get team hierarchy members returns empty results", + "schema_version": 1, + "version": "v2" +} diff --git a/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-returns-not-found-response.json b/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-returns-not-found-response.json new file mode 100644 index 000000000000..4b7774831de9 --- /dev/null +++ b/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-returns-not-found-response.json @@ -0,0 +1,35 @@ +{ + "api": "Teams", + "expected_status": 404, + "feature": "Teams", + "id": "v2/Teams/Get team hierarchy members returns \"Not Found\" response", + "operation_id": "ListTeamHierarchyMembers", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "team_id", + "required": true, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "00000000-0000-4000-8000-000000000000" + }, + "style": null + } + ], + "path": "/api/v2/team/{team_id}/members" + }, + "scenario": "Get team hierarchy members returns \"Not Found\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-returns-ok-response-with-pagination.json b/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-returns-ok-response-with-pagination.json new file mode 100644 index 000000000000..afcee1cb1529 --- /dev/null +++ b/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-returns-ok-response-with-pagination.json @@ -0,0 +1,67 @@ +{ + "api": "Teams", + "expected_status": 200, + "feature": "Teams", + "id": "v2/Teams/Get team hierarchy members returns \"OK\" response with pagination", + "operation_id": "ListTeamHierarchyMembers", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": true, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "team_id", + "required": true, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "path": "dd_team.data.id", + "type": "fixture" + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "filter[keyword]", + "required": false, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "{{ unique }}" + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "page[size]", + "required": false, + "schema": { + "format": "int64", + "ref": null, + "type": "integer" + }, + "source": { + "type": "literal", + "value": 1 + }, + "style": null + } + ], + "path": "/api/v2/team/{team_id}/members" + }, + "scenario": "Get team hierarchy members returns \"OK\" response with pagination", + "schema_version": 1, + "version": "v2" +} diff --git a/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-returns-ok-response.json b/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-returns-ok-response.json new file mode 100644 index 000000000000..c83daecae46a --- /dev/null +++ b/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-returns-ok-response.json @@ -0,0 +1,67 @@ +{ + "api": "Teams", + "expected_status": 200, + "feature": "Teams", + "id": "v2/Teams/Get team hierarchy members returns \"OK\" response", + "operation_id": "ListTeamHierarchyMembers", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "team_id", + "required": true, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "path": "dd_team.data.id", + "type": "fixture" + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "filter[keyword]", + "required": false, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "{{ user.data.attributes.email }}" + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "include", + "required": false, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "user,team" + }, + "style": null + } + ], + "path": "/api/v2/team/{team_id}/members" + }, + "scenario": "Get team hierarchy members returns \"OK\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-sorts-inherited-members-before-direct-members.json b/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-sorts-inherited-members-before-direct-members.json new file mode 100644 index 000000000000..493d99f66b24 --- /dev/null +++ b/features/generated-test/test-runner-data/v2/teams/get-team-hierarchy-members-sorts-inherited-members-before-direct-members.json @@ -0,0 +1,67 @@ +{ + "api": "Teams", + "expected_status": 200, + "feature": "Teams", + "id": "v2/Teams/Get team hierarchy members sorts inherited members before direct members", + "operation_id": "ListTeamHierarchyMembers", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "team_id", + "required": true, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "path": "dd_team.data.id", + "type": "fixture" + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "filter[keyword]", + "required": false, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "{{ unique }}" + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "sort", + "required": false, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "is_direct,-name" + }, + "style": null + } + ], + "path": "/api/v2/team/{team_id}/members" + }, + "scenario": "Get team hierarchy members sorts inherited members before direct members", + "schema_version": 1, + "version": "v2" +} diff --git a/features/generated-test/test-server-data/v2/teams.json b/features/generated-test/test-server-data/v2/teams.json index 155df675f1ac..ae078ac4c8ec 100644 --- a/features/generated-test/test-server-data/v2/teams.json +++ b/features/generated-test/test-server-data/v2/teams.json @@ -3730,6 +3730,3654 @@ "scenario": "Get team hierarchy links returns \"OK\" response", "version": "v2" }, + { + "feature": "Teams", + "frozen_at": "2026-10-20T16:17:15.165Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "handle": "test-handle-c36a7248a9067833", + "name": "test-name-c36a7248a9067833" + }, + "type": "team" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"c431b345-4b84-4c7b-a4f2-a3bd3773a0bc\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":14,\"created_at\":\"2026-10-20T16:17:17.323875+00:00\",\"description\":null,\"handle\":\"test-handle-c36a7248a9067833\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2026-10-20T16:17:17.323876+00:00\",\"name\":\"test-name-c36a7248a9067833\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/c431b345-4b84-4c7b-a4f2-a3bd3773a0bc/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/c431b345-4b84-4c7b-a4f2-a3bd3773a0bc/permission-settings\"}}}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "handle": "test-handle-2-c36a7248a9067833", + "name": "test-name-2-c36a7248a9067833" + }, + "type": "team" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"c8984857-6077-47d3-a2e0-6ecd0ad002ef\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":9,\"created_at\":\"2026-10-20T16:17:17.572334+00:00\",\"description\":null,\"handle\":\"test-handle-2-c36a7248a9067833\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2026-10-20T16:17:17.572334+00:00\",\"name\":\"test-name-2-c36a7248a9067833\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/c8984857-6077-47d3-a2e0-6ecd0ad002ef/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/c8984857-6077-47d3-a2e0-6ecd0ad002ef/permission-settings\"}}}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "relationships": { + "parent_team": { + "data": { + "id": "c431b345-4b84-4c7b-a4f2-a3bd3773a0bc", + "type": "team" + } + }, + "sub_team": { + "data": { + "id": "c8984857-6077-47d3-a2e0-6ecd0ad002ef", + "type": "team" + } + } + }, + "type": "team_hierarchy_links" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team-hierarchy-links", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"41879250-c4f4-4751-a484-f1a092959af9\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2026-10-20T16:17:17.838807089Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"c431b345-4b84-4c7b-a4f2-a3bd3773a0bc\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"c8984857-6077-47d3-a2e0-6ecd0ad002ef\",\"type\":\"team\"}}}},\"included\":[{\"id\":\"c431b345-4b84-4c7b-a4f2-a3bd3773a0bc\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":14,\"handle\":\"test-handle-c36a7248a9067833\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-c36a7248a9067833\",\"summary\":null,\"user_count\":0}},{\"id\":\"c8984857-6077-47d3-a2e0-6ecd0ad002ef\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":9,\"handle\":\"test-handle-2-c36a7248a9067833\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-2-c36a7248a9067833\",\"summary\":null,\"user_count\":0}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "email": "hierarchy-Test-Get_team_hierarchy_members_deduplicates_direct_and_inherited_membership-1792513035@datadoghq.com", + "name": "Hierarchy member" + }, + "type": "users" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/users", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"type\":\"users\",\"id\":\"e7e78653-ee88-4e6d-8803-79156009e862\",\"attributes\":{\"uuid\":\"e7e78653-ee88-4e6d-8803-79156009e862\",\"name\":\"Hierarchy member\",\"handle\":\"hierarchy-test-get_team_hierarchy_members_deduplicates_direct_and_inherited_membership-1792513035@datadoghq.com\",\"created_at\":\"2026-10-20T16:17:18.106492+00:00\",\"modified_at\":\"2026-10-20T16:17:18.106492+00:00\",\"email\":\"hierarchy-test-get_team_hierarchy_members_deduplicates_direct_and_inherited_membership-1792513035@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/47d6d66718b8406d16643547000c8f67?s=48&d=retro\",\"title\":null,\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\",\"last_login_time\":null},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n" + }, + "headers": { + "content-type": "application/json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "role": "admin" + }, + "relationships": { + "user": { + "data": { + "id": "e7e78653-ee88-4e6d-8803-79156009e862", + "type": "users" + } + } + }, + "type": "team_memberships" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team/c8984857-6077-47d3-a2e0-6ecd0ad002ef/memberships", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"TeamMembership-c8984857-6077-47d3-a2e0-6ecd0ad002ef-71947471\",\"type\":\"team_memberships\",\"attributes\":{\"provisioned_by\":null,\"provisioned_by_id\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"role\":\"admin\"},\"relationships\":{\"user\":{\"data\":{\"id\":\"e7e78653-ee88-4e6d-8803-79156009e862\",\"type\":\"users\"}}}},\"included\":[{\"id\":\"e7e78653-ee88-4e6d-8803-79156009e862\",\"type\":\"users\",\"attributes\":{\"disabled\":false,\"email\":\"hierarchy-test-get_team_hierarchy_members_deduplicates_direct_and_inherited_membership-1792513035@datadoghq.com\",\"handle\":\"hierarchy-test-get_team_hierarchy_members_deduplicates_direct_and_inherited_membership-1792513035@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/47d6d66718b8406d16643547000c8f67?d=retro\\u0026s=48\",\"name\":\"Hierarchy member\",\"service_account\":false,\"status\":\"Pending\"}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "email": "Test-Get_team_hierarchy_members_deduplicates_direct_and_inherited_membership-1792513035@datadoghq.com", + "title": "user title" + }, + "type": "users" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/users", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"type\":\"users\",\"id\":\"b10d80ab-e01d-4f3d-8bee-e0ba5996bf55\",\"attributes\":{\"uuid\":\"b10d80ab-e01d-4f3d-8bee-e0ba5996bf55\",\"name\":null,\"handle\":\"test-get_team_hierarchy_members_deduplicates_direct_and_inherited_membership-1792513035@datadoghq.com\",\"created_at\":\"2026-10-20T16:17:18.678850+00:00\",\"modified_at\":\"2026-10-20T16:17:18.678850+00:00\",\"email\":\"test-get_team_hierarchy_members_deduplicates_direct_and_inherited_membership-1792513035@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/ab8e1e28a33de20e8b414c085889b815?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\",\"last_login_time\":null},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n" + }, + "headers": { + "content-type": "application/json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "role": "admin" + }, + "relationships": { + "user": { + "data": { + "id": "b10d80ab-e01d-4f3d-8bee-e0ba5996bf55", + "type": "users" + } + } + }, + "type": "team_memberships" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team/c431b345-4b84-4c7b-a4f2-a3bd3773a0bc/memberships", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"TeamMembership-c431b345-4b84-4c7b-a4f2-a3bd3773a0bc-71947472\",\"type\":\"team_memberships\",\"attributes\":{\"provisioned_by\":null,\"provisioned_by_id\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"role\":\"admin\"},\"relationships\":{\"user\":{\"data\":{\"id\":\"b10d80ab-e01d-4f3d-8bee-e0ba5996bf55\",\"type\":\"users\"}}}},\"included\":[{\"id\":\"b10d80ab-e01d-4f3d-8bee-e0ba5996bf55\",\"type\":\"users\",\"attributes\":{\"disabled\":false,\"email\":\"test-get_team_hierarchy_members_deduplicates_direct_and_inherited_membership-1792513035@datadoghq.com\",\"handle\":\"test-get_team_hierarchy_members_deduplicates_direct_and_inherited_membership-1792513035@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/ab8e1e28a33de20e8b414c085889b815?d=retro\\u0026s=48\",\"name\":null,\"service_account\":false,\"status\":\"Pending\"}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "role": "admin" + }, + "relationships": { + "user": { + "data": { + "id": "b10d80ab-e01d-4f3d-8bee-e0ba5996bf55", + "type": "users" + } + } + }, + "type": "team_memberships" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team/c8984857-6077-47d3-a2e0-6ecd0ad002ef/memberships", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"TeamMembership-c8984857-6077-47d3-a2e0-6ecd0ad002ef-71947472\",\"type\":\"team_memberships\",\"attributes\":{\"provisioned_by\":null,\"provisioned_by_id\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"role\":\"admin\"},\"relationships\":{\"user\":{\"data\":{\"id\":\"b10d80ab-e01d-4f3d-8bee-e0ba5996bf55\",\"type\":\"users\"}}}},\"included\":[{\"id\":\"b10d80ab-e01d-4f3d-8bee-e0ba5996bf55\",\"type\":\"users\",\"attributes\":{\"disabled\":false,\"email\":\"test-get_team_hierarchy_members_deduplicates_direct_and_inherited_membership-1792513035@datadoghq.com\",\"handle\":\"test-get_team_hierarchy_members_deduplicates_direct_and_inherited_membership-1792513035@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/ab8e1e28a33de20e8b414c085889b815?d=retro\\u0026s=48\",\"name\":null,\"service_account\":false,\"status\":\"Pending\"}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/team/c431b345-4b84-4c7b-a4f2-a3bd3773a0bc/members", + "query": [ + [ + "filter[keyword]", + "Test-Get_team_hierarchy_members_deduplicates_direct_and_inherited_membership-1792513035" + ], + [ + "include", + "team" + ], + [ + "sort", + "-is_direct,handle" + ] + ] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":[{\"id\":\"UserTeamRelationship:c431b345-4b84-4c7b-a4f2-a3bd3773a0bc:b10d80ab-e01d-4f3d-8bee-e0ba5996bf55\",\"type\":\"user_team_relationship\",\"attributes\":{\"direct_role\":\"admin\",\"is_direct\":true,\"provisioned_by\":null,\"provisioned_by_id\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\"},\"relationships\":{\"team\":{\"data\":{\"id\":\"c431b345-4b84-4c7b-a4f2-a3bd3773a0bc\",\"type\":\"teams\"}},\"user\":{\"data\":{\"id\":\"b10d80ab-e01d-4f3d-8bee-e0ba5996bf55\",\"type\":\"users\"}}}},{\"id\":\"UserTeamRelationship:c431b345-4b84-4c7b-a4f2-a3bd3773a0bc:e7e78653-ee88-4e6d-8803-79156009e862\",\"type\":\"user_team_relationship\",\"attributes\":{\"direct_role\":null,\"is_direct\":false,\"provisioned_by\":null,\"provisioned_by_id\":null},\"relationships\":{\"team\":{\"data\":{\"id\":\"c431b345-4b84-4c7b-a4f2-a3bd3773a0bc\",\"type\":\"teams\"}},\"user\":{\"data\":{\"id\":\"e7e78653-ee88-4e6d-8803-79156009e862\",\"type\":\"users\"}}}}],\"meta\":{\"page\":{\"type\":\"offset_limit\",\"offset\":0,\"limit\":100,\"total\":2,\"first_offset\":0,\"prev_offset\":null,\"next_offset\":null,\"last_offset\":0}},\"links\":{\"self\":\"https://api.datadoghq.com/api/v2/team/c431b345-4b84-4c7b-a4f2-a3bd3773a0bc/members?filter%5Bkeyword%5D=Test-Get_team_hierarchy_members_deduplicates_direct_and_inherited_membership-1792513035\\u0026sort=-is_direct%2Chandle\\u0026include=team\",\"first\":\"https://api.datadoghq.com/api/v2/team/c431b345-4b84-4c7b-a4f2-a3bd3773a0bc/members?filter[keyword]=Test-Get_team_hierarchy_members_deduplicates_direct_and_inherited_membership-1792513035\\u0026include=team\\u0026page[limit]=100\\u0026page[offset]=0\\u0026sort=-is_direct,handle\",\"last\":\"https://api.datadoghq.com/api/v2/team/c431b345-4b84-4c7b-a4f2-a3bd3773a0bc/members?filter[keyword]=Test-Get_team_hierarchy_members_deduplicates_direct_and_inherited_membership-1792513035\\u0026include=team\\u0026page[limit]=100\\u0026page[offset]=0\\u0026sort=-is_direct,handle\"},\"included\":[{\"id\":\"c431b345-4b84-4c7b-a4f2-a3bd3773a0bc\",\"type\":\"teams\",\"attributes\":{\"handle\":\"test-handle-c36a7248a9067833\",\"name\":\"test-name-c36a7248a9067833\"}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/c8984857-6077-47d3-a2e0-6ecd0ad002ef/memberships/b10d80ab-e01d-4f3d-8bee-e0ba5996bf55", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/c431b345-4b84-4c7b-a4f2-a3bd3773a0bc/memberships/b10d80ab-e01d-4f3d-8bee-e0ba5996bf55", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/users/b10d80ab-e01d-4f3d-8bee-e0ba5996bf55", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/c8984857-6077-47d3-a2e0-6ecd0ad002ef/memberships/e7e78653-ee88-4e6d-8803-79156009e862", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/users/e7e78653-ee88-4e6d-8803-79156009e862", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team-hierarchy-links/41879250-c4f4-4751-a484-f1a092959af9", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/c8984857-6077-47d3-a2e0-6ecd0ad002ef", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/c431b345-4b84-4c7b-a4f2-a3bd3773a0bc", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + } + ], + "scenario": "Get team hierarchy members deduplicates direct and inherited membership", + "version": "v2" + }, + { + "feature": "Teams", + "frozen_at": "2026-10-20T16:17:22.023Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "handle": "test-handle-6e5570209bc2c8a9", + "name": "test-name-6e5570209bc2c8a9" + }, + "type": "team" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"68621a1f-67f2-4203-a614-485d8dc94985\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":9,\"created_at\":\"2026-10-20T16:17:22.206891+00:00\",\"description\":null,\"handle\":\"test-handle-6e5570209bc2c8a9\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2026-10-20T16:17:22.206891+00:00\",\"name\":\"test-name-6e5570209bc2c8a9\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/68621a1f-67f2-4203-a614-485d8dc94985/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/68621a1f-67f2-4203-a614-485d8dc94985/permission-settings\"}}}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "handle": "test-handle-2-6e5570209bc2c8a9", + "name": "test-name-2-6e5570209bc2c8a9" + }, + "type": "team" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"e87e3abc-f0dd-4761-adfd-abcf6ff91406\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":5,\"created_at\":\"2026-10-20T16:17:22.460938+00:00\",\"description\":null,\"handle\":\"test-handle-2-6e5570209bc2c8a9\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2026-10-20T16:17:22.460938+00:00\",\"name\":\"test-name-2-6e5570209bc2c8a9\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/e87e3abc-f0dd-4761-adfd-abcf6ff91406/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/e87e3abc-f0dd-4761-adfd-abcf6ff91406/permission-settings\"}}}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "relationships": { + "parent_team": { + "data": { + "id": "68621a1f-67f2-4203-a614-485d8dc94985", + "type": "team" + } + }, + "sub_team": { + "data": { + "id": "e87e3abc-f0dd-4761-adfd-abcf6ff91406", + "type": "team" + } + } + }, + "type": "team_hierarchy_links" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team-hierarchy-links", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"f0f518b0-1c4d-4381-9cec-29c1e3a1ebe3\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2026-10-20T16:17:22.742932483Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"68621a1f-67f2-4203-a614-485d8dc94985\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"e87e3abc-f0dd-4761-adfd-abcf6ff91406\",\"type\":\"team\"}}}},\"included\":[{\"id\":\"68621a1f-67f2-4203-a614-485d8dc94985\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":9,\"handle\":\"test-handle-6e5570209bc2c8a9\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-6e5570209bc2c8a9\",\"summary\":null,\"user_count\":0}},{\"id\":\"e87e3abc-f0dd-4761-adfd-abcf6ff91406\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":5,\"handle\":\"test-handle-2-6e5570209bc2c8a9\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-2-6e5570209bc2c8a9\",\"summary\":null,\"user_count\":0}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "email": "hierarchy-Test-Get_team_hierarchy_members_filters_direct_members-1792513042@datadoghq.com", + "name": "Hierarchy member" + }, + "type": "users" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/users", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"type\":\"users\",\"id\":\"0a768693-26ef-4763-b13b-194713d13160\",\"attributes\":{\"uuid\":\"0a768693-26ef-4763-b13b-194713d13160\",\"name\":\"Hierarchy member\",\"handle\":\"hierarchy-test-get_team_hierarchy_members_filters_direct_members-1792513042@datadoghq.com\",\"created_at\":\"2026-10-20T16:17:23.005450+00:00\",\"modified_at\":\"2026-10-20T16:17:23.005450+00:00\",\"email\":\"hierarchy-test-get_team_hierarchy_members_filters_direct_members-1792513042@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/e35521be35d41b1b7dce0e437f5259cc?s=48&d=retro\",\"title\":null,\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\",\"last_login_time\":null},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n" + }, + "headers": { + "content-type": "application/json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "role": "admin" + }, + "relationships": { + "user": { + "data": { + "id": "0a768693-26ef-4763-b13b-194713d13160", + "type": "users" + } + } + }, + "type": "team_memberships" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team/e87e3abc-f0dd-4761-adfd-abcf6ff91406/memberships", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"TeamMembership-e87e3abc-f0dd-4761-adfd-abcf6ff91406-71947473\",\"type\":\"team_memberships\",\"attributes\":{\"provisioned_by\":null,\"provisioned_by_id\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"role\":\"admin\"},\"relationships\":{\"user\":{\"data\":{\"id\":\"0a768693-26ef-4763-b13b-194713d13160\",\"type\":\"users\"}}}},\"included\":[{\"id\":\"0a768693-26ef-4763-b13b-194713d13160\",\"type\":\"users\",\"attributes\":{\"disabled\":false,\"email\":\"hierarchy-test-get_team_hierarchy_members_filters_direct_members-1792513042@datadoghq.com\",\"handle\":\"hierarchy-test-get_team_hierarchy_members_filters_direct_members-1792513042@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/e35521be35d41b1b7dce0e437f5259cc?d=retro\\u0026s=48\",\"name\":\"Hierarchy member\",\"service_account\":false,\"status\":\"Pending\"}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "email": "Test-Get_team_hierarchy_members_filters_direct_members-1792513042@datadoghq.com", + "title": "user title" + }, + "type": "users" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/users", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"type\":\"users\",\"id\":\"010ada19-6be1-4c9f-a69d-74aed601d1b9\",\"attributes\":{\"uuid\":\"010ada19-6be1-4c9f-a69d-74aed601d1b9\",\"name\":null,\"handle\":\"test-get_team_hierarchy_members_filters_direct_members-1792513042@datadoghq.com\",\"created_at\":\"2026-10-20T16:17:23.555103+00:00\",\"modified_at\":\"2026-10-20T16:17:23.555103+00:00\",\"email\":\"test-get_team_hierarchy_members_filters_direct_members-1792513042@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/1e9425084b3d8211180a2ba1b9027b0f?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\",\"last_login_time\":null},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n" + }, + "headers": { + "content-type": "application/json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "role": "admin" + }, + "relationships": { + "user": { + "data": { + "id": "010ada19-6be1-4c9f-a69d-74aed601d1b9", + "type": "users" + } + } + }, + "type": "team_memberships" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team/68621a1f-67f2-4203-a614-485d8dc94985/memberships", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"TeamMembership-68621a1f-67f2-4203-a614-485d8dc94985-71947474\",\"type\":\"team_memberships\",\"attributes\":{\"provisioned_by\":null,\"provisioned_by_id\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"role\":\"admin\"},\"relationships\":{\"user\":{\"data\":{\"id\":\"010ada19-6be1-4c9f-a69d-74aed601d1b9\",\"type\":\"users\"}}}},\"included\":[{\"id\":\"010ada19-6be1-4c9f-a69d-74aed601d1b9\",\"type\":\"users\",\"attributes\":{\"disabled\":false,\"email\":\"test-get_team_hierarchy_members_filters_direct_members-1792513042@datadoghq.com\",\"handle\":\"test-get_team_hierarchy_members_filters_direct_members-1792513042@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/1e9425084b3d8211180a2ba1b9027b0f?d=retro\\u0026s=48\",\"name\":null,\"service_account\":false,\"status\":\"Pending\"}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/team/68621a1f-67f2-4203-a614-485d8dc94985/members", + "query": [ + [ + "filter[include_service_accounts]", + "false" + ], + [ + "filter[is_direct_only]", + "true" + ], + [ + "filter[keyword]", + "Test-Get_team_hierarchy_members_filters_direct_members-1792513042" + ] + ] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":[{\"id\":\"UserTeamRelationship:68621a1f-67f2-4203-a614-485d8dc94985:010ada19-6be1-4c9f-a69d-74aed601d1b9\",\"type\":\"user_team_relationship\",\"attributes\":{\"direct_role\":\"admin\",\"is_direct\":true,\"provisioned_by\":null,\"provisioned_by_id\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\"},\"relationships\":{\"team\":{\"data\":{\"id\":\"68621a1f-67f2-4203-a614-485d8dc94985\",\"type\":\"teams\"}},\"user\":{\"data\":{\"id\":\"010ada19-6be1-4c9f-a69d-74aed601d1b9\",\"type\":\"users\"}}}}],\"meta\":{\"page\":{\"type\":\"offset_limit\",\"offset\":0,\"limit\":100,\"total\":1,\"first_offset\":0,\"prev_offset\":null,\"next_offset\":null,\"last_offset\":0}},\"links\":{\"self\":\"https://api.datadoghq.com/api/v2/team/68621a1f-67f2-4203-a614-485d8dc94985/members?filter%5Bkeyword%5D=Test-Get_team_hierarchy_members_filters_direct_members-1792513042\\u0026filter%5Bis_direct_only%5D=true\\u0026filter%5Binclude_service_accounts%5D=false\",\"first\":\"https://api.datadoghq.com/api/v2/team/68621a1f-67f2-4203-a614-485d8dc94985/members?filter[include_service_accounts]=false\\u0026filter[is_direct_only]=true\\u0026filter[keyword]=Test-Get_team_hierarchy_members_filters_direct_members-1792513042\\u0026page[limit]=100\\u0026page[offset]=0\",\"last\":\"https://api.datadoghq.com/api/v2/team/68621a1f-67f2-4203-a614-485d8dc94985/members?filter[include_service_accounts]=false\\u0026filter[is_direct_only]=true\\u0026filter[keyword]=Test-Get_team_hierarchy_members_filters_direct_members-1792513042\\u0026page[limit]=100\\u0026page[offset]=0\"}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/68621a1f-67f2-4203-a614-485d8dc94985/memberships/010ada19-6be1-4c9f-a69d-74aed601d1b9", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/users/010ada19-6be1-4c9f-a69d-74aed601d1b9", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/e87e3abc-f0dd-4761-adfd-abcf6ff91406/memberships/0a768693-26ef-4763-b13b-194713d13160", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/users/0a768693-26ef-4763-b13b-194713d13160", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team-hierarchy-links/f0f518b0-1c4d-4381-9cec-29c1e3a1ebe3", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/e87e3abc-f0dd-4761-adfd-abcf6ff91406", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/68621a1f-67f2-4203-a614-485d8dc94985", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + } + ], + "scenario": "Get team hierarchy members filters direct members", + "version": "v2" + }, + { + "feature": "Teams", + "frozen_at": "2026-10-20T16:17:26.511Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "handle": "test-handle-9fa8b295281a71b5", + "name": "test-name-9fa8b295281a71b5" + }, + "type": "team" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"e4ac0cab-3371-4195-9f62-97d89ce8616c\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":5,\"created_at\":\"2026-10-20T16:17:26.702617+00:00\",\"description\":null,\"handle\":\"test-handle-9fa8b295281a71b5\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2026-10-20T16:17:26.702617+00:00\",\"name\":\"test-name-9fa8b295281a71b5\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/e4ac0cab-3371-4195-9f62-97d89ce8616c/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/e4ac0cab-3371-4195-9f62-97d89ce8616c/permission-settings\"}}}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "handle": "test-handle-2-9fa8b295281a71b5", + "name": "test-name-2-9fa8b295281a71b5" + }, + "type": "team" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"0c63ab5a-cef0-4717-9a2b-27381e95744a\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":11,\"created_at\":\"2026-10-20T16:17:26.935127+00:00\",\"description\":null,\"handle\":\"test-handle-2-9fa8b295281a71b5\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2026-10-20T16:17:26.935127+00:00\",\"name\":\"test-name-2-9fa8b295281a71b5\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/0c63ab5a-cef0-4717-9a2b-27381e95744a/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/0c63ab5a-cef0-4717-9a2b-27381e95744a/permission-settings\"}}}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "relationships": { + "parent_team": { + "data": { + "id": "e4ac0cab-3371-4195-9f62-97d89ce8616c", + "type": "team" + } + }, + "sub_team": { + "data": { + "id": "0c63ab5a-cef0-4717-9a2b-27381e95744a", + "type": "team" + } + } + }, + "type": "team_hierarchy_links" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team-hierarchy-links", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"dba101c0-a9de-4fc3-8c5e-8454f661b59e\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2026-10-20T16:17:27.20080516Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"e4ac0cab-3371-4195-9f62-97d89ce8616c\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"0c63ab5a-cef0-4717-9a2b-27381e95744a\",\"type\":\"team\"}}}},\"included\":[{\"id\":\"e4ac0cab-3371-4195-9f62-97d89ce8616c\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":5,\"handle\":\"test-handle-9fa8b295281a71b5\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-9fa8b295281a71b5\",\"summary\":null,\"user_count\":0}},{\"id\":\"0c63ab5a-cef0-4717-9a2b-27381e95744a\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":11,\"handle\":\"test-handle-2-9fa8b295281a71b5\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-2-9fa8b295281a71b5\",\"summary\":null,\"user_count\":0}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "email": "hierarchy-Test-Get_team_hierarchy_members_filters_names_case_insensitively-1792513046@datadoghq.com", + "name": "Hierarchy member" + }, + "type": "users" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/users", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"type\":\"users\",\"id\":\"501785dc-53da-49f8-ab50-8f375044cfa6\",\"attributes\":{\"uuid\":\"501785dc-53da-49f8-ab50-8f375044cfa6\",\"name\":\"Hierarchy member\",\"handle\":\"hierarchy-test-get_team_hierarchy_members_filters_names_case_insensitively-1792513046@datadoghq.com\",\"created_at\":\"2026-10-20T16:17:27.467467+00:00\",\"modified_at\":\"2026-10-20T16:17:27.467467+00:00\",\"email\":\"hierarchy-test-get_team_hierarchy_members_filters_names_case_insensitively-1792513046@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/f40c9dc213ecd8a3c70c46f605ac25f6?s=48&d=retro\",\"title\":null,\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\",\"last_login_time\":null},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n" + }, + "headers": { + "content-type": "application/json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "role": "admin" + }, + "relationships": { + "user": { + "data": { + "id": "501785dc-53da-49f8-ab50-8f375044cfa6", + "type": "users" + } + } + }, + "type": "team_memberships" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team/0c63ab5a-cef0-4717-9a2b-27381e95744a/memberships", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"TeamMembership-0c63ab5a-cef0-4717-9a2b-27381e95744a-71947475\",\"type\":\"team_memberships\",\"attributes\":{\"provisioned_by\":null,\"provisioned_by_id\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"role\":\"admin\"},\"relationships\":{\"user\":{\"data\":{\"id\":\"501785dc-53da-49f8-ab50-8f375044cfa6\",\"type\":\"users\"}}}},\"included\":[{\"id\":\"501785dc-53da-49f8-ab50-8f375044cfa6\",\"type\":\"users\",\"attributes\":{\"disabled\":false,\"email\":\"hierarchy-test-get_team_hierarchy_members_filters_names_case_insensitively-1792513046@datadoghq.com\",\"handle\":\"hierarchy-test-get_team_hierarchy_members_filters_names_case_insensitively-1792513046@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/f40c9dc213ecd8a3c70c46f605ac25f6?d=retro\\u0026s=48\",\"name\":\"Hierarchy member\",\"service_account\":false,\"status\":\"Pending\"}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/team/e4ac0cab-3371-4195-9f62-97d89ce8616c/members", + "query": [ + [ + "filter[keyword]", + "hIeRaRcHy MeMbEr" + ] + ] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":[{\"id\":\"UserTeamRelationship:e4ac0cab-3371-4195-9f62-97d89ce8616c:501785dc-53da-49f8-ab50-8f375044cfa6\",\"type\":\"user_team_relationship\",\"attributes\":{\"direct_role\":null,\"is_direct\":false,\"provisioned_by\":null,\"provisioned_by_id\":null},\"relationships\":{\"team\":{\"data\":{\"id\":\"e4ac0cab-3371-4195-9f62-97d89ce8616c\",\"type\":\"teams\"}},\"user\":{\"data\":{\"id\":\"501785dc-53da-49f8-ab50-8f375044cfa6\",\"type\":\"users\"}}}}],\"meta\":{\"page\":{\"type\":\"offset_limit\",\"offset\":0,\"limit\":100,\"total\":1,\"first_offset\":0,\"prev_offset\":null,\"next_offset\":null,\"last_offset\":0}},\"links\":{\"self\":\"https://api.datadoghq.com/api/v2/team/e4ac0cab-3371-4195-9f62-97d89ce8616c/members?filter%5Bkeyword%5D=hIeRaRcHy%20MeMbEr\",\"first\":\"https://api.datadoghq.com/api/v2/team/e4ac0cab-3371-4195-9f62-97d89ce8616c/members?filter[keyword]=hIeRaRcHy MeMbEr\\u0026page[limit]=100\\u0026page[offset]=0\",\"last\":\"https://api.datadoghq.com/api/v2/team/e4ac0cab-3371-4195-9f62-97d89ce8616c/members?filter[keyword]=hIeRaRcHy MeMbEr\\u0026page[limit]=100\\u0026page[offset]=0\"}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/0c63ab5a-cef0-4717-9a2b-27381e95744a/memberships/501785dc-53da-49f8-ab50-8f375044cfa6", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/users/501785dc-53da-49f8-ab50-8f375044cfa6", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team-hierarchy-links/dba101c0-a9de-4fc3-8c5e-8454f661b59e", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/0c63ab5a-cef0-4717-9a2b-27381e95744a", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/e4ac0cab-3371-4195-9f62-97d89ce8616c", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + } + ], + "scenario": "Get team hierarchy members filters names case insensitively", + "version": "v2" + }, + { + "feature": "Teams", + "frozen_at": "2026-10-20T16:17:29.748Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "handle": "test-handle-ee75adac6bb6b536", + "name": "test-name-ee75adac6bb6b536" + }, + "type": "team" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"a91b02e6-085c-4ac9-9289-58cd9ef4de65\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":3,\"created_at\":\"2026-10-20T16:17:29.934951+00:00\",\"description\":null,\"handle\":\"test-handle-ee75adac6bb6b536\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2026-10-20T16:17:29.934951+00:00\",\"name\":\"test-name-ee75adac6bb6b536\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/a91b02e6-085c-4ac9-9289-58cd9ef4de65/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/a91b02e6-085c-4ac9-9289-58cd9ef4de65/permission-settings\"}}}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "handle": "test-handle-2-ee75adac6bb6b536", + "name": "test-name-2-ee75adac6bb6b536" + }, + "type": "team" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"cd9f6e4d-8c6c-4588-9b9d-3713d5e8f3f5\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":0,\"created_at\":\"2026-10-20T16:17:30.166541+00:00\",\"description\":null,\"handle\":\"test-handle-2-ee75adac6bb6b536\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2026-10-20T16:17:30.166541+00:00\",\"name\":\"test-name-2-ee75adac6bb6b536\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/cd9f6e4d-8c6c-4588-9b9d-3713d5e8f3f5/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/cd9f6e4d-8c6c-4588-9b9d-3713d5e8f3f5/permission-settings\"}}}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "relationships": { + "parent_team": { + "data": { + "id": "a91b02e6-085c-4ac9-9289-58cd9ef4de65", + "type": "team" + } + }, + "sub_team": { + "data": { + "id": "cd9f6e4d-8c6c-4588-9b9d-3713d5e8f3f5", + "type": "team" + } + } + }, + "type": "team_hierarchy_links" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team-hierarchy-links", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"8a9c48f0-2635-4c6c-b908-b9d2719b782f\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2026-10-20T16:17:30.450855109Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"a91b02e6-085c-4ac9-9289-58cd9ef4de65\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"cd9f6e4d-8c6c-4588-9b9d-3713d5e8f3f5\",\"type\":\"team\"}}}},\"included\":[{\"id\":\"a91b02e6-085c-4ac9-9289-58cd9ef4de65\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":3,\"handle\":\"test-handle-ee75adac6bb6b536\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-ee75adac6bb6b536\",\"summary\":null,\"user_count\":0}},{\"id\":\"cd9f6e4d-8c6c-4588-9b9d-3713d5e8f3f5\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":0,\"handle\":\"test-handle-2-ee75adac6bb6b536\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-2-ee75adac6bb6b536\",\"summary\":null,\"user_count\":0}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "email": "hierarchy-Test-Get_team_hierarchy_members_includes_inherited_users_with_null_root_membership_attributes-1792513049@datadoghq.com", + "name": "Hierarchy member" + }, + "type": "users" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/users", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"type\":\"users\",\"id\":\"807ce33a-757e-4558-ae87-d6e9b804c061\",\"attributes\":{\"uuid\":\"807ce33a-757e-4558-ae87-d6e9b804c061\",\"name\":\"Hierarchy member\",\"handle\":\"hierarchy-test-get_team_hierarchy_members_includes_inherited_users_with_null_root_membership_attributes-1792513049@datadoghq.com\",\"created_at\":\"2026-10-20T16:17:30.727618+00:00\",\"modified_at\":\"2026-10-20T16:17:30.727618+00:00\",\"email\":\"hierarchy-test-get_team_hierarchy_members_includes_inherited_users_with_null_root_membership_attributes-1792513049@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/2dcff54befe8933b11038dea8aeafd3e?s=48&d=retro\",\"title\":null,\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\",\"last_login_time\":null},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n" + }, + "headers": { + "content-type": "application/json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "role": "admin" + }, + "relationships": { + "user": { + "data": { + "id": "807ce33a-757e-4558-ae87-d6e9b804c061", + "type": "users" + } + } + }, + "type": "team_memberships" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team/cd9f6e4d-8c6c-4588-9b9d-3713d5e8f3f5/memberships", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"TeamMembership-cd9f6e4d-8c6c-4588-9b9d-3713d5e8f3f5-71947476\",\"type\":\"team_memberships\",\"attributes\":{\"provisioned_by\":null,\"provisioned_by_id\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"role\":\"admin\"},\"relationships\":{\"user\":{\"data\":{\"id\":\"807ce33a-757e-4558-ae87-d6e9b804c061\",\"type\":\"users\"}}}},\"included\":[{\"id\":\"807ce33a-757e-4558-ae87-d6e9b804c061\",\"type\":\"users\",\"attributes\":{\"disabled\":false,\"email\":\"hierarchy-test-get_team_hierarchy_members_includes_inherited_users_with_null_root_membership_attributes-1792513049@datadoghq.com\",\"handle\":\"hierarchy-test-get_team_hierarchy_members_includes_inherited_users_with_null_root_membership_attributes-1792513049@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/2dcff54befe8933b11038dea8aeafd3e?d=retro\\u0026s=48\",\"name\":\"Hierarchy member\",\"service_account\":false,\"status\":\"Pending\"}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/team/a91b02e6-085c-4ac9-9289-58cd9ef4de65/members", + "query": [ + [ + "filter[keyword]", + "Test-Get_team_hierarchy_members_includes_inherited_users_with_null_root_membership_attributes-1792513049" + ], + [ + "include", + "user,team" + ] + ] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":[{\"id\":\"UserTeamRelationship:a91b02e6-085c-4ac9-9289-58cd9ef4de65:807ce33a-757e-4558-ae87-d6e9b804c061\",\"type\":\"user_team_relationship\",\"attributes\":{\"direct_role\":null,\"is_direct\":false,\"provisioned_by\":null,\"provisioned_by_id\":null},\"relationships\":{\"team\":{\"data\":{\"id\":\"a91b02e6-085c-4ac9-9289-58cd9ef4de65\",\"type\":\"teams\"}},\"user\":{\"data\":{\"id\":\"807ce33a-757e-4558-ae87-d6e9b804c061\",\"type\":\"users\"}}}}],\"meta\":{\"page\":{\"type\":\"offset_limit\",\"offset\":0,\"limit\":100,\"total\":1,\"first_offset\":0,\"prev_offset\":null,\"next_offset\":null,\"last_offset\":0}},\"links\":{\"self\":\"https://api.datadoghq.com/api/v2/team/a91b02e6-085c-4ac9-9289-58cd9ef4de65/members?filter%5Bkeyword%5D=Test-Get_team_hierarchy_members_includes_inherited_users_with_null_root_membership_attributes-1792513049\\u0026include=user%2Cteam\",\"first\":\"https://api.datadoghq.com/api/v2/team/a91b02e6-085c-4ac9-9289-58cd9ef4de65/members?filter[keyword]=Test-Get_team_hierarchy_members_includes_inherited_users_with_null_root_membership_attributes-1792513049\\u0026include=user,team\\u0026page[limit]=100\\u0026page[offset]=0\",\"last\":\"https://api.datadoghq.com/api/v2/team/a91b02e6-085c-4ac9-9289-58cd9ef4de65/members?filter[keyword]=Test-Get_team_hierarchy_members_includes_inherited_users_with_null_root_membership_attributes-1792513049\\u0026include=user,team\\u0026page[limit]=100\\u0026page[offset]=0\"},\"included\":[{\"id\":\"807ce33a-757e-4558-ae87-d6e9b804c061\",\"type\":\"users\",\"attributes\":{\"created_at\":\"2026-10-20T16:17:30.727618+00:00\",\"disabled\":false,\"email\":\"hierarchy-test-get_team_hierarchy_members_includes_inherited_users_with_null_root_membership_attributes-1792513049@datadoghq.com\",\"handle\":\"hierarchy-test-get_team_hierarchy_members_includes_inherited_users_with_null_root_membership_attributes-1792513049@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/2dcff54befe8933b11038dea8aeafd3e?d=retro\\u0026s=48\",\"modified_at\":\"2026-10-20T16:17:30.727618+00:00\",\"name\":\"Hierarchy member\",\"service_account\":false,\"status\":\"Pending\",\"title\":null,\"verified\":false}},{\"id\":\"a91b02e6-085c-4ac9-9289-58cd9ef4de65\",\"type\":\"teams\",\"attributes\":{\"handle\":\"test-handle-ee75adac6bb6b536\",\"name\":\"test-name-ee75adac6bb6b536\"}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/cd9f6e4d-8c6c-4588-9b9d-3713d5e8f3f5/memberships/807ce33a-757e-4558-ae87-d6e9b804c061", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/users/807ce33a-757e-4558-ae87-d6e9b804c061", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team-hierarchy-links/8a9c48f0-2635-4c6c-b908-b9d2719b782f", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/cd9f6e4d-8c6c-4588-9b9d-3713d5e8f3f5", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/a91b02e6-085c-4ac9-9289-58cd9ef4de65", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + } + ], + "scenario": "Get team hierarchy members includes inherited users with null root membership attributes", + "version": "v2" + }, + { + "feature": "Teams", + "frozen_at": "2026-10-20T16:17:32.939Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "handle": "test-handle-3e67528452a8070e", + "name": "test-name-3e67528452a8070e" + }, + "type": "team" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"c3124fd1-8eae-456c-b095-5a895db68088\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":11,\"created_at\":\"2026-10-20T16:17:33.132728+00:00\",\"description\":null,\"handle\":\"test-handle-3e67528452a8070e\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2026-10-20T16:17:33.132729+00:00\",\"name\":\"test-name-3e67528452a8070e\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/c3124fd1-8eae-456c-b095-5a895db68088/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/c3124fd1-8eae-456c-b095-5a895db68088/permission-settings\"}}}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "handle": "test-handle-2-3e67528452a8070e", + "name": "test-name-2-3e67528452a8070e" + }, + "type": "team" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"9e4773ce-3c0d-4a75-b7f9-9c02d15fc28e\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":5,\"created_at\":\"2026-10-20T16:17:33.386817+00:00\",\"description\":null,\"handle\":\"test-handle-2-3e67528452a8070e\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2026-10-20T16:17:33.386817+00:00\",\"name\":\"test-name-2-3e67528452a8070e\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/9e4773ce-3c0d-4a75-b7f9-9c02d15fc28e/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/9e4773ce-3c0d-4a75-b7f9-9c02d15fc28e/permission-settings\"}}}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "relationships": { + "parent_team": { + "data": { + "id": "c3124fd1-8eae-456c-b095-5a895db68088", + "type": "team" + } + }, + "sub_team": { + "data": { + "id": "9e4773ce-3c0d-4a75-b7f9-9c02d15fc28e", + "type": "team" + } + } + }, + "type": "team_hierarchy_links" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team-hierarchy-links", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"3461c720-496e-4460-95a6-ffa94eed2cf7\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2026-10-20T16:17:33.668267849Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"c3124fd1-8eae-456c-b095-5a895db68088\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"9e4773ce-3c0d-4a75-b7f9-9c02d15fc28e\",\"type\":\"team\"}}}},\"included\":[{\"id\":\"c3124fd1-8eae-456c-b095-5a895db68088\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":11,\"handle\":\"test-handle-3e67528452a8070e\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-3e67528452a8070e\",\"summary\":null,\"user_count\":0}},{\"id\":\"9e4773ce-3c0d-4a75-b7f9-9c02d15fc28e\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":5,\"handle\":\"test-handle-2-3e67528452a8070e\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-2-3e67528452a8070e\",\"summary\":null,\"user_count\":0}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "email": "hierarchy-Test-Get_team_hierarchy_members_paginates_by_number_and_size-1792513052@datadoghq.com", + "name": "Hierarchy member" + }, + "type": "users" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/users", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"type\":\"users\",\"id\":\"2be6a556-0719-4824-9f49-b4ec431a5132\",\"attributes\":{\"uuid\":\"2be6a556-0719-4824-9f49-b4ec431a5132\",\"name\":\"Hierarchy member\",\"handle\":\"hierarchy-test-get_team_hierarchy_members_paginates_by_number_and_size-1792513052@datadoghq.com\",\"created_at\":\"2026-10-20T16:17:33.995050+00:00\",\"modified_at\":\"2026-10-20T16:17:33.995050+00:00\",\"email\":\"hierarchy-test-get_team_hierarchy_members_paginates_by_number_and_size-1792513052@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/1f79bbc3a890dff5a6cf4fc912ef725d?s=48&d=retro\",\"title\":null,\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\",\"last_login_time\":null},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n" + }, + "headers": { + "content-type": "application/json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "role": "admin" + }, + "relationships": { + "user": { + "data": { + "id": "2be6a556-0719-4824-9f49-b4ec431a5132", + "type": "users" + } + } + }, + "type": "team_memberships" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team/9e4773ce-3c0d-4a75-b7f9-9c02d15fc28e/memberships", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"TeamMembership-9e4773ce-3c0d-4a75-b7f9-9c02d15fc28e-71947478\",\"type\":\"team_memberships\",\"attributes\":{\"provisioned_by\":null,\"provisioned_by_id\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"role\":\"admin\"},\"relationships\":{\"user\":{\"data\":{\"id\":\"2be6a556-0719-4824-9f49-b4ec431a5132\",\"type\":\"users\"}}}},\"included\":[{\"id\":\"2be6a556-0719-4824-9f49-b4ec431a5132\",\"type\":\"users\",\"attributes\":{\"disabled\":false,\"email\":\"hierarchy-test-get_team_hierarchy_members_paginates_by_number_and_size-1792513052@datadoghq.com\",\"handle\":\"hierarchy-test-get_team_hierarchy_members_paginates_by_number_and_size-1792513052@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/1f79bbc3a890dff5a6cf4fc912ef725d?d=retro\\u0026s=48\",\"name\":\"Hierarchy member\",\"service_account\":false,\"status\":\"Pending\"}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "email": "Test-Get_team_hierarchy_members_paginates_by_number_and_size-1792513052@datadoghq.com", + "title": "user title" + }, + "type": "users" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/users", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"type\":\"users\",\"id\":\"2b1b56ec-9ae6-4ac7-acb5-f7ef7f576369\",\"attributes\":{\"uuid\":\"2b1b56ec-9ae6-4ac7-acb5-f7ef7f576369\",\"name\":null,\"handle\":\"test-get_team_hierarchy_members_paginates_by_number_and_size-1792513052@datadoghq.com\",\"created_at\":\"2026-10-20T16:17:34.571437+00:00\",\"modified_at\":\"2026-10-20T16:17:34.571437+00:00\",\"email\":\"test-get_team_hierarchy_members_paginates_by_number_and_size-1792513052@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/13facc5110340fafbef1c40dde1fdf48?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\",\"last_login_time\":null},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n" + }, + "headers": { + "content-type": "application/json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "role": "admin" + }, + "relationships": { + "user": { + "data": { + "id": "2b1b56ec-9ae6-4ac7-acb5-f7ef7f576369", + "type": "users" + } + } + }, + "type": "team_memberships" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team/c3124fd1-8eae-456c-b095-5a895db68088/memberships", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"TeamMembership-c3124fd1-8eae-456c-b095-5a895db68088-71947479\",\"type\":\"team_memberships\",\"attributes\":{\"provisioned_by\":null,\"provisioned_by_id\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"role\":\"admin\"},\"relationships\":{\"user\":{\"data\":{\"id\":\"2b1b56ec-9ae6-4ac7-acb5-f7ef7f576369\",\"type\":\"users\"}}}},\"included\":[{\"id\":\"2b1b56ec-9ae6-4ac7-acb5-f7ef7f576369\",\"type\":\"users\",\"attributes\":{\"disabled\":false,\"email\":\"test-get_team_hierarchy_members_paginates_by_number_and_size-1792513052@datadoghq.com\",\"handle\":\"test-get_team_hierarchy_members_paginates_by_number_and_size-1792513052@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/13facc5110340fafbef1c40dde1fdf48?d=retro\\u0026s=48\",\"name\":null,\"service_account\":false,\"status\":\"Pending\"}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/team/c3124fd1-8eae-456c-b095-5a895db68088/members", + "query": [ + [ + "filter[keyword]", + "Test-Get_team_hierarchy_members_paginates_by_number_and_size-1792513052" + ], + [ + "page[number]", + "1" + ], + [ + "page[size]", + "1" + ], + [ + "sort", + "-is_direct" + ] + ] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":[{\"id\":\"UserTeamRelationship:c3124fd1-8eae-456c-b095-5a895db68088:2be6a556-0719-4824-9f49-b4ec431a5132\",\"type\":\"user_team_relationship\",\"attributes\":{\"direct_role\":null,\"is_direct\":false,\"provisioned_by\":null,\"provisioned_by_id\":null},\"relationships\":{\"team\":{\"data\":{\"id\":\"c3124fd1-8eae-456c-b095-5a895db68088\",\"type\":\"teams\"}},\"user\":{\"data\":{\"id\":\"2be6a556-0719-4824-9f49-b4ec431a5132\",\"type\":\"users\"}}}}],\"meta\":{\"page\":{\"type\":\"number_size\",\"number\":1,\"size\":1,\"total\":2,\"first_number\":0,\"prev_number\":0,\"next_number\":null,\"last_number\":1}},\"links\":{\"self\":\"https://api.datadoghq.com/api/v2/team/c3124fd1-8eae-456c-b095-5a895db68088/members?filter%5Bkeyword%5D=Test-Get_team_hierarchy_members_paginates_by_number_and_size-1792513052\\u0026sort=-is_direct\\u0026page%5Bnumber%5D=1\\u0026page%5Bsize%5D=1\",\"first\":\"https://api.datadoghq.com/api/v2/team/c3124fd1-8eae-456c-b095-5a895db68088/members?filter[keyword]=Test-Get_team_hierarchy_members_paginates_by_number_and_size-1792513052\\u0026page[number]=0\\u0026page[size]=1\\u0026sort=-is_direct\",\"last\":\"https://api.datadoghq.com/api/v2/team/c3124fd1-8eae-456c-b095-5a895db68088/members?filter[keyword]=Test-Get_team_hierarchy_members_paginates_by_number_and_size-1792513052\\u0026page[number]=1\\u0026page[size]=1\\u0026sort=-is_direct\",\"prev\":\"https://api.datadoghq.com/api/v2/team/c3124fd1-8eae-456c-b095-5a895db68088/members?filter[keyword]=Test-Get_team_hierarchy_members_paginates_by_number_and_size-1792513052\\u0026page[number]=0\\u0026page[size]=1\\u0026sort=-is_direct\"}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/c3124fd1-8eae-456c-b095-5a895db68088/memberships/2b1b56ec-9ae6-4ac7-acb5-f7ef7f576369", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/users/2b1b56ec-9ae6-4ac7-acb5-f7ef7f576369", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/9e4773ce-3c0d-4a75-b7f9-9c02d15fc28e/memberships/2be6a556-0719-4824-9f49-b4ec431a5132", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/users/2be6a556-0719-4824-9f49-b4ec431a5132", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team-hierarchy-links/3461c720-496e-4460-95a6-ffa94eed2cf7", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/9e4773ce-3c0d-4a75-b7f9-9c02d15fc28e", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/c3124fd1-8eae-456c-b095-5a895db68088", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + } + ], + "scenario": "Get team hierarchy members paginates by number and size", + "version": "v2" + }, + { + "feature": "Teams", + "frozen_at": "2026-10-20T16:17:38.097Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "handle": "test-handle-d99fb67a9032e747", + "name": "test-name-d99fb67a9032e747" + }, + "type": "team" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"94df68fe-05bb-466e-9d5f-c469ec3da203\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":9,\"created_at\":\"2026-10-20T16:17:38.275526+00:00\",\"description\":null,\"handle\":\"test-handle-d99fb67a9032e747\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2026-10-20T16:17:38.275526+00:00\",\"name\":\"test-name-d99fb67a9032e747\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/94df68fe-05bb-466e-9d5f-c469ec3da203/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/94df68fe-05bb-466e-9d5f-c469ec3da203/permission-settings\"}}}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/team/94df68fe-05bb-466e-9d5f-c469ec3da203/members", + "query": [ + [ + "include", + "descendants" + ] + ] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"errors\":[{\"status\":\"400\",\"title\":\"Invalid Parameter\",\"detail\":\"'descendants' is not a valid value for include. Supported values are: [user, team]\",\"source\":{\"parameter\":\"include\"}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Bad Request", + "status": 400 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/94df68fe-05bb-466e-9d5f-c469ec3da203", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + } + ], + "scenario": "Get team hierarchy members rejects unsupported includes", + "version": "v2" + }, + { + "feature": "Teams", + "frozen_at": "2026-10-20T16:17:38.859Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "handle": "test-handle-940bd9caf95f93ca", + "name": "test-name-940bd9caf95f93ca" + }, + "type": "team" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"94164ef6-ed82-41af-a152-9d5a5b540a92\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":3,\"created_at\":\"2026-10-20T16:17:39.041449+00:00\",\"description\":null,\"handle\":\"test-handle-940bd9caf95f93ca\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2026-10-20T16:17:39.041449+00:00\",\"name\":\"test-name-940bd9caf95f93ca\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/94164ef6-ed82-41af-a152-9d5a5b540a92/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/94164ef6-ed82-41af-a152-9d5a5b540a92/permission-settings\"}}}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/team/94164ef6-ed82-41af-a152-9d5a5b540a92/members", + "query": [ + [ + "sort", + "invalid" + ] + ] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"errors\":[{\"status\":\"400\",\"title\":\"Invalid Parameter\",\"detail\":\"'invalid' is not a valid sort parameter. Supported sort parameters are: [name, handle, is_direct, provisioned_by]\",\"source\":{\"parameter\":\"sort\"}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Bad Request", + "status": 400 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/94164ef6-ed82-41af-a152-9d5a5b540a92", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + } + ], + "scenario": "Get team hierarchy members returns \"Bad Request\" response", + "version": "v2" + }, + { + "feature": "Teams", + "frozen_at": "2026-10-20T16:17:39.613Z", + "interactions": [ + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/team/00000000-0000-4000-8000-000000000000/members", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"no team found (teamId=00000000-0000-4000-8000-000000000000)\"}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Not Found", + "status": 404 + } + } + ], + "scenario": "Get team hierarchy members returns \"Not Found\" response", + "version": "v2" + }, + { + "feature": "Teams", + "frozen_at": "2026-10-20T16:17:39.824Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "handle": "test-handle-21fa5a1bbb13a2ca", + "name": "test-name-21fa5a1bbb13a2ca" + }, + "type": "team" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"02d2a4eb-5ead-425c-8950-07a4b01bec2c\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":10,\"created_at\":\"2026-10-20T16:17:40.006116+00:00\",\"description\":null,\"handle\":\"test-handle-21fa5a1bbb13a2ca\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2026-10-20T16:17:40.006116+00:00\",\"name\":\"test-name-21fa5a1bbb13a2ca\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/02d2a4eb-5ead-425c-8950-07a4b01bec2c/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/02d2a4eb-5ead-425c-8950-07a4b01bec2c/permission-settings\"}}}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "email": "Test-Get_team_hierarchy_members_returns_OK_response-1792513059@datadoghq.com", + "title": "user title" + }, + "type": "users" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/users", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"type\":\"users\",\"id\":\"a7b523b6-c43f-4435-8e0e-066635294c54\",\"attributes\":{\"uuid\":\"a7b523b6-c43f-4435-8e0e-066635294c54\",\"name\":null,\"handle\":\"test-get_team_hierarchy_members_returns_ok_response-1792513059@datadoghq.com\",\"created_at\":\"2026-10-20T16:17:40.294873+00:00\",\"modified_at\":\"2026-10-20T16:17:40.294873+00:00\",\"email\":\"test-get_team_hierarchy_members_returns_ok_response-1792513059@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/98de8457708c5ef1a3fdbdb16833255f?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\",\"last_login_time\":null},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n" + }, + "headers": { + "content-type": "application/json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "role": "admin" + }, + "relationships": { + "user": { + "data": { + "id": "a7b523b6-c43f-4435-8e0e-066635294c54", + "type": "users" + } + } + }, + "type": "team_memberships" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team/02d2a4eb-5ead-425c-8950-07a4b01bec2c/memberships", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"TeamMembership-02d2a4eb-5ead-425c-8950-07a4b01bec2c-71947480\",\"type\":\"team_memberships\",\"attributes\":{\"provisioned_by\":null,\"provisioned_by_id\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"role\":\"admin\"},\"relationships\":{\"user\":{\"data\":{\"id\":\"a7b523b6-c43f-4435-8e0e-066635294c54\",\"type\":\"users\"}}}},\"included\":[{\"id\":\"a7b523b6-c43f-4435-8e0e-066635294c54\",\"type\":\"users\",\"attributes\":{\"disabled\":false,\"email\":\"test-get_team_hierarchy_members_returns_ok_response-1792513059@datadoghq.com\",\"handle\":\"test-get_team_hierarchy_members_returns_ok_response-1792513059@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/98de8457708c5ef1a3fdbdb16833255f?d=retro\\u0026s=48\",\"name\":null,\"service_account\":false,\"status\":\"Pending\"}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/team/02d2a4eb-5ead-425c-8950-07a4b01bec2c/members", + "query": [ + [ + "filter[keyword]", + "test-get_team_hierarchy_members_returns_ok_response-1792513059@datadoghq.com" + ], + [ + "include", + "user,team" + ] + ] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":[{\"id\":\"UserTeamRelationship:02d2a4eb-5ead-425c-8950-07a4b01bec2c:a7b523b6-c43f-4435-8e0e-066635294c54\",\"type\":\"user_team_relationship\",\"attributes\":{\"direct_role\":\"admin\",\"is_direct\":true,\"provisioned_by\":null,\"provisioned_by_id\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\"},\"relationships\":{\"team\":{\"data\":{\"id\":\"02d2a4eb-5ead-425c-8950-07a4b01bec2c\",\"type\":\"teams\"}},\"user\":{\"data\":{\"id\":\"a7b523b6-c43f-4435-8e0e-066635294c54\",\"type\":\"users\"}}}}],\"meta\":{\"page\":{\"type\":\"offset_limit\",\"offset\":0,\"limit\":100,\"total\":1,\"first_offset\":0,\"prev_offset\":null,\"next_offset\":null,\"last_offset\":0}},\"links\":{\"self\":\"https://api.datadoghq.com/api/v2/team/02d2a4eb-5ead-425c-8950-07a4b01bec2c/members?filter%5Bkeyword%5D=test-get_team_hierarchy_members_returns_ok_response-1792513059%40datadoghq.com\\u0026include=user%2Cteam\",\"first\":\"https://api.datadoghq.com/api/v2/team/02d2a4eb-5ead-425c-8950-07a4b01bec2c/members?filter[keyword]=test-get_team_hierarchy_members_returns_ok_response-1792513059@datadoghq.com\\u0026include=user,team\\u0026page[limit]=100\\u0026page[offset]=0\",\"last\":\"https://api.datadoghq.com/api/v2/team/02d2a4eb-5ead-425c-8950-07a4b01bec2c/members?filter[keyword]=test-get_team_hierarchy_members_returns_ok_response-1792513059@datadoghq.com\\u0026include=user,team\\u0026page[limit]=100\\u0026page[offset]=0\"},\"included\":[{\"id\":\"a7b523b6-c43f-4435-8e0e-066635294c54\",\"type\":\"users\",\"attributes\":{\"created_at\":\"2026-10-20T16:17:40.294873+00:00\",\"disabled\":false,\"email\":\"test-get_team_hierarchy_members_returns_ok_response-1792513059@datadoghq.com\",\"handle\":\"test-get_team_hierarchy_members_returns_ok_response-1792513059@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/98de8457708c5ef1a3fdbdb16833255f?d=retro\\u0026s=48\",\"modified_at\":\"2026-10-20T16:17:40.294873+00:00\",\"name\":null,\"service_account\":false,\"status\":\"Pending\",\"title\":\"user title\",\"verified\":false}},{\"id\":\"02d2a4eb-5ead-425c-8950-07a4b01bec2c\",\"type\":\"teams\",\"attributes\":{\"handle\":\"test-handle-21fa5a1bbb13a2ca\",\"name\":\"test-name-21fa5a1bbb13a2ca\"}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/02d2a4eb-5ead-425c-8950-07a4b01bec2c/memberships/a7b523b6-c43f-4435-8e0e-066635294c54", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/users/a7b523b6-c43f-4435-8e0e-066635294c54", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/02d2a4eb-5ead-425c-8950-07a4b01bec2c", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + } + ], + "scenario": "Get team hierarchy members returns \"OK\" response", + "version": "v2" + }, + { + "feature": "Teams", + "frozen_at": "2026-10-21T18:20:16.586Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "handle": "test-handle-63ea1132a02fda4d", + "name": "test-name-63ea1132a02fda4d" + }, + "type": "team" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"4aa6a28c-26fb-4835-a93c-a7afbf705ac1\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":14,\"created_at\":\"2026-10-21T18:20:18.752288+00:00\",\"description\":null,\"handle\":\"test-handle-63ea1132a02fda4d\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2026-10-21T18:20:18.752288+00:00\",\"name\":\"test-name-63ea1132a02fda4d\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/4aa6a28c-26fb-4835-a93c-a7afbf705ac1/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/4aa6a28c-26fb-4835-a93c-a7afbf705ac1/permission-settings\"}}}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "handle": "test-handle-2-63ea1132a02fda4d", + "name": "test-name-2-63ea1132a02fda4d" + }, + "type": "team" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"b44fa329-8ba1-4302-a15e-a7fa51cd29b1\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":2,\"created_at\":\"2026-10-21T18:20:18.847457+00:00\",\"description\":null,\"handle\":\"test-handle-2-63ea1132a02fda4d\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2026-10-21T18:20:18.847457+00:00\",\"name\":\"test-name-2-63ea1132a02fda4d\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/b44fa329-8ba1-4302-a15e-a7fa51cd29b1/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/b44fa329-8ba1-4302-a15e-a7fa51cd29b1/permission-settings\"}}}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "relationships": { + "parent_team": { + "data": { + "id": "4aa6a28c-26fb-4835-a93c-a7afbf705ac1", + "type": "team" + } + }, + "sub_team": { + "data": { + "id": "b44fa329-8ba1-4302-a15e-a7fa51cd29b1", + "type": "team" + } + } + }, + "type": "team_hierarchy_links" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team-hierarchy-links", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"7da37475-d6ed-42c1-ac7f-1dc7fec6f47b\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2026-10-21T18:20:18.985967055Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"4aa6a28c-26fb-4835-a93c-a7afbf705ac1\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"b44fa329-8ba1-4302-a15e-a7fa51cd29b1\",\"type\":\"team\"}}}},\"included\":[{\"id\":\"4aa6a28c-26fb-4835-a93c-a7afbf705ac1\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":14,\"handle\":\"test-handle-63ea1132a02fda4d\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-63ea1132a02fda4d\",\"summary\":null,\"user_count\":0}},{\"id\":\"b44fa329-8ba1-4302-a15e-a7fa51cd29b1\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":2,\"handle\":\"test-handle-2-63ea1132a02fda4d\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-2-63ea1132a02fda4d\",\"summary\":null,\"user_count\":0}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "email": "hierarchy-Test-Get_team_hierarchy_members_returns_OK_response_with_pagination-1792606816@datadoghq.com", + "name": "Hierarchy member" + }, + "type": "users" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/users", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"type\":\"users\",\"id\":\"332ea5af-400d-44a9-b41e-a5050b389474\",\"attributes\":{\"uuid\":\"332ea5af-400d-44a9-b41e-a5050b389474\",\"name\":\"Hierarchy member\",\"handle\":\"hierarchy-test-get_team_hierarchy_members_returns_ok_response_with_pagination-1792606816@datadoghq.com\",\"created_at\":\"2026-10-21T18:20:19.092003+00:00\",\"modified_at\":\"2026-10-21T18:20:19.092003+00:00\",\"email\":\"hierarchy-test-get_team_hierarchy_members_returns_ok_response_with_pagination-1792606816@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/e5b9ac26b0638c99cd37f45dfe223311?s=48&d=retro\",\"title\":null,\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\",\"last_login_time\":null},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n" + }, + "headers": { + "content-type": "application/json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "role": "admin" + }, + "relationships": { + "user": { + "data": { + "id": "332ea5af-400d-44a9-b41e-a5050b389474", + "type": "users" + } + } + }, + "type": "team_memberships" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team/b44fa329-8ba1-4302-a15e-a7fa51cd29b1/memberships", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"TeamMembership-b44fa329-8ba1-4302-a15e-a7fa51cd29b1-71972306\",\"type\":\"team_memberships\",\"attributes\":{\"provisioned_by\":null,\"provisioned_by_id\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"role\":\"admin\"},\"relationships\":{\"user\":{\"data\":{\"id\":\"332ea5af-400d-44a9-b41e-a5050b389474\",\"type\":\"users\"}}}},\"included\":[{\"id\":\"332ea5af-400d-44a9-b41e-a5050b389474\",\"type\":\"users\",\"attributes\":{\"disabled\":false,\"email\":\"hierarchy-test-get_team_hierarchy_members_returns_ok_response_with_pagination-1792606816@datadoghq.com\",\"handle\":\"hierarchy-test-get_team_hierarchy_members_returns_ok_response_with_pagination-1792606816@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/e5b9ac26b0638c99cd37f45dfe223311?d=retro\\u0026s=48\",\"name\":\"Hierarchy member\",\"service_account\":false,\"status\":\"Pending\"}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "email": "Test-Get_team_hierarchy_members_returns_OK_response_with_pagination-1792606816@datadoghq.com", + "title": "user title" + }, + "type": "users" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/users", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"type\":\"users\",\"id\":\"5e946e21-2624-4259-8251-6e7ad76b5a2e\",\"attributes\":{\"uuid\":\"5e946e21-2624-4259-8251-6e7ad76b5a2e\",\"name\":null,\"handle\":\"test-get_team_hierarchy_members_returns_ok_response_with_pagination-1792606816@datadoghq.com\",\"created_at\":\"2026-10-21T18:20:19.353764+00:00\",\"modified_at\":\"2026-10-21T18:20:19.353764+00:00\",\"email\":\"test-get_team_hierarchy_members_returns_ok_response_with_pagination-1792606816@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/138b79b2d02fad9102b8cb5ef1ab21c9?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\",\"last_login_time\":null},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n" + }, + "headers": { + "content-type": "application/json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "role": "admin" + }, + "relationships": { + "user": { + "data": { + "id": "5e946e21-2624-4259-8251-6e7ad76b5a2e", + "type": "users" + } + } + }, + "type": "team_memberships" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team/4aa6a28c-26fb-4835-a93c-a7afbf705ac1/memberships", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"TeamMembership-4aa6a28c-26fb-4835-a93c-a7afbf705ac1-71972307\",\"type\":\"team_memberships\",\"attributes\":{\"provisioned_by\":null,\"provisioned_by_id\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"role\":\"admin\"},\"relationships\":{\"user\":{\"data\":{\"id\":\"5e946e21-2624-4259-8251-6e7ad76b5a2e\",\"type\":\"users\"}}}},\"included\":[{\"id\":\"5e946e21-2624-4259-8251-6e7ad76b5a2e\",\"type\":\"users\",\"attributes\":{\"disabled\":false,\"email\":\"test-get_team_hierarchy_members_returns_ok_response_with_pagination-1792606816@datadoghq.com\",\"handle\":\"test-get_team_hierarchy_members_returns_ok_response_with_pagination-1792606816@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/138b79b2d02fad9102b8cb5ef1ab21c9?d=retro\\u0026s=48\",\"name\":null,\"service_account\":false,\"status\":\"Pending\"}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/team/4aa6a28c-26fb-4835-a93c-a7afbf705ac1/members", + "query": [ + [ + "filter[keyword]", + "Test-Get_team_hierarchy_members_returns_OK_response_with_pagination-1792606816" + ], + [ + "page[number]", + "0" + ], + [ + "page[size]", + "1" + ] + ] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":[{\"id\":\"UserTeamRelationship:4aa6a28c-26fb-4835-a93c-a7afbf705ac1:5e946e21-2624-4259-8251-6e7ad76b5a2e\",\"type\":\"user_team_relationship\",\"attributes\":{\"direct_role\":\"admin\",\"is_direct\":true,\"provisioned_by\":null,\"provisioned_by_id\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\"},\"relationships\":{\"team\":{\"data\":{\"id\":\"4aa6a28c-26fb-4835-a93c-a7afbf705ac1\",\"type\":\"teams\"}},\"user\":{\"data\":{\"id\":\"5e946e21-2624-4259-8251-6e7ad76b5a2e\",\"type\":\"users\"}}}}],\"meta\":{\"page\":{\"type\":\"number_size\",\"number\":0,\"size\":1,\"total\":2,\"first_number\":0,\"prev_number\":null,\"next_number\":1,\"last_number\":1}},\"links\":{\"self\":\"https://api.datadoghq.com/api/v2/team/4aa6a28c-26fb-4835-a93c-a7afbf705ac1/members?filter%5Bkeyword%5D=Test-Get_team_hierarchy_members_returns_OK_response_with_pagination-1792606816\\u0026page%5Bsize%5D=1\\u0026page%5Bnumber%5D=0\",\"first\":\"https://api.datadoghq.com/api/v2/team/4aa6a28c-26fb-4835-a93c-a7afbf705ac1/members?filter[keyword]=Test-Get_team_hierarchy_members_returns_OK_response_with_pagination-1792606816\\u0026page[number]=0\\u0026page[size]=1\",\"last\":\"https://api.datadoghq.com/api/v2/team/4aa6a28c-26fb-4835-a93c-a7afbf705ac1/members?filter[keyword]=Test-Get_team_hierarchy_members_returns_OK_response_with_pagination-1792606816\\u0026page[number]=1\\u0026page[size]=1\",\"next\":\"https://api.datadoghq.com/api/v2/team/4aa6a28c-26fb-4835-a93c-a7afbf705ac1/members?filter[keyword]=Test-Get_team_hierarchy_members_returns_OK_response_with_pagination-1792606816\\u0026page[number]=1\\u0026page[size]=1\"}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/team/4aa6a28c-26fb-4835-a93c-a7afbf705ac1/members", + "query": [ + [ + "filter[keyword]", + "Test-Get_team_hierarchy_members_returns_OK_response_with_pagination-1792606816" + ], + [ + "page[number]", + "1" + ], + [ + "page[size]", + "1" + ] + ] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":[{\"id\":\"UserTeamRelationship:4aa6a28c-26fb-4835-a93c-a7afbf705ac1:332ea5af-400d-44a9-b41e-a5050b389474\",\"type\":\"user_team_relationship\",\"attributes\":{\"direct_role\":null,\"is_direct\":false,\"provisioned_by\":null,\"provisioned_by_id\":null},\"relationships\":{\"team\":{\"data\":{\"id\":\"4aa6a28c-26fb-4835-a93c-a7afbf705ac1\",\"type\":\"teams\"}},\"user\":{\"data\":{\"id\":\"332ea5af-400d-44a9-b41e-a5050b389474\",\"type\":\"users\"}}}}],\"meta\":{\"page\":{\"type\":\"number_size\",\"number\":1,\"size\":1,\"total\":2,\"first_number\":0,\"prev_number\":0,\"next_number\":null,\"last_number\":1}},\"links\":{\"self\":\"https://api.datadoghq.com/api/v2/team/4aa6a28c-26fb-4835-a93c-a7afbf705ac1/members?filter%5Bkeyword%5D=Test-Get_team_hierarchy_members_returns_OK_response_with_pagination-1792606816\\u0026page%5Bsize%5D=1\\u0026page%5Bnumber%5D=1\",\"first\":\"https://api.datadoghq.com/api/v2/team/4aa6a28c-26fb-4835-a93c-a7afbf705ac1/members?filter[keyword]=Test-Get_team_hierarchy_members_returns_OK_response_with_pagination-1792606816\\u0026page[number]=0\\u0026page[size]=1\",\"last\":\"https://api.datadoghq.com/api/v2/team/4aa6a28c-26fb-4835-a93c-a7afbf705ac1/members?filter[keyword]=Test-Get_team_hierarchy_members_returns_OK_response_with_pagination-1792606816\\u0026page[number]=1\\u0026page[size]=1\",\"prev\":\"https://api.datadoghq.com/api/v2/team/4aa6a28c-26fb-4835-a93c-a7afbf705ac1/members?filter[keyword]=Test-Get_team_hierarchy_members_returns_OK_response_with_pagination-1792606816\\u0026page[number]=0\\u0026page[size]=1\"}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/team/4aa6a28c-26fb-4835-a93c-a7afbf705ac1/members", + "query": [ + [ + "filter[keyword]", + "Test-Get_team_hierarchy_members_returns_OK_response_with_pagination-1792606816" + ], + [ + "page[number]", + "2" + ], + [ + "page[size]", + "1" + ] + ] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":[],\"meta\":{\"page\":{\"type\":\"number_size\",\"number\":2,\"size\":1,\"total\":2,\"first_number\":0,\"prev_number\":1,\"next_number\":null,\"last_number\":1}},\"links\":{\"self\":\"https://api.datadoghq.com/api/v2/team/4aa6a28c-26fb-4835-a93c-a7afbf705ac1/members?filter%5Bkeyword%5D=Test-Get_team_hierarchy_members_returns_OK_response_with_pagination-1792606816\\u0026page%5Bsize%5D=1\\u0026page%5Bnumber%5D=2\",\"first\":\"https://api.datadoghq.com/api/v2/team/4aa6a28c-26fb-4835-a93c-a7afbf705ac1/members?filter[keyword]=Test-Get_team_hierarchy_members_returns_OK_response_with_pagination-1792606816\\u0026page[number]=0\\u0026page[size]=1\",\"last\":\"https://api.datadoghq.com/api/v2/team/4aa6a28c-26fb-4835-a93c-a7afbf705ac1/members?filter[keyword]=Test-Get_team_hierarchy_members_returns_OK_response_with_pagination-1792606816\\u0026page[number]=1\\u0026page[size]=1\",\"prev\":\"https://api.datadoghq.com/api/v2/team/4aa6a28c-26fb-4835-a93c-a7afbf705ac1/members?filter[keyword]=Test-Get_team_hierarchy_members_returns_OK_response_with_pagination-1792606816\\u0026page[number]=1\\u0026page[size]=1\"}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/4aa6a28c-26fb-4835-a93c-a7afbf705ac1/memberships/5e946e21-2624-4259-8251-6e7ad76b5a2e", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/users/5e946e21-2624-4259-8251-6e7ad76b5a2e", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/b44fa329-8ba1-4302-a15e-a7fa51cd29b1/memberships/332ea5af-400d-44a9-b41e-a5050b389474", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/users/332ea5af-400d-44a9-b41e-a5050b389474", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team-hierarchy-links/7da37475-d6ed-42c1-ac7f-1dc7fec6f47b", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/b44fa329-8ba1-4302-a15e-a7fa51cd29b1", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/4aa6a28c-26fb-4835-a93c-a7afbf705ac1", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + } + ], + "scenario": "Get team hierarchy members returns \"OK\" response with pagination", + "version": "v2" + }, + { + "feature": "Teams", + "frozen_at": "2026-10-20T16:17:41.933Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "handle": "test-handle-ec9daca7dd9a1540", + "name": "test-name-ec9daca7dd9a1540" + }, + "type": "team" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"8c0b2465-ebba-491a-ac4c-20134ed219a5\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":5,\"created_at\":\"2026-10-20T16:17:42.121783+00:00\",\"description\":null,\"handle\":\"test-handle-ec9daca7dd9a1540\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2026-10-20T16:17:42.121783+00:00\",\"name\":\"test-name-ec9daca7dd9a1540\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/8c0b2465-ebba-491a-ac4c-20134ed219a5/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/8c0b2465-ebba-491a-ac4c-20134ed219a5/permission-settings\"}}}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "handle": "test-handle-2-ec9daca7dd9a1540", + "name": "test-name-2-ec9daca7dd9a1540" + }, + "type": "team" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"e978614e-5d76-4908-98e7-2903bfcccdba\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":8,\"created_at\":\"2026-10-20T16:17:42.368024+00:00\",\"description\":null,\"handle\":\"test-handle-2-ec9daca7dd9a1540\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2026-10-20T16:17:42.368024+00:00\",\"name\":\"test-name-2-ec9daca7dd9a1540\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/e978614e-5d76-4908-98e7-2903bfcccdba/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/e978614e-5d76-4908-98e7-2903bfcccdba/permission-settings\"}}}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "relationships": { + "parent_team": { + "data": { + "id": "8c0b2465-ebba-491a-ac4c-20134ed219a5", + "type": "team" + } + }, + "sub_team": { + "data": { + "id": "e978614e-5d76-4908-98e7-2903bfcccdba", + "type": "team" + } + } + }, + "type": "team_hierarchy_links" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team-hierarchy-links", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"f24c2d02-2043-4b18-980a-a7f7da74865f\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2026-10-20T16:17:42.660142606Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"8c0b2465-ebba-491a-ac4c-20134ed219a5\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"e978614e-5d76-4908-98e7-2903bfcccdba\",\"type\":\"team\"}}}},\"included\":[{\"id\":\"8c0b2465-ebba-491a-ac4c-20134ed219a5\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":5,\"handle\":\"test-handle-ec9daca7dd9a1540\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-ec9daca7dd9a1540\",\"summary\":null,\"user_count\":0}},{\"id\":\"e978614e-5d76-4908-98e7-2903bfcccdba\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":8,\"handle\":\"test-handle-2-ec9daca7dd9a1540\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-2-ec9daca7dd9a1540\",\"summary\":null,\"user_count\":0}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "email": "hierarchy-Test-Get_team_hierarchy_members_returns_empty_results-1792513061@datadoghq.com", + "name": "Hierarchy member" + }, + "type": "users" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/users", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"type\":\"users\",\"id\":\"afff5e9a-383d-4642-a062-4c3ea544f977\",\"attributes\":{\"uuid\":\"afff5e9a-383d-4642-a062-4c3ea544f977\",\"name\":\"Hierarchy member\",\"handle\":\"hierarchy-test-get_team_hierarchy_members_returns_empty_results-1792513061@datadoghq.com\",\"created_at\":\"2026-10-20T16:17:42.933104+00:00\",\"modified_at\":\"2026-10-20T16:17:42.933104+00:00\",\"email\":\"hierarchy-test-get_team_hierarchy_members_returns_empty_results-1792513061@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/c1f0829035833d29dcc79619ead1d412?s=48&d=retro\",\"title\":null,\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\",\"last_login_time\":null},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n" + }, + "headers": { + "content-type": "application/json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "role": "admin" + }, + "relationships": { + "user": { + "data": { + "id": "afff5e9a-383d-4642-a062-4c3ea544f977", + "type": "users" + } + } + }, + "type": "team_memberships" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team/e978614e-5d76-4908-98e7-2903bfcccdba/memberships", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"TeamMembership-e978614e-5d76-4908-98e7-2903bfcccdba-71947481\",\"type\":\"team_memberships\",\"attributes\":{\"provisioned_by\":null,\"provisioned_by_id\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"role\":\"admin\"},\"relationships\":{\"user\":{\"data\":{\"id\":\"afff5e9a-383d-4642-a062-4c3ea544f977\",\"type\":\"users\"}}}},\"included\":[{\"id\":\"afff5e9a-383d-4642-a062-4c3ea544f977\",\"type\":\"users\",\"attributes\":{\"disabled\":false,\"email\":\"hierarchy-test-get_team_hierarchy_members_returns_empty_results-1792513061@datadoghq.com\",\"handle\":\"hierarchy-test-get_team_hierarchy_members_returns_empty_results-1792513061@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/c1f0829035833d29dcc79619ead1d412?d=retro\\u0026s=48\",\"name\":\"Hierarchy member\",\"service_account\":false,\"status\":\"Pending\"}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/team/8c0b2465-ebba-491a-ac4c-20134ed219a5/members", + "query": [ + [ + "filter[keyword]", + "no-matching-member-Test-Get_team_hierarchy_members_returns_empty_results-1792513061" + ], + [ + "include", + "user,team" + ] + ] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":[],\"meta\":{\"page\":{\"type\":\"offset_limit\",\"offset\":0,\"limit\":100,\"total\":0,\"first_offset\":0,\"prev_offset\":null,\"next_offset\":null,\"last_offset\":0}},\"links\":{\"self\":\"https://api.datadoghq.com/api/v2/team/8c0b2465-ebba-491a-ac4c-20134ed219a5/members?filter%5Bkeyword%5D=no-matching-member-Test-Get_team_hierarchy_members_returns_empty_results-1792513061\\u0026include=user%2Cteam\",\"first\":\"https://api.datadoghq.com/api/v2/team/8c0b2465-ebba-491a-ac4c-20134ed219a5/members?filter[keyword]=no-matching-member-Test-Get_team_hierarchy_members_returns_empty_results-1792513061\\u0026include=user,team\\u0026page[limit]=100\\u0026page[offset]=0\",\"last\":\"https://api.datadoghq.com/api/v2/team/8c0b2465-ebba-491a-ac4c-20134ed219a5/members?filter[keyword]=no-matching-member-Test-Get_team_hierarchy_members_returns_empty_results-1792513061\\u0026include=user,team\\u0026page[limit]=100\\u0026page[offset]=0\"}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/e978614e-5d76-4908-98e7-2903bfcccdba/memberships/afff5e9a-383d-4642-a062-4c3ea544f977", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/users/afff5e9a-383d-4642-a062-4c3ea544f977", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team-hierarchy-links/f24c2d02-2043-4b18-980a-a7f7da74865f", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/e978614e-5d76-4908-98e7-2903bfcccdba", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/8c0b2465-ebba-491a-ac4c-20134ed219a5", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + } + ], + "scenario": "Get team hierarchy members returns empty results", + "version": "v2" + }, + { + "feature": "Teams", + "frozen_at": "2026-10-20T16:17:46.133Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "handle": "test-handle-16f197d2db3daaf0", + "name": "test-name-16f197d2db3daaf0" + }, + "type": "team" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"6fa845c4-6c51-48d9-a26d-a6652963d3d7\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":5,\"created_at\":\"2026-10-20T16:17:46.313985+00:00\",\"description\":null,\"handle\":\"test-handle-16f197d2db3daaf0\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2026-10-20T16:17:46.313985+00:00\",\"name\":\"test-name-16f197d2db3daaf0\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/6fa845c4-6c51-48d9-a26d-a6652963d3d7/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/6fa845c4-6c51-48d9-a26d-a6652963d3d7/permission-settings\"}}}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "handle": "test-handle-2-16f197d2db3daaf0", + "name": "test-name-2-16f197d2db3daaf0" + }, + "type": "team" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"eb2f597e-e374-495b-bc3b-50c26fcee0ee\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":5,\"created_at\":\"2026-10-20T16:17:46.560941+00:00\",\"description\":null,\"handle\":\"test-handle-2-16f197d2db3daaf0\",\"hidden_modules\":null,\"is_managed\":false,\"link_count\":0,\"modified_at\":\"2026-10-20T16:17:46.560941+00:00\",\"name\":\"test-name-2-16f197d2db3daaf0\",\"summary\":null,\"user_count\":0,\"visible_modules\":null},\"relationships\":{\"team_links\":{\"data\":[],\"links\":{\"related\":\"/api/v2/team/eb2f597e-e374-495b-bc3b-50c26fcee0ee/links\"}},\"user_team_permissions\":{\"data\":null,\"links\":{\"related\":\"/api/v2/team/eb2f597e-e374-495b-bc3b-50c26fcee0ee/permission-settings\"}}}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "relationships": { + "parent_team": { + "data": { + "id": "6fa845c4-6c51-48d9-a26d-a6652963d3d7", + "type": "team" + } + }, + "sub_team": { + "data": { + "id": "eb2f597e-e374-495b-bc3b-50c26fcee0ee", + "type": "team" + } + } + }, + "type": "team_hierarchy_links" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team-hierarchy-links", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"5793ec72-5e73-46ca-b0c3-6a74e1d64a42\",\"type\":\"team_hierarchy_links\",\"attributes\":{\"created_at\":\"2026-10-20T16:17:46.859388416Z\",\"provisioned_by\":\"\"},\"relationships\":{\"parent_team\":{\"data\":{\"id\":\"6fa845c4-6c51-48d9-a26d-a6652963d3d7\",\"type\":\"team\"}},\"sub_team\":{\"data\":{\"id\":\"eb2f597e-e374-495b-bc3b-50c26fcee0ee\",\"type\":\"team\"}}}},\"included\":[{\"id\":\"6fa845c4-6c51-48d9-a26d-a6652963d3d7\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":5,\"handle\":\"test-handle-16f197d2db3daaf0\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-16f197d2db3daaf0\",\"summary\":null,\"user_count\":0}},{\"id\":\"eb2f597e-e374-495b-bc3b-50c26fcee0ee\",\"type\":\"team\",\"attributes\":{\"avatar\":null,\"banner\":5,\"handle\":\"test-handle-2-16f197d2db3daaf0\",\"is_managed\":false,\"is_open_membership\":false,\"link_count\":0,\"name\":\"test-name-2-16f197d2db3daaf0\",\"summary\":null,\"user_count\":0}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "email": "hierarchy-Test-Get_team_hierarchy_members_sorts_inherited_members_before_direct_members-1792513066@datadoghq.com", + "name": "Hierarchy member" + }, + "type": "users" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/users", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"type\":\"users\",\"id\":\"7ac4c748-1222-4b8e-962b-a6470458bee1\",\"attributes\":{\"uuid\":\"7ac4c748-1222-4b8e-962b-a6470458bee1\",\"name\":\"Hierarchy member\",\"handle\":\"hierarchy-test-get_team_hierarchy_members_sorts_inherited_members_before_direct_members-1792513066@datadoghq.com\",\"created_at\":\"2026-10-20T16:17:47.351948+00:00\",\"modified_at\":\"2026-10-20T16:17:47.351948+00:00\",\"email\":\"hierarchy-test-get_team_hierarchy_members_sorts_inherited_members_before_direct_members-1792513066@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/3efe3bed3f3e2280994c99d58611d129?s=48&d=retro\",\"title\":null,\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\",\"last_login_time\":null},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n" + }, + "headers": { + "content-type": "application/json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "role": "admin" + }, + "relationships": { + "user": { + "data": { + "id": "7ac4c748-1222-4b8e-962b-a6470458bee1", + "type": "users" + } + } + }, + "type": "team_memberships" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team/eb2f597e-e374-495b-bc3b-50c26fcee0ee/memberships", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"TeamMembership-eb2f597e-e374-495b-bc3b-50c26fcee0ee-71947482\",\"type\":\"team_memberships\",\"attributes\":{\"provisioned_by\":null,\"provisioned_by_id\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"role\":\"admin\"},\"relationships\":{\"user\":{\"data\":{\"id\":\"7ac4c748-1222-4b8e-962b-a6470458bee1\",\"type\":\"users\"}}}},\"included\":[{\"id\":\"7ac4c748-1222-4b8e-962b-a6470458bee1\",\"type\":\"users\",\"attributes\":{\"disabled\":false,\"email\":\"hierarchy-test-get_team_hierarchy_members_sorts_inherited_members_before_direct_members-1792513066@datadoghq.com\",\"handle\":\"hierarchy-test-get_team_hierarchy_members_sorts_inherited_members_before_direct_members-1792513066@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/3efe3bed3f3e2280994c99d58611d129?d=retro\\u0026s=48\",\"name\":\"Hierarchy member\",\"service_account\":false,\"status\":\"Pending\"}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "email": "Test-Get_team_hierarchy_members_sorts_inherited_members_before_direct_members-1792513066@datadoghq.com", + "title": "user title" + }, + "type": "users" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/users", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"type\":\"users\",\"id\":\"49945882-0401-4210-82ca-d248e90069dc\",\"attributes\":{\"uuid\":\"49945882-0401-4210-82ca-d248e90069dc\",\"name\":null,\"handle\":\"test-get_team_hierarchy_members_sorts_inherited_members_before_direct_members-1792513066@datadoghq.com\",\"created_at\":\"2026-10-20T16:17:47.899573+00:00\",\"modified_at\":\"2026-10-20T16:17:47.899573+00:00\",\"email\":\"test-get_team_hierarchy_members_sorts_inherited_members_before_direct_members-1792513066@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/daaffb4fa55f118ee9b31eb5e0ee2d79?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\",\"last_login_time\":null},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}\n" + }, + "headers": { + "content-type": "application/json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "role": "admin" + }, + "relationships": { + "user": { + "data": { + "id": "49945882-0401-4210-82ca-d248e90069dc", + "type": "users" + } + } + }, + "type": "team_memberships" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/team/6fa845c4-6c51-48d9-a26d-a6652963d3d7/memberships", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"TeamMembership-6fa845c4-6c51-48d9-a26d-a6652963d3d7-71947483\",\"type\":\"team_memberships\",\"attributes\":{\"provisioned_by\":null,\"provisioned_by_id\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\",\"role\":\"admin\"},\"relationships\":{\"user\":{\"data\":{\"id\":\"49945882-0401-4210-82ca-d248e90069dc\",\"type\":\"users\"}}}},\"included\":[{\"id\":\"49945882-0401-4210-82ca-d248e90069dc\",\"type\":\"users\",\"attributes\":{\"disabled\":false,\"email\":\"test-get_team_hierarchy_members_sorts_inherited_members_before_direct_members-1792513066@datadoghq.com\",\"handle\":\"test-get_team_hierarchy_members_sorts_inherited_members_before_direct_members-1792513066@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/daaffb4fa55f118ee9b31eb5e0ee2d79?d=retro\\u0026s=48\",\"name\":null,\"service_account\":false,\"status\":\"Pending\"}}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/team/6fa845c4-6c51-48d9-a26d-a6652963d3d7/members", + "query": [ + [ + "filter[keyword]", + "Test-Get_team_hierarchy_members_sorts_inherited_members_before_direct_members-1792513066" + ], + [ + "sort", + "is_direct,-name" + ] + ] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":[{\"id\":\"UserTeamRelationship:6fa845c4-6c51-48d9-a26d-a6652963d3d7:7ac4c748-1222-4b8e-962b-a6470458bee1\",\"type\":\"user_team_relationship\",\"attributes\":{\"direct_role\":null,\"is_direct\":false,\"provisioned_by\":null,\"provisioned_by_id\":null},\"relationships\":{\"team\":{\"data\":{\"id\":\"6fa845c4-6c51-48d9-a26d-a6652963d3d7\",\"type\":\"teams\"}},\"user\":{\"data\":{\"id\":\"7ac4c748-1222-4b8e-962b-a6470458bee1\",\"type\":\"users\"}}}},{\"id\":\"UserTeamRelationship:6fa845c4-6c51-48d9-a26d-a6652963d3d7:49945882-0401-4210-82ca-d248e90069dc\",\"type\":\"user_team_relationship\",\"attributes\":{\"direct_role\":\"admin\",\"is_direct\":true,\"provisioned_by\":null,\"provisioned_by_id\":\"028000b7-d90f-4d20-b4a9-6ff4a83b7950\"},\"relationships\":{\"team\":{\"data\":{\"id\":\"6fa845c4-6c51-48d9-a26d-a6652963d3d7\",\"type\":\"teams\"}},\"user\":{\"data\":{\"id\":\"49945882-0401-4210-82ca-d248e90069dc\",\"type\":\"users\"}}}}],\"meta\":{\"page\":{\"type\":\"offset_limit\",\"offset\":0,\"limit\":100,\"total\":2,\"first_offset\":0,\"prev_offset\":null,\"next_offset\":null,\"last_offset\":0}},\"links\":{\"self\":\"https://api.datadoghq.com/api/v2/team/6fa845c4-6c51-48d9-a26d-a6652963d3d7/members?filter%5Bkeyword%5D=Test-Get_team_hierarchy_members_sorts_inherited_members_before_direct_members-1792513066\\u0026sort=is_direct%2C-name\",\"first\":\"https://api.datadoghq.com/api/v2/team/6fa845c4-6c51-48d9-a26d-a6652963d3d7/members?filter[keyword]=Test-Get_team_hierarchy_members_sorts_inherited_members_before_direct_members-1792513066\\u0026page[limit]=100\\u0026page[offset]=0\\u0026sort=is_direct,-name\",\"last\":\"https://api.datadoghq.com/api/v2/team/6fa845c4-6c51-48d9-a26d-a6652963d3d7/members?filter[keyword]=Test-Get_team_hierarchy_members_sorts_inherited_members_before_direct_members-1792513066\\u0026page[limit]=100\\u0026page[offset]=0\\u0026sort=is_direct,-name\"}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/6fa845c4-6c51-48d9-a26d-a6652963d3d7/memberships/49945882-0401-4210-82ca-d248e90069dc", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/users/49945882-0401-4210-82ca-d248e90069dc", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/eb2f597e-e374-495b-bc3b-50c26fcee0ee/memberships/7ac4c748-1222-4b8e-962b-a6470458bee1", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/users/7ac4c748-1222-4b8e-962b-a6470458bee1", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team-hierarchy-links/5793ec72-5e73-46ca-b0c3-6a74e1d64a42", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/eb2f597e-e374-495b-bc3b-50c26fcee0ee", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/team/6fa845c4-6c51-48d9-a26d-a6652963d3d7", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + } + ], + "scenario": "Get team hierarchy members sorts inherited members before direct members", + "version": "v2" + }, { "feature": "Teams", "frozen_at": "2023-08-21T19:44:49.337Z", diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index 320e733e3adf..fb57129d481e 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -20125,6 +20125,41 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "TeamLinkResponse", }, + "v2.ListTeamHierarchyMembers": { + "teamId": { + "type": "string", + "format": "", + }, + "filterIsDirectOnly": { + "type": "boolean", + "format": "", + }, + "filterIncludeServiceAccounts": { + "type": "boolean", + "format": "", + }, + "filterKeyword": { + "type": "string", + "format": "", + }, + "include": { + "type": "string", + "format": "", + }, + "sort": { + "type": "string", + "format": "", + }, + "pageNumber": { + "type": "number", + "format": "int64", + }, + "pageSize": { + "type": "number", + "format": "int64", + }, + "operationResponseType": "TeamHierarchyMembersResponse", + }, "v2.GetTeamMemberships": { "teamId": { "type": "string", diff --git a/features/v2/given.json b/features/v2/given.json index 1eecd8ab2dfb..a97e50322f71 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -1998,6 +1998,38 @@ "tag": "Teams", "operationId": "CreateTeamLink" }, + { + "parameters": [ + { + "name": "team_id", + "source": "dd_team_2.data.id" + }, + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"role\": \"admin\"\n },\n \"relationships\": {\n \"user\": {\n \"data\": {\n \"id\": \"{{team_hierarchy_user.data.id}}\",\n \"type\": \"users\"\n }\n }\n },\n \"type\": \"team_memberships\"\n }\n}" + } + ], + "step": "there is a valid \"team_hierarchy_child_membership\" in the system", + "key": "team_hierarchy_child_membership", + "tag": "Teams", + "operationId": "CreateTeamMembership" + }, + { + "parameters": [ + { + "name": "team_id", + "source": "dd_team_2.data.id" + }, + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"role\": \"admin\"\n },\n \"relationships\": {\n \"user\": {\n \"data\": {\n \"id\": \"{{user.data.id}}\",\n \"type\": \"users\"\n }\n }\n },\n \"type\": \"team_memberships\"\n }\n}" + } + ], + "step": "there is a valid \"team_hierarchy_duplicate_membership\" in the system", + "key": "team_hierarchy_duplicate_membership", + "tag": "Teams", + "operationId": "CreateTeamMembership" + }, { "parameters": [ { @@ -2043,6 +2075,18 @@ "tag": "Users", "operationId": "SendInvitations" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"users\",\n \"attributes\": {\n \"email\": \"hierarchy-{{ unique }}@datadoghq.com\",\n \"name\": \"Hierarchy member\"\n }\n }\n}" + } + ], + "step": "there is a valid \"team_hierarchy_user\" in the system", + "key": "team_hierarchy_user", + "tag": "Users", + "operationId": "CreateUser" + }, { "parameters": [ { diff --git a/features/v2/teams.feature b/features/v2/teams.feature index be7d684a4306..9bdf0e7ab456 100644 --- a/features/v2/teams.feature +++ b/features/v2/teams.feature @@ -378,6 +378,233 @@ Feature: Teams When the request with pagination is sent Then the response status is 200 OK + @team:ddoghq/teams-and-ownership + Scenario: Get team hierarchy members deduplicates direct and inherited membership + Given operation "ListTeamHierarchyMembers" enabled + And new "ListTeamHierarchyMembers" 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 there is a valid "team_hierarchy_user" in the system + And there is a valid "team_hierarchy_child_membership" in the system + And there is a valid "user" in the system + And there is a valid "team_membership" in the system + And there is a valid "team_hierarchy_duplicate_membership" in the system + And request contains "team_id" parameter from "dd_team.data.id" + And request contains "filter[keyword]" parameter with value "{{ unique }}" + And request contains "sort" parameter with value "-is_direct,handle" + And request contains "include" parameter with value "team" + When the request is sent + Then the response status is 200 OK + And the response "data" has length 2 + And the response "meta.page.total" is equal to 2 + And the response "data[0].relationships.user.data.id" is equal to "{{ user.data.id }}" + And the response "data[0].attributes.is_direct" is equal to true + And the response "data[0].attributes.direct_role" is equal to "admin" + And the response "data[1].relationships.user.data.id" is equal to "{{ team_hierarchy_user.data.id }}" + And the response "data[1].attributes.is_direct" is equal to false + And the response "included" has length 1 + And the response "included[0].id" is equal to "{{ dd_team.data.id }}" + + @team:ddoghq/teams-and-ownership + Scenario: Get team hierarchy members filters direct members + Given operation "ListTeamHierarchyMembers" enabled + And new "ListTeamHierarchyMembers" 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 there is a valid "team_hierarchy_user" in the system + And there is a valid "team_hierarchy_child_membership" in the system + And there is a valid "user" in the system + And there is a valid "team_membership" in the system + And request contains "team_id" parameter from "dd_team.data.id" + And request contains "filter[keyword]" parameter with value "{{ unique }}" + And request contains "filter[is_direct_only]" parameter with value true + And request contains "filter[include_service_accounts]" parameter with value false + When the request is sent + Then the response status is 200 OK + And the response "data" has length 1 + And the response "data[0].relationships.user.data.id" is equal to "{{ user.data.id }}" + And the response "data[0].attributes.is_direct" is equal to true + + @team:ddoghq/teams-and-ownership + Scenario: Get team hierarchy members filters names case insensitively + Given operation "ListTeamHierarchyMembers" enabled + And new "ListTeamHierarchyMembers" 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 there is a valid "team_hierarchy_user" in the system + And there is a valid "team_hierarchy_child_membership" in the system + And request contains "team_id" parameter from "dd_team.data.id" + And request contains "filter[keyword]" parameter with value "hIeRaRcHy MeMbEr" + When the request is sent + Then the response status is 200 OK + And the response "data" has length 1 + And the response "data[0].relationships.user.data.id" is equal to "{{ team_hierarchy_user.data.id }}" + + @team:ddoghq/teams-and-ownership + Scenario: Get team hierarchy members includes inherited users with null root membership attributes + Given operation "ListTeamHierarchyMembers" enabled + And new "ListTeamHierarchyMembers" 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 there is a valid "team_hierarchy_user" in the system + And there is a valid "team_hierarchy_child_membership" in the system + And request contains "team_id" parameter from "dd_team.data.id" + And request contains "filter[keyword]" parameter with value "{{ unique }}" + And request contains "include" parameter with value "user,team" + When the request is sent + Then the response status is 200 OK + And the response "data" has length 1 + And the response "data[0].attributes.is_direct" is equal to false + And the response "data[0].attributes.direct_role" is equal to null + And the response "data[0].attributes.provisioned_by" is equal to null + And the response "data[0].attributes.provisioned_by_id" is equal to null + And the response "data[0].relationships.user.data.id" is equal to "{{ team_hierarchy_user.data.id }}" + And the response "data[0].relationships.team.data.id" is equal to "{{ dd_team.data.id }}" + And the response "included" has length 2 + And the response "included" has item with field "id" with value "{{ dd_team.data.id }}" + + @team:ddoghq/teams-and-ownership + Scenario: Get team hierarchy members paginates by number and size + Given operation "ListTeamHierarchyMembers" enabled + And new "ListTeamHierarchyMembers" 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 there is a valid "team_hierarchy_user" in the system + And there is a valid "team_hierarchy_child_membership" in the system + And there is a valid "user" in the system + And there is a valid "team_membership" in the system + And request contains "team_id" parameter from "dd_team.data.id" + And request contains "filter[keyword]" parameter with value "{{ unique }}" + And request contains "sort" parameter with value "-is_direct" + And request contains "page[number]" parameter with value 1 + And request contains "page[size]" parameter with value 1 + When the request is sent + Then the response status is 200 OK + And the response "data" has length 1 + And the response "data[0].attributes.is_direct" is equal to false + And the response "meta.page.type" is equal to "number_size" + And the response "meta.page.number" is equal to 1 + And the response "meta.page.size" is equal to 1 + And the response "meta.page.total" is equal to 2 + + @skip-ruby @team:ddoghq/teams-and-ownership + Scenario: Get team hierarchy members rejects unsupported includes + Given operation "ListTeamHierarchyMembers" enabled + And new "ListTeamHierarchyMembers" request + And there is a valid "dd_team" in the system + And request contains "team_id" parameter from "dd_team.data.id" + And request contains "include" parameter with value "descendants" + When the request is sent + Then the response status is 400 Bad Request + And the response "errors[0].status" is equal to "400" + + @team:ddoghq/teams-and-ownership + Scenario: Get team hierarchy members returns "Bad Request" response + Given operation "ListTeamHierarchyMembers" enabled + And new "ListTeamHierarchyMembers" request + And there is a valid "dd_team" in the system + And request contains "team_id" parameter from "dd_team.data.id" + And request contains "sort" parameter with value "invalid" + When the request is sent + Then the response status is 400 Bad Request + And the response "errors[0].status" is equal to "400" + + @team:ddoghq/teams-and-ownership + Scenario: Get team hierarchy members returns "Not Found" response + Given operation "ListTeamHierarchyMembers" enabled + And new "ListTeamHierarchyMembers" request + And request contains "team_id" parameter with value "00000000-0000-4000-8000-000000000000" + When the request is sent + Then the response status is 404 Not Found + And the response "errors[0].status" is equal to "404" + + @team:ddoghq/teams-and-ownership + Scenario: Get team hierarchy members returns "OK" response + Given operation "ListTeamHierarchyMembers" enabled + And new "ListTeamHierarchyMembers" request + And there is a valid "dd_team" in the system + And there is a valid "user" in the system + And there is a valid "team_membership" in the system + And request contains "team_id" parameter from "dd_team.data.id" + And request contains "filter[keyword]" parameter with value "{{ user.data.attributes.email }}" + And request contains "include" parameter with value "user,team" + 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 "UserTeamRelationship:{{ dd_team.data.id }}:{{ user.data.id }}" + And the response "data[0].type" is equal to "user_team_relationship" + And the response "data[0].attributes.is_direct" is equal to true + And the response "data[0].attributes.direct_role" is equal to "admin" + And the response "data[0].relationships.user.data.type" is equal to "users" + And the response "data[0].relationships.team.data.type" is equal to "teams" + And the response "data[0].relationships.team.data.id" is equal to "{{ dd_team.data.id }}" + And the response "included" has length 2 + And the response "included" has item with field "id" with value "{{ user.data.id }}" + And the response "included" has item with field "id" with value "{{ dd_team.data.id }}" + And the response "meta.page.type" is equal to "offset_limit" + And the response "meta.page.limit" is equal to 100 + And the response "meta.page.total" is equal to 1 + + @team:ddoghq/teams-and-ownership @with-pagination + Scenario: Get team hierarchy members returns "OK" response with pagination + Given operation "ListTeamHierarchyMembers" enabled + And new "ListTeamHierarchyMembers" 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 there is a valid "team_hierarchy_user" in the system + And there is a valid "team_hierarchy_child_membership" in the system + And there is a valid "user" in the system + And there is a valid "team_membership" in the system + And request contains "team_id" parameter from "dd_team.data.id" + And request contains "filter[keyword]" parameter with value "{{ unique }}" + And request contains "page[size]" parameter with value 1 + When the request with pagination is sent + Then the response status is 200 OK + And the response has 2 items + + @team:ddoghq/teams-and-ownership + Scenario: Get team hierarchy members returns empty results + Given operation "ListTeamHierarchyMembers" enabled + And new "ListTeamHierarchyMembers" 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 there is a valid "team_hierarchy_user" in the system + And there is a valid "team_hierarchy_child_membership" in the system + And request contains "team_id" parameter from "dd_team.data.id" + And request contains "filter[keyword]" parameter with value "no-matching-member-{{ unique }}" + And request contains "include" parameter with value "user,team" + When the request is sent + Then the response status is 200 OK + And the response "data" has length 0 + And the response "meta.page.total" is equal to 0 + + @team:ddoghq/teams-and-ownership + Scenario: Get team hierarchy members sorts inherited members before direct members + Given operation "ListTeamHierarchyMembers" enabled + And new "ListTeamHierarchyMembers" 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 there is a valid "team_hierarchy_user" in the system + And there is a valid "team_hierarchy_child_membership" in the system + And there is a valid "user" in the system + And there is a valid "team_membership" in the system + And request contains "team_id" parameter from "dd_team.data.id" + And request contains "filter[keyword]" parameter with value "{{ unique }}" + And request contains "sort" parameter with value "is_direct,-name" + When the request is sent + Then the response status is 200 OK + And the response "data" has length 2 + And the response "data[0].relationships.user.data.id" is equal to "{{ team_hierarchy_user.data.id }}" + And the response "data[1].relationships.user.data.id" is equal to "{{ user.data.id }}" + @team:ddoghq/teams-and-ownership Scenario: Get team memberships returns "API error response." response Given new "GetTeamMemberships" request diff --git a/features/v2/undo.json b/features/v2/undo.json index 37961c9528f2..3bff824b2514 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -10990,6 +10990,12 @@ "type": "idempotent" } }, + "ListTeamHierarchyMembers": { + "tag": "Teams", + "undo": { + "type": "safe" + } + }, "GetTeamMemberships": { "tag": "Teams", "undo": { diff --git a/packages/datadog-api-client-common/configuration.ts b/packages/datadog-api-client-common/configuration.ts index adad5c573d2e..0d0e607d81ef 100644 --- a/packages/datadog-api-client-common/configuration.ts +++ b/packages/datadog-api-client-common/configuration.ts @@ -855,6 +855,7 @@ export function createConfiguration( "v2.updateCustomRuleset": false, "v2.addMemberTeam": false, "v2.listMemberTeams": false, + "v2.listTeamHierarchyMembers": false, "v2.removeMemberTeam": false, "v2.createTimeseriesAnomalyInvestigation": false, "v2.createWebIntegrationAccount": false, diff --git a/packages/datadog-api-client-v2/apis/TeamsApi.ts b/packages/datadog-api-client-v2/apis/TeamsApi.ts index fe5650698df5..680247807fca 100644 --- a/packages/datadog-api-client-v2/apis/TeamsApi.ts +++ b/packages/datadog-api-client-v2/apis/TeamsApi.ts @@ -19,6 +19,7 @@ import { ApiException } from "../../datadog-api-client-common/exception"; import { AddMemberTeamRequest } from "../models/AddMemberTeamRequest"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { GetTeamMembershipsSort } from "../models/GetTeamMembershipsSort"; +import { JSONAPIErrorResponse } from "../models/JSONAPIErrorResponse"; import { ListTeamsInclude } from "../models/ListTeamsInclude"; import { ListTeamsSort } from "../models/ListTeamsSort"; import { Team } from "../models/Team"; @@ -31,6 +32,8 @@ import { TeamHierarchyLink } from "../models/TeamHierarchyLink"; import { TeamHierarchyLinkCreateRequest } from "../models/TeamHierarchyLinkCreateRequest"; import { TeamHierarchyLinkResponse } from "../models/TeamHierarchyLinkResponse"; import { TeamHierarchyLinksResponse } from "../models/TeamHierarchyLinksResponse"; +import { TeamHierarchyMember } from "../models/TeamHierarchyMember"; +import { TeamHierarchyMembersResponse } from "../models/TeamHierarchyMembersResponse"; import { TeamLinkCreateRequest } from "../models/TeamLinkCreateRequest"; import { TeamLinkResponse } from "../models/TeamLinkResponse"; import { TeamLinksResponse } from "../models/TeamLinksResponse"; @@ -1300,6 +1303,110 @@ export class TeamsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async listTeamHierarchyMembers( + teamId: string, + filterIsDirectOnly?: boolean, + filterIncludeServiceAccounts?: boolean, + filterKeyword?: string, + include?: string, + sort?: string, + pageNumber?: number, + pageSize?: number, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'listTeamHierarchyMembers'"); + if (!_config.unstableOperations["v2.listTeamHierarchyMembers"]) { + throw new Error( + "Unstable operation 'listTeamHierarchyMembers' is disabled" + ); + } + + // verify required parameter 'teamId' is not null or undefined + if (teamId === null || teamId === undefined) { + throw new RequiredError("teamId", "listTeamHierarchyMembers"); + } + + // Path Params + const localVarPath = "/api/v2/team/{team_id}/members".replace( + "{team_id}", + encodeURIComponent(String(teamId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.TeamsApi.listTeamHierarchyMembers") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set IaC header + if (_config.isIaC) { + requestContext.setHeaderParam("X-Datadog-Managed-By", "iac"); + } + + // Query Params + if (filterIsDirectOnly !== undefined) { + requestContext.setQueryParam( + "filter[is_direct_only]", + ObjectSerializer.serialize(filterIsDirectOnly, "boolean", ""), + "" + ); + } + if (filterIncludeServiceAccounts !== undefined) { + requestContext.setQueryParam( + "filter[include_service_accounts]", + ObjectSerializer.serialize(filterIncludeServiceAccounts, "boolean", ""), + "" + ); + } + if (filterKeyword !== undefined) { + requestContext.setQueryParam( + "filter[keyword]", + ObjectSerializer.serialize(filterKeyword, "string", ""), + "" + ); + } + if (include !== undefined) { + requestContext.setQueryParam( + "include", + ObjectSerializer.serialize(include, "string", ""), + "" + ); + } + if (sort !== undefined) { + requestContext.setQueryParam( + "sort", + ObjectSerializer.serialize(sort, "string", ""), + "" + ); + } + if (pageNumber !== undefined) { + requestContext.setQueryParam( + "page[number]", + ObjectSerializer.serialize(pageNumber, "number", "int64"), + "" + ); + } + if (pageSize !== undefined) { + requestContext.setQueryParam( + "page[size]", + ObjectSerializer.serialize(pageSize, "number", "int64"), + "" + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async listTeams( pageNumber?: number, pageSize?: number, @@ -3305,6 +3412,91 @@ 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 listTeamHierarchyMembers + * @throws ApiException if the response code was not in [200, 299] + */ + public async listTeamHierarchyMembers( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: TeamHierarchyMembersResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "TeamHierarchyMembersResponse" + ) as TeamHierarchyMembersResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 404 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + 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: TeamHierarchyMembersResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "TeamHierarchyMembersResponse", + "" + ) as TeamHierarchyMembersResponse; + 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 @@ -4140,6 +4332,49 @@ export interface TeamsApiListTeamHierarchyLinksRequest { filterSubTeam?: string; } +export interface TeamsApiListTeamHierarchyMembersRequest { + /** + * UUID of the requested root team. + * @type string + */ + teamId: string; + /** + * Return only direct members. By default, members inherited from descendant teams are also returned. + * @type boolean + */ + filterIsDirectOnly?: boolean; + /** + * Include service accounts. Datadog support users are always excluded. + * @type boolean + */ + filterIncludeServiceAccounts?: boolean; + /** + * Filter by a case-insensitive substring of the user name, handle, or email. + * @type string + */ + filterKeyword?: string; + /** + * Comma-separated resources to include: `user` and `team`. The included team is the requested team. Whitespace is trimmed, and duplicate or empty entries are ignored. + * @type string + */ + include?: string; + /** + * Comma-separated sort fields: `name`, `handle`, `is_direct`, and `provisioned_by`. Fields are applied in order, each optionally prefixed with `-` for descending order. By default, team admins come first, followed by other direct members, then inherited members, sorted by name within each group. + * @type string + */ + sort?: string; + /** + * Zero-based page number. Negative values become 0. Defaults to 0. + * @type number + */ + pageNumber?: number; + /** + * Requested number of members per page. Defaults to and maxes out at 100. + * @type number + */ + pageSize?: number; +} + export interface TeamsApiListTeamsRequest { /** * Specific page number to return. @@ -5047,6 +5282,89 @@ export class TeamsApi { } } + /** + * List the direct and inherited members of a team, deduplicated by user. + * Members of descendant teams are included unless `filter[is_direct_only]` is true. + * Datadog support users are always excluded. + * + * Use `page[number]` and `page[size]` to paginate through the results. + * Invalid query parameters return a JSON:API error with status 400. + * Invalid or unknown team UUIDs return status 404. + * @param param The request object + */ + public listTeamHierarchyMembers( + param: TeamsApiListTeamHierarchyMembersRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.listTeamHierarchyMembers( + param.teamId, + param.filterIsDirectOnly, + param.filterIncludeServiceAccounts, + param.filterKeyword, + param.include, + param.sort, + param.pageNumber, + param.pageSize, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listTeamHierarchyMembers( + responseContext + ); + }); + }); + } + + /** + * Provide a paginated version of listTeamHierarchyMembers returning a generator with all the items. + */ + public async *listTeamHierarchyMembersWithPagination( + param: TeamsApiListTeamHierarchyMembersRequest, + options?: Configuration + ): AsyncGenerator { + let pageSize = 100; + if (param.pageSize !== undefined) { + pageSize = param.pageSize; + } + param.pageSize = pageSize; + param.pageNumber = 0; + while (true) { + const requestContext = await this.requestFactory.listTeamHierarchyMembers( + param.teamId, + param.filterIsDirectOnly, + param.filterIncludeServiceAccounts, + param.filterKeyword, + param.include, + param.sort, + param.pageNumber, + param.pageSize, + options + ); + const responseContext = await this.configuration.httpApi.send( + requestContext + ); + + const response = await this.responseProcessor.listTeamHierarchyMembers( + 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. diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index f29f4ddfa0ca..8671a2989603 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -2035,6 +2035,7 @@ export { TeamsApiListMemberTeamsRequest, TeamsApiListTeamConnectionsRequest, TeamsApiListTeamHierarchyLinksRequest, + TeamsApiListTeamHierarchyMembersRequest, TeamsApiListTeamsRequest, TeamsApiRemoveMemberTeamRequest, TeamsApiRemoveTeamHierarchyLinkRequest, @@ -9954,6 +9955,27 @@ export { TeamHierarchyLinkTeam } from "./models/TeamHierarchyLinkTeam"; export { TeamHierarchyLinkTeamAttributes } from "./models/TeamHierarchyLinkTeamAttributes"; export { TeamHierarchyLinkTeamRelationship } from "./models/TeamHierarchyLinkTeamRelationship"; export { TeamHierarchyLinkType } from "./models/TeamHierarchyLinkType"; +export { TeamHierarchyMember } from "./models/TeamHierarchyMember"; +export { TeamHierarchyMemberAttributes } from "./models/TeamHierarchyMemberAttributes"; +export { TeamHierarchyMemberIncluded } from "./models/TeamHierarchyMemberIncluded"; +export { TeamHierarchyMemberRelationships } from "./models/TeamHierarchyMemberRelationships"; +export { TeamHierarchyMembersNumberPage } from "./models/TeamHierarchyMembersNumberPage"; +export { TeamHierarchyMembersNumberPageType } from "./models/TeamHierarchyMembersNumberPageType"; +export { TeamHierarchyMembersOffsetPage } from "./models/TeamHierarchyMembersOffsetPage"; +export { TeamHierarchyMembersOffsetPageType } from "./models/TeamHierarchyMembersOffsetPageType"; +export { TeamHierarchyMembersPage } from "./models/TeamHierarchyMembersPage"; +export { TeamHierarchyMembersResponse } from "./models/TeamHierarchyMembersResponse"; +export { TeamHierarchyMembersResponseLinks } from "./models/TeamHierarchyMembersResponseLinks"; +export { TeamHierarchyMembersResponseMeta } from "./models/TeamHierarchyMembersResponseMeta"; +export { TeamHierarchyMemberTeam } from "./models/TeamHierarchyMemberTeam"; +export { TeamHierarchyMemberTeamAttributes } from "./models/TeamHierarchyMemberTeamAttributes"; +export { TeamHierarchyMemberTeamData } from "./models/TeamHierarchyMemberTeamData"; +export { TeamHierarchyMemberTeamRelationship } from "./models/TeamHierarchyMemberTeamRelationship"; +export { TeamHierarchyMemberTeamType } from "./models/TeamHierarchyMemberTeamType"; +export { TeamHierarchyMemberType } from "./models/TeamHierarchyMemberType"; +export { TeamHierarchyMemberUser } from "./models/TeamHierarchyMemberUser"; +export { TeamHierarchyMemberUserData } from "./models/TeamHierarchyMemberUserData"; +export { TeamHierarchyMemberUserRelationship } from "./models/TeamHierarchyMemberUserRelationship"; export { TeamIncluded } from "./models/TeamIncluded"; export { TeamLink } from "./models/TeamLink"; export { TeamLinkAttributes } from "./models/TeamLinkAttributes"; diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index c0bc424c4da0..5ec044ef6a69 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -6022,6 +6022,21 @@ import { TeamHierarchyLinkTeam } from "./TeamHierarchyLinkTeam"; import { TeamHierarchyLinkTeamAttributes } from "./TeamHierarchyLinkTeamAttributes"; import { TeamHierarchyLinkTeamRelationship } from "./TeamHierarchyLinkTeamRelationship"; import { TeamHierarchyLinksResponse } from "./TeamHierarchyLinksResponse"; +import { TeamHierarchyMember } from "./TeamHierarchyMember"; +import { TeamHierarchyMemberAttributes } from "./TeamHierarchyMemberAttributes"; +import { TeamHierarchyMemberRelationships } from "./TeamHierarchyMemberRelationships"; +import { TeamHierarchyMemberTeam } from "./TeamHierarchyMemberTeam"; +import { TeamHierarchyMemberTeamAttributes } from "./TeamHierarchyMemberTeamAttributes"; +import { TeamHierarchyMemberTeamData } from "./TeamHierarchyMemberTeamData"; +import { TeamHierarchyMemberTeamRelationship } from "./TeamHierarchyMemberTeamRelationship"; +import { TeamHierarchyMemberUser } from "./TeamHierarchyMemberUser"; +import { TeamHierarchyMemberUserData } from "./TeamHierarchyMemberUserData"; +import { TeamHierarchyMemberUserRelationship } from "./TeamHierarchyMemberUserRelationship"; +import { TeamHierarchyMembersNumberPage } from "./TeamHierarchyMembersNumberPage"; +import { TeamHierarchyMembersOffsetPage } from "./TeamHierarchyMembersOffsetPage"; +import { TeamHierarchyMembersResponse } from "./TeamHierarchyMembersResponse"; +import { TeamHierarchyMembersResponseLinks } from "./TeamHierarchyMembersResponseLinks"; +import { TeamHierarchyMembersResponseMeta } from "./TeamHierarchyMembersResponseMeta"; import { TeamLink } from "./TeamLink"; import { TeamLinkAttributes } from "./TeamLinkAttributes"; import { TeamLinkCreate } from "./TeamLinkCreate"; @@ -9975,6 +9990,10 @@ const enumsMap: { [key: string]: any[] } = { TagRuleType: ["blocking", "surfacing"], TeamConnectionType: ["team_connection"], TeamHierarchyLinkType: ["team_hierarchy_links"], + TeamHierarchyMemberTeamType: ["teams"], + TeamHierarchyMemberType: ["user_team_relationship"], + TeamHierarchyMembersNumberPageType: ["number_size"], + TeamHierarchyMembersOffsetPageType: ["offset_limit"], TeamLinkType: ["team_links"], TeamNotificationRuleType: ["team_notification_rules"], TeamOnCallRespondersDataRelationshipsEscalationsDataItemsType: [ @@ -17813,6 +17832,21 @@ const typeMap: { [index: string]: any } = { TeamHierarchyLinkTeamAttributes: TeamHierarchyLinkTeamAttributes, TeamHierarchyLinkTeamRelationship: TeamHierarchyLinkTeamRelationship, TeamHierarchyLinksResponse: TeamHierarchyLinksResponse, + TeamHierarchyMember: TeamHierarchyMember, + TeamHierarchyMemberAttributes: TeamHierarchyMemberAttributes, + TeamHierarchyMemberRelationships: TeamHierarchyMemberRelationships, + TeamHierarchyMemberTeam: TeamHierarchyMemberTeam, + TeamHierarchyMemberTeamAttributes: TeamHierarchyMemberTeamAttributes, + TeamHierarchyMemberTeamData: TeamHierarchyMemberTeamData, + TeamHierarchyMemberTeamRelationship: TeamHierarchyMemberTeamRelationship, + TeamHierarchyMemberUser: TeamHierarchyMemberUser, + TeamHierarchyMemberUserData: TeamHierarchyMemberUserData, + TeamHierarchyMemberUserRelationship: TeamHierarchyMemberUserRelationship, + TeamHierarchyMembersNumberPage: TeamHierarchyMembersNumberPage, + TeamHierarchyMembersOffsetPage: TeamHierarchyMembersOffsetPage, + TeamHierarchyMembersResponse: TeamHierarchyMembersResponse, + TeamHierarchyMembersResponseLinks: TeamHierarchyMembersResponseLinks, + TeamHierarchyMembersResponseMeta: TeamHierarchyMembersResponseMeta, TeamLink: TeamLink, TeamLinkAttributes: TeamLinkAttributes, TeamLinkCreate: TeamLinkCreate, @@ -19361,6 +19395,14 @@ const oneOfMap: { [index: string]: string[] } = { "SyntheticsNetworkAssertionPacketLossPercentage", "SyntheticsNetworkAssertionJitter", ], + TeamHierarchyMemberIncluded: [ + "TeamHierarchyMemberUser", + "TeamHierarchyMemberTeam", + ], + TeamHierarchyMembersPage: [ + "TeamHierarchyMembersOffsetPage", + "TeamHierarchyMembersNumberPage", + ], TeamIncluded: ["User", "TeamLink", "UserTeamPermission"], TeamOnCallRespondersIncluded: ["User", "Escalation"], TeamRoutingRulesIncluded: ["RoutingRule"], diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyMember.ts b/packages/datadog-api-client-v2/models/TeamHierarchyMember.ts new file mode 100644 index 000000000000..3581dc08a636 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyMember.ts @@ -0,0 +1,83 @@ +/** + * 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 { TeamHierarchyMemberAttributes } from "./TeamHierarchyMemberAttributes"; +import { TeamHierarchyMemberRelationships } from "./TeamHierarchyMemberRelationships"; +import { TeamHierarchyMemberType } from "./TeamHierarchyMemberType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A user relationship to the requested team. + */ +export class TeamHierarchyMember { + /** + * Membership attributes relative to the requested team. + */ + "attributes": TeamHierarchyMemberAttributes; + /** + * Relationship identifier containing the team UUID and user UUID. + */ + "id": string; + /** + * User and requested team linkage. + */ + "relationships": TeamHierarchyMemberRelationships; + /** + * Team hierarchy membership resource type. + */ + "type": TeamHierarchyMemberType; + + /** + * 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: "TeamHierarchyMemberAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + relationships: { + baseName: "relationships", + type: "TeamHierarchyMemberRelationships", + required: true, + }, + type: { + baseName: "type", + type: "TeamHierarchyMemberType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamHierarchyMember.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyMemberAttributes.ts b/packages/datadog-api-client-v2/models/TeamHierarchyMemberAttributes.ts new file mode 100644 index 000000000000..764c22b845c8 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyMemberAttributes.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 { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Membership attributes relative to the requested team. + */ +export class TeamHierarchyMemberAttributes { + /** + * Role on the requested team: admin or member. Null for inherited members. + */ + "directRole": string | null; + /** + * Whether the user belongs directly to the requested team. + */ + "isDirect": boolean; + /** + * Membership provisioner. Null for inherited members. + */ + "provisionedBy": string | null; + /** + * Identifier supplied by the membership provisioner. Null when unavailable or for inherited members. + */ + "provisionedById": string | null; + + /** + * 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 = { + directRole: { + baseName: "direct_role", + type: "string", + required: true, + }, + isDirect: { + baseName: "is_direct", + type: "boolean", + required: true, + }, + provisionedBy: { + baseName: "provisioned_by", + type: "string", + required: true, + }, + provisionedById: { + baseName: "provisioned_by_id", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamHierarchyMemberAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyMemberIncluded.ts b/packages/datadog-api-client-v2/models/TeamHierarchyMemberIncluded.ts new file mode 100644 index 000000000000..a39348f092b8 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyMemberIncluded.ts @@ -0,0 +1,18 @@ +/** + * 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 { TeamHierarchyMemberTeam } from "./TeamHierarchyMemberTeam"; +import { TeamHierarchyMemberUser } from "./TeamHierarchyMemberUser"; + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * An included user or the requested team, distinguished by resource type. + */ + +export type TeamHierarchyMemberIncluded = + | TeamHierarchyMemberUser + | TeamHierarchyMemberTeam + | UnparsedObject; diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyMemberRelationships.ts b/packages/datadog-api-client-v2/models/TeamHierarchyMemberRelationships.ts new file mode 100644 index 000000000000..e2517734b403 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyMemberRelationships.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 { TeamHierarchyMemberTeamRelationship } from "./TeamHierarchyMemberTeamRelationship"; +import { TeamHierarchyMemberUserRelationship } from "./TeamHierarchyMemberUserRelationship"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * User and requested team linkage. + */ +export class TeamHierarchyMemberRelationships { + /** + * Linkage to the requested team. + */ + "team": TeamHierarchyMemberTeamRelationship; + /** + * Linkage to the user. + */ + "user": TeamHierarchyMemberUserRelationship; + + /** + * 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 = { + team: { + baseName: "team", + type: "TeamHierarchyMemberTeamRelationship", + required: true, + }, + user: { + baseName: "user", + type: "TeamHierarchyMemberUserRelationship", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamHierarchyMemberRelationships.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyMemberTeam.ts b/packages/datadog-api-client-v2/models/TeamHierarchyMemberTeam.ts new file mode 100644 index 000000000000..eb5256d8e8fe --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyMemberTeam.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 { TeamHierarchyMemberTeamAttributes } from "./TeamHierarchyMemberTeamAttributes"; +import { TeamHierarchyMemberTeamType } from "./TeamHierarchyMemberTeamType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The requested team, included at most once. Descendant teams are not included. + */ +export class TeamHierarchyMemberTeam { + /** + * Available attributes of the requested team. + */ + "attributes"?: TeamHierarchyMemberTeamAttributes; + /** + * UUID of the requested team. + */ + "id": string; + /** + * Requested team resource type. + */ + "type": TeamHierarchyMemberTeamType; + + /** + * 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: "TeamHierarchyMemberTeamAttributes", + }, + id: { + baseName: "id", + type: "string", + required: true, + format: "uuid", + }, + type: { + baseName: "type", + type: "TeamHierarchyMemberTeamType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamHierarchyMemberTeam.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyMemberTeamAttributes.ts b/packages/datadog-api-client-v2/models/TeamHierarchyMemberTeamAttributes.ts new file mode 100644 index 000000000000..c59b68bf78cc --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyMemberTeamAttributes.ts @@ -0,0 +1,60 @@ +/** + * 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"; + +/** + * Available attributes of the requested team. + */ +export class TeamHierarchyMemberTeamAttributes { + /** + * Handle of the team. + */ + "handle"?: string; + /** + * Name of the team. + */ + "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 = { + handle: { + baseName: "handle", + type: "string", + }, + name: { + baseName: "name", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamHierarchyMemberTeamAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyMemberTeamData.ts b/packages/datadog-api-client-v2/models/TeamHierarchyMemberTeamData.ts new file mode 100644 index 000000000000..3a2f19fd12f6 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyMemberTeamData.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 { TeamHierarchyMemberTeamType } from "./TeamHierarchyMemberTeamType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Team resource identifier. + */ +export class TeamHierarchyMemberTeamData { + /** + * UUID of the team. + */ + "id": string; + /** + * Requested team resource type. + */ + "type": TeamHierarchyMemberTeamType; + + /** + * 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, + format: "uuid", + }, + type: { + baseName: "type", + type: "TeamHierarchyMemberTeamType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamHierarchyMemberTeamData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyMemberTeamRelationship.ts b/packages/datadog-api-client-v2/models/TeamHierarchyMemberTeamRelationship.ts new file mode 100644 index 000000000000..a2282112278b --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyMemberTeamRelationship.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 { TeamHierarchyMemberTeamData } from "./TeamHierarchyMemberTeamData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Linkage to the requested team. + */ +export class TeamHierarchyMemberTeamRelationship { + /** + * Team resource identifier. + */ + "data": TeamHierarchyMemberTeamData; + + /** + * 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: "TeamHierarchyMemberTeamData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamHierarchyMemberTeamRelationship.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyMemberTeamType.ts b/packages/datadog-api-client-v2/models/TeamHierarchyMemberTeamType.ts new file mode 100644 index 000000000000..c933222fa1ab --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyMemberTeamType.ts @@ -0,0 +1,14 @@ +/** + * 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"; + +/** + * Requested team resource type. + */ + +export type TeamHierarchyMemberTeamType = typeof TEAMS | UnparsedObject; +export const TEAMS = "teams"; diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyMemberType.ts b/packages/datadog-api-client-v2/models/TeamHierarchyMemberType.ts new file mode 100644 index 000000000000..2ef25ad5c387 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyMemberType.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 membership resource type. + */ + +export type TeamHierarchyMemberType = + | typeof USER_TEAM_RELATIONSHIP + | UnparsedObject; +export const USER_TEAM_RELATIONSHIP = "user_team_relationship"; diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyMemberUser.ts b/packages/datadog-api-client-v2/models/TeamHierarchyMemberUser.ts new file mode 100644 index 000000000000..eb6f4b8f021b --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyMemberUser.ts @@ -0,0 +1,74 @@ +/** + * 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 { UserAttributes } from "./UserAttributes"; +import { UsersType } from "./UsersType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A user included in the hierarchy members response. + */ +export class TeamHierarchyMemberUser { + /** + * Attributes of user object returned by the API. + */ + "attributes": UserAttributes; + /** + * UUID of the user. + */ + "id": string; + /** + * Users resource type. + */ + "type": UsersType; + + /** + * 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: "UserAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + format: "uuid", + }, + type: { + baseName: "type", + type: "UsersType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamHierarchyMemberUser.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyMemberUserData.ts b/packages/datadog-api-client-v2/models/TeamHierarchyMemberUserData.ts new file mode 100644 index 000000000000..72bae23cf929 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyMemberUserData.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 { UsersType } from "./UsersType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * User resource identifier. + */ +export class TeamHierarchyMemberUserData { + /** + * UUID of the user. + */ + "id": string; + /** + * Users resource type. + */ + "type": UsersType; + + /** + * 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, + format: "uuid", + }, + type: { + baseName: "type", + type: "UsersType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamHierarchyMemberUserData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyMemberUserRelationship.ts b/packages/datadog-api-client-v2/models/TeamHierarchyMemberUserRelationship.ts new file mode 100644 index 000000000000..16fef358fd50 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyMemberUserRelationship.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 { TeamHierarchyMemberUserData } from "./TeamHierarchyMemberUserData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Linkage to the user. + */ +export class TeamHierarchyMemberUserRelationship { + /** + * User resource identifier. + */ + "data": TeamHierarchyMemberUserData; + + /** + * 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: "TeamHierarchyMemberUserData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamHierarchyMemberUserRelationship.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyMembersNumberPage.ts b/packages/datadog-api-client-v2/models/TeamHierarchyMembersNumberPage.ts new file mode 100644 index 000000000000..7a77af6882af --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyMembersNumberPage.ts @@ -0,0 +1,124 @@ +/** + * 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 { TeamHierarchyMembersNumberPageType } from "./TeamHierarchyMembersNumberPageType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Pagination metadata using number and size. + */ +export class TeamHierarchyMembersNumberPage { + /** + * First page number. + */ + "firstNumber": number; + /** + * Last page number. Null when unavailable. + */ + "lastNumber": number | null; + /** + * Next page number. Null when unavailable. + */ + "nextNumber": number | null; + /** + * Current zero-based page number. + */ + "number": number; + /** + * Previous page number. Null when unavailable. + */ + "prevNumber": number | null; + /** + * Maximum number of members per page. + */ + "size": number; + /** + * Total number of members matching the filters. + */ + "total": number; + /** + * Pagination mode. + */ + "type": TeamHierarchyMembersNumberPageType; + + /** + * 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", + required: true, + format: "int64", + }, + lastNumber: { + baseName: "last_number", + type: "number", + required: true, + format: "int64", + }, + nextNumber: { + baseName: "next_number", + type: "number", + required: true, + format: "int64", + }, + number: { + baseName: "number", + type: "number", + required: true, + format: "int64", + }, + prevNumber: { + baseName: "prev_number", + type: "number", + required: true, + format: "int64", + }, + size: { + baseName: "size", + type: "number", + required: true, + format: "int64", + }, + total: { + baseName: "total", + type: "number", + required: true, + format: "int64", + }, + type: { + baseName: "type", + type: "TeamHierarchyMembersNumberPageType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamHierarchyMembersNumberPage.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyMembersNumberPageType.ts b/packages/datadog-api-client-v2/models/TeamHierarchyMembersNumberPageType.ts new file mode 100644 index 000000000000..0970b712e3ab --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyMembersNumberPageType.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"; + +/** + * Pagination mode. + */ + +export type TeamHierarchyMembersNumberPageType = + | typeof NUMBER_SIZE + | UnparsedObject; +export const NUMBER_SIZE = "number_size"; diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyMembersOffsetPage.ts b/packages/datadog-api-client-v2/models/TeamHierarchyMembersOffsetPage.ts new file mode 100644 index 000000000000..318c80e52d09 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyMembersOffsetPage.ts @@ -0,0 +1,124 @@ +/** + * 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 { TeamHierarchyMembersOffsetPageType } from "./TeamHierarchyMembersOffsetPageType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Pagination metadata using offset and limit. + */ +export class TeamHierarchyMembersOffsetPage { + /** + * First offset. + */ + "firstOffset": number; + /** + * Last offset. Null when unavailable. + */ + "lastOffset": number | null; + /** + * Maximum number of members per page. + */ + "limit": number; + /** + * Next offset. Null when unavailable. + */ + "nextOffset": number | null; + /** + * Current offset. + */ + "offset": number; + /** + * Previous offset. Null when unavailable. + */ + "prevOffset": number | null; + /** + * Total number of members matching the filters. + */ + "total": number; + /** + * Pagination mode. + */ + "type": TeamHierarchyMembersOffsetPageType; + + /** + * 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 = { + firstOffset: { + baseName: "first_offset", + type: "number", + required: true, + format: "int64", + }, + lastOffset: { + baseName: "last_offset", + type: "number", + required: true, + format: "int64", + }, + limit: { + baseName: "limit", + type: "number", + required: true, + format: "int64", + }, + nextOffset: { + baseName: "next_offset", + type: "number", + required: true, + format: "int64", + }, + offset: { + baseName: "offset", + type: "number", + required: true, + format: "int64", + }, + prevOffset: { + baseName: "prev_offset", + type: "number", + required: true, + format: "int64", + }, + total: { + baseName: "total", + type: "number", + required: true, + format: "int64", + }, + type: { + baseName: "type", + type: "TeamHierarchyMembersOffsetPageType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamHierarchyMembersOffsetPage.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyMembersOffsetPageType.ts b/packages/datadog-api-client-v2/models/TeamHierarchyMembersOffsetPageType.ts new file mode 100644 index 000000000000..55065261280b --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyMembersOffsetPageType.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"; + +/** + * Pagination mode. + */ + +export type TeamHierarchyMembersOffsetPageType = + | typeof OFFSET_LIMIT + | UnparsedObject; +export const OFFSET_LIMIT = "offset_limit"; diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyMembersPage.ts b/packages/datadog-api-client-v2/models/TeamHierarchyMembersPage.ts new file mode 100644 index 000000000000..72bcb5b056e8 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyMembersPage.ts @@ -0,0 +1,18 @@ +/** + * 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 { TeamHierarchyMembersNumberPage } from "./TeamHierarchyMembersNumberPage"; +import { TeamHierarchyMembersOffsetPage } from "./TeamHierarchyMembersOffsetPage"; + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Pagination metadata for the selected pagination mode. + */ + +export type TeamHierarchyMembersPage = + | TeamHierarchyMembersOffsetPage + | TeamHierarchyMembersNumberPage + | UnparsedObject; diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyMembersResponse.ts b/packages/datadog-api-client-v2/models/TeamHierarchyMembersResponse.ts new file mode 100644 index 000000000000..c158bbb4d613 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyMembersResponse.ts @@ -0,0 +1,83 @@ +/** + * 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 { TeamHierarchyMember } from "./TeamHierarchyMember"; +import { TeamHierarchyMemberIncluded } from "./TeamHierarchyMemberIncluded"; +import { TeamHierarchyMembersResponseLinks } from "./TeamHierarchyMembersResponseLinks"; +import { TeamHierarchyMembersResponseMeta } from "./TeamHierarchyMembersResponseMeta"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Direct and inherited members of the requested team. + */ +export class TeamHierarchyMembersResponse { + /** + * Membership relationships for users who belong to the requested team or inherit membership through its descendant teams. Each user appears once, even if they belong to multiple teams in the hierarchy. Each relationship identifies the user and requested team, and indicates whether the user is a direct member of the requested team. + */ + "data": Array; + /** + * Requested users and the team. May be absent when the result is empty, even if requested. + */ + "included"?: Array; + /** + * Page navigation links. Unavailable links are omitted. + */ + "links": TeamHierarchyMembersResponseLinks; + /** + * Pagination metadata for the filtered members. + */ + "meta": TeamHierarchyMembersResponseMeta; + + /** + * 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", + required: true, + }, + included: { + baseName: "included", + type: "Array", + }, + links: { + baseName: "links", + type: "TeamHierarchyMembersResponseLinks", + required: true, + }, + meta: { + baseName: "meta", + type: "TeamHierarchyMembersResponseMeta", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamHierarchyMembersResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyMembersResponseLinks.ts b/packages/datadog-api-client-v2/models/TeamHierarchyMembersResponseLinks.ts new file mode 100644 index 000000000000..ecd142a88d62 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyMembersResponseLinks.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"; + +/** + * Page navigation links. Unavailable links are omitted. + */ +export class TeamHierarchyMembersResponseLinks { + /** + * First page URL. + */ + "first"?: string; + /** + * Last page URL. + */ + "last"?: string; + /** + * Next page URL. + */ + "next"?: string; + /** + * Previous page URL. + */ + "prev"?: string; + /** + * Current page URL. + */ + "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 TeamHierarchyMembersResponseLinks.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamHierarchyMembersResponseMeta.ts b/packages/datadog-api-client-v2/models/TeamHierarchyMembersResponseMeta.ts new file mode 100644 index 000000000000..d459ae2de540 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamHierarchyMembersResponseMeta.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 { TeamHierarchyMembersPage } from "./TeamHierarchyMembersPage"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Pagination metadata for the filtered members. + */ +export class TeamHierarchyMembersResponseMeta { + /** + * Pagination metadata for the selected pagination mode. + */ + "page": TeamHierarchyMembersPage; + + /** + * 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: "TeamHierarchyMembersPage", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamHierarchyMembersResponseMeta.attributeTypeMap; + } + + public constructor() {} +}