From b6700dd030d1386adf7001d1ebb5cd2f3ec3e698 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 26 Nov 2025 09:00:34 +0000 Subject: [PATCH] Regenerate client from commit 132ac7d of spec repo --- .generator/schemas/v2/openapi.yaml | 462 +++++++++++++++++- docs/datadog_api_client.v2.model.rst | 119 +++++ examples/v2/teams/AddTeamHierarchyLink.py | 49 ++ examples/v2/teams/GetTeamHierarchyLink.py | 19 + examples/v2/teams/ListTeamHierarchyLinks.py | 27 + .../ListTeamHierarchyLinks_3360757486.py | 13 + examples/v2/teams/RemoveTeamHierarchyLink.py | 17 + src/datadog_api_client/v2/api/teams_api.py | 260 +++++++++- .../relationship_to_user_team_permission.py | 5 +- ...lationship_to_user_team_permission_data.py | 2 + .../v2/model/team_attributes.py | 20 +- .../v2/model/team_hierarchy_link.py | 72 +++ .../model/team_hierarchy_link_attributes.py | 40 ++ .../v2/model/team_hierarchy_link_create.py | 52 ++ ...eam_hierarchy_link_create_relationships.py | 55 +++ .../team_hierarchy_link_create_request.py | 40 ++ .../model/team_hierarchy_link_create_team.py | 46 ++ ...hierarchy_link_create_team_relationship.py | 40 ++ .../team_hierarchy_link_relationships.py | 48 ++ .../v2/model/team_hierarchy_link_response.py | 66 +++ .../v2/model/team_hierarchy_link_team.py | 59 +++ .../team_hierarchy_link_team_attributes.py | 104 ++++ .../team_hierarchy_link_team_relationship.py | 40 ++ .../v2/model/team_hierarchy_link_type.py | 35 ++ .../v2/model/team_hierarchy_links_response.py | 76 +++ .../teams_hierarchy_links_response_links.py | 73 +++ .../teams_hierarchy_links_response_meta.py | 44 ++ ...eams_hierarchy_links_response_meta_page.py | 97 ++++ src/datadog_api_client/v2/models/__init__.py | 36 ++ ...rchy_link_returns_conflict_response.frozen | 1 + ...rarchy_link_returns_conflict_response.yaml | 120 +++++ ...archy_link_returns_created_response.frozen | 1 + ...erarchy_link_returns_created_response.yaml | 98 ++++ ..._hierarchy_link_returns_ok_response.frozen | 1 + ...am_hierarchy_link_returns_ok_response.yaml | 98 ++++ ...archy_link_returns_success_response.frozen | 1 + ...erarchy_link_returns_success_response.yaml | 98 ++++ ...returns_api_error_response_response.frozen | 1 + ...k_returns_api_error_response_response.yaml | 18 + ..._hierarchy_link_returns_ok_response.frozen | 1 + ...am_hierarchy_link_returns_ok_response.yaml | 114 +++++ ...hierarchy_links_returns_ok_response.frozen | 1 + ...m_hierarchy_links_returns_ok_response.yaml | 114 +++++ ...returns_api_error_response_response.frozen | 1 + ...k_returns_api_error_response_response.yaml | 19 + ...hy_link_returns_no_content_response.frozen | 1 + ...rchy_link_returns_no_content_response.yaml | 115 +++++ tests/v2/features/given.json | 24 + tests/v2/features/teams.feature | 83 ++++ tests/v2/features/undo.json | 31 ++ 50 files changed, 2943 insertions(+), 14 deletions(-) create mode 100644 examples/v2/teams/AddTeamHierarchyLink.py create mode 100644 examples/v2/teams/GetTeamHierarchyLink.py create mode 100644 examples/v2/teams/ListTeamHierarchyLinks.py create mode 100644 examples/v2/teams/ListTeamHierarchyLinks_3360757486.py create mode 100644 examples/v2/teams/RemoveTeamHierarchyLink.py create mode 100644 src/datadog_api_client/v2/model/team_hierarchy_link.py create mode 100644 src/datadog_api_client/v2/model/team_hierarchy_link_attributes.py create mode 100644 src/datadog_api_client/v2/model/team_hierarchy_link_create.py create mode 100644 src/datadog_api_client/v2/model/team_hierarchy_link_create_relationships.py create mode 100644 src/datadog_api_client/v2/model/team_hierarchy_link_create_request.py create mode 100644 src/datadog_api_client/v2/model/team_hierarchy_link_create_team.py create mode 100644 src/datadog_api_client/v2/model/team_hierarchy_link_create_team_relationship.py create mode 100644 src/datadog_api_client/v2/model/team_hierarchy_link_relationships.py create mode 100644 src/datadog_api_client/v2/model/team_hierarchy_link_response.py create mode 100644 src/datadog_api_client/v2/model/team_hierarchy_link_team.py create mode 100644 src/datadog_api_client/v2/model/team_hierarchy_link_team_attributes.py create mode 100644 src/datadog_api_client/v2/model/team_hierarchy_link_team_relationship.py create mode 100644 src/datadog_api_client/v2/model/team_hierarchy_link_type.py create mode 100644 src/datadog_api_client/v2/model/team_hierarchy_links_response.py create mode 100644 src/datadog_api_client/v2/model/teams_hierarchy_links_response_links.py create mode 100644 src/datadog_api_client/v2/model/teams_hierarchy_links_response_meta.py create mode 100644 src/datadog_api_client/v2/model/teams_hierarchy_links_response_meta_page.py create mode 100644 tests/v2/cassettes/test_scenarios/test_create_a_team_hierarchy_link_returns_conflict_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_create_a_team_hierarchy_link_returns_conflict_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_create_a_team_hierarchy_link_returns_created_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_create_a_team_hierarchy_link_returns_created_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_create_a_team_hierarchy_link_returns_ok_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_create_a_team_hierarchy_link_returns_ok_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_create_a_team_hierarchy_link_returns_success_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_create_a_team_hierarchy_link_returns_success_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_get_a_team_hierarchy_link_returns_api_error_response_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_a_team_hierarchy_link_returns_api_error_response_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_get_a_team_hierarchy_link_returns_ok_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_a_team_hierarchy_link_returns_ok_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_get_team_hierarchy_links_returns_ok_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_team_hierarchy_links_returns_ok_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_remove_a_team_hierarchy_link_returns_api_error_response_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_remove_a_team_hierarchy_link_returns_api_error_response_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_remove_a_team_hierarchy_link_returns_no_content_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_remove_a_team_hierarchy_link_returns_no_content_response.yaml diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 9bceb71549..f8a48250fa 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -41410,6 +41410,7 @@ components: type: object RelationshipToUserTeamPermissionData: description: Related user team permission data + nullable: true properties: id: description: The ID of the user team permission @@ -51804,7 +51805,11 @@ components: items: description: String identifier of the module type: string + nullable: true type: array + is_managed: + description: Whether the team is managed from an external source + type: boolean link_count: description: The number of links belonging to the team format: int32 @@ -51836,6 +51841,7 @@ components: items: description: String identifier of the module type: string + nullable: true type: array required: - handle @@ -52016,6 +52022,206 @@ components: required: - data type: object + TeamHierarchyLink: + description: Team hierarchy link + properties: + attributes: + $ref: '#/components/schemas/TeamHierarchyLinkAttributes' + id: + description: The team hierarchy link's identifier + example: b8626d7e-cedd-11eb-abf5-da7ad0900001 + type: string + relationships: + $ref: '#/components/schemas/TeamHierarchyLinkRelationships' + type: + $ref: '#/components/schemas/TeamHierarchyLinkType' + required: + - attributes + - id + - type + type: object + TeamHierarchyLinkAttributes: + description: Team hierarchy link attributes + properties: + created_at: + description: Timestamp when the team hierarchy link was created + example: '' + format: date-time + type: string + provisioned_by: + description: The provisioner of the team hierarchy link + example: system + type: string + required: + - provisioned_by + - created_at + type: object + TeamHierarchyLinkCreate: + description: Team hierarchy link creation + properties: + relationships: + $ref: '#/components/schemas/TeamHierarchyLinkCreateRelationships' + type: + $ref: '#/components/schemas/TeamHierarchyLinkType' + required: + - relationships + - type + type: object + TeamHierarchyLinkCreateRelationships: + description: Team hierarchy link creation relationships + properties: + parent_team: + $ref: '#/components/schemas/TeamHierarchyLinkCreateTeamRelationship' + sub_team: + $ref: '#/components/schemas/TeamHierarchyLinkCreateTeamRelationship' + required: + - parent_team + - sub_team + type: object + TeamHierarchyLinkCreateRequest: + description: Request to create a team hierarchy link + properties: + data: + $ref: '#/components/schemas/TeamHierarchyLinkCreate' + required: + - data + type: object + TeamHierarchyLinkCreateTeam: + description: Team reference for hierarchy link creation + properties: + id: + description: The team's identifier + example: 692e8073-12c4-4c71-8408-5090bd44c9c8 + type: string + type: + $ref: '#/components/schemas/TeamType' + required: + - id + - type + type: object + TeamHierarchyLinkCreateTeamRelationship: + description: Team relationship for hierarchy link creation + properties: + data: + $ref: '#/components/schemas/TeamHierarchyLinkCreateTeam' + required: + - data + type: object + TeamHierarchyLinkRelationships: + description: Team hierarchy link relationships + properties: + parent_team: + $ref: '#/components/schemas/TeamHierarchyLinkTeamRelationship' + sub_team: + $ref: '#/components/schemas/TeamHierarchyLinkTeamRelationship' + required: + - parent_team + - sub_team + type: object + TeamHierarchyLinkResponse: + description: Team hierarchy link response + properties: + data: + $ref: '#/components/schemas/TeamHierarchyLink' + included: + description: Included teams + items: + $ref: '#/components/schemas/TeamHierarchyLinkTeam' + type: array + links: + $ref: '#/components/schemas/TeamsHierarchyLinksResponseLinks' + type: object + TeamHierarchyLinkTeam: + description: Team information in hierarchy link context + properties: + attributes: + $ref: '#/components/schemas/TeamHierarchyLinkTeamAttributes' + id: + description: The team's identifier + example: 692e8073-12c4-4c71-8408-5090bd44c9c8 + type: string + type: + $ref: '#/components/schemas/TeamType' + required: + - id + - type + type: object + TeamHierarchyLinkTeamAttributes: + description: Team attributes in hierarchy link context + properties: + avatar: + description: The team's avatar + nullable: true + type: string + banner: + description: The team's banner + format: int64 + type: integer + handle: + description: The team's handle + example: team-handle + type: string + is_managed: + description: Whether the team is managed + type: boolean + is_open_membership: + description: Whether the team has open membership + type: boolean + link_count: + description: The number of links for the team + format: int64 + type: integer + name: + description: The team's name + example: Team Name + type: string + summary: + description: The team's summary + nullable: true + type: string + user_count: + description: The number of users in the team + format: int64 + type: integer + required: + - handle + - name + type: object + TeamHierarchyLinkTeamRelationship: + description: Team hierarchy link team relationship + properties: + data: + $ref: '#/components/schemas/TeamHierarchyLinkTeam' + required: + - data + type: object + TeamHierarchyLinkType: + default: team_hierarchy_links + description: Team hierarchy link type + enum: + - team_hierarchy_links + example: team_hierarchy_links + type: string + x-enum-varnames: + - TEAM_HIERARCHY_LINKS + TeamHierarchyLinksResponse: + description: Team hierarchy links response + properties: + data: + description: Team hierarchy links response data + items: + $ref: '#/components/schemas/TeamHierarchyLink' + type: array + included: + description: Included teams + items: + $ref: '#/components/schemas/TeamHierarchyLinkTeam' + type: array + links: + $ref: '#/components/schemas/TeamsHierarchyLinksResponseLinks' + meta: + $ref: '#/components/schemas/TeamsHierarchyLinksResponseMeta' + type: object TeamIncluded: description: Included resources related to the team oneOf: @@ -52895,6 +53101,73 @@ components: - LINK_COUNT - TEAM_LINKS - USER_TEAM_PERMISSIONS + TeamsHierarchyLinksResponseLinks: + description: Teams hierarchy links response links. + properties: + first: + description: Link to the first page. + nullable: true + type: string + last: + description: Link to the last page. + nullable: true + type: string + next: + description: Link to the next page. + nullable: true + type: string + prev: + description: Link to the previous page. + nullable: true + type: string + self: + description: Link to the current object. + type: string + type: object + TeamsHierarchyLinksResponseMeta: + description: Team hierarchy links response metadata. + properties: + page: + $ref: '#/components/schemas/TeamsHierarchyLinksResponseMetaPage' + type: object + TeamsHierarchyLinksResponseMetaPage: + description: Teams hierarchy links response page metadata. + properties: + first_number: + description: First page number. + format: int64 + type: integer + last_number: + description: Last page number. + format: int64 + type: integer + next_number: + description: Next page number. + format: int64 + nullable: true + type: integer + number: + description: Page number. + format: int64 + type: integer + prev_number: + description: Previous page number. + format: int64 + nullable: true + type: integer + size: + description: Page size. + format: int64 + type: integer + total: + description: Total number of results. + format: int64 + type: integer + type: + description: Pagination type. + example: number_size + type: string + type: object TeamsResponse: description: Response with multiple teams properties: @@ -81999,6 +82272,170 @@ paths: permissions: - teams_read - teams_manage + /api/v2/team-hierarchy-links: + get: + description: List all team hierarchy links that match the provided filters. + operationId: ListTeamHierarchyLinks + parameters: + - $ref: '#/components/parameters/PageNumber' + - $ref: '#/components/parameters/PageSize' + - description: Filter by parent team ID + in: query + name: filter[parent_team] + required: false + schema: + type: string + - description: Filter by sub team ID + in: query + name: filter[sub_team] + required: false + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamHierarchyLinksResponse' + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Get team hierarchy links + tags: + - Teams + x-pagination: + limitParam: page[size] + pageParam: page[number] + resultsPath: data + x-permission: + operator: OR + permissions: + - teams_read + post: + description: Create a new team hierarchy link between a parent team and a sub + team. + operationId: AddTeamHierarchyLink + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TeamHierarchyLinkCreateRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamHierarchyLinkResponse' + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Conflict + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + - teams_manage + summary: Create a team hierarchy link + tags: + - Teams + x-permission: + operator: AND + permissions: + - teams_read + - teams_manage + /api/v2/team-hierarchy-links/{link_id}: + delete: + description: Remove a team hierarchy link by the given link_id. + operationId: RemoveTeamHierarchyLink + parameters: + - description: The team hierarchy link's identifier + in: path + name: link_id + required: true + schema: + type: string + responses: + '204': + description: No Content + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + - teams_manage + summary: Remove a team hierarchy link + tags: + - Teams + x-permission: + operator: AND + permissions: + - teams_read + - teams_manage + get: + description: Get a single team hierarchy link for the given link_id. + operationId: GetTeamHierarchyLink + parameters: + - description: The team hierarchy link's identifier + in: path + name: link_id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamHierarchyLinkResponse' + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Get a team hierarchy link + tags: + - Teams + x-permission: + operator: OR + permissions: + - teams_read /api/v2/team/connections: delete: description: Delete multiple team connections. @@ -82273,7 +82710,13 @@ paths: If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/team/{super_team_id}/member_teams: get: - description: Get all member teams. + deprecated: true + description: 'Get all member teams. + + + **Note**: This API is deprecated. For team hierarchy relationships (parent-child + + teams), use the team hierarchy links API: `GET /api/v2/team-hierarchy-links`.' operationId: ListMemberTeams parameters: - description: None @@ -82326,14 +82769,20 @@ paths: operator: OR permissions: - teams_read + x-sunset: '2026-06-01' x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' post: + deprecated: true description: 'Add a member team. Adds the team given by the `id` in the body as a member team of the super - team.' + team. + + + **Note**: This API is deprecated. For creating team hierarchy links, use the + team hierarchy links API: `POST /api/v2/team-hierarchy-links`.' operationId: AddMemberTeam parameters: - description: None @@ -82373,12 +82822,18 @@ paths: operator: OR permissions: - teams_read + x-sunset: '2026-06-01' x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/team/{super_team_id}/member_teams/{member_team_id}: delete: - description: Remove a super team's member team identified by `member_team_id`. + deprecated: true + description: 'Remove a super team''s member team identified by `member_team_id`. + + + **Note**: This API is deprecated. For deleting team hierarchy links, use the + team hierarchy links API: `DELETE /api/v2/team-hierarchy-links/{link_id}`.' operationId: RemoveMemberTeam parameters: - description: None @@ -82418,6 +82873,7 @@ paths: operator: OR permissions: - teams_read + x-sunset: '2026-06-01' x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 60fdfd49e2..00c96438a0 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -22922,6 +22922,104 @@ datadog\_api\_client.v2.model.team\_create\_request module :members: :show-inheritance: +datadog\_api\_client.v2.model.team\_hierarchy\_link module +---------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.team_hierarchy_link + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.team\_hierarchy\_link\_attributes module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.team_hierarchy_link_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.team\_hierarchy\_link\_create module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.team_hierarchy_link_create + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.team\_hierarchy\_link\_create\_relationships module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.team_hierarchy_link_create_relationships + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.team\_hierarchy\_link\_create\_request module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.team_hierarchy_link_create_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.team\_hierarchy\_link\_create\_team module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.team_hierarchy_link_create_team + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.team\_hierarchy\_link\_create\_team\_relationship module +-------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.team_hierarchy_link_create_team_relationship + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.team\_hierarchy\_link\_relationships module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.team_hierarchy_link_relationships + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.team\_hierarchy\_link\_response module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.team_hierarchy_link_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.team\_hierarchy\_link\_team module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.team_hierarchy_link_team + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.team\_hierarchy\_link\_team\_attributes module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.team_hierarchy_link_team_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.team\_hierarchy\_link\_team\_relationship module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.team_hierarchy_link_team_relationship + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.team\_hierarchy\_link\_type module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.team_hierarchy_link_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.team\_hierarchy\_links\_response module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.team_hierarchy_links_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.team\_included module --------------------------------------------------- @@ -23398,6 +23496,27 @@ datadog\_api\_client.v2.model.teams\_field module :members: :show-inheritance: +datadog\_api\_client.v2.model.teams\_hierarchy\_links\_response\_links module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.teams_hierarchy_links_response_links + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.teams\_hierarchy\_links\_response\_meta module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.teams_hierarchy_links_response_meta + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.teams\_hierarchy\_links\_response\_meta\_page module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.teams_hierarchy_links_response_meta_page + :members: + :show-inheritance: + datadog\_api\_client.v2.model.teams\_response module ---------------------------------------------------- diff --git a/examples/v2/teams/AddTeamHierarchyLink.py b/examples/v2/teams/AddTeamHierarchyLink.py new file mode 100644 index 0000000000..2824ee843a --- /dev/null +++ b/examples/v2/teams/AddTeamHierarchyLink.py @@ -0,0 +1,49 @@ +""" +Create a team hierarchy link returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.teams_api import TeamsApi +from datadog_api_client.v2.model.team_hierarchy_link_create import TeamHierarchyLinkCreate +from datadog_api_client.v2.model.team_hierarchy_link_create_relationships import TeamHierarchyLinkCreateRelationships +from datadog_api_client.v2.model.team_hierarchy_link_create_request import TeamHierarchyLinkCreateRequest +from datadog_api_client.v2.model.team_hierarchy_link_create_team import TeamHierarchyLinkCreateTeam +from datadog_api_client.v2.model.team_hierarchy_link_create_team_relationship import ( + TeamHierarchyLinkCreateTeamRelationship, +) +from datadog_api_client.v2.model.team_hierarchy_link_type import TeamHierarchyLinkType +from datadog_api_client.v2.model.team_type import TeamType + +# there is a valid "dd_team" in the system +DD_TEAM_DATA_ID = environ["DD_TEAM_DATA_ID"] + +# there is a valid "dd_team_2" in the system +DD_TEAM_2_DATA_ID = environ["DD_TEAM_2_DATA_ID"] + +body = TeamHierarchyLinkCreateRequest( + data=TeamHierarchyLinkCreate( + relationships=TeamHierarchyLinkCreateRelationships( + parent_team=TeamHierarchyLinkCreateTeamRelationship( + data=TeamHierarchyLinkCreateTeam( + id=DD_TEAM_DATA_ID, + type=TeamType.TEAM, + ), + ), + sub_team=TeamHierarchyLinkCreateTeamRelationship( + data=TeamHierarchyLinkCreateTeam( + id=DD_TEAM_2_DATA_ID, + type=TeamType.TEAM, + ), + ), + ), + type=TeamHierarchyLinkType.TEAM_HIERARCHY_LINKS, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = TeamsApi(api_client) + response = api_instance.add_team_hierarchy_link(body=body) + + print(response) diff --git a/examples/v2/teams/GetTeamHierarchyLink.py b/examples/v2/teams/GetTeamHierarchyLink.py new file mode 100644 index 0000000000..3375ca3074 --- /dev/null +++ b/examples/v2/teams/GetTeamHierarchyLink.py @@ -0,0 +1,19 @@ +""" +Get a team hierarchy link returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.teams_api import TeamsApi + +# there is a valid "team_hierarchy_link" in the system +TEAM_HIERARCHY_LINK_DATA_ID = environ["TEAM_HIERARCHY_LINK_DATA_ID"] + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = TeamsApi(api_client) + response = api_instance.get_team_hierarchy_link( + link_id=TEAM_HIERARCHY_LINK_DATA_ID, + ) + + print(response) diff --git a/examples/v2/teams/ListTeamHierarchyLinks.py b/examples/v2/teams/ListTeamHierarchyLinks.py new file mode 100644 index 0000000000..1b5a14b4b5 --- /dev/null +++ b/examples/v2/teams/ListTeamHierarchyLinks.py @@ -0,0 +1,27 @@ +""" +Get team hierarchy links returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.teams_api import TeamsApi + +# there is a valid "team_hierarchy_link" in the system +TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_PARENT_TEAM_DATA_ID = environ[ + "TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_PARENT_TEAM_DATA_ID" +] +TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_SUB_TEAM_DATA_ID = environ[ + "TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_SUB_TEAM_DATA_ID" +] + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = TeamsApi(api_client) + response = api_instance.list_team_hierarchy_links( + page_number=0, + page_size=100, + filter_parent_team=TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_PARENT_TEAM_DATA_ID, + filter_sub_team=TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_SUB_TEAM_DATA_ID, + ) + + print(response) diff --git a/examples/v2/teams/ListTeamHierarchyLinks_3360757486.py b/examples/v2/teams/ListTeamHierarchyLinks_3360757486.py new file mode 100644 index 0000000000..709734ab9a --- /dev/null +++ b/examples/v2/teams/ListTeamHierarchyLinks_3360757486.py @@ -0,0 +1,13 @@ +""" +Get team hierarchy links returns "OK" response with pagination +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.teams_api import TeamsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = TeamsApi(api_client) + items = api_instance.list_team_hierarchy_links_with_pagination() + for item in items: + print(item) diff --git a/examples/v2/teams/RemoveTeamHierarchyLink.py b/examples/v2/teams/RemoveTeamHierarchyLink.py new file mode 100644 index 0000000000..ae38e367d9 --- /dev/null +++ b/examples/v2/teams/RemoveTeamHierarchyLink.py @@ -0,0 +1,17 @@ +""" +Remove a team hierarchy link returns "No Content" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.teams_api import TeamsApi + +# there is a valid "team_hierarchy_link" in the system +TEAM_HIERARCHY_LINK_DATA_ID = environ["TEAM_HIERARCHY_LINK_DATA_ID"] + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = TeamsApi(api_client) + api_instance.remove_team_hierarchy_link( + link_id=TEAM_HIERARCHY_LINK_DATA_ID, + ) diff --git a/src/datadog_api_client/v2/api/teams_api.py b/src/datadog_api_client/v2/api/teams_api.py index 7993971eb5..707aa63931 100644 --- a/src/datadog_api_client/v2/api/teams_api.py +++ b/src/datadog_api_client/v2/api/teams_api.py @@ -5,6 +5,7 @@ import collections from typing import Any, Dict, List, Union +import warnings from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint from datadog_api_client.configuration import Configuration @@ -21,6 +22,10 @@ from datadog_api_client.v2.model.team import Team from datadog_api_client.v2.model.team_response import TeamResponse from datadog_api_client.v2.model.team_create_request import TeamCreateRequest +from datadog_api_client.v2.model.team_hierarchy_links_response import TeamHierarchyLinksResponse +from datadog_api_client.v2.model.team_hierarchy_link import TeamHierarchyLink +from datadog_api_client.v2.model.team_hierarchy_link_response import TeamHierarchyLinkResponse +from datadog_api_client.v2.model.team_hierarchy_link_create_request import TeamHierarchyLinkCreateRequest from datadog_api_client.v2.model.team_sync_response import TeamSyncResponse from datadog_api_client.v2.model.team_sync_attributes_source import TeamSyncAttributesSource from datadog_api_client.v2.model.team_sync_request import TeamSyncRequest @@ -76,6 +81,26 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._add_team_hierarchy_link_endpoint = _Endpoint( + settings={ + "response_type": (TeamHierarchyLinkResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/team-hierarchy-links", + "operation_id": "add_team_hierarchy_link", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (TeamHierarchyLinkCreateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._create_team_endpoint = _Endpoint( settings={ "response_type": (TeamResponse,), @@ -252,6 +277,29 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._get_team_hierarchy_link_endpoint = _Endpoint( + settings={ + "response_type": (TeamHierarchyLinkResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/team-hierarchy-links/{link_id}", + "operation_id": "get_team_hierarchy_link", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "link_id": { + "required": True, + "openapi_types": (str,), + "attribute": "link_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._get_team_link_endpoint = _Endpoint( settings={ "response_type": (TeamLinkResponse,), @@ -455,6 +503,43 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._list_team_hierarchy_links_endpoint = _Endpoint( + settings={ + "response_type": (TeamHierarchyLinksResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/team-hierarchy-links", + "operation_id": "list_team_hierarchy_links", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "page_number": { + "openapi_types": (int,), + "attribute": "page[number]", + "location": "query", + }, + "page_size": { + "openapi_types": (int,), + "attribute": "page[size]", + "location": "query", + }, + "filter_parent_team": { + "openapi_types": (str,), + "attribute": "filter[parent_team]", + "location": "query", + }, + "filter_sub_team": { + "openapi_types": (str,), + "attribute": "filter[sub_team]", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._list_teams_endpoint = _Endpoint( settings={ "response_type": (TeamsResponse,), @@ -538,6 +623,29 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._remove_team_hierarchy_link_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/team-hierarchy-links/{link_id}", + "operation_id": "remove_team_hierarchy_link", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "link_id": { + "required": True, + "openapi_types": (str,), + "attribute": "link_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + self._sync_teams_endpoint = _Endpoint( settings={ "response_type": None, @@ -685,11 +793,13 @@ def add_member_team( super_team_id: str, body: AddMemberTeamRequest, ) -> None: - """Add a member team. + """Add a member team. **Deprecated**. Add a member team. Adds the team given by the ``id`` in the body as a member team of the super team. + **Note** : This API is deprecated. For creating team hierarchy links, use the team hierarchy links API: ``POST /api/v2/team-hierarchy-links``. + :param super_team_id: None :type super_team_id: str :type body: AddMemberTeamRequest @@ -700,8 +810,25 @@ def add_member_team( kwargs["body"] = body + warnings.warn("add_member_team is deprecated", DeprecationWarning, stacklevel=2) return self._add_member_team_endpoint.call_with_http_info(**kwargs) + def add_team_hierarchy_link( + self, + body: TeamHierarchyLinkCreateRequest, + ) -> TeamHierarchyLinkResponse: + """Create a team hierarchy link. + + Create a new team hierarchy link between a parent team and a sub team. + + :type body: TeamHierarchyLinkCreateRequest + :rtype: TeamHierarchyLinkResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._add_team_hierarchy_link_endpoint.call_with_http_info(**kwargs) + def create_team( self, body: TeamCreateRequest, @@ -839,6 +966,23 @@ def get_team( return self._get_team_endpoint.call_with_http_info(**kwargs) + def get_team_hierarchy_link( + self, + link_id: str, + ) -> TeamHierarchyLinkResponse: + """Get a team hierarchy link. + + Get a single team hierarchy link for the given link_id. + + :param link_id: The team hierarchy link's identifier + :type link_id: str + :rtype: TeamHierarchyLinkResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["link_id"] = link_id + + return self._get_team_hierarchy_link_endpoint.call_with_http_info(**kwargs) + def get_team_link( self, team_id: str, @@ -1034,10 +1178,13 @@ def list_member_teams( page_number: Union[int, UnsetType] = unset, fields_team: Union[List[TeamsField], UnsetType] = unset, ) -> TeamsResponse: - """Get all member teams. + """Get all member teams. **Deprecated**. Get all member teams. + **Note** : This API is deprecated. For team hierarchy relationships (parent-child + teams), use the team hierarchy links API: ``GET /api/v2/team-hierarchy-links``. + :param super_team_id: None :type super_team_id: str :param page_size: Size for a given page. The maximum allowed value is 100. @@ -1060,6 +1207,7 @@ def list_member_teams( if fields_team is not unset: kwargs["fields_team"] = fields_team + warnings.warn("list_member_teams is deprecated", DeprecationWarning, stacklevel=2) return self._list_member_teams_endpoint.call_with_http_info(**kwargs) def list_member_teams_with_pagination( @@ -1110,6 +1258,92 @@ def list_member_teams_with_pagination( } return endpoint.call_with_http_info_paginated(pagination) + def list_team_hierarchy_links( + self, + *, + page_number: Union[int, UnsetType] = unset, + page_size: Union[int, UnsetType] = unset, + filter_parent_team: Union[str, UnsetType] = unset, + filter_sub_team: Union[str, UnsetType] = unset, + ) -> TeamHierarchyLinksResponse: + """Get team hierarchy links. + + List all team hierarchy links that match the provided filters. + + :param page_number: Specific page number to return. + :type page_number: int, optional + :param page_size: Size for a given page. The maximum allowed value is 100. + :type page_size: int, optional + :param filter_parent_team: Filter by parent team ID + :type filter_parent_team: str, optional + :param filter_sub_team: Filter by sub team ID + :type filter_sub_team: str, optional + :rtype: TeamHierarchyLinksResponse + """ + kwargs: Dict[str, Any] = {} + if page_number is not unset: + kwargs["page_number"] = page_number + + if page_size is not unset: + kwargs["page_size"] = page_size + + if filter_parent_team is not unset: + kwargs["filter_parent_team"] = filter_parent_team + + if filter_sub_team is not unset: + kwargs["filter_sub_team"] = filter_sub_team + + return self._list_team_hierarchy_links_endpoint.call_with_http_info(**kwargs) + + def list_team_hierarchy_links_with_pagination( + self, + *, + page_number: Union[int, UnsetType] = unset, + page_size: Union[int, UnsetType] = unset, + filter_parent_team: Union[str, UnsetType] = unset, + filter_sub_team: Union[str, UnsetType] = unset, + ) -> collections.abc.Iterable[TeamHierarchyLink]: + """Get team hierarchy links. + + Provide a paginated version of :meth:`list_team_hierarchy_links`, returning all items. + + :param page_number: Specific page number to return. + :type page_number: int, optional + :param page_size: Size for a given page. The maximum allowed value is 100. + :type page_size: int, optional + :param filter_parent_team: Filter by parent team ID + :type filter_parent_team: str, optional + :param filter_sub_team: Filter by sub team ID + :type filter_sub_team: str, optional + + :return: A generator of paginated results. + :rtype: collections.abc.Iterable[TeamHierarchyLink] + """ + kwargs: Dict[str, Any] = {} + if page_number is not unset: + kwargs["page_number"] = page_number + + if page_size is not unset: + kwargs["page_size"] = page_size + + if filter_parent_team is not unset: + kwargs["filter_parent_team"] = filter_parent_team + + if filter_sub_team is not unset: + kwargs["filter_sub_team"] = filter_sub_team + + local_page_size = get_attribute_from_path(kwargs, "page_size", 10) + endpoint = self._list_team_hierarchy_links_endpoint + set_attribute_from_path(kwargs, "page_size", local_page_size, endpoint.params_map) + pagination = { + "limit_value": local_page_size, + "results_path": "data", + "page_param": "page_number", + "endpoint": endpoint, + "kwargs": kwargs, + } + return endpoint.call_with_http_info_paginated(pagination) + def list_teams( self, *, @@ -1238,10 +1472,12 @@ def remove_member_team( super_team_id: str, member_team_id: str, ) -> None: - """Remove a member team. + """Remove a member team. **Deprecated**. Remove a super team's member team identified by ``member_team_id``. + **Note** : This API is deprecated. For deleting team hierarchy links, use the team hierarchy links API: ``DELETE /api/v2/team-hierarchy-links/{link_id}``. + :param super_team_id: None :type super_team_id: str :param member_team_id: None @@ -1253,8 +1489,26 @@ def remove_member_team( kwargs["member_team_id"] = member_team_id + warnings.warn("remove_member_team is deprecated", DeprecationWarning, stacklevel=2) return self._remove_member_team_endpoint.call_with_http_info(**kwargs) + def remove_team_hierarchy_link( + self, + link_id: str, + ) -> None: + """Remove a team hierarchy link. + + Remove a team hierarchy link by the given link_id. + + :param link_id: The team hierarchy link's identifier + :type link_id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["link_id"] = link_id + + return self._remove_team_hierarchy_link_endpoint.call_with_http_info(**kwargs) + def sync_teams( self, body: TeamSyncRequest, diff --git a/src/datadog_api_client/v2/model/relationship_to_user_team_permission.py b/src/datadog_api_client/v2/model/relationship_to_user_team_permission.py index 6c4663c10e..a78ec5e106 100644 --- a/src/datadog_api_client/v2/model/relationship_to_user_team_permission.py +++ b/src/datadog_api_client/v2/model/relationship_to_user_team_permission.py @@ -8,6 +8,7 @@ from datadog_api_client.model_utils import ( ModelNormal, cached_property, + none_type, unset, UnsetType, ) @@ -40,7 +41,7 @@ def openapi_types(_): def __init__( self_, - data: Union[RelationshipToUserTeamPermissionData, UnsetType] = unset, + data: Union[RelationshipToUserTeamPermissionData, none_type, UnsetType] = unset, links: Union[TeamRelationshipsLinks, UnsetType] = unset, **kwargs, ): @@ -48,7 +49,7 @@ def __init__( Relationship between a user team permission and a team :param data: Related user team permission data - :type data: RelationshipToUserTeamPermissionData, optional + :type data: RelationshipToUserTeamPermissionData, none_type, optional :param links: Links attributes. :type links: TeamRelationshipsLinks, optional diff --git a/src/datadog_api_client/v2/model/relationship_to_user_team_permission_data.py b/src/datadog_api_client/v2/model/relationship_to_user_team_permission_data.py index c2e8c74afc..b0a4d453f5 100644 --- a/src/datadog_api_client/v2/model/relationship_to_user_team_permission_data.py +++ b/src/datadog_api_client/v2/model/relationship_to_user_team_permission_data.py @@ -16,6 +16,8 @@ class RelationshipToUserTeamPermissionData(ModelNormal): + _nullable = True + @cached_property def openapi_types(_): from datadog_api_client.v2.model.user_team_permission_type import UserTeamPermissionType diff --git a/src/datadog_api_client/v2/model/team_attributes.py b/src/datadog_api_client/v2/model/team_attributes.py index 713ae9b7fe..272ea0a909 100644 --- a/src/datadog_api_client/v2/model/team_attributes.py +++ b/src/datadog_api_client/v2/model/team_attributes.py @@ -42,13 +42,14 @@ def openapi_types(_): "created_at": (datetime,), "description": (str, none_type), "handle": (str,), - "hidden_modules": ([str],), + "hidden_modules": ([str], none_type), + "is_managed": (bool,), "link_count": (int,), "modified_at": (datetime,), "name": (str,), "summary": (str, none_type), "user_count": (int,), - "visible_modules": ([str],), + "visible_modules": ([str], none_type), } attribute_map = { @@ -58,6 +59,7 @@ def openapi_types(_): "description": "description", "handle": "handle", "hidden_modules": "hidden_modules", + "is_managed": "is_managed", "link_count": "link_count", "modified_at": "modified_at", "name": "name", @@ -78,12 +80,13 @@ def __init__( banner: Union[int, none_type, UnsetType] = unset, created_at: Union[datetime, UnsetType] = unset, description: Union[str, none_type, UnsetType] = unset, - hidden_modules: Union[List[str], UnsetType] = unset, + hidden_modules: Union[List[str], none_type, UnsetType] = unset, + is_managed: Union[bool, UnsetType] = unset, link_count: Union[int, UnsetType] = unset, modified_at: Union[datetime, UnsetType] = unset, summary: Union[str, none_type, UnsetType] = unset, user_count: Union[int, UnsetType] = unset, - visible_modules: Union[List[str], UnsetType] = unset, + visible_modules: Union[List[str], none_type, UnsetType] = unset, **kwargs, ): """ @@ -105,7 +108,10 @@ def __init__( :type handle: str :param hidden_modules: Collection of hidden modules for the team - :type hidden_modules: [str], optional + :type hidden_modules: [str], none_type, optional + + :param is_managed: Whether the team is managed from an external source + :type is_managed: bool, optional :param link_count: The number of links belonging to the team :type link_count: int, optional @@ -123,7 +129,7 @@ def __init__( :type user_count: int, optional :param visible_modules: Collection of visible modules for the team - :type visible_modules: [str], optional + :type visible_modules: [str], none_type, optional """ if avatar is not unset: kwargs["avatar"] = avatar @@ -135,6 +141,8 @@ def __init__( kwargs["description"] = description if hidden_modules is not unset: kwargs["hidden_modules"] = hidden_modules + if is_managed is not unset: + kwargs["is_managed"] = is_managed if link_count is not unset: kwargs["link_count"] = link_count if modified_at is not unset: diff --git a/src/datadog_api_client/v2/model/team_hierarchy_link.py b/src/datadog_api_client/v2/model/team_hierarchy_link.py new file mode 100644 index 0000000000..e9bb56b77b --- /dev/null +++ b/src/datadog_api_client/v2/model/team_hierarchy_link.py @@ -0,0 +1,72 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.team_hierarchy_link_attributes import TeamHierarchyLinkAttributes + from datadog_api_client.v2.model.team_hierarchy_link_relationships import TeamHierarchyLinkRelationships + from datadog_api_client.v2.model.team_hierarchy_link_type import TeamHierarchyLinkType + + +class TeamHierarchyLink(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.team_hierarchy_link_attributes import TeamHierarchyLinkAttributes + from datadog_api_client.v2.model.team_hierarchy_link_relationships import TeamHierarchyLinkRelationships + from datadog_api_client.v2.model.team_hierarchy_link_type import TeamHierarchyLinkType + + return { + "attributes": (TeamHierarchyLinkAttributes,), + "id": (str,), + "relationships": (TeamHierarchyLinkRelationships,), + "type": (TeamHierarchyLinkType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + attributes: TeamHierarchyLinkAttributes, + id: str, + type: TeamHierarchyLinkType, + relationships: Union[TeamHierarchyLinkRelationships, UnsetType] = unset, + **kwargs, + ): + """ + Team hierarchy link + + :param attributes: Team hierarchy link attributes + :type attributes: TeamHierarchyLinkAttributes + + :param id: The team hierarchy link's identifier + :type id: str + + :param relationships: Team hierarchy link relationships + :type relationships: TeamHierarchyLinkRelationships, optional + + :param type: Team hierarchy link type + :type type: TeamHierarchyLinkType + """ + if relationships is not unset: + kwargs["relationships"] = relationships + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/team_hierarchy_link_attributes.py b/src/datadog_api_client/v2/model/team_hierarchy_link_attributes.py new file mode 100644 index 0000000000..ece028573f --- /dev/null +++ b/src/datadog_api_client/v2/model/team_hierarchy_link_attributes.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, +) + + +class TeamHierarchyLinkAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "created_at": (datetime,), + "provisioned_by": (str,), + } + + attribute_map = { + "created_at": "created_at", + "provisioned_by": "provisioned_by", + } + + def __init__(self_, created_at: datetime, provisioned_by: str, **kwargs): + """ + Team hierarchy link attributes + + :param created_at: Timestamp when the team hierarchy link was created + :type created_at: datetime + + :param provisioned_by: The provisioner of the team hierarchy link + :type provisioned_by: str + """ + super().__init__(kwargs) + + self_.created_at = created_at + self_.provisioned_by = provisioned_by diff --git a/src/datadog_api_client/v2/model/team_hierarchy_link_create.py b/src/datadog_api_client/v2/model/team_hierarchy_link_create.py new file mode 100644 index 0000000000..3a994d9c0b --- /dev/null +++ b/src/datadog_api_client/v2/model/team_hierarchy_link_create.py @@ -0,0 +1,52 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.team_hierarchy_link_create_relationships import ( + TeamHierarchyLinkCreateRelationships, + ) + from datadog_api_client.v2.model.team_hierarchy_link_type import TeamHierarchyLinkType + + +class TeamHierarchyLinkCreate(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.team_hierarchy_link_create_relationships import ( + TeamHierarchyLinkCreateRelationships, + ) + from datadog_api_client.v2.model.team_hierarchy_link_type import TeamHierarchyLinkType + + return { + "relationships": (TeamHierarchyLinkCreateRelationships,), + "type": (TeamHierarchyLinkType,), + } + + attribute_map = { + "relationships": "relationships", + "type": "type", + } + + def __init__(self_, relationships: TeamHierarchyLinkCreateRelationships, type: TeamHierarchyLinkType, **kwargs): + """ + Team hierarchy link creation + + :param relationships: Team hierarchy link creation relationships + :type relationships: TeamHierarchyLinkCreateRelationships + + :param type: Team hierarchy link type + :type type: TeamHierarchyLinkType + """ + super().__init__(kwargs) + + self_.relationships = relationships + self_.type = type diff --git a/src/datadog_api_client/v2/model/team_hierarchy_link_create_relationships.py b/src/datadog_api_client/v2/model/team_hierarchy_link_create_relationships.py new file mode 100644 index 0000000000..49ac316d46 --- /dev/null +++ b/src/datadog_api_client/v2/model/team_hierarchy_link_create_relationships.py @@ -0,0 +1,55 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.team_hierarchy_link_create_team_relationship import ( + TeamHierarchyLinkCreateTeamRelationship, + ) + + +class TeamHierarchyLinkCreateRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.team_hierarchy_link_create_team_relationship import ( + TeamHierarchyLinkCreateTeamRelationship, + ) + + return { + "parent_team": (TeamHierarchyLinkCreateTeamRelationship,), + "sub_team": (TeamHierarchyLinkCreateTeamRelationship,), + } + + attribute_map = { + "parent_team": "parent_team", + "sub_team": "sub_team", + } + + def __init__( + self_, + parent_team: TeamHierarchyLinkCreateTeamRelationship, + sub_team: TeamHierarchyLinkCreateTeamRelationship, + **kwargs, + ): + """ + Team hierarchy link creation relationships + + :param parent_team: Team relationship for hierarchy link creation + :type parent_team: TeamHierarchyLinkCreateTeamRelationship + + :param sub_team: Team relationship for hierarchy link creation + :type sub_team: TeamHierarchyLinkCreateTeamRelationship + """ + super().__init__(kwargs) + + self_.parent_team = parent_team + self_.sub_team = sub_team diff --git a/src/datadog_api_client/v2/model/team_hierarchy_link_create_request.py b/src/datadog_api_client/v2/model/team_hierarchy_link_create_request.py new file mode 100644 index 0000000000..e3f15df7bc --- /dev/null +++ b/src/datadog_api_client/v2/model/team_hierarchy_link_create_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.team_hierarchy_link_create import TeamHierarchyLinkCreate + + +class TeamHierarchyLinkCreateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.team_hierarchy_link_create import TeamHierarchyLinkCreate + + return { + "data": (TeamHierarchyLinkCreate,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: TeamHierarchyLinkCreate, **kwargs): + """ + Request to create a team hierarchy link + + :param data: Team hierarchy link creation + :type data: TeamHierarchyLinkCreate + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/team_hierarchy_link_create_team.py b/src/datadog_api_client/v2/model/team_hierarchy_link_create_team.py new file mode 100644 index 0000000000..ed5f83dddc --- /dev/null +++ b/src/datadog_api_client/v2/model/team_hierarchy_link_create_team.py @@ -0,0 +1,46 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.team_type import TeamType + + +class TeamHierarchyLinkCreateTeam(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.team_type import TeamType + + return { + "id": (str,), + "type": (TeamType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: str, type: TeamType, **kwargs): + """ + Team reference for hierarchy link creation + + :param id: The team's identifier + :type id: str + + :param type: Team type + :type type: TeamType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/team_hierarchy_link_create_team_relationship.py b/src/datadog_api_client/v2/model/team_hierarchy_link_create_team_relationship.py new file mode 100644 index 0000000000..7d1292d0f0 --- /dev/null +++ b/src/datadog_api_client/v2/model/team_hierarchy_link_create_team_relationship.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.team_hierarchy_link_create_team import TeamHierarchyLinkCreateTeam + + +class TeamHierarchyLinkCreateTeamRelationship(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.team_hierarchy_link_create_team import TeamHierarchyLinkCreateTeam + + return { + "data": (TeamHierarchyLinkCreateTeam,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: TeamHierarchyLinkCreateTeam, **kwargs): + """ + Team relationship for hierarchy link creation + + :param data: Team reference for hierarchy link creation + :type data: TeamHierarchyLinkCreateTeam + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/team_hierarchy_link_relationships.py b/src/datadog_api_client/v2/model/team_hierarchy_link_relationships.py new file mode 100644 index 0000000000..874ae3533b --- /dev/null +++ b/src/datadog_api_client/v2/model/team_hierarchy_link_relationships.py @@ -0,0 +1,48 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.team_hierarchy_link_team_relationship import TeamHierarchyLinkTeamRelationship + + +class TeamHierarchyLinkRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.team_hierarchy_link_team_relationship import TeamHierarchyLinkTeamRelationship + + return { + "parent_team": (TeamHierarchyLinkTeamRelationship,), + "sub_team": (TeamHierarchyLinkTeamRelationship,), + } + + attribute_map = { + "parent_team": "parent_team", + "sub_team": "sub_team", + } + + def __init__( + self_, parent_team: TeamHierarchyLinkTeamRelationship, sub_team: TeamHierarchyLinkTeamRelationship, **kwargs + ): + """ + Team hierarchy link relationships + + :param parent_team: Team hierarchy link team relationship + :type parent_team: TeamHierarchyLinkTeamRelationship + + :param sub_team: Team hierarchy link team relationship + :type sub_team: TeamHierarchyLinkTeamRelationship + """ + super().__init__(kwargs) + + self_.parent_team = parent_team + self_.sub_team = sub_team diff --git a/src/datadog_api_client/v2/model/team_hierarchy_link_response.py b/src/datadog_api_client/v2/model/team_hierarchy_link_response.py new file mode 100644 index 0000000000..28bd09b7e3 --- /dev/null +++ b/src/datadog_api_client/v2/model/team_hierarchy_link_response.py @@ -0,0 +1,66 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.team_hierarchy_link import TeamHierarchyLink + from datadog_api_client.v2.model.team_hierarchy_link_team import TeamHierarchyLinkTeam + from datadog_api_client.v2.model.teams_hierarchy_links_response_links import TeamsHierarchyLinksResponseLinks + + +class TeamHierarchyLinkResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.team_hierarchy_link import TeamHierarchyLink + from datadog_api_client.v2.model.team_hierarchy_link_team import TeamHierarchyLinkTeam + from datadog_api_client.v2.model.teams_hierarchy_links_response_links import TeamsHierarchyLinksResponseLinks + + return { + "data": (TeamHierarchyLink,), + "included": ([TeamHierarchyLinkTeam],), + "links": (TeamsHierarchyLinksResponseLinks,), + } + + attribute_map = { + "data": "data", + "included": "included", + "links": "links", + } + + def __init__( + self_, + data: Union[TeamHierarchyLink, UnsetType] = unset, + included: Union[List[TeamHierarchyLinkTeam], UnsetType] = unset, + links: Union[TeamsHierarchyLinksResponseLinks, UnsetType] = unset, + **kwargs, + ): + """ + Team hierarchy link response + + :param data: Team hierarchy link + :type data: TeamHierarchyLink, optional + + :param included: Included teams + :type included: [TeamHierarchyLinkTeam], optional + + :param links: Teams hierarchy links response links. + :type links: TeamsHierarchyLinksResponseLinks, optional + """ + if data is not unset: + kwargs["data"] = data + if included is not unset: + kwargs["included"] = included + if links is not unset: + kwargs["links"] = links + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/team_hierarchy_link_team.py b/src/datadog_api_client/v2/model/team_hierarchy_link_team.py new file mode 100644 index 0000000000..36e209ab2b --- /dev/null +++ b/src/datadog_api_client/v2/model/team_hierarchy_link_team.py @@ -0,0 +1,59 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.team_hierarchy_link_team_attributes import TeamHierarchyLinkTeamAttributes + from datadog_api_client.v2.model.team_type import TeamType + + +class TeamHierarchyLinkTeam(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.team_hierarchy_link_team_attributes import TeamHierarchyLinkTeamAttributes + from datadog_api_client.v2.model.team_type import TeamType + + return { + "attributes": (TeamHierarchyLinkTeamAttributes,), + "id": (str,), + "type": (TeamType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, id: str, type: TeamType, attributes: Union[TeamHierarchyLinkTeamAttributes, UnsetType] = unset, **kwargs + ): + """ + Team information in hierarchy link context + + :param attributes: Team attributes in hierarchy link context + :type attributes: TeamHierarchyLinkTeamAttributes, optional + + :param id: The team's identifier + :type id: str + + :param type: Team type + :type type: TeamType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/team_hierarchy_link_team_attributes.py b/src/datadog_api_client/v2/model/team_hierarchy_link_team_attributes.py new file mode 100644 index 0000000000..abebc06ad9 --- /dev/null +++ b/src/datadog_api_client/v2/model/team_hierarchy_link_team_attributes.py @@ -0,0 +1,104 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + none_type, + unset, + UnsetType, +) + + +class TeamHierarchyLinkTeamAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "avatar": (str, none_type), + "banner": (int,), + "handle": (str,), + "is_managed": (bool,), + "is_open_membership": (bool,), + "link_count": (int,), + "name": (str,), + "summary": (str, none_type), + "user_count": (int,), + } + + attribute_map = { + "avatar": "avatar", + "banner": "banner", + "handle": "handle", + "is_managed": "is_managed", + "is_open_membership": "is_open_membership", + "link_count": "link_count", + "name": "name", + "summary": "summary", + "user_count": "user_count", + } + + def __init__( + self_, + handle: str, + name: str, + avatar: Union[str, none_type, UnsetType] = unset, + banner: Union[int, UnsetType] = unset, + is_managed: Union[bool, UnsetType] = unset, + is_open_membership: Union[bool, UnsetType] = unset, + link_count: Union[int, UnsetType] = unset, + summary: Union[str, none_type, UnsetType] = unset, + user_count: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + Team attributes in hierarchy link context + + :param avatar: The team's avatar + :type avatar: str, none_type, optional + + :param banner: The team's banner + :type banner: int, optional + + :param handle: The team's handle + :type handle: str + + :param is_managed: Whether the team is managed + :type is_managed: bool, optional + + :param is_open_membership: Whether the team has open membership + :type is_open_membership: bool, optional + + :param link_count: The number of links for the team + :type link_count: int, optional + + :param name: The team's name + :type name: str + + :param summary: The team's summary + :type summary: str, none_type, optional + + :param user_count: The number of users in the team + :type user_count: int, optional + """ + if avatar is not unset: + kwargs["avatar"] = avatar + if banner is not unset: + kwargs["banner"] = banner + if is_managed is not unset: + kwargs["is_managed"] = is_managed + if is_open_membership is not unset: + kwargs["is_open_membership"] = is_open_membership + if link_count is not unset: + kwargs["link_count"] = link_count + if summary is not unset: + kwargs["summary"] = summary + if user_count is not unset: + kwargs["user_count"] = user_count + super().__init__(kwargs) + + self_.handle = handle + self_.name = name diff --git a/src/datadog_api_client/v2/model/team_hierarchy_link_team_relationship.py b/src/datadog_api_client/v2/model/team_hierarchy_link_team_relationship.py new file mode 100644 index 0000000000..90aa4b559b --- /dev/null +++ b/src/datadog_api_client/v2/model/team_hierarchy_link_team_relationship.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.team_hierarchy_link_team import TeamHierarchyLinkTeam + + +class TeamHierarchyLinkTeamRelationship(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.team_hierarchy_link_team import TeamHierarchyLinkTeam + + return { + "data": (TeamHierarchyLinkTeam,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: TeamHierarchyLinkTeam, **kwargs): + """ + Team hierarchy link team relationship + + :param data: Team information in hierarchy link context + :type data: TeamHierarchyLinkTeam + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/team_hierarchy_link_type.py b/src/datadog_api_client/v2/model/team_hierarchy_link_type.py new file mode 100644 index 0000000000..ad13ffdf62 --- /dev/null +++ b/src/datadog_api_client/v2/model/team_hierarchy_link_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class TeamHierarchyLinkType(ModelSimple): + """ + Team hierarchy link type + + :param value: If omitted defaults to "team_hierarchy_links". Must be one of ["team_hierarchy_links"]. + :type value: str + """ + + allowed_values = { + "team_hierarchy_links", + } + TEAM_HIERARCHY_LINKS: ClassVar["TeamHierarchyLinkType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +TeamHierarchyLinkType.TEAM_HIERARCHY_LINKS = TeamHierarchyLinkType("team_hierarchy_links") diff --git a/src/datadog_api_client/v2/model/team_hierarchy_links_response.py b/src/datadog_api_client/v2/model/team_hierarchy_links_response.py new file mode 100644 index 0000000000..99e133a7b7 --- /dev/null +++ b/src/datadog_api_client/v2/model/team_hierarchy_links_response.py @@ -0,0 +1,76 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.team_hierarchy_link import TeamHierarchyLink + from datadog_api_client.v2.model.team_hierarchy_link_team import TeamHierarchyLinkTeam + from datadog_api_client.v2.model.teams_hierarchy_links_response_links import TeamsHierarchyLinksResponseLinks + from datadog_api_client.v2.model.teams_hierarchy_links_response_meta import TeamsHierarchyLinksResponseMeta + + +class TeamHierarchyLinksResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.team_hierarchy_link import TeamHierarchyLink + from datadog_api_client.v2.model.team_hierarchy_link_team import TeamHierarchyLinkTeam + from datadog_api_client.v2.model.teams_hierarchy_links_response_links import TeamsHierarchyLinksResponseLinks + from datadog_api_client.v2.model.teams_hierarchy_links_response_meta import TeamsHierarchyLinksResponseMeta + + return { + "data": ([TeamHierarchyLink],), + "included": ([TeamHierarchyLinkTeam],), + "links": (TeamsHierarchyLinksResponseLinks,), + "meta": (TeamsHierarchyLinksResponseMeta,), + } + + attribute_map = { + "data": "data", + "included": "included", + "links": "links", + "meta": "meta", + } + + def __init__( + self_, + data: Union[List[TeamHierarchyLink], UnsetType] = unset, + included: Union[List[TeamHierarchyLinkTeam], UnsetType] = unset, + links: Union[TeamsHierarchyLinksResponseLinks, UnsetType] = unset, + meta: Union[TeamsHierarchyLinksResponseMeta, UnsetType] = unset, + **kwargs, + ): + """ + Team hierarchy links response + + :param data: Team hierarchy links response data + :type data: [TeamHierarchyLink], optional + + :param included: Included teams + :type included: [TeamHierarchyLinkTeam], optional + + :param links: Teams hierarchy links response links. + :type links: TeamsHierarchyLinksResponseLinks, optional + + :param meta: Team hierarchy links response metadata. + :type meta: TeamsHierarchyLinksResponseMeta, optional + """ + if data is not unset: + kwargs["data"] = data + if included is not unset: + kwargs["included"] = included + if links is not unset: + kwargs["links"] = links + if meta is not unset: + kwargs["meta"] = meta + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/teams_hierarchy_links_response_links.py b/src/datadog_api_client/v2/model/teams_hierarchy_links_response_links.py new file mode 100644 index 0000000000..38b8fd7050 --- /dev/null +++ b/src/datadog_api_client/v2/model/teams_hierarchy_links_response_links.py @@ -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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + none_type, + unset, + UnsetType, +) + + +class TeamsHierarchyLinksResponseLinks(ModelNormal): + @cached_property + def openapi_types(_): + return { + "first": (str, none_type), + "last": (str, none_type), + "next": (str, none_type), + "prev": (str, none_type), + "self": (str,), + } + + attribute_map = { + "first": "first", + "last": "last", + "next": "next", + "prev": "prev", + "self": "self", + } + + def __init__( + self_, + first: Union[str, none_type, UnsetType] = unset, + last: Union[str, none_type, UnsetType] = unset, + next: Union[str, none_type, UnsetType] = unset, + prev: Union[str, none_type, UnsetType] = unset, + self: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Teams hierarchy links response links. + + :param first: Link to the first page. + :type first: str, none_type, optional + + :param last: Link to the last page. + :type last: str, none_type, optional + + :param next: Link to the next page. + :type next: str, none_type, optional + + :param prev: Link to the previous page. + :type prev: str, none_type, optional + + :param self: Link to the current object. + :type self: str, optional + """ + if first is not unset: + kwargs["first"] = first + if last is not unset: + kwargs["last"] = last + if next is not unset: + kwargs["next"] = next + if prev is not unset: + kwargs["prev"] = prev + if self is not unset: + kwargs["self"] = self + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/teams_hierarchy_links_response_meta.py b/src/datadog_api_client/v2/model/teams_hierarchy_links_response_meta.py new file mode 100644 index 0000000000..ed01e2d08e --- /dev/null +++ b/src/datadog_api_client/v2/model/teams_hierarchy_links_response_meta.py @@ -0,0 +1,44 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.teams_hierarchy_links_response_meta_page import TeamsHierarchyLinksResponseMetaPage + + +class TeamsHierarchyLinksResponseMeta(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.teams_hierarchy_links_response_meta_page import ( + TeamsHierarchyLinksResponseMetaPage, + ) + + return { + "page": (TeamsHierarchyLinksResponseMetaPage,), + } + + attribute_map = { + "page": "page", + } + + def __init__(self_, page: Union[TeamsHierarchyLinksResponseMetaPage, UnsetType] = unset, **kwargs): + """ + Team hierarchy links response metadata. + + :param page: Teams hierarchy links response page metadata. + :type page: TeamsHierarchyLinksResponseMetaPage, optional + """ + if page is not unset: + kwargs["page"] = page + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/teams_hierarchy_links_response_meta_page.py b/src/datadog_api_client/v2/model/teams_hierarchy_links_response_meta_page.py new file mode 100644 index 0000000000..fedc92d806 --- /dev/null +++ b/src/datadog_api_client/v2/model/teams_hierarchy_links_response_meta_page.py @@ -0,0 +1,97 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + none_type, + unset, + UnsetType, +) + + +class TeamsHierarchyLinksResponseMetaPage(ModelNormal): + @cached_property + def openapi_types(_): + return { + "first_number": (int,), + "last_number": (int,), + "next_number": (int, none_type), + "number": (int,), + "prev_number": (int, none_type), + "size": (int,), + "total": (int,), + "type": (str,), + } + + attribute_map = { + "first_number": "first_number", + "last_number": "last_number", + "next_number": "next_number", + "number": "number", + "prev_number": "prev_number", + "size": "size", + "total": "total", + "type": "type", + } + + def __init__( + self_, + first_number: Union[int, UnsetType] = unset, + last_number: Union[int, UnsetType] = unset, + next_number: Union[int, none_type, UnsetType] = unset, + number: Union[int, UnsetType] = unset, + prev_number: Union[int, none_type, UnsetType] = unset, + size: Union[int, UnsetType] = unset, + total: Union[int, UnsetType] = unset, + type: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Teams hierarchy links response page metadata. + + :param first_number: First page number. + :type first_number: int, optional + + :param last_number: Last page number. + :type last_number: int, optional + + :param next_number: Next page number. + :type next_number: int, none_type, optional + + :param number: Page number. + :type number: int, optional + + :param prev_number: Previous page number. + :type prev_number: int, none_type, optional + + :param size: Page size. + :type size: int, optional + + :param total: Total number of results. + :type total: int, optional + + :param type: Pagination type. + :type type: str, optional + """ + if first_number is not unset: + kwargs["first_number"] = first_number + if last_number is not unset: + kwargs["last_number"] = last_number + if next_number is not unset: + kwargs["next_number"] = next_number + if number is not unset: + kwargs["number"] = number + if prev_number is not unset: + kwargs["prev_number"] = prev_number + if size is not unset: + kwargs["size"] = size + if total is not unset: + kwargs["total"] = total + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 9cece11cff..f96813acd0 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -4589,6 +4589,22 @@ from datadog_api_client.v2.model.team_create_attributes import TeamCreateAttributes from datadog_api_client.v2.model.team_create_relationships import TeamCreateRelationships from datadog_api_client.v2.model.team_create_request import TeamCreateRequest +from datadog_api_client.v2.model.team_hierarchy_link import TeamHierarchyLink +from datadog_api_client.v2.model.team_hierarchy_link_attributes import TeamHierarchyLinkAttributes +from datadog_api_client.v2.model.team_hierarchy_link_create import TeamHierarchyLinkCreate +from datadog_api_client.v2.model.team_hierarchy_link_create_relationships import TeamHierarchyLinkCreateRelationships +from datadog_api_client.v2.model.team_hierarchy_link_create_request import TeamHierarchyLinkCreateRequest +from datadog_api_client.v2.model.team_hierarchy_link_create_team import TeamHierarchyLinkCreateTeam +from datadog_api_client.v2.model.team_hierarchy_link_create_team_relationship import ( + TeamHierarchyLinkCreateTeamRelationship, +) +from datadog_api_client.v2.model.team_hierarchy_link_relationships import TeamHierarchyLinkRelationships +from datadog_api_client.v2.model.team_hierarchy_link_response import TeamHierarchyLinkResponse +from datadog_api_client.v2.model.team_hierarchy_link_team import TeamHierarchyLinkTeam +from datadog_api_client.v2.model.team_hierarchy_link_team_attributes import TeamHierarchyLinkTeamAttributes +from datadog_api_client.v2.model.team_hierarchy_link_team_relationship import TeamHierarchyLinkTeamRelationship +from datadog_api_client.v2.model.team_hierarchy_link_type import TeamHierarchyLinkType +from datadog_api_client.v2.model.team_hierarchy_links_response import TeamHierarchyLinksResponse from datadog_api_client.v2.model.team_included import TeamIncluded from datadog_api_client.v2.model.team_link import TeamLink from datadog_api_client.v2.model.team_link_attributes import TeamLinkAttributes @@ -4675,6 +4691,9 @@ from datadog_api_client.v2.model.team_update_relationships import TeamUpdateRelationships from datadog_api_client.v2.model.team_update_request import TeamUpdateRequest from datadog_api_client.v2.model.teams_field import TeamsField +from datadog_api_client.v2.model.teams_hierarchy_links_response_links import TeamsHierarchyLinksResponseLinks +from datadog_api_client.v2.model.teams_hierarchy_links_response_meta import TeamsHierarchyLinksResponseMeta +from datadog_api_client.v2.model.teams_hierarchy_links_response_meta_page import TeamsHierarchyLinksResponseMetaPage from datadog_api_client.v2.model.teams_response import TeamsResponse from datadog_api_client.v2.model.teams_response_links import TeamsResponseLinks from datadog_api_client.v2.model.teams_response_meta import TeamsResponseMeta @@ -8231,6 +8250,20 @@ "TeamCreateAttributes", "TeamCreateRelationships", "TeamCreateRequest", + "TeamHierarchyLink", + "TeamHierarchyLinkAttributes", + "TeamHierarchyLinkCreate", + "TeamHierarchyLinkCreateRelationships", + "TeamHierarchyLinkCreateRequest", + "TeamHierarchyLinkCreateTeam", + "TeamHierarchyLinkCreateTeamRelationship", + "TeamHierarchyLinkRelationships", + "TeamHierarchyLinkResponse", + "TeamHierarchyLinkTeam", + "TeamHierarchyLinkTeamAttributes", + "TeamHierarchyLinkTeamRelationship", + "TeamHierarchyLinkType", + "TeamHierarchyLinksResponse", "TeamIncluded", "TeamLink", "TeamLinkAttributes", @@ -8299,6 +8332,9 @@ "TeamUpdateRelationships", "TeamUpdateRequest", "TeamsField", + "TeamsHierarchyLinksResponseLinks", + "TeamsHierarchyLinksResponseMeta", + "TeamsHierarchyLinksResponseMetaPage", "TeamsResponse", "TeamsResponseLinks", "TeamsResponseMeta", diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_team_hierarchy_link_returns_conflict_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_a_team_hierarchy_link_returns_conflict_response.frozen new file mode 100644 index 0000000000..4da94657ee --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_team_hierarchy_link_returns_conflict_response.frozen @@ -0,0 +1 @@ +2025-11-24T17:06:46.856Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_team_hierarchy_link_returns_conflict_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_a_team_hierarchy_link_returns_conflict_response.yaml new file mode 100644 index 0000000000..ced99cf39a --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_team_hierarchy_link_returns_conflict_response.yaml @@ -0,0 +1,120 @@ +interactions: +- request: + body: '{"data":{"attributes":{"handle":"test-handle-6c891437b748aea8","name":"test-name-6c891437b748aea8"},"type":"team"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + string: '{"data":{"id":"4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87","type":"team","attributes":{"avatar":null,"banner":0,"created_at":"2025-11-24T17:06:47.453319+00:00","description":null,"handle":"test-handle-6c891437b748aea8","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2025-11-24T17:06:47.453319+00:00","name":"test-name-6c891437b748aea8","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87/permission-settings"}}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"handle":"test-handle-2-6c891437b748aea8","name":"test-name-2-6c891437b748aea8"},"type":"team"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + string: '{"data":{"id":"21296c73-c9e2-4889-a33f-417d2974b2bd","type":"team","attributes":{"avatar":null,"banner":2,"created_at":"2025-11-24T17:06:48.020887+00:00","description":null,"handle":"test-handle-2-6c891437b748aea8","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2025-11-24T17:06:48.020887+00:00","name":"test-name-2-6c891437b748aea8","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/21296c73-c9e2-4889-a33f-417d2974b2bd/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/21296c73-c9e2-4889-a33f-417d2974b2bd/permission-settings"}}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"relationships":{"parent_team":{"data":{"id":"4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87","type":"team"}},"sub_team":{"data":{"id":"21296c73-c9e2-4889-a33f-417d2974b2bd","type":"team"}}},"type":"team_hierarchy_links"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links + response: + body: + string: '{"data":{"id":"e980108e-d535-4bdf-84ca-5e8f84a68480","type":"team_hierarchy_links","attributes":{"created_at":"2025-11-24T17:06:48.279316439Z","provisioned_by":""},"relationships":{"parent_team":{"data":{"id":"4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87","type":"team"}},"sub_team":{"data":{"id":"21296c73-c9e2-4889-a33f-417d2974b2bd","type":"team"}}}},"included":[{"id":"4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87","type":"team","attributes":{"avatar":null,"banner":0,"handle":"test-handle-6c891437b748aea8","is_managed":false,"is_open_membership":false,"link_count":0,"name":"test-name-6c891437b748aea8","summary":null,"user_count":0}},{"id":"21296c73-c9e2-4889-a33f-417d2974b2bd","type":"team","attributes":{"avatar":null,"banner":2,"handle":"test-handle-2-6c891437b748aea8","is_managed":false,"is_open_membership":false,"link_count":0,"name":"test-name-2-6c891437b748aea8","summary":null,"user_count":0}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: '{"data":{"relationships":{"parent_team":{"data":{"id":"4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87","type":"team"}},"sub_team":{"data":{"id":"21296c73-c9e2-4889-a33f-417d2974b2bd","type":"team"}}},"type":"team_hierarchy_links"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links + response: + body: + string: '{"errors":["Conflict: could not add team 21296c73-c9e2-4889-a33f-417d2974b2bd + as a member team of team 4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87 in org 321813: + team hierarchy link between super team 4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87 + and member team 21296c73-c9e2-4889-a33f-417d2974b2bd already exists in org + 321813"]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 409 + message: Conflict +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links/e980108e-d535-4bdf-84ca-5e8f84a68480 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/21296c73-c9e2-4889-a33f-417d2974b2bd + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_team_hierarchy_link_returns_created_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_a_team_hierarchy_link_returns_created_response.frozen new file mode 100644 index 0000000000..5ca151ab8b --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_team_hierarchy_link_returns_created_response.frozen @@ -0,0 +1 @@ +2025-11-24T14:29:58.684Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_team_hierarchy_link_returns_created_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_a_team_hierarchy_link_returns_created_response.yaml new file mode 100644 index 0000000000..20a3d868df --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_team_hierarchy_link_returns_created_response.yaml @@ -0,0 +1,98 @@ +interactions: +- request: + body: '{"data":{"attributes":{"handle":"test-handle-34095e00d70ee50a","name":"test-name-34095e00d70ee50a"},"type":"team"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + string: '{"data":{"id":"551c947a-0f0f-4ff0-8c41-0ceddabe3551","type":"team","attributes":{"avatar":null,"banner":3,"created_at":"2025-11-24T14:29:59.195740+00:00","description":null,"handle":"test-handle-34095e00d70ee50a","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2025-11-24T14:29:59.195740+00:00","name":"test-name-34095e00d70ee50a","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/551c947a-0f0f-4ff0-8c41-0ceddabe3551/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/551c947a-0f0f-4ff0-8c41-0ceddabe3551/permission-settings"}}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"handle":"test-handle-2-34095e00d70ee50a","name":"test-name-2-34095e00d70ee50a"},"type":"team"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + string: '{"data":{"id":"e1c6ab08-0325-4df7-aea1-6bec76692d55","type":"team","attributes":{"avatar":null,"banner":14,"created_at":"2025-11-24T14:29:59.754699+00:00","description":null,"handle":"test-handle-2-34095e00d70ee50a","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2025-11-24T14:29:59.754699+00:00","name":"test-name-2-34095e00d70ee50a","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/e1c6ab08-0325-4df7-aea1-6bec76692d55/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/e1c6ab08-0325-4df7-aea1-6bec76692d55/permission-settings"}}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"relationships":{"parent_team":{"data":{"id":"551c947a-0f0f-4ff0-8c41-0ceddabe3551","type":"team"}},"sub_team":{"data":{"id":"e1c6ab08-0325-4df7-aea1-6bec76692d55","type":"team"}}},"type":"team_hierarchy_links"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links + response: + body: + string: '{"data":{"id":"c53bed14-1c0a-4895-b845-1c04be086ba0","type":"team_hierarchy_links","attributes":{"created_at":"2025-11-24T14:30:00.032477595Z","provisioned_by":""},"relationships":{"parent_team":{"data":{"id":"551c947a-0f0f-4ff0-8c41-0ceddabe3551","type":"team"}},"sub_team":{"data":{"id":"e1c6ab08-0325-4df7-aea1-6bec76692d55","type":"team"}}}},"included":[{"id":"551c947a-0f0f-4ff0-8c41-0ceddabe3551","type":"team","attributes":{"avatar":null,"banner":3,"handle":"test-handle-34095e00d70ee50a","is_managed":false,"is_open_membership":false,"link_count":0,"name":"test-name-34095e00d70ee50a","summary":null,"user_count":0}},{"id":"e1c6ab08-0325-4df7-aea1-6bec76692d55","type":"team","attributes":{"avatar":null,"banner":14,"handle":"test-handle-2-34095e00d70ee50a","is_managed":false,"is_open_membership":false,"link_count":0,"name":"test-name-2-34095e00d70ee50a","summary":null,"user_count":0}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links/c53bed14-1c0a-4895-b845-1c04be086ba0 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/e1c6ab08-0325-4df7-aea1-6bec76692d55 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/551c947a-0f0f-4ff0-8c41-0ceddabe3551 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_team_hierarchy_link_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_a_team_hierarchy_link_returns_ok_response.frozen new file mode 100644 index 0000000000..bf8a8d4fa4 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_team_hierarchy_link_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-11-24T16:01:16.053Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_team_hierarchy_link_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_a_team_hierarchy_link_returns_ok_response.yaml new file mode 100644 index 0000000000..084da497f9 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_team_hierarchy_link_returns_ok_response.yaml @@ -0,0 +1,98 @@ +interactions: +- request: + body: '{"data":{"attributes":{"handle":"test-handle-4d8084da4dfa4ed8","name":"test-name-4d8084da4dfa4ed8"},"type":"team"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + string: '{"data":{"id":"d5b049f4-59f1-474d-ad98-5a7342a8961f","type":"team","attributes":{"avatar":null,"banner":11,"created_at":"2025-11-24T16:01:16.149673+00:00","description":null,"handle":"test-handle-4d8084da4dfa4ed8","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2025-11-24T16:01:16.149673+00:00","name":"test-name-4d8084da4dfa4ed8","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/d5b049f4-59f1-474d-ad98-5a7342a8961f/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/d5b049f4-59f1-474d-ad98-5a7342a8961f/permission-settings"}}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"handle":"test-handle-2-4d8084da4dfa4ed8","name":"test-name-2-4d8084da4dfa4ed8"},"type":"team"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + string: '{"data":{"id":"790428f6-10bc-427d-bf36-f53ca3c197e0","type":"team","attributes":{"avatar":null,"banner":4,"created_at":"2025-11-24T16:01:16.315013+00:00","description":null,"handle":"test-handle-2-4d8084da4dfa4ed8","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2025-11-24T16:01:16.315013+00:00","name":"test-name-2-4d8084da4dfa4ed8","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/790428f6-10bc-427d-bf36-f53ca3c197e0/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/790428f6-10bc-427d-bf36-f53ca3c197e0/permission-settings"}}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"relationships":{"parent_team":{"data":{"id":"d5b049f4-59f1-474d-ad98-5a7342a8961f","type":"team"}},"sub_team":{"data":{"id":"790428f6-10bc-427d-bf36-f53ca3c197e0","type":"team"}}},"type":"team_hierarchy_links"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links + response: + body: + string: '{"data":{"id":"6cf86539-2c6e-497e-8cef-0b285ff05514","type":"team_hierarchy_links","attributes":{"created_at":"2025-11-24T16:01:16.460042023Z","provisioned_by":""},"relationships":{"parent_team":{"data":{"id":"d5b049f4-59f1-474d-ad98-5a7342a8961f","type":"team"}},"sub_team":{"data":{"id":"790428f6-10bc-427d-bf36-f53ca3c197e0","type":"team"}}}},"included":[{"id":"d5b049f4-59f1-474d-ad98-5a7342a8961f","type":"team","attributes":{"avatar":null,"banner":11,"handle":"test-handle-4d8084da4dfa4ed8","is_managed":false,"is_open_membership":false,"link_count":0,"name":"test-name-4d8084da4dfa4ed8","summary":null,"user_count":0}},{"id":"790428f6-10bc-427d-bf36-f53ca3c197e0","type":"team","attributes":{"avatar":null,"banner":4,"handle":"test-handle-2-4d8084da4dfa4ed8","is_managed":false,"is_open_membership":false,"link_count":0,"name":"test-name-2-4d8084da4dfa4ed8","summary":null,"user_count":0}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links/6cf86539-2c6e-497e-8cef-0b285ff05514 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/790428f6-10bc-427d-bf36-f53ca3c197e0 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/d5b049f4-59f1-474d-ad98-5a7342a8961f + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_team_hierarchy_link_returns_success_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_a_team_hierarchy_link_returns_success_response.frozen new file mode 100644 index 0000000000..e4ed51cc86 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_team_hierarchy_link_returns_success_response.frozen @@ -0,0 +1 @@ +2025-11-24T15:48:39.900Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_team_hierarchy_link_returns_success_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_a_team_hierarchy_link_returns_success_response.yaml new file mode 100644 index 0000000000..66fbaa00ec --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_team_hierarchy_link_returns_success_response.yaml @@ -0,0 +1,98 @@ +interactions: +- request: + body: '{"data":{"attributes":{"handle":"test-handle-a75ee0b8b483d66f","name":"test-name-a75ee0b8b483d66f"},"type":"team"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + string: '{"data":{"id":"b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd","type":"team","attributes":{"avatar":null,"banner":3,"created_at":"2025-11-24T15:48:40.359260+00:00","description":null,"handle":"test-handle-a75ee0b8b483d66f","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2025-11-24T15:48:40.359261+00:00","name":"test-name-a75ee0b8b483d66f","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd/permission-settings"}}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"handle":"test-handle-2-a75ee0b8b483d66f","name":"test-name-2-a75ee0b8b483d66f"},"type":"team"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + string: '{"data":{"id":"2d096572-eb6a-4579-ba38-b4247cf75e17","type":"team","attributes":{"avatar":null,"banner":8,"created_at":"2025-11-24T15:48:40.893488+00:00","description":null,"handle":"test-handle-2-a75ee0b8b483d66f","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2025-11-24T15:48:40.893488+00:00","name":"test-name-2-a75ee0b8b483d66f","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/2d096572-eb6a-4579-ba38-b4247cf75e17/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/2d096572-eb6a-4579-ba38-b4247cf75e17/permission-settings"}}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"relationships":{"parent_team":{"data":{"id":"b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd","type":"team"}},"sub_team":{"data":{"id":"2d096572-eb6a-4579-ba38-b4247cf75e17","type":"team"}}},"type":"team_hierarchy_links"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links + response: + body: + string: '{"data":{"id":"fb94d43b-fe10-4c5f-ae7c-4ad745428651","type":"team_hierarchy_links","attributes":{"created_at":"2025-11-24T15:48:41.150923395Z","provisioned_by":""},"relationships":{"parent_team":{"data":{"id":"b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd","type":"team"}},"sub_team":{"data":{"id":"2d096572-eb6a-4579-ba38-b4247cf75e17","type":"team"}}}},"included":[{"id":"b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd","type":"team","attributes":{"avatar":null,"banner":3,"handle":"test-handle-a75ee0b8b483d66f","is_managed":false,"is_open_membership":false,"link_count":0,"name":"test-name-a75ee0b8b483d66f","summary":null,"user_count":0}},{"id":"2d096572-eb6a-4579-ba38-b4247cf75e17","type":"team","attributes":{"avatar":null,"banner":8,"handle":"test-handle-2-a75ee0b8b483d66f","is_managed":false,"is_open_membership":false,"link_count":0,"name":"test-name-2-a75ee0b8b483d66f","summary":null,"user_count":0}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links/fb94d43b-fe10-4c5f-ae7c-4ad745428651 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/2d096572-eb6a-4579-ba38-b4247cf75e17 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_team_hierarchy_link_returns_api_error_response_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_a_team_hierarchy_link_returns_api_error_response_response.frozen new file mode 100644 index 0000000000..21b6221c0d --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_a_team_hierarchy_link_returns_api_error_response_response.frozen @@ -0,0 +1 @@ +2025-11-24T13:19:11.816Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_team_hierarchy_link_returns_api_error_response_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_a_team_hierarchy_link_returns_api_error_response_response.yaml new file mode 100644 index 0000000000..6d3226821a --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_a_team_hierarchy_link_returns_api_error_response_response.yaml @@ -0,0 +1,18 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links/aaa11111-aa11-aa11-aaaa-aaaaaa111111 + response: + body: + string: '{"errors":["Not Found: team hierarchy link not found (linkId=aaa11111-aa11-aa11-aaaa-aaaaaa111111)"]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_team_hierarchy_link_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_a_team_hierarchy_link_returns_ok_response.frozen new file mode 100644 index 0000000000..be8e0fd4a3 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_a_team_hierarchy_link_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-11-24T17:07:09.212Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_team_hierarchy_link_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_a_team_hierarchy_link_returns_ok_response.yaml new file mode 100644 index 0000000000..7d8f100c6b --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_a_team_hierarchy_link_returns_ok_response.yaml @@ -0,0 +1,114 @@ +interactions: +- request: + body: '{"data":{"attributes":{"handle":"test-handle-ae3e76a23be3747a","name":"test-name-ae3e76a23be3747a"},"type":"team"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + string: '{"data":{"id":"fafeac94-42b4-4469-91e8-0ae5ca3f564b","type":"team","attributes":{"avatar":null,"banner":11,"created_at":"2025-11-24T17:07:09.817794+00:00","description":null,"handle":"test-handle-ae3e76a23be3747a","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2025-11-24T17:07:09.817794+00:00","name":"test-name-ae3e76a23be3747a","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/fafeac94-42b4-4469-91e8-0ae5ca3f564b/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/fafeac94-42b4-4469-91e8-0ae5ca3f564b/permission-settings"}}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"handle":"test-handle-2-ae3e76a23be3747a","name":"test-name-2-ae3e76a23be3747a"},"type":"team"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + string: '{"data":{"id":"196bcc55-bd30-4cfd-8549-b3d255a0517b","type":"team","attributes":{"avatar":null,"banner":4,"created_at":"2025-11-24T17:07:10.381761+00:00","description":null,"handle":"test-handle-2-ae3e76a23be3747a","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2025-11-24T17:07:10.381761+00:00","name":"test-name-2-ae3e76a23be3747a","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/196bcc55-bd30-4cfd-8549-b3d255a0517b/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/196bcc55-bd30-4cfd-8549-b3d255a0517b/permission-settings"}}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"relationships":{"parent_team":{"data":{"id":"fafeac94-42b4-4469-91e8-0ae5ca3f564b","type":"team"}},"sub_team":{"data":{"id":"196bcc55-bd30-4cfd-8549-b3d255a0517b","type":"team"}}},"type":"team_hierarchy_links"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links + response: + body: + string: '{"data":{"id":"5401e712-de1b-4deb-ac35-2c6ee1943ad0","type":"team_hierarchy_links","attributes":{"created_at":"2025-11-24T17:07:10.643798843Z","provisioned_by":""},"relationships":{"parent_team":{"data":{"id":"fafeac94-42b4-4469-91e8-0ae5ca3f564b","type":"team"}},"sub_team":{"data":{"id":"196bcc55-bd30-4cfd-8549-b3d255a0517b","type":"team"}}}},"included":[{"id":"fafeac94-42b4-4469-91e8-0ae5ca3f564b","type":"team","attributes":{"avatar":null,"banner":11,"handle":"test-handle-ae3e76a23be3747a","is_managed":false,"is_open_membership":false,"link_count":0,"name":"test-name-ae3e76a23be3747a","summary":null,"user_count":0}},{"id":"196bcc55-bd30-4cfd-8549-b3d255a0517b","type":"team","attributes":{"avatar":null,"banner":4,"handle":"test-handle-2-ae3e76a23be3747a","is_managed":false,"is_open_membership":false,"link_count":0,"name":"test-name-2-ae3e76a23be3747a","summary":null,"user_count":0}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links/5401e712-de1b-4deb-ac35-2c6ee1943ad0 + response: + body: + string: '{"data":{"id":"5401e712-de1b-4deb-ac35-2c6ee1943ad0","type":"team_hierarchy_links","attributes":{"created_at":"2025-11-24T17:07:10.643799Z","provisioned_by":""},"relationships":{"parent_team":{"data":{"id":"fafeac94-42b4-4469-91e8-0ae5ca3f564b","type":"team"}},"sub_team":{"data":{"id":"196bcc55-bd30-4cfd-8549-b3d255a0517b","type":"team"}}}},"links":{"self":"https://api.datadoghq.com/api/v2/team-hierarchy-links/5401e712-de1b-4deb-ac35-2c6ee1943ad0"},"included":[{"id":"196bcc55-bd30-4cfd-8549-b3d255a0517b","type":"team","attributes":{"avatar":null,"banner":4,"handle":"test-handle-2-ae3e76a23be3747a","is_managed":false,"is_open_membership":true,"link_count":0,"name":"test-name-2-ae3e76a23be3747a","summary":null,"user_count":0}},{"id":"fafeac94-42b4-4469-91e8-0ae5ca3f564b","type":"team","attributes":{"avatar":null,"banner":11,"handle":"test-handle-ae3e76a23be3747a","is_managed":false,"is_open_membership":true,"link_count":0,"name":"test-name-ae3e76a23be3747a","summary":null,"user_count":0}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links/5401e712-de1b-4deb-ac35-2c6ee1943ad0 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/196bcc55-bd30-4cfd-8549-b3d255a0517b + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/fafeac94-42b4-4469-91e8-0ae5ca3f564b + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_team_hierarchy_links_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_team_hierarchy_links_returns_ok_response.frozen new file mode 100644 index 0000000000..1d3731961e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_team_hierarchy_links_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-11-24T17:18:13.180Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_team_hierarchy_links_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_team_hierarchy_links_returns_ok_response.yaml new file mode 100644 index 0000000000..6df4ee4552 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_team_hierarchy_links_returns_ok_response.yaml @@ -0,0 +1,114 @@ +interactions: +- request: + body: '{"data":{"attributes":{"handle":"test-handle-ab0ee85594ae1dfd","name":"test-name-ab0ee85594ae1dfd"},"type":"team"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + string: '{"data":{"id":"d1baf3de-7316-43b5-8582-dc887acc26ef","type":"team","attributes":{"avatar":null,"banner":6,"created_at":"2025-11-24T17:18:13.814865+00:00","description":null,"handle":"test-handle-ab0ee85594ae1dfd","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2025-11-24T17:18:13.814865+00:00","name":"test-name-ab0ee85594ae1dfd","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/d1baf3de-7316-43b5-8582-dc887acc26ef/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/d1baf3de-7316-43b5-8582-dc887acc26ef/permission-settings"}}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"handle":"test-handle-2-ab0ee85594ae1dfd","name":"test-name-2-ab0ee85594ae1dfd"},"type":"team"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + string: '{"data":{"id":"61b0ab36-c1e5-47fd-898a-ba9bfc860e9d","type":"team","attributes":{"avatar":null,"banner":13,"created_at":"2025-11-24T17:18:14.383042+00:00","description":null,"handle":"test-handle-2-ab0ee85594ae1dfd","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2025-11-24T17:18:14.383042+00:00","name":"test-name-2-ab0ee85594ae1dfd","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/61b0ab36-c1e5-47fd-898a-ba9bfc860e9d/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/61b0ab36-c1e5-47fd-898a-ba9bfc860e9d/permission-settings"}}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"relationships":{"parent_team":{"data":{"id":"d1baf3de-7316-43b5-8582-dc887acc26ef","type":"team"}},"sub_team":{"data":{"id":"61b0ab36-c1e5-47fd-898a-ba9bfc860e9d","type":"team"}}},"type":"team_hierarchy_links"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links + response: + body: + string: '{"data":{"id":"61509612-5bb0-42c5-a16e-bf4920acf473","type":"team_hierarchy_links","attributes":{"created_at":"2025-11-24T17:18:14.635205462Z","provisioned_by":""},"relationships":{"parent_team":{"data":{"id":"d1baf3de-7316-43b5-8582-dc887acc26ef","type":"team"}},"sub_team":{"data":{"id":"61b0ab36-c1e5-47fd-898a-ba9bfc860e9d","type":"team"}}}},"included":[{"id":"d1baf3de-7316-43b5-8582-dc887acc26ef","type":"team","attributes":{"avatar":null,"banner":6,"handle":"test-handle-ab0ee85594ae1dfd","is_managed":false,"is_open_membership":false,"link_count":0,"name":"test-name-ab0ee85594ae1dfd","summary":null,"user_count":0}},{"id":"61b0ab36-c1e5-47fd-898a-ba9bfc860e9d","type":"team","attributes":{"avatar":null,"banner":13,"handle":"test-handle-2-ab0ee85594ae1dfd","is_managed":false,"is_open_membership":false,"link_count":0,"name":"test-name-2-ab0ee85594ae1dfd","summary":null,"user_count":0}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links?filter%5Bparent_team%5D=d1baf3de-7316-43b5-8582-dc887acc26ef&filter%5Bsub_team%5D=61b0ab36-c1e5-47fd-898a-ba9bfc860e9d&page%5Bnumber%5D=0&page%5Bsize%5D=100 + response: + body: + string: '{"data":[{"id":"61509612-5bb0-42c5-a16e-bf4920acf473","type":"team_hierarchy_links","attributes":{"created_at":"2025-11-24T17:18:14.635205Z","provisioned_by":""},"relationships":{"parent_team":{"data":{"id":"d1baf3de-7316-43b5-8582-dc887acc26ef","type":"team"}},"sub_team":{"data":{"id":"61b0ab36-c1e5-47fd-898a-ba9bfc860e9d","type":"team"}}}}],"meta":{"page":{"type":"number_size","number":0,"size":100,"total":1,"first_number":0,"prev_number":null,"next_number":null,"last_number":0}},"links":{"self":"https://api.datadoghq.com/api/v2/team-hierarchy-links?filter%5Bparent_team%5D=d1baf3de-7316-43b5-8582-dc887acc26ef\u0026filter%5Bsub_team%5D=61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\u0026page%5Bnumber%5D=0\u0026page%5Bsize%5D=100","first":"https://api.datadoghq.com/api/v2/team-hierarchy-links?filter[parent_team]=d1baf3de-7316-43b5-8582-dc887acc26ef\u0026filter[sub_team]=61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\u0026page[number]=0\u0026page[size]=100","last":"https://api.datadoghq.com/api/v2/team-hierarchy-links?filter[parent_team]=d1baf3de-7316-43b5-8582-dc887acc26ef\u0026filter[sub_team]=61b0ab36-c1e5-47fd-898a-ba9bfc860e9d\u0026page[number]=0\u0026page[size]=100"},"included":[{"id":"61b0ab36-c1e5-47fd-898a-ba9bfc860e9d","type":"team","attributes":{"avatar":null,"banner":13,"handle":"test-handle-2-ab0ee85594ae1dfd","is_managed":false,"is_open_membership":true,"link_count":0,"name":"test-name-2-ab0ee85594ae1dfd","summary":null,"user_count":0}},{"id":"d1baf3de-7316-43b5-8582-dc887acc26ef","type":"team","attributes":{"avatar":null,"banner":6,"handle":"test-handle-ab0ee85594ae1dfd","is_managed":false,"is_open_membership":true,"link_count":0,"name":"test-name-ab0ee85594ae1dfd","summary":null,"user_count":0}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links/61509612-5bb0-42c5-a16e-bf4920acf473 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/61b0ab36-c1e5-47fd-898a-ba9bfc860e9d + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/d1baf3de-7316-43b5-8582-dc887acc26ef + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_remove_a_team_hierarchy_link_returns_api_error_response_response.frozen b/tests/v2/cassettes/test_scenarios/test_remove_a_team_hierarchy_link_returns_api_error_response_response.frozen new file mode 100644 index 0000000000..73f686747b --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_remove_a_team_hierarchy_link_returns_api_error_response_response.frozen @@ -0,0 +1 @@ +2025-11-24T13:14:20.481Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_remove_a_team_hierarchy_link_returns_api_error_response_response.yaml b/tests/v2/cassettes/test_scenarios/test_remove_a_team_hierarchy_link_returns_api_error_response_response.yaml new file mode 100644 index 0000000000..abf7e6c92b --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_remove_a_team_hierarchy_link_returns_api_error_response_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links/aaa11111-aa11-aa11-aaaa-aaaaaa111111 + response: + body: + string: '{"errors":["Not Found: link with id aaa11111-aa11-aa11-aaaa-aaaaaa111111 + not found"]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_remove_a_team_hierarchy_link_returns_no_content_response.frozen b/tests/v2/cassettes/test_scenarios/test_remove_a_team_hierarchy_link_returns_no_content_response.frozen new file mode 100644 index 0000000000..be1311ed7c --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_remove_a_team_hierarchy_link_returns_no_content_response.frozen @@ -0,0 +1 @@ +2025-11-24T17:08:01.196Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_remove_a_team_hierarchy_link_returns_no_content_response.yaml b/tests/v2/cassettes/test_scenarios/test_remove_a_team_hierarchy_link_returns_no_content_response.yaml new file mode 100644 index 0000000000..291f1b820d --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_remove_a_team_hierarchy_link_returns_no_content_response.yaml @@ -0,0 +1,115 @@ +interactions: +- request: + body: '{"data":{"attributes":{"handle":"test-handle-db31819631324305","name":"test-name-db31819631324305"},"type":"team"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + string: '{"data":{"id":"eaf01981-6b63-41ba-b49f-30449c50e865","type":"team","attributes":{"avatar":null,"banner":10,"created_at":"2025-11-24T17:08:01.930314+00:00","description":null,"handle":"test-handle-db31819631324305","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2025-11-24T17:08:01.930314+00:00","name":"test-name-db31819631324305","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/eaf01981-6b63-41ba-b49f-30449c50e865/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/eaf01981-6b63-41ba-b49f-30449c50e865/permission-settings"}}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"attributes":{"handle":"test-handle-2-db31819631324305","name":"test-name-2-db31819631324305"},"type":"team"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + string: '{"data":{"id":"120aeb27-ca42-4e38-a9e4-6497b8f9407c","type":"team","attributes":{"avatar":null,"banner":6,"created_at":"2025-11-24T17:08:02.174211+00:00","description":null,"handle":"test-handle-2-db31819631324305","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2025-11-24T17:08:02.174211+00:00","name":"test-name-2-db31819631324305","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/120aeb27-ca42-4e38-a9e4-6497b8f9407c/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/120aeb27-ca42-4e38-a9e4-6497b8f9407c/permission-settings"}}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +- request: + body: '{"data":{"relationships":{"parent_team":{"data":{"id":"eaf01981-6b63-41ba-b49f-30449c50e865","type":"team"}},"sub_team":{"data":{"id":"120aeb27-ca42-4e38-a9e4-6497b8f9407c","type":"team"}}},"type":"team_hierarchy_links"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links + response: + body: + string: '{"data":{"id":"185446b8-1e88-419c-b266-3933f1411b6e","type":"team_hierarchy_links","attributes":{"created_at":"2025-11-24T17:08:02.736655421Z","provisioned_by":""},"relationships":{"parent_team":{"data":{"id":"eaf01981-6b63-41ba-b49f-30449c50e865","type":"team"}},"sub_team":{"data":{"id":"120aeb27-ca42-4e38-a9e4-6497b8f9407c","type":"team"}}}},"included":[{"id":"eaf01981-6b63-41ba-b49f-30449c50e865","type":"team","attributes":{"avatar":null,"banner":10,"handle":"test-handle-db31819631324305","is_managed":false,"is_open_membership":false,"link_count":0,"name":"test-name-db31819631324305","summary":null,"user_count":0}},{"id":"120aeb27-ca42-4e38-a9e4-6497b8f9407c","type":"team","attributes":{"avatar":null,"banner":6,"handle":"test-handle-2-db31819631324305","is_managed":false,"is_open_membership":false,"link_count":0,"name":"test-name-2-db31819631324305","summary":null,"user_count":0}}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links/185446b8-1e88-419c-b266-3933f1411b6e + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links/185446b8-1e88-419c-b266-3933f1411b6e + response: + body: + string: '{"errors":["Not Found: link with id 185446b8-1e88-419c-b266-3933f1411b6e + not found"]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/120aeb27-ca42-4e38-a9e4-6497b8f9407c + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/eaf01981-6b63-41ba-b49f-30449c50e865 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/features/given.json b/tests/v2/features/given.json index 198c7af1b5..64b50d8057 100644 --- a/tests/v2/features/given.json +++ b/tests/v2/features/given.json @@ -1169,6 +1169,30 @@ "tag": "Teams", "operationId": "CreateTeam" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"handle\": \"test-handle-2-{{ unique_hash }}\",\n \"name\": \"test-name-2-{{ unique_hash }}\"\n },\n \"type\": \"team\"\n }\n}" + } + ], + "step": "there is a valid \"dd_team_2\" in the system", + "key": "dd_team_2", + "tag": "Teams", + "operationId": "CreateTeam" + }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"team_hierarchy_links\",\n \"relationships\": {\n \"parent_team\": {\n \"data\": {\n \"id\": \"{{ dd_team.data.id }}\",\n \"type\": \"team\"\n }\n },\n \"sub_team\": {\n \"data\": {\n \"id\": \"{{ dd_team_2.data.id }}\",\n \"type\": \"team\"\n }\n }\n }\n }\n}" + } + ], + "step": "there is a valid \"team_hierarchy_link\" in the system", + "key": "team_hierarchy_link", + "tag": "Teams", + "operationId": "AddTeamHierarchyLink" + }, { "source": "data.data[0]", "step": "there is a valid \"team_connection\" in the system", diff --git a/tests/v2/features/teams.feature b/tests/v2/features/teams.feature index bf11bd0316..faa1ca0889 100644 --- a/tests/v2/features/teams.feature +++ b/tests/v2/features/teams.feature @@ -43,6 +43,25 @@ Feature: Teams When the request is sent Then the response status is 200 Represents a user's association to a team + @team:DataDog/aaa-omg + Scenario: Create a team hierarchy link returns "Conflict" response + Given new "AddTeamHierarchyLink" request + And there is a valid "dd_team" in the system + And there is a valid "dd_team_2" in the system + And there is a valid "team_hierarchy_link" in the system + And body with value {"data": {"relationships": {"parent_team": {"data": {"id": "{{team_hierarchy_link.data.relationships.parent_team.data.id}}", "type": "team"}}, "sub_team": {"data": {"id": "{{team_hierarchy_link.data.relationships.sub_team.data.id}}", "type": "team"}}}, "type": "team_hierarchy_links"}} + When the request is sent + Then the response status is 409 Conflict + + @team:DataDog/aaa-omg + Scenario: Create a team hierarchy link returns "OK" response + Given new "AddTeamHierarchyLink" request + And there is a valid "dd_team" in the system + And there is a valid "dd_team_2" in the system + And body with value {"data": {"relationships": {"parent_team": {"data": {"id": "{{dd_team.data.id}}", "type": "team"}}, "sub_team": {"data": {"id": "{{dd_team_2.data.id}}", "type": "team"}}}, "type": "team_hierarchy_links"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/aaa-omg Scenario: Create a team link returns "API error response." response Given new "CreateTeamLink" request @@ -96,6 +115,28 @@ Feature: Teams And the response "data.attributes.visible_modules" is equal to ["m1","m2"] And the response "data.attributes.hidden_modules" is equal to ["m3"] + @team:DataDog/aaa-omg + Scenario: Get a team hierarchy link returns "API error response." response + Given new "GetTeamHierarchyLink" request + And request contains "link_id" parameter with value "aaa11111-aa11-aa11-aaaa-aaaaaa111111" + When the request is sent + Then the response status is 404 API error response. + + @team:DataDog/aaa-omg + Scenario: Get a team hierarchy link returns "OK" response + Given new "GetTeamHierarchyLink" request + And there is a valid "dd_team" in the system + And there is a valid "dd_team_2" in the system + And there is a valid "team_hierarchy_link" in the system + And request contains "link_id" parameter from "team_hierarchy_link.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "{{ team_hierarchy_link.data.id }}" + And the response "data.relationships.parent_team.data.id" is equal to "{{ dd_team.data.id }}" + And the response "data.relationships.sub_team.data.id" is equal to "{{ dd_team_2.data.id }}" + And the response "included" has item with field "id" with value "{{ dd_team.data.id }}" + And the response "included" has item with field "id" with value "{{ dd_team_2.data.id }}" + @team:DataDog/aaa-omg Scenario: Get a team link returns "API error response." response Given new "GetTeamLink" request @@ -211,6 +252,31 @@ Feature: Teams When the request is sent Then the response status is 200 OK + @team:DataDog/aaa-omg + Scenario: Get team hierarchy links returns "OK" response + Given new "ListTeamHierarchyLinks" request + And there is a valid "dd_team" in the system + And there is a valid "dd_team_2" in the system + And there is a valid "team_hierarchy_link" in the system + And request contains "filter[parent_team]" parameter from "team_hierarchy_link.data.relationships.parent_team.data.id" + And request contains "filter[sub_team]" parameter from "team_hierarchy_link.data.relationships.sub_team.data.id" + And request contains "page[number]" parameter with value 0 + And request contains "page[size]" parameter with value 100 + When the request is sent + Then the response status is 200 OK + And the response "data" has length 1 + And the response "data[0].id" is equal to "{{ team_hierarchy_link.data.id }}" + And the response "data[0].relationships.parent_team.data.id" is equal to "{{ dd_team.data.id }}" + And the response "data[0].relationships.sub_team.data.id" is equal to "{{ dd_team_2.data.id }}" + And the response "included" has item with field "id" with value "{{ dd_team.data.id }}" + And the response "included" has item with field "id" with value "{{ dd_team_2.data.id }}" + + @generated @skip @team:DataDog/aaa-omg @with-pagination + Scenario: Get team hierarchy links returns "OK" response with pagination + Given new "ListTeamHierarchyLinks" request + When the request with pagination is sent + Then the response status is 200 OK + @team:DataDog/aaa-omg Scenario: Get team memberships returns "API error response." response Given new "GetTeamMemberships" request @@ -293,6 +359,23 @@ Feature: Teams When the request is sent Then the response status is 204 No Content + @team:DataDog/aaa-omg + Scenario: Remove a team hierarchy link returns "API error response." response + Given new "RemoveTeamHierarchyLink" request + And request contains "link_id" parameter with value "aaa11111-aa11-aa11-aaaa-aaaaaa111111" + When the request is sent + Then the response status is 404 API error response. + + @team:DataDog/aaa-omg + Scenario: Remove a team hierarchy link returns "No Content" response + Given new "RemoveTeamHierarchyLink" request + And there is a valid "dd_team" in the system + And there is a valid "dd_team_2" in the system + And there is a valid "team_hierarchy_link" in the system + And request contains "link_id" parameter from "team_hierarchy_link.data.id" + When the request is sent + Then the response status is 204 No Content + @team:DataDog/aaa-omg Scenario: Remove a team link returns "API error response." response Given new "DeleteTeamLink" request diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 3799e64e63..86540fc397 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -4345,6 +4345,37 @@ "type": "unsafe" } }, + "ListTeamHierarchyLinks": { + "tag": "Teams", + "undo": { + "type": "safe" + } + }, + "AddTeamHierarchyLink": { + "tag": "Teams", + "undo": { + "operationId": "RemoveTeamHierarchyLink", + "parameters": [ + { + "name": "link_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "RemoveTeamHierarchyLink": { + "tag": "Teams", + "undo": { + "type": "idempotent" + } + }, + "GetTeamHierarchyLink": { + "tag": "Teams", + "undo": { + "type": "safe" + } + }, "DeleteTeamConnections": { "tag": "Team Connections", "undo": {