From 5339f37b52ca6dc93700671dc9adba624c2826b1 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 1 Dec 2025 14:55:40 +0000 Subject: [PATCH] Regenerate client from commit 979bb6b of spec repo --- .generator/schemas/v2/openapi.yaml | 1204 ++++++++++++++++- docs/datadog_api_client.v2.api.rst | 7 + docs/datadog_api_client.v2.model.rst | 238 ++++ .../AddRoleToRestrictionQuery.py | 29 + .../CreateRestrictionQuery.py | 27 + .../DeleteRestrictionQuery.py | 18 + .../GetRestrictionQuery.py | 20 + .../GetRoleRestrictionQuery.py | 20 + .../ListRestrictionQueries.py | 14 + .../ListRestrictionQueryRoles.py | 20 + .../ListUserRestrictionQueries.py | 20 + .../RemoveRoleFromRestrictionQuery.py | 29 + .../ReplaceRestrictionQuery.py | 31 + .../UpdateRestrictionQuery.py | 31 + 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/configuration.py | 11 + .../v2/api/logs_restriction_queries_api.py | 551 ++++++++ src/datadog_api_client/v2/api/teams_api.py | 260 +++- src/datadog_api_client/v2/apis/__init__.py | 2 + .../v2/model/logs_restriction_queries_type.py | 35 + .../relationship_to_user_team_permission.py | 5 +- ...lationship_to_user_team_permission_data.py | 2 + .../v2/model/restriction_query_attributes.py | 97 ++ .../restriction_query_create_attributes.py | 33 + .../v2/model/restriction_query_create_data.py | 56 + .../model/restriction_query_create_payload.py | 42 + .../model/restriction_query_list_response.py | 44 + ...estriction_query_response_included_item.py | 44 + .../v2/model/restriction_query_role.py | 54 + .../model/restriction_query_role_attribute.py | 36 + .../model/restriction_query_roles_response.py | 42 + .../restriction_query_update_attributes.py | 33 + .../v2/model/restriction_query_update_data.py | 56 + .../model/restriction_query_update_payload.py | 42 + .../restriction_query_with_relationships.py | 74 + ...ction_query_with_relationships_response.py | 61 + ...restriction_query_without_relationships.py | 65 + ...on_query_without_relationships_response.py | 44 + .../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 | 74 + ..._query_returns_bad_request_response.frozen | 1 + ...on_query_returns_bad_request_response.yaml | 21 + ...striction_query_returns_ok_response.frozen | 1 + ...restriction_query_returns_ok_response.yaml | 38 + ...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 ++ ..._query_returns_bad_request_response.frozen | 1 + ...on_query_returns_bad_request_response.yaml | 18 + ...on_query_returns_not_found_response.frozen | 1 + ...tion_query_returns_not_found_response.yaml | 18 + ...striction_query_returns_ok_response.frozen | 1 + ...restriction_query_returns_ok_response.yaml | 54 + ..._query_returns_bad_request_response.frozen | 1 + ...on_query_returns_bad_request_response.yaml | 18 + ...on_query_returns_not_found_response.frozen | 1 + ...tion_query_returns_not_found_response.yaml | 18 + ...striction_query_returns_ok_response.frozen | 1 + ...restriction_query_returns_ok_response.yaml | 56 + ...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 ++ ...n_user_returns_bad_request_response.frozen | 1 + ...ven_user_returns_bad_request_response.yaml | 18 + ...ven_user_returns_not_found_response.frozen | 1 + ...given_user_returns_not_found_response.yaml | 19 + ...n_role_returns_bad_request_response.frozen | 1 + ...ven_role_returns_bad_request_response.yaml | 18 + ...ven_role_returns_not_found_response.frozen | 1 + ...given_role_returns_not_found_response.yaml | 18 + ...or_a_given_role_returns_ok_response.frozen | 1 + ..._for_a_given_role_returns_ok_response.yaml | 52 + ...hierarchy_links_returns_ok_response.frozen | 1 + ...m_hierarchy_links_returns_ok_response.yaml | 114 ++ ..._query_returns_bad_request_response.frozen | 1 + ...on_query_returns_bad_request_response.yaml | 21 + ...on_query_returns_not_found_response.frozen | 1 + ...tion_query_returns_not_found_response.yaml | 21 + ...striction_query_returns_ok_response.frozen | 1 + ...restriction_query_returns_ok_response.yaml | 88 ++ ...riction_queries_returns_ok_response.frozen | 1 + ...striction_queries_returns_ok_response.yaml | 20 + ..._query_returns_bad_request_response.frozen | 1 + ...on_query_returns_bad_request_response.yaml | 18 + ...on_query_returns_not_found_response.frozen | 1 + ...tion_query_returns_not_found_response.yaml | 18 + ...striction_query_returns_ok_response.frozen | 1 + ...restriction_query_returns_ok_response.yaml | 56 + ...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 | 36 + .../features/logs_restriction_queries.feature | 287 ++++ tests/v2/features/teams.feature | 83 ++ tests/v2/features/undo.json | 104 ++ 123 files changed, 6530 insertions(+), 14 deletions(-) create mode 100644 examples/v2/logs-restriction-queries/AddRoleToRestrictionQuery.py create mode 100644 examples/v2/logs-restriction-queries/CreateRestrictionQuery.py create mode 100644 examples/v2/logs-restriction-queries/DeleteRestrictionQuery.py create mode 100644 examples/v2/logs-restriction-queries/GetRestrictionQuery.py create mode 100644 examples/v2/logs-restriction-queries/GetRoleRestrictionQuery.py create mode 100644 examples/v2/logs-restriction-queries/ListRestrictionQueries.py create mode 100644 examples/v2/logs-restriction-queries/ListRestrictionQueryRoles.py create mode 100644 examples/v2/logs-restriction-queries/ListUserRestrictionQueries.py create mode 100644 examples/v2/logs-restriction-queries/RemoveRoleFromRestrictionQuery.py create mode 100644 examples/v2/logs-restriction-queries/ReplaceRestrictionQuery.py create mode 100644 examples/v2/logs-restriction-queries/UpdateRestrictionQuery.py 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/api/logs_restriction_queries_api.py create mode 100644 src/datadog_api_client/v2/model/logs_restriction_queries_type.py create mode 100644 src/datadog_api_client/v2/model/restriction_query_attributes.py create mode 100644 src/datadog_api_client/v2/model/restriction_query_create_attributes.py create mode 100644 src/datadog_api_client/v2/model/restriction_query_create_data.py create mode 100644 src/datadog_api_client/v2/model/restriction_query_create_payload.py create mode 100644 src/datadog_api_client/v2/model/restriction_query_list_response.py create mode 100644 src/datadog_api_client/v2/model/restriction_query_response_included_item.py create mode 100644 src/datadog_api_client/v2/model/restriction_query_role.py create mode 100644 src/datadog_api_client/v2/model/restriction_query_role_attribute.py create mode 100644 src/datadog_api_client/v2/model/restriction_query_roles_response.py create mode 100644 src/datadog_api_client/v2/model/restriction_query_update_attributes.py create mode 100644 src/datadog_api_client/v2/model/restriction_query_update_data.py create mode 100644 src/datadog_api_client/v2/model/restriction_query_update_payload.py create mode 100644 src/datadog_api_client/v2/model/restriction_query_with_relationships.py create mode 100644 src/datadog_api_client/v2/model/restriction_query_with_relationships_response.py create mode 100644 src/datadog_api_client/v2/model/restriction_query_without_relationships.py create mode 100644 src/datadog_api_client/v2/model/restriction_query_without_relationships_response.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_restriction_query_returns_bad_request_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_create_a_restriction_query_returns_bad_request_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_create_a_restriction_query_returns_ok_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_create_a_restriction_query_returns_ok_response.yaml 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_delete_a_restriction_query_returns_bad_request_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_a_restriction_query_returns_bad_request_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_a_restriction_query_returns_not_found_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_a_restriction_query_returns_not_found_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_a_restriction_query_returns_ok_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_a_restriction_query_returns_ok_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_get_a_restriction_query_returns_bad_request_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_a_restriction_query_returns_bad_request_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_get_a_restriction_query_returns_not_found_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_a_restriction_query_returns_not_found_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_get_a_restriction_query_returns_ok_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_a_restriction_query_returns_ok_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_all_restriction_queries_for_a_given_user_returns_bad_request_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_all_restriction_queries_for_a_given_user_returns_bad_request_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_get_all_restriction_queries_for_a_given_user_returns_not_found_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_all_restriction_queries_for_a_given_user_returns_not_found_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_get_restriction_query_for_a_given_role_returns_bad_request_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_restriction_query_for_a_given_role_returns_bad_request_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_get_restriction_query_for_a_given_role_returns_not_found_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_restriction_query_for_a_given_role_returns_not_found_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_get_restriction_query_for_a_given_role_returns_ok_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_get_restriction_query_for_a_given_role_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_grant_role_to_a_restriction_query_returns_bad_request_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_grant_role_to_a_restriction_query_returns_bad_request_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_grant_role_to_a_restriction_query_returns_not_found_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_grant_role_to_a_restriction_query_returns_not_found_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_grant_role_to_a_restriction_query_returns_ok_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_grant_role_to_a_restriction_query_returns_ok_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_list_restriction_queries_returns_ok_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_list_restriction_queries_returns_ok_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_list_roles_for_a_restriction_query_returns_bad_request_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_list_roles_for_a_restriction_query_returns_bad_request_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_list_roles_for_a_restriction_query_returns_not_found_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_list_roles_for_a_restriction_query_returns_not_found_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_list_roles_for_a_restriction_query_returns_ok_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_list_roles_for_a_restriction_query_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 create mode 100644 tests/v2/features/logs_restriction_queries.feature diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 9bceb71549..6bc8997cfd 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -945,6 +945,27 @@ components: required: true schema: type: string + RestrictionQueryID: + description: The ID of the restriction query. + in: path + name: restriction_query_id + required: true + schema: + type: string + RestrictionQueryRoleID: + description: The ID of the role. + in: path + name: role_id + required: true + schema: + type: string + RestrictionQueryUserID: + description: The ID of the user. + in: path + name: user_id + required: true + schema: + type: string RetentionFilterIdParam: description: The ID of the retention filter. in: path @@ -30501,6 +30522,15 @@ components: example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== type: string type: object + LogsRestrictionQueriesType: + default: logs_restriction_queries + description: Restriction query resource type. + enum: + - logs_restriction_queries + example: logs_restriction_queries + type: string + x-enum-varnames: + - LOGS_RESTRICTION_QUERIES LogsSort: description: Sort parameters when querying logs. enum: @@ -41410,6 +41440,7 @@ components: type: object RelationshipToUserTeamPermissionData: description: Related user team permission data + nullable: true properties: id: description: The ID of the user team permission @@ -41838,6 +41869,191 @@ components: required: - data type: object + RestrictionQueryAttributes: + description: Attributes of the restriction query. + properties: + created_at: + description: Creation time of the restriction query. + example: '2020-03-17T21:06:44.000Z' + format: date-time + readOnly: true + type: string + last_modifier_email: + description: Email of the user who last modified this restriction query. + example: user@example.com + readOnly: true + type: string + last_modifier_name: + description: Name of the user who last modified this restriction query. + example: John Doe + readOnly: true + type: string + modified_at: + description: Time of last restriction query modification. + example: '2020-03-17T21:15:15.000Z' + format: date-time + readOnly: true + type: string + restriction_query: + description: The query that defines the restriction. Only the content matching + the query can be returned. + example: env:sandbox + type: string + role_count: + description: Number of roles associated with this restriction query. + example: 3 + format: int64 + readOnly: true + type: integer + user_count: + description: Number of users associated with this restriction query. + example: 5 + format: int64 + readOnly: true + type: integer + type: object + RestrictionQueryCreateAttributes: + description: Attributes of the created restriction query. + properties: + restriction_query: + description: The restriction query. + example: env:sandbox + type: string + required: + - restriction_query + type: object + RestrictionQueryCreateData: + description: Data related to the creation of a restriction query. + properties: + attributes: + $ref: '#/components/schemas/RestrictionQueryCreateAttributes' + type: + $ref: '#/components/schemas/LogsRestrictionQueriesType' + type: object + RestrictionQueryCreatePayload: + description: Create a restriction query. + properties: + data: + $ref: '#/components/schemas/RestrictionQueryCreateData' + type: object + RestrictionQueryListResponse: + description: Response containing information about multiple restriction queries. + properties: + data: + description: Array of returned restriction queries. + items: + $ref: '#/components/schemas/RestrictionQueryWithoutRelationships' + type: array + type: object + RestrictionQueryResponseIncludedItem: + description: An object related to a restriction query. + oneOf: + - $ref: '#/components/schemas/RestrictionQueryRole' + RestrictionQueryRole: + description: Partial role object. + properties: + attributes: + $ref: '#/components/schemas/RestrictionQueryRoleAttribute' + id: + description: ID of the role. + example: + type: string + type: + $ref: '#/components/schemas/RolesType' + required: + - type + - id + - attributes + type: object + RestrictionQueryRoleAttribute: + description: Attributes of the role for a restriction query. + properties: + name: + description: The role name. + example: Datadog Admin Role + type: string + type: object + RestrictionQueryRolesResponse: + description: Response containing information about roles attached to a restriction + query. + properties: + data: + description: Array of roles. + items: + $ref: '#/components/schemas/RestrictionQueryRole' + type: array + type: object + RestrictionQueryUpdateAttributes: + description: Attributes of the edited restriction query. + properties: + restriction_query: + description: The restriction query. + example: env:sandbox + type: string + required: + - restriction_query + type: object + RestrictionQueryUpdateData: + description: Data related to the update of a restriction query. + properties: + attributes: + $ref: '#/components/schemas/RestrictionQueryUpdateAttributes' + type: + $ref: '#/components/schemas/LogsRestrictionQueriesType' + type: object + RestrictionQueryUpdatePayload: + description: Update a restriction query. + properties: + data: + $ref: '#/components/schemas/RestrictionQueryUpdateData' + type: object + RestrictionQueryWithRelationships: + description: Restriction query object returned by the API. + properties: + attributes: + $ref: '#/components/schemas/RestrictionQueryAttributes' + id: + description: ID of the restriction query. + example: 79a0e60a-644a-11ea-ad29-43329f7f58b5 + type: string + relationships: + $ref: '#/components/schemas/UserRelationships' + type: + $ref: '#/components/schemas/LogsRestrictionQueriesType' + type: object + RestrictionQueryWithRelationshipsResponse: + description: Response containing information about a single restriction query. + properties: + data: + $ref: '#/components/schemas/RestrictionQueryWithRelationships' + included: + description: Array of objects related to the restriction query. + items: + $ref: '#/components/schemas/RestrictionQueryResponseIncludedItem' + type: array + type: object + RestrictionQueryWithoutRelationships: + description: Restriction query object returned by the API. + properties: + attributes: + $ref: '#/components/schemas/RestrictionQueryAttributes' + id: + description: ID of the restriction query. + example: 79a0e60a-644a-11ea-ad29-43329f7f58b5 + type: string + type: + default: logs_restriction_queries + description: Restriction queries type. + example: logs_restriction_queries + readOnly: true + type: string + type: object + RestrictionQueryWithoutRelationshipsResponse: + description: Response containing information about a single restriction query. + properties: + data: + $ref: '#/components/schemas/RestrictionQueryWithoutRelationships' + type: object RetentionFilter: description: The definition of the retention filter. properties: @@ -51804,7 +52020,11 @@ components: items: description: String identifier of the module type: string + nullable: true type: array + is_managed: + description: Whether the team is managed from an external source + type: boolean link_count: description: The number of links belonging to the team format: int32 @@ -51836,6 +52056,7 @@ components: items: description: String identifier of the module type: string + nullable: true type: array required: - handle @@ -52016,6 +52237,211 @@ components: required: - data type: object + TeamHierarchyLink: + description: Team hierarchy link + properties: + attributes: + $ref: '#/components/schemas/TeamHierarchyLinkAttributes' + id: + description: The team hierarchy link's identifier + example: b8626d7e-cedd-11eb-abf5-da7ad0900001 + type: string + relationships: + $ref: '#/components/schemas/TeamHierarchyLinkRelationships' + type: + $ref: '#/components/schemas/TeamHierarchyLinkType' + required: + - attributes + - id + - type + type: object + TeamHierarchyLinkAttributes: + description: Team hierarchy link attributes + properties: + created_at: + description: Timestamp when the team hierarchy link was created + example: '' + format: date-time + type: string + provisioned_by: + description: The provisioner of the team hierarchy link + example: system + type: string + required: + - provisioned_by + - created_at + type: object + TeamHierarchyLinkCreate: + description: Data provided when creating a team hierarchy link + properties: + relationships: + $ref: '#/components/schemas/TeamHierarchyLinkCreateRelationships' + type: + $ref: '#/components/schemas/TeamHierarchyLinkType' + required: + - relationships + - type + type: object + TeamHierarchyLinkCreateRelationships: + description: The related teams that will be connected by the team hierarchy + link + properties: + parent_team: + $ref: '#/components/schemas/TeamHierarchyLinkCreateTeamRelationship' + sub_team: + $ref: '#/components/schemas/TeamHierarchyLinkCreateTeamRelationship' + required: + - parent_team + - sub_team + type: object + TeamHierarchyLinkCreateRequest: + description: Request to create a team hierarchy link + properties: + data: + $ref: '#/components/schemas/TeamHierarchyLinkCreate' + required: + - data + type: object + TeamHierarchyLinkCreateTeam: + description: This schema defines the attributes about each team that has to + be provided when creating a team hierarchy link + properties: + id: + description: The team's identifier + example: 692e8073-12c4-4c71-8408-5090bd44c9c8 + type: string + type: + $ref: '#/components/schemas/TeamType' + required: + - id + - type + type: object + TeamHierarchyLinkCreateTeamRelationship: + description: Data about each team that will be connected by the team hierarchy + link + properties: + data: + $ref: '#/components/schemas/TeamHierarchyLinkCreateTeam' + required: + - data + type: object + TeamHierarchyLinkRelationships: + description: Team hierarchy link relationships + properties: + parent_team: + $ref: '#/components/schemas/TeamHierarchyLinkTeamRelationship' + sub_team: + $ref: '#/components/schemas/TeamHierarchyLinkTeamRelationship' + required: + - parent_team + - sub_team + type: object + TeamHierarchyLinkResponse: + description: Team hierarchy link response + properties: + data: + $ref: '#/components/schemas/TeamHierarchyLink' + included: + description: Included teams + items: + $ref: '#/components/schemas/TeamHierarchyLinkTeam' + type: array + links: + $ref: '#/components/schemas/TeamsHierarchyLinksResponseLinks' + type: object + TeamHierarchyLinkTeam: + description: Team hierarchy links connect different teams. This represents team + objects that are connected by the team hierarchy link. + properties: + attributes: + $ref: '#/components/schemas/TeamHierarchyLinkTeamAttributes' + id: + description: The team's identifier + example: 692e8073-12c4-4c71-8408-5090bd44c9c8 + type: string + type: + $ref: '#/components/schemas/TeamType' + required: + - id + - type + type: object + TeamHierarchyLinkTeamAttributes: + description: Team hierarchy links connect different teams. This represents attributes + from teams that are connected by the team hierarchy link. + properties: + avatar: + description: The team's avatar + nullable: true + type: string + banner: + description: The team's banner + format: int64 + type: integer + handle: + description: The team's handle + example: team-handle + type: string + is_managed: + description: Whether the team is managed + type: boolean + is_open_membership: + description: Whether the team has open membership + type: boolean + link_count: + description: The number of links for the team + format: int64 + type: integer + name: + description: The team's name + example: Team Name + type: string + summary: + description: The team's summary + nullable: true + type: string + user_count: + description: The number of users in the team + format: int64 + type: integer + required: + - handle + - name + type: object + TeamHierarchyLinkTeamRelationship: + description: Team hierarchy link team relationship + properties: + data: + $ref: '#/components/schemas/TeamHierarchyLinkTeam' + required: + - data + type: object + TeamHierarchyLinkType: + default: team_hierarchy_links + description: Team hierarchy link type + enum: + - team_hierarchy_links + example: team_hierarchy_links + type: string + x-enum-varnames: + - TEAM_HIERARCHY_LINKS + TeamHierarchyLinksResponse: + description: Team hierarchy links response + properties: + data: + description: Team hierarchy links response data + items: + $ref: '#/components/schemas/TeamHierarchyLink' + type: array + included: + description: Included teams + items: + $ref: '#/components/schemas/TeamHierarchyLinkTeam' + type: array + links: + $ref: '#/components/schemas/TeamsHierarchyLinksResponseLinks' + meta: + $ref: '#/components/schemas/TeamsHierarchyLinksResponseMeta' + type: object TeamIncluded: description: Included resources related to the team oneOf: @@ -52895,6 +53321,76 @@ components: - LINK_COUNT - TEAM_LINKS - USER_TEAM_PERMISSIONS + TeamsHierarchyLinksResponseLinks: + description: When querying team hierarchy links, a set of links for navigation + between different pages is included + properties: + first: + description: Link to the first page. + nullable: true + type: string + last: + description: Link to the last page. + nullable: true + type: string + next: + description: Link to the next page. + nullable: true + type: string + prev: + description: Link to the previous page. + nullable: true + type: string + self: + description: Link to the current object. + type: string + type: object + TeamsHierarchyLinksResponseMeta: + description: Metadata that is included in the response when querying the team + hierarchy links + properties: + page: + $ref: '#/components/schemas/TeamsHierarchyLinksResponseMetaPage' + type: object + TeamsHierarchyLinksResponseMetaPage: + description: Metadata related to paging information that is included in the + response when querying the team hierarchy links + properties: + first_number: + description: First page number. + format: int64 + type: integer + last_number: + description: Last page number. + format: int64 + type: integer + next_number: + description: Next page number. + format: int64 + nullable: true + type: integer + number: + description: Page number. + format: int64 + type: integer + prev_number: + description: Previous page number. + format: int64 + nullable: true + type: integer + size: + description: Page size. + format: int64 + type: integer + total: + description: Total number of results. + format: int64 + type: integer + type: + description: Pagination type. + example: number_size + type: string + type: object TeamsResponse: description: Response with multiple teams properties: @@ -70264,6 +70760,487 @@ paths: operator: OR permissions: - logs_generate_metrics + /api/v2/logs/config/restriction_queries: + get: + description: Returns all restriction queries, including their names and IDs. + operationId: ListRestrictionQueries + parameters: + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/PageNumber' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryListResponse' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List restriction queries + tags: + - Logs Restriction Queries + x-permission: + operator: OR + permissions: + - logs_read_config + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Create a new restriction query for your organization. + operationId: CreateRestrictionQuery + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryCreatePayload' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryWithoutRelationshipsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create a restriction query + tags: + - Logs Restriction Queries + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - user_access_manage + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/logs/config/restriction_queries/role/{role_id}: + get: + description: Get restriction query for a given role. + operationId: GetRoleRestrictionQuery + parameters: + - $ref: '#/components/parameters/RestrictionQueryRoleID' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryListResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get restriction query for a given role + tags: + - Logs Restriction Queries + x-permission: + operator: OR + permissions: + - logs_read_config + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/logs/config/restriction_queries/user/{user_id}: + get: + description: Get all restriction queries for a given user. + operationId: ListUserRestrictionQueries + parameters: + - $ref: '#/components/parameters/RestrictionQueryUserID' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryListResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get all restriction queries for a given user + tags: + - Logs Restriction Queries + x-permission: + operator: OR + permissions: + - logs_read_config + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/logs/config/restriction_queries/{restriction_query_id}: + delete: + description: Deletes a restriction query. + operationId: DeleteRestrictionQuery + parameters: + - $ref: '#/components/parameters/RestrictionQueryID' + responses: + '204': + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete a restriction query + tags: + - Logs Restriction Queries + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - user_access_manage + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + get: + description: Get a restriction query in the organization specified by the restriction + query's `restriction_query_id`. + operationId: GetRestrictionQuery + parameters: + - $ref: '#/components/parameters/RestrictionQueryID' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryWithRelationshipsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get a restriction query + tags: + - Logs Restriction Queries + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - logs_read_config + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + patch: + description: Edit a restriction query. + operationId: UpdateRestrictionQuery + parameters: + - $ref: '#/components/parameters/RestrictionQueryID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryUpdatePayload' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryWithoutRelationshipsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update a restriction query + tags: + - Logs Restriction Queries + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - user_access_manage + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + put: + description: Replace a restriction query. + operationId: ReplaceRestrictionQuery + parameters: + - $ref: '#/components/parameters/RestrictionQueryID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryUpdatePayload' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryWithoutRelationshipsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Replace a restriction query + tags: + - Logs Restriction Queries + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - user_access_manage + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/logs/config/restriction_queries/{restriction_query_id}/roles: + delete: + description: Removes a role from a restriction query. + operationId: RemoveRoleFromRestrictionQuery + parameters: + - $ref: '#/components/parameters/RestrictionQueryID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RelationshipToRole' + required: true + responses: + '204': + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Revoke role from a restriction query + tags: + - Logs Restriction Queries + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - user_access_manage + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + get: + description: Returns all roles that have a given restriction query. + operationId: ListRestrictionQueryRoles + parameters: + - $ref: '#/components/parameters/RestrictionQueryID' + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/PageNumber' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryRolesResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List roles for a restriction query + tags: + - Logs Restriction Queries + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - logs_read_config + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: 'Adds a role to a restriction query. + + + **Note**: This operation automatically grants the `logs_read_data` permission + to the role if it doesn''t already have it.' + operationId: AddRoleToRestrictionQuery + parameters: + - $ref: '#/components/parameters/RestrictionQueryID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RelationshipToRole' + required: true + responses: + '204': + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Grant role to a restriction query + tags: + - Logs Restriction Queries + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - user_access_manage + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/logs/events: get: description: 'List endpoint returns logs that match a log search query. @@ -81999,6 +82976,170 @@ paths: permissions: - teams_read - teams_manage + /api/v2/team-hierarchy-links: + get: + description: List all team hierarchy links that match the provided filters. + operationId: ListTeamHierarchyLinks + parameters: + - $ref: '#/components/parameters/PageNumber' + - $ref: '#/components/parameters/PageSize' + - description: Filter by parent team ID + in: query + name: filter[parent_team] + required: false + schema: + type: string + - description: Filter by sub team ID + in: query + name: filter[sub_team] + required: false + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamHierarchyLinksResponse' + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Get team hierarchy links + tags: + - Teams + x-pagination: + limitParam: page[size] + pageParam: page[number] + resultsPath: data + x-permission: + operator: OR + permissions: + - teams_read + post: + description: Create a new team hierarchy link between a parent team and a sub + team. + operationId: AddTeamHierarchyLink + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TeamHierarchyLinkCreateRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamHierarchyLinkResponse' + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Conflict + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + - teams_manage + summary: Create a team hierarchy link + tags: + - Teams + x-permission: + operator: AND + permissions: + - teams_read + - teams_manage + /api/v2/team-hierarchy-links/{link_id}: + delete: + description: Remove a team hierarchy link by the given link_id. + operationId: RemoveTeamHierarchyLink + parameters: + - description: The team hierarchy link's identifier + in: path + name: link_id + required: true + schema: + type: string + responses: + '204': + description: No Content + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + - teams_manage + summary: Remove a team hierarchy link + tags: + - Teams + x-permission: + operator: AND + permissions: + - teams_read + - teams_manage + get: + description: Get a single team hierarchy link for the given link_id. + operationId: GetTeamHierarchyLink + parameters: + - description: The team hierarchy link's identifier + in: path + name: link_id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamHierarchyLinkResponse' + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Get a team hierarchy link + tags: + - Teams + x-permission: + operator: OR + permissions: + - teams_read /api/v2/team/connections: delete: description: Delete multiple team connections. @@ -82273,7 +83414,13 @@ paths: If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/team/{super_team_id}/member_teams: get: - description: Get all member teams. + deprecated: true + description: 'Get all member teams. + + + **Note**: This API is deprecated. For team hierarchy relationships (parent-child + + teams), use the team hierarchy links API: `GET /api/v2/team-hierarchy-links`.' operationId: ListMemberTeams parameters: - description: None @@ -82326,14 +83473,20 @@ paths: operator: OR permissions: - teams_read + x-sunset: '2026-06-01' x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' post: + deprecated: true description: 'Add a member team. Adds the team given by the `id` in the body as a member team of the super - team.' + team. + + + **Note**: This API is deprecated. For creating team hierarchy links, use the + team hierarchy links API: `POST /api/v2/team-hierarchy-links`.' operationId: AddMemberTeam parameters: - description: None @@ -82373,12 +83526,18 @@ paths: operator: OR permissions: - teams_read + x-sunset: '2026-06-01' x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/team/{super_team_id}/member_teams/{member_team_id}: delete: - description: Remove a super team's member team identified by `member_team_id`. + deprecated: true + description: 'Remove a super team''s member team identified by `member_team_id`. + + + **Note**: This API is deprecated. For deleting team hierarchy links, use the + team hierarchy links API: `DELETE /api/v2/team-hierarchy-links/{link_id}`.' operationId: RemoveMemberTeam parameters: - description: None @@ -82418,6 +83577,7 @@ paths: operator: OR permissions: - teams_read + x-sunset: '2026-06-01' x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' @@ -85210,6 +86370,44 @@ tags: description: Find out more at url: https://docs.datadoghq.com/logs/logs_to_metrics/ name: Logs Metrics +- description: '**Note: This endpoint is in public beta. If you have any feedback, + contact [Datadog support](https://docs.datadoghq.com/help/).** + + + A Restriction Query is a logs query that restricts which logs the `logs_read_data` + permission grants read access to. + + For users whose roles have Restriction Queries, any log query they make only returns + those log events that also match + + one of their Restriction Queries. This is true whether the user queries log events + from any log-related feature, including + + the log explorer, Live Tail, re-hydration, or a dashboard widget. + + + Restriction Queries currently only support use of the following components of + log events: + + + - Reserved attributes + + - The log message + + - Tags + + + To restrict read access on log data, add a team tag to log events to indicate + which teams own them, and then scope Restriction Queries to the relevant values + of the team tag. Tags can be applied to log events in many ways, and a log event + can have multiple tags with the same key (like team) and different values. This + means the same log event can be visible to roles whose restriction queries are + scoped to different team values. + + + See [How to Set Up RBAC for Logs](https://docs.datadoghq.com/logs/guide/logs-rbac/?tab=api#restrict-access-to-logs) + for details on how to add restriction queries.' + name: Logs Restriction Queries - description: "The metrics endpoint allows you to:\n\n- Post metrics data so it can be graphed on Datadog\u2019s dashboards\n- Query metrics from any time period (timeseries and scalar)\n- Modify tag configurations for metrics\n- View tags diff --git a/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index 3768dae831..035b95ffa8 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -326,6 +326,13 @@ datadog\_api\_client.v2.api.logs\_metrics\_api module :members: :show-inheritance: +datadog\_api\_client.v2.api.logs\_restriction\_queries\_api module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.api.logs_restriction_queries_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.metrics\_api module ----------------------------------------------- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 60fdfd49e2..c45678dbee 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -13171,6 +13171,13 @@ datadog\_api\_client.v2.model.logs\_response\_metadata\_page module :members: :show-inheritance: +datadog\_api\_client.v2.model.logs\_restriction\_queries\_type module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.logs_restriction_queries_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.logs\_sort module ----------------------------------------------- @@ -18204,6 +18211,118 @@ datadog\_api\_client.v2.model.restriction\_policy\_update\_request module :members: :show-inheritance: +datadog\_api\_client.v2.model.restriction\_query\_attributes module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.restriction_query_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.restriction\_query\_create\_attributes module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.restriction_query_create_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.restriction\_query\_create\_data module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.restriction_query_create_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.restriction\_query\_create\_payload module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.restriction_query_create_payload + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.restriction\_query\_list\_response module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.restriction_query_list_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.restriction\_query\_response\_included\_item module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.restriction_query_response_included_item + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.restriction\_query\_role module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.restriction_query_role + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.restriction\_query\_role\_attribute module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.restriction_query_role_attribute + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.restriction\_query\_roles\_response module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.restriction_query_roles_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.restriction\_query\_update\_attributes module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.restriction_query_update_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.restriction\_query\_update\_data module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.restriction_query_update_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.restriction\_query\_update\_payload module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.restriction_query_update_payload + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.restriction\_query\_with\_relationships module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.restriction_query_with_relationships + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.restriction\_query\_with\_relationships\_response module +-------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.restriction_query_with_relationships_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.restriction\_query\_without\_relationships module +------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.restriction_query_without_relationships + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.restriction\_query\_without\_relationships\_response module +----------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.restriction_query_without_relationships_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.retention\_filter module ------------------------------------------------------ @@ -22922,6 +23041,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 +23615,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/logs-restriction-queries/AddRoleToRestrictionQuery.py b/examples/v2/logs-restriction-queries/AddRoleToRestrictionQuery.py new file mode 100644 index 0000000000..79c4d5e50f --- /dev/null +++ b/examples/v2/logs-restriction-queries/AddRoleToRestrictionQuery.py @@ -0,0 +1,29 @@ +""" +Grant role to a restriction query returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.logs_restriction_queries_api import LogsRestrictionQueriesApi +from datadog_api_client.v2.model.relationship_to_role import RelationshipToRole +from datadog_api_client.v2.model.relationship_to_role_data import RelationshipToRoleData +from datadog_api_client.v2.model.roles_type import RolesType + +# there is a valid "restriction_query" in the system +RESTRICTION_QUERY_DATA_ID = environ["RESTRICTION_QUERY_DATA_ID"] + +# there is a valid "role" in the system +ROLE_DATA_ID = environ["ROLE_DATA_ID"] + +body = RelationshipToRole( + data=RelationshipToRoleData( + id=ROLE_DATA_ID, + type=RolesType.ROLES, + ), +) + +configuration = Configuration() +configuration.unstable_operations["add_role_to_restriction_query"] = True +with ApiClient(configuration) as api_client: + api_instance = LogsRestrictionQueriesApi(api_client) + api_instance.add_role_to_restriction_query(restriction_query_id=RESTRICTION_QUERY_DATA_ID, body=body) diff --git a/examples/v2/logs-restriction-queries/CreateRestrictionQuery.py b/examples/v2/logs-restriction-queries/CreateRestrictionQuery.py new file mode 100644 index 0000000000..29ae888ea9 --- /dev/null +++ b/examples/v2/logs-restriction-queries/CreateRestrictionQuery.py @@ -0,0 +1,27 @@ +""" +Create a restriction query returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.logs_restriction_queries_api import LogsRestrictionQueriesApi +from datadog_api_client.v2.model.logs_restriction_queries_type import LogsRestrictionQueriesType +from datadog_api_client.v2.model.restriction_query_create_attributes import RestrictionQueryCreateAttributes +from datadog_api_client.v2.model.restriction_query_create_data import RestrictionQueryCreateData +from datadog_api_client.v2.model.restriction_query_create_payload import RestrictionQueryCreatePayload + +body = RestrictionQueryCreatePayload( + data=RestrictionQueryCreateData( + attributes=RestrictionQueryCreateAttributes( + restriction_query="env:sandbox", + ), + type=LogsRestrictionQueriesType.LOGS_RESTRICTION_QUERIES, + ), +) + +configuration = Configuration() +configuration.unstable_operations["create_restriction_query"] = True +with ApiClient(configuration) as api_client: + api_instance = LogsRestrictionQueriesApi(api_client) + response = api_instance.create_restriction_query(body=body) + + print(response) diff --git a/examples/v2/logs-restriction-queries/DeleteRestrictionQuery.py b/examples/v2/logs-restriction-queries/DeleteRestrictionQuery.py new file mode 100644 index 0000000000..6345a1dc35 --- /dev/null +++ b/examples/v2/logs-restriction-queries/DeleteRestrictionQuery.py @@ -0,0 +1,18 @@ +""" +Delete a restriction query returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.logs_restriction_queries_api import LogsRestrictionQueriesApi + +# there is a valid "restriction_query" in the system +RESTRICTION_QUERY_DATA_ID = environ["RESTRICTION_QUERY_DATA_ID"] + +configuration = Configuration() +configuration.unstable_operations["delete_restriction_query"] = True +with ApiClient(configuration) as api_client: + api_instance = LogsRestrictionQueriesApi(api_client) + api_instance.delete_restriction_query( + restriction_query_id=RESTRICTION_QUERY_DATA_ID, + ) diff --git a/examples/v2/logs-restriction-queries/GetRestrictionQuery.py b/examples/v2/logs-restriction-queries/GetRestrictionQuery.py new file mode 100644 index 0000000000..0268655ad8 --- /dev/null +++ b/examples/v2/logs-restriction-queries/GetRestrictionQuery.py @@ -0,0 +1,20 @@ +""" +Get a restriction query returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.logs_restriction_queries_api import LogsRestrictionQueriesApi + +# there is a valid "restriction_query" in the system +RESTRICTION_QUERY_DATA_ID = environ["RESTRICTION_QUERY_DATA_ID"] + +configuration = Configuration() +configuration.unstable_operations["get_restriction_query"] = True +with ApiClient(configuration) as api_client: + api_instance = LogsRestrictionQueriesApi(api_client) + response = api_instance.get_restriction_query( + restriction_query_id=RESTRICTION_QUERY_DATA_ID, + ) + + print(response) diff --git a/examples/v2/logs-restriction-queries/GetRoleRestrictionQuery.py b/examples/v2/logs-restriction-queries/GetRoleRestrictionQuery.py new file mode 100644 index 0000000000..6fb59a2f9a --- /dev/null +++ b/examples/v2/logs-restriction-queries/GetRoleRestrictionQuery.py @@ -0,0 +1,20 @@ +""" +Get restriction query for a given role returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.logs_restriction_queries_api import LogsRestrictionQueriesApi + +# there is a valid "role" in the system +ROLE_DATA_ID = environ["ROLE_DATA_ID"] + +configuration = Configuration() +configuration.unstable_operations["get_role_restriction_query"] = True +with ApiClient(configuration) as api_client: + api_instance = LogsRestrictionQueriesApi(api_client) + response = api_instance.get_role_restriction_query( + role_id=ROLE_DATA_ID, + ) + + print(response) diff --git a/examples/v2/logs-restriction-queries/ListRestrictionQueries.py b/examples/v2/logs-restriction-queries/ListRestrictionQueries.py new file mode 100644 index 0000000000..ead1933153 --- /dev/null +++ b/examples/v2/logs-restriction-queries/ListRestrictionQueries.py @@ -0,0 +1,14 @@ +""" +List restriction queries returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.logs_restriction_queries_api import LogsRestrictionQueriesApi + +configuration = Configuration() +configuration.unstable_operations["list_restriction_queries"] = True +with ApiClient(configuration) as api_client: + api_instance = LogsRestrictionQueriesApi(api_client) + response = api_instance.list_restriction_queries() + + print(response) diff --git a/examples/v2/logs-restriction-queries/ListRestrictionQueryRoles.py b/examples/v2/logs-restriction-queries/ListRestrictionQueryRoles.py new file mode 100644 index 0000000000..88bf84753a --- /dev/null +++ b/examples/v2/logs-restriction-queries/ListRestrictionQueryRoles.py @@ -0,0 +1,20 @@ +""" +List roles for a restriction query returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.logs_restriction_queries_api import LogsRestrictionQueriesApi + +# there is a valid "restriction_query" in the system +RESTRICTION_QUERY_DATA_ID = environ["RESTRICTION_QUERY_DATA_ID"] + +configuration = Configuration() +configuration.unstable_operations["list_restriction_query_roles"] = True +with ApiClient(configuration) as api_client: + api_instance = LogsRestrictionQueriesApi(api_client) + response = api_instance.list_restriction_query_roles( + restriction_query_id=RESTRICTION_QUERY_DATA_ID, + ) + + print(response) diff --git a/examples/v2/logs-restriction-queries/ListUserRestrictionQueries.py b/examples/v2/logs-restriction-queries/ListUserRestrictionQueries.py new file mode 100644 index 0000000000..798287ba9c --- /dev/null +++ b/examples/v2/logs-restriction-queries/ListUserRestrictionQueries.py @@ -0,0 +1,20 @@ +""" +Get all restriction queries for a given user returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.logs_restriction_queries_api import LogsRestrictionQueriesApi + +# there is a valid "user" in the system +USER_DATA_ID = environ["USER_DATA_ID"] + +configuration = Configuration() +configuration.unstable_operations["list_user_restriction_queries"] = True +with ApiClient(configuration) as api_client: + api_instance = LogsRestrictionQueriesApi(api_client) + response = api_instance.list_user_restriction_queries( + user_id=USER_DATA_ID, + ) + + print(response) diff --git a/examples/v2/logs-restriction-queries/RemoveRoleFromRestrictionQuery.py b/examples/v2/logs-restriction-queries/RemoveRoleFromRestrictionQuery.py new file mode 100644 index 0000000000..c41aba7ffa --- /dev/null +++ b/examples/v2/logs-restriction-queries/RemoveRoleFromRestrictionQuery.py @@ -0,0 +1,29 @@ +""" +Revoke role from a restriction query returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.logs_restriction_queries_api import LogsRestrictionQueriesApi +from datadog_api_client.v2.model.relationship_to_role import RelationshipToRole +from datadog_api_client.v2.model.relationship_to_role_data import RelationshipToRoleData +from datadog_api_client.v2.model.roles_type import RolesType + +# there is a valid "restriction_query" in the system +RESTRICTION_QUERY_DATA_ID = environ["RESTRICTION_QUERY_DATA_ID"] + +# there is a valid "role" in the system +ROLE_DATA_ID = environ["ROLE_DATA_ID"] + +body = RelationshipToRole( + data=RelationshipToRoleData( + id=ROLE_DATA_ID, + type=RolesType.ROLES, + ), +) + +configuration = Configuration() +configuration.unstable_operations["remove_role_from_restriction_query"] = True +with ApiClient(configuration) as api_client: + api_instance = LogsRestrictionQueriesApi(api_client) + api_instance.remove_role_from_restriction_query(restriction_query_id=RESTRICTION_QUERY_DATA_ID, body=body) diff --git a/examples/v2/logs-restriction-queries/ReplaceRestrictionQuery.py b/examples/v2/logs-restriction-queries/ReplaceRestrictionQuery.py new file mode 100644 index 0000000000..993f953ae0 --- /dev/null +++ b/examples/v2/logs-restriction-queries/ReplaceRestrictionQuery.py @@ -0,0 +1,31 @@ +""" +Replace a restriction query returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.logs_restriction_queries_api import LogsRestrictionQueriesApi +from datadog_api_client.v2.model.logs_restriction_queries_type import LogsRestrictionQueriesType +from datadog_api_client.v2.model.restriction_query_update_attributes import RestrictionQueryUpdateAttributes +from datadog_api_client.v2.model.restriction_query_update_data import RestrictionQueryUpdateData +from datadog_api_client.v2.model.restriction_query_update_payload import RestrictionQueryUpdatePayload + +# there is a valid "restriction_query" in the system +RESTRICTION_QUERY_DATA_ID = environ["RESTRICTION_QUERY_DATA_ID"] + +body = RestrictionQueryUpdatePayload( + data=RestrictionQueryUpdateData( + attributes=RestrictionQueryUpdateAttributes( + restriction_query="env:staging", + ), + type=LogsRestrictionQueriesType.LOGS_RESTRICTION_QUERIES, + ), +) + +configuration = Configuration() +configuration.unstable_operations["replace_restriction_query"] = True +with ApiClient(configuration) as api_client: + api_instance = LogsRestrictionQueriesApi(api_client) + response = api_instance.replace_restriction_query(restriction_query_id=RESTRICTION_QUERY_DATA_ID, body=body) + + print(response) diff --git a/examples/v2/logs-restriction-queries/UpdateRestrictionQuery.py b/examples/v2/logs-restriction-queries/UpdateRestrictionQuery.py new file mode 100644 index 0000000000..de5722249b --- /dev/null +++ b/examples/v2/logs-restriction-queries/UpdateRestrictionQuery.py @@ -0,0 +1,31 @@ +""" +Update a restriction query returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.logs_restriction_queries_api import LogsRestrictionQueriesApi +from datadog_api_client.v2.model.logs_restriction_queries_type import LogsRestrictionQueriesType +from datadog_api_client.v2.model.restriction_query_update_attributes import RestrictionQueryUpdateAttributes +from datadog_api_client.v2.model.restriction_query_update_data import RestrictionQueryUpdateData +from datadog_api_client.v2.model.restriction_query_update_payload import RestrictionQueryUpdatePayload + +# there is a valid "restriction_query" in the system +RESTRICTION_QUERY_DATA_ID = environ["RESTRICTION_QUERY_DATA_ID"] + +body = RestrictionQueryUpdatePayload( + data=RestrictionQueryUpdateData( + attributes=RestrictionQueryUpdateAttributes( + restriction_query="env:production", + ), + type=LogsRestrictionQueriesType.LOGS_RESTRICTION_QUERIES, + ), +) + +configuration = Configuration() +configuration.unstable_operations["update_restriction_query"] = True +with ApiClient(configuration) as api_client: + api_instance = LogsRestrictionQueriesApi(api_client) + response = api_instance.update_restriction_query(restriction_query_id=RESTRICTION_QUERY_DATA_ID, body=body) + + print(response) 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/configuration.py b/src/datadog_api_client/configuration.py index 665081694b..77d6091d8b 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -337,6 +337,17 @@ def __init__( "v2.update_incident_notification_template": False, "v2.update_incident_todo": False, "v2.update_incident_type": False, + "v2.add_role_to_restriction_query": False, + "v2.create_restriction_query": False, + "v2.delete_restriction_query": False, + "v2.get_restriction_query": False, + "v2.get_role_restriction_query": False, + "v2.list_restriction_queries": False, + "v2.list_restriction_query_roles": False, + "v2.list_user_restriction_queries": False, + "v2.remove_role_from_restriction_query": False, + "v2.replace_restriction_query": False, + "v2.update_restriction_query": False, "v2.create_monitor_user_template": False, "v2.delete_monitor_user_template": False, "v2.get_monitor_user_template": False, diff --git a/src/datadog_api_client/v2/api/logs_restriction_queries_api.py b/src/datadog_api_client/v2/api/logs_restriction_queries_api.py new file mode 100644 index 0000000000..3c084e57c8 --- /dev/null +++ b/src/datadog_api_client/v2/api/logs_restriction_queries_api.py @@ -0,0 +1,551 @@ +# 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 Any, Dict, Union + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.model_utils import ( + UnsetType, + unset, +) +from datadog_api_client.v2.model.restriction_query_list_response import RestrictionQueryListResponse +from datadog_api_client.v2.model.restriction_query_without_relationships_response import ( + RestrictionQueryWithoutRelationshipsResponse, +) +from datadog_api_client.v2.model.restriction_query_create_payload import RestrictionQueryCreatePayload +from datadog_api_client.v2.model.restriction_query_with_relationships_response import ( + RestrictionQueryWithRelationshipsResponse, +) +from datadog_api_client.v2.model.restriction_query_update_payload import RestrictionQueryUpdatePayload +from datadog_api_client.v2.model.relationship_to_role import RelationshipToRole +from datadog_api_client.v2.model.restriction_query_roles_response import RestrictionQueryRolesResponse + + +class LogsRestrictionQueriesApi: + """ + Note: This endpoint is in public beta. If you have any feedback, contact `Datadog support `_. + + A Restriction Query is a logs query that restricts which logs the ``logs_read_data`` permission grants read access to. + For users whose roles have Restriction Queries, any log query they make only returns those log events that also match + one of their Restriction Queries. This is true whether the user queries log events from any log-related feature, including + the log explorer, Live Tail, re-hydration, or a dashboard widget. + + Restriction Queries currently only support use of the following components of log events: + + * Reserved attributes + * The log message + * Tags + + To restrict read access on log data, add a team tag to log events to indicate which teams own them, and then scope Restriction Queries to the relevant values of the team tag. Tags can be applied to log events in many ways, and a log event can have multiple tags with the same key (like team) and different values. This means the same log event can be visible to roles whose restriction queries are scoped to different team values. + + See `How to Set Up RBAC for Logs `_ for details on how to add restriction queries. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._add_role_to_restriction_query_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/logs/config/restriction_queries/{restriction_query_id}/roles", + "operation_id": "add_role_to_restriction_query", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "restriction_query_id": { + "required": True, + "openapi_types": (str,), + "attribute": "restriction_query_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (RelationshipToRole,), + "location": "body", + }, + }, + headers_map={"accept": ["*/*"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._create_restriction_query_endpoint = _Endpoint( + settings={ + "response_type": (RestrictionQueryWithoutRelationshipsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/logs/config/restriction_queries", + "operation_id": "create_restriction_query", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (RestrictionQueryCreatePayload,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._delete_restriction_query_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/logs/config/restriction_queries/{restriction_query_id}", + "operation_id": "delete_restriction_query", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "restriction_query_id": { + "required": True, + "openapi_types": (str,), + "attribute": "restriction_query_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._get_restriction_query_endpoint = _Endpoint( + settings={ + "response_type": (RestrictionQueryWithRelationshipsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/logs/config/restriction_queries/{restriction_query_id}", + "operation_id": "get_restriction_query", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "restriction_query_id": { + "required": True, + "openapi_types": (str,), + "attribute": "restriction_query_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._get_role_restriction_query_endpoint = _Endpoint( + settings={ + "response_type": (RestrictionQueryListResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/logs/config/restriction_queries/role/{role_id}", + "operation_id": "get_role_restriction_query", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "role_id": { + "required": True, + "openapi_types": (str,), + "attribute": "role_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_restriction_queries_endpoint = _Endpoint( + settings={ + "response_type": (RestrictionQueryListResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/logs/config/restriction_queries", + "operation_id": "list_restriction_queries", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "page_size": { + "openapi_types": (int,), + "attribute": "page[size]", + "location": "query", + }, + "page_number": { + "openapi_types": (int,), + "attribute": "page[number]", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_restriction_query_roles_endpoint = _Endpoint( + settings={ + "response_type": (RestrictionQueryRolesResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/logs/config/restriction_queries/{restriction_query_id}/roles", + "operation_id": "list_restriction_query_roles", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "restriction_query_id": { + "required": True, + "openapi_types": (str,), + "attribute": "restriction_query_id", + "location": "path", + }, + "page_size": { + "openapi_types": (int,), + "attribute": "page[size]", + "location": "query", + }, + "page_number": { + "openapi_types": (int,), + "attribute": "page[number]", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_user_restriction_queries_endpoint = _Endpoint( + settings={ + "response_type": (RestrictionQueryListResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/logs/config/restriction_queries/user/{user_id}", + "operation_id": "list_user_restriction_queries", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "user_id": { + "required": True, + "openapi_types": (str,), + "attribute": "user_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._remove_role_from_restriction_query_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/logs/config/restriction_queries/{restriction_query_id}/roles", + "operation_id": "remove_role_from_restriction_query", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "restriction_query_id": { + "required": True, + "openapi_types": (str,), + "attribute": "restriction_query_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (RelationshipToRole,), + "location": "body", + }, + }, + headers_map={"accept": ["*/*"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._replace_restriction_query_endpoint = _Endpoint( + settings={ + "response_type": (RestrictionQueryWithoutRelationshipsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/logs/config/restriction_queries/{restriction_query_id}", + "operation_id": "replace_restriction_query", + "http_method": "PUT", + "version": "v2", + }, + params_map={ + "restriction_query_id": { + "required": True, + "openapi_types": (str,), + "attribute": "restriction_query_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (RestrictionQueryUpdatePayload,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._update_restriction_query_endpoint = _Endpoint( + settings={ + "response_type": (RestrictionQueryWithoutRelationshipsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/logs/config/restriction_queries/{restriction_query_id}", + "operation_id": "update_restriction_query", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "restriction_query_id": { + "required": True, + "openapi_types": (str,), + "attribute": "restriction_query_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (RestrictionQueryUpdatePayload,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def add_role_to_restriction_query( + self, + restriction_query_id: str, + body: RelationshipToRole, + ) -> None: + """Grant role to a restriction query. + + Adds a role to a restriction query. + + **Note** : This operation automatically grants the ``logs_read_data`` permission to the role if it doesn't already have it. + + :param restriction_query_id: The ID of the restriction query. + :type restriction_query_id: str + :type body: RelationshipToRole + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["restriction_query_id"] = restriction_query_id + + kwargs["body"] = body + + return self._add_role_to_restriction_query_endpoint.call_with_http_info(**kwargs) + + def create_restriction_query( + self, + body: RestrictionQueryCreatePayload, + ) -> RestrictionQueryWithoutRelationshipsResponse: + """Create a restriction query. + + Create a new restriction query for your organization. + + :type body: RestrictionQueryCreatePayload + :rtype: RestrictionQueryWithoutRelationshipsResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_restriction_query_endpoint.call_with_http_info(**kwargs) + + def delete_restriction_query( + self, + restriction_query_id: str, + ) -> None: + """Delete a restriction query. + + Deletes a restriction query. + + :param restriction_query_id: The ID of the restriction query. + :type restriction_query_id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["restriction_query_id"] = restriction_query_id + + return self._delete_restriction_query_endpoint.call_with_http_info(**kwargs) + + def get_restriction_query( + self, + restriction_query_id: str, + ) -> RestrictionQueryWithRelationshipsResponse: + """Get a restriction query. + + Get a restriction query in the organization specified by the restriction query's ``restriction_query_id``. + + :param restriction_query_id: The ID of the restriction query. + :type restriction_query_id: str + :rtype: RestrictionQueryWithRelationshipsResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["restriction_query_id"] = restriction_query_id + + return self._get_restriction_query_endpoint.call_with_http_info(**kwargs) + + def get_role_restriction_query( + self, + role_id: str, + ) -> RestrictionQueryListResponse: + """Get restriction query for a given role. + + Get restriction query for a given role. + + :param role_id: The ID of the role. + :type role_id: str + :rtype: RestrictionQueryListResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["role_id"] = role_id + + return self._get_role_restriction_query_endpoint.call_with_http_info(**kwargs) + + def list_restriction_queries( + self, + *, + page_size: Union[int, UnsetType] = unset, + page_number: Union[int, UnsetType] = unset, + ) -> RestrictionQueryListResponse: + """List restriction queries. + + Returns all restriction queries, including their names and IDs. + + :param page_size: Size for a given page. The maximum allowed value is 100. + :type page_size: int, optional + :param page_number: Specific page number to return. + :type page_number: int, optional + :rtype: RestrictionQueryListResponse + """ + kwargs: Dict[str, Any] = {} + if page_size is not unset: + kwargs["page_size"] = page_size + + if page_number is not unset: + kwargs["page_number"] = page_number + + return self._list_restriction_queries_endpoint.call_with_http_info(**kwargs) + + def list_restriction_query_roles( + self, + restriction_query_id: str, + *, + page_size: Union[int, UnsetType] = unset, + page_number: Union[int, UnsetType] = unset, + ) -> RestrictionQueryRolesResponse: + """List roles for a restriction query. + + Returns all roles that have a given restriction query. + + :param restriction_query_id: The ID of the restriction query. + :type restriction_query_id: str + :param page_size: Size for a given page. The maximum allowed value is 100. + :type page_size: int, optional + :param page_number: Specific page number to return. + :type page_number: int, optional + :rtype: RestrictionQueryRolesResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["restriction_query_id"] = restriction_query_id + + if page_size is not unset: + kwargs["page_size"] = page_size + + if page_number is not unset: + kwargs["page_number"] = page_number + + return self._list_restriction_query_roles_endpoint.call_with_http_info(**kwargs) + + def list_user_restriction_queries( + self, + user_id: str, + ) -> RestrictionQueryListResponse: + """Get all restriction queries for a given user. + + Get all restriction queries for a given user. + + :param user_id: The ID of the user. + :type user_id: str + :rtype: RestrictionQueryListResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["user_id"] = user_id + + return self._list_user_restriction_queries_endpoint.call_with_http_info(**kwargs) + + def remove_role_from_restriction_query( + self, + restriction_query_id: str, + body: RelationshipToRole, + ) -> None: + """Revoke role from a restriction query. + + Removes a role from a restriction query. + + :param restriction_query_id: The ID of the restriction query. + :type restriction_query_id: str + :type body: RelationshipToRole + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["restriction_query_id"] = restriction_query_id + + kwargs["body"] = body + + return self._remove_role_from_restriction_query_endpoint.call_with_http_info(**kwargs) + + def replace_restriction_query( + self, + restriction_query_id: str, + body: RestrictionQueryUpdatePayload, + ) -> RestrictionQueryWithoutRelationshipsResponse: + """Replace a restriction query. + + Replace a restriction query. + + :param restriction_query_id: The ID of the restriction query. + :type restriction_query_id: str + :type body: RestrictionQueryUpdatePayload + :rtype: RestrictionQueryWithoutRelationshipsResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["restriction_query_id"] = restriction_query_id + + kwargs["body"] = body + + return self._replace_restriction_query_endpoint.call_with_http_info(**kwargs) + + def update_restriction_query( + self, + restriction_query_id: str, + body: RestrictionQueryUpdatePayload, + ) -> RestrictionQueryWithoutRelationshipsResponse: + """Update a restriction query. + + Edit a restriction query. + + :param restriction_query_id: The ID of the restriction query. + :type restriction_query_id: str + :type body: RestrictionQueryUpdatePayload + :rtype: RestrictionQueryWithoutRelationshipsResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["restriction_query_id"] = restriction_query_id + + kwargs["body"] = body + + return self._update_restriction_query_endpoint.call_with_http_info(**kwargs) 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/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index 924b45b146..c6e85950dc 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -44,6 +44,7 @@ from datadog_api_client.v2.api.logs_archives_api import LogsArchivesApi from datadog_api_client.v2.api.logs_custom_destinations_api import LogsCustomDestinationsApi from datadog_api_client.v2.api.logs_metrics_api import LogsMetricsApi +from datadog_api_client.v2.api.logs_restriction_queries_api import LogsRestrictionQueriesApi from datadog_api_client.v2.api.metrics_api import MetricsApi from datadog_api_client.v2.api.microsoft_teams_integration_api import MicrosoftTeamsIntegrationApi from datadog_api_client.v2.api.monitors_api import MonitorsApi @@ -131,6 +132,7 @@ "LogsArchivesApi", "LogsCustomDestinationsApi", "LogsMetricsApi", + "LogsRestrictionQueriesApi", "MetricsApi", "MicrosoftTeamsIntegrationApi", "MonitorsApi", diff --git a/src/datadog_api_client/v2/model/logs_restriction_queries_type.py b/src/datadog_api_client/v2/model/logs_restriction_queries_type.py new file mode 100644 index 0000000000..e5c09b37d4 --- /dev/null +++ b/src/datadog_api_client/v2/model/logs_restriction_queries_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 LogsRestrictionQueriesType(ModelSimple): + """ + Restriction query resource type. + + :param value: If omitted defaults to "logs_restriction_queries". Must be one of ["logs_restriction_queries"]. + :type value: str + """ + + allowed_values = { + "logs_restriction_queries", + } + LOGS_RESTRICTION_QUERIES: ClassVar["LogsRestrictionQueriesType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +LogsRestrictionQueriesType.LOGS_RESTRICTION_QUERIES = LogsRestrictionQueriesType("logs_restriction_queries") 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/restriction_query_attributes.py b/src/datadog_api_client/v2/model/restriction_query_attributes.py new file mode 100644 index 0000000000..b0ceac97dd --- /dev/null +++ b/src/datadog_api_client/v2/model/restriction_query_attributes.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, + datetime, + unset, + UnsetType, +) + + +class RestrictionQueryAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "created_at": (datetime,), + "last_modifier_email": (str,), + "last_modifier_name": (str,), + "modified_at": (datetime,), + "restriction_query": (str,), + "role_count": (int,), + "user_count": (int,), + } + + attribute_map = { + "created_at": "created_at", + "last_modifier_email": "last_modifier_email", + "last_modifier_name": "last_modifier_name", + "modified_at": "modified_at", + "restriction_query": "restriction_query", + "role_count": "role_count", + "user_count": "user_count", + } + read_only_vars = { + "created_at", + "last_modifier_email", + "last_modifier_name", + "modified_at", + "role_count", + "user_count", + } + + def __init__( + self_, + created_at: Union[datetime, UnsetType] = unset, + last_modifier_email: Union[str, UnsetType] = unset, + last_modifier_name: Union[str, UnsetType] = unset, + modified_at: Union[datetime, UnsetType] = unset, + restriction_query: Union[str, UnsetType] = unset, + role_count: Union[int, UnsetType] = unset, + user_count: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + Attributes of the restriction query. + + :param created_at: Creation time of the restriction query. + :type created_at: datetime, optional + + :param last_modifier_email: Email of the user who last modified this restriction query. + :type last_modifier_email: str, optional + + :param last_modifier_name: Name of the user who last modified this restriction query. + :type last_modifier_name: str, optional + + :param modified_at: Time of last restriction query modification. + :type modified_at: datetime, optional + + :param restriction_query: The query that defines the restriction. Only the content matching the query can be returned. + :type restriction_query: str, optional + + :param role_count: Number of roles associated with this restriction query. + :type role_count: int, optional + + :param user_count: Number of users associated with this restriction query. + :type user_count: int, optional + """ + if created_at is not unset: + kwargs["created_at"] = created_at + if last_modifier_email is not unset: + kwargs["last_modifier_email"] = last_modifier_email + if last_modifier_name is not unset: + kwargs["last_modifier_name"] = last_modifier_name + if modified_at is not unset: + kwargs["modified_at"] = modified_at + if restriction_query is not unset: + kwargs["restriction_query"] = restriction_query + if role_count is not unset: + kwargs["role_count"] = role_count + if user_count is not unset: + kwargs["user_count"] = user_count + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/restriction_query_create_attributes.py b/src/datadog_api_client/v2/model/restriction_query_create_attributes.py new file mode 100644 index 0000000000..e2f4d8b2e7 --- /dev/null +++ b/src/datadog_api_client/v2/model/restriction_query_create_attributes.py @@ -0,0 +1,33 @@ +# 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, +) + + +class RestrictionQueryCreateAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "restriction_query": (str,), + } + + attribute_map = { + "restriction_query": "restriction_query", + } + + def __init__(self_, restriction_query: str, **kwargs): + """ + Attributes of the created restriction query. + + :param restriction_query: The restriction query. + :type restriction_query: str + """ + super().__init__(kwargs) + + self_.restriction_query = restriction_query diff --git a/src/datadog_api_client/v2/model/restriction_query_create_data.py b/src/datadog_api_client/v2/model/restriction_query_create_data.py new file mode 100644 index 0000000000..d532d0b0b6 --- /dev/null +++ b/src/datadog_api_client/v2/model/restriction_query_create_data.py @@ -0,0 +1,56 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +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.restriction_query_create_attributes import RestrictionQueryCreateAttributes + from datadog_api_client.v2.model.logs_restriction_queries_type import LogsRestrictionQueriesType + + +class RestrictionQueryCreateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.restriction_query_create_attributes import RestrictionQueryCreateAttributes + from datadog_api_client.v2.model.logs_restriction_queries_type import LogsRestrictionQueriesType + + return { + "attributes": (RestrictionQueryCreateAttributes,), + "type": (LogsRestrictionQueriesType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, + attributes: Union[RestrictionQueryCreateAttributes, UnsetType] = unset, + type: Union[LogsRestrictionQueriesType, UnsetType] = unset, + **kwargs, + ): + """ + Data related to the creation of a restriction query. + + :param attributes: Attributes of the created restriction query. + :type attributes: RestrictionQueryCreateAttributes, optional + + :param type: Restriction query resource type. + :type type: LogsRestrictionQueriesType, optional + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/restriction_query_create_payload.py b/src/datadog_api_client/v2/model/restriction_query_create_payload.py new file mode 100644 index 0000000000..9eb6c44b5a --- /dev/null +++ b/src/datadog_api_client/v2/model/restriction_query_create_payload.py @@ -0,0 +1,42 @@ +# 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.restriction_query_create_data import RestrictionQueryCreateData + + +class RestrictionQueryCreatePayload(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.restriction_query_create_data import RestrictionQueryCreateData + + return { + "data": (RestrictionQueryCreateData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[RestrictionQueryCreateData, UnsetType] = unset, **kwargs): + """ + Create a restriction query. + + :param data: Data related to the creation of a restriction query. + :type data: RestrictionQueryCreateData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/restriction_query_list_response.py b/src/datadog_api_client/v2/model/restriction_query_list_response.py new file mode 100644 index 0000000000..9318bce64e --- /dev/null +++ b/src/datadog_api_client/v2/model/restriction_query_list_response.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 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.restriction_query_without_relationships import RestrictionQueryWithoutRelationships + + +class RestrictionQueryListResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.restriction_query_without_relationships import ( + RestrictionQueryWithoutRelationships, + ) + + return { + "data": ([RestrictionQueryWithoutRelationships],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[List[RestrictionQueryWithoutRelationships], UnsetType] = unset, **kwargs): + """ + Response containing information about multiple restriction queries. + + :param data: Array of returned restriction queries. + :type data: [RestrictionQueryWithoutRelationships], optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/restriction_query_response_included_item.py b/src/datadog_api_client/v2/model/restriction_query_response_included_item.py new file mode 100644 index 0000000000..14d50cc2c0 --- /dev/null +++ b/src/datadog_api_client/v2/model/restriction_query_response_included_item.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 datadog_api_client.model_utils import ( + ModelComposed, + cached_property, +) + + +class RestrictionQueryResponseIncludedItem(ModelComposed): + def __init__(self, **kwargs): + """ + An object related to a restriction query. + + :param attributes: Attributes of the role for a restriction query. + :type attributes: RestrictionQueryRoleAttribute + + :param id: ID of the role. + :type id: str + + :param type: Roles type. + :type type: RolesType + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.restriction_query_role import RestrictionQueryRole + + return { + "oneOf": [ + RestrictionQueryRole, + ], + } diff --git a/src/datadog_api_client/v2/model/restriction_query_role.py b/src/datadog_api_client/v2/model/restriction_query_role.py new file mode 100644 index 0000000000..811d0242ab --- /dev/null +++ b/src/datadog_api_client/v2/model/restriction_query_role.py @@ -0,0 +1,54 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 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.restriction_query_role_attribute import RestrictionQueryRoleAttribute + from datadog_api_client.v2.model.roles_type import RolesType + + +class RestrictionQueryRole(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.restriction_query_role_attribute import RestrictionQueryRoleAttribute + from datadog_api_client.v2.model.roles_type import RolesType + + return { + "attributes": (RestrictionQueryRoleAttribute,), + "id": (str,), + "type": (RolesType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: RestrictionQueryRoleAttribute, id: str, type: RolesType, **kwargs): + """ + Partial role object. + + :param attributes: Attributes of the role for a restriction query. + :type attributes: RestrictionQueryRoleAttribute + + :param id: ID of the role. + :type id: str + + :param type: Roles type. + :type type: RolesType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/restriction_query_role_attribute.py b/src/datadog_api_client/v2/model/restriction_query_role_attribute.py new file mode 100644 index 0000000000..76b5bb24f2 --- /dev/null +++ b/src/datadog_api_client/v2/model/restriction_query_role_attribute.py @@ -0,0 +1,36 @@ +# 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, + unset, + UnsetType, +) + + +class RestrictionQueryRoleAttribute(ModelNormal): + @cached_property + def openapi_types(_): + return { + "name": (str,), + } + + attribute_map = { + "name": "name", + } + + def __init__(self_, name: Union[str, UnsetType] = unset, **kwargs): + """ + Attributes of the role for a restriction query. + + :param name: The role name. + :type name: str, optional + """ + if name is not unset: + kwargs["name"] = name + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/restriction_query_roles_response.py b/src/datadog_api_client/v2/model/restriction_query_roles_response.py new file mode 100644 index 0000000000..cffd5c9f77 --- /dev/null +++ b/src/datadog_api_client/v2/model/restriction_query_roles_response.py @@ -0,0 +1,42 @@ +# 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.restriction_query_role import RestrictionQueryRole + + +class RestrictionQueryRolesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.restriction_query_role import RestrictionQueryRole + + return { + "data": ([RestrictionQueryRole],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[List[RestrictionQueryRole], UnsetType] = unset, **kwargs): + """ + Response containing information about roles attached to a restriction query. + + :param data: Array of roles. + :type data: [RestrictionQueryRole], optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/restriction_query_update_attributes.py b/src/datadog_api_client/v2/model/restriction_query_update_attributes.py new file mode 100644 index 0000000000..ae7b783115 --- /dev/null +++ b/src/datadog_api_client/v2/model/restriction_query_update_attributes.py @@ -0,0 +1,33 @@ +# 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, +) + + +class RestrictionQueryUpdateAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "restriction_query": (str,), + } + + attribute_map = { + "restriction_query": "restriction_query", + } + + def __init__(self_, restriction_query: str, **kwargs): + """ + Attributes of the edited restriction query. + + :param restriction_query: The restriction query. + :type restriction_query: str + """ + super().__init__(kwargs) + + self_.restriction_query = restriction_query diff --git a/src/datadog_api_client/v2/model/restriction_query_update_data.py b/src/datadog_api_client/v2/model/restriction_query_update_data.py new file mode 100644 index 0000000000..4fb14adf32 --- /dev/null +++ b/src/datadog_api_client/v2/model/restriction_query_update_data.py @@ -0,0 +1,56 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +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.restriction_query_update_attributes import RestrictionQueryUpdateAttributes + from datadog_api_client.v2.model.logs_restriction_queries_type import LogsRestrictionQueriesType + + +class RestrictionQueryUpdateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.restriction_query_update_attributes import RestrictionQueryUpdateAttributes + from datadog_api_client.v2.model.logs_restriction_queries_type import LogsRestrictionQueriesType + + return { + "attributes": (RestrictionQueryUpdateAttributes,), + "type": (LogsRestrictionQueriesType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, + attributes: Union[RestrictionQueryUpdateAttributes, UnsetType] = unset, + type: Union[LogsRestrictionQueriesType, UnsetType] = unset, + **kwargs, + ): + """ + Data related to the update of a restriction query. + + :param attributes: Attributes of the edited restriction query. + :type attributes: RestrictionQueryUpdateAttributes, optional + + :param type: Restriction query resource type. + :type type: LogsRestrictionQueriesType, optional + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/restriction_query_update_payload.py b/src/datadog_api_client/v2/model/restriction_query_update_payload.py new file mode 100644 index 0000000000..6f028ae11c --- /dev/null +++ b/src/datadog_api_client/v2/model/restriction_query_update_payload.py @@ -0,0 +1,42 @@ +# 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.restriction_query_update_data import RestrictionQueryUpdateData + + +class RestrictionQueryUpdatePayload(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.restriction_query_update_data import RestrictionQueryUpdateData + + return { + "data": (RestrictionQueryUpdateData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[RestrictionQueryUpdateData, UnsetType] = unset, **kwargs): + """ + Update a restriction query. + + :param data: Data related to the update of a restriction query. + :type data: RestrictionQueryUpdateData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/restriction_query_with_relationships.py b/src/datadog_api_client/v2/model/restriction_query_with_relationships.py new file mode 100644 index 0000000000..a56ec8f20e --- /dev/null +++ b/src/datadog_api_client/v2/model/restriction_query_with_relationships.py @@ -0,0 +1,74 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 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.restriction_query_attributes import RestrictionQueryAttributes + from datadog_api_client.v2.model.user_relationships import UserRelationships + from datadog_api_client.v2.model.logs_restriction_queries_type import LogsRestrictionQueriesType + + +class RestrictionQueryWithRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.restriction_query_attributes import RestrictionQueryAttributes + from datadog_api_client.v2.model.user_relationships import UserRelationships + from datadog_api_client.v2.model.logs_restriction_queries_type import LogsRestrictionQueriesType + + return { + "attributes": (RestrictionQueryAttributes,), + "id": (str,), + "relationships": (UserRelationships,), + "type": (LogsRestrictionQueriesType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + attributes: Union[RestrictionQueryAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + relationships: Union[UserRelationships, UnsetType] = unset, + type: Union[LogsRestrictionQueriesType, UnsetType] = unset, + **kwargs, + ): + """ + Restriction query object returned by the API. + + :param attributes: Attributes of the restriction query. + :type attributes: RestrictionQueryAttributes, optional + + :param id: ID of the restriction query. + :type id: str, optional + + :param relationships: Relationships of the user object. + :type relationships: UserRelationships, optional + + :param type: Restriction query resource type. + :type type: LogsRestrictionQueriesType, optional + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + if relationships is not unset: + kwargs["relationships"] = relationships + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/restriction_query_with_relationships_response.py b/src/datadog_api_client/v2/model/restriction_query_with_relationships_response.py new file mode 100644 index 0000000000..b77017573a --- /dev/null +++ b/src/datadog_api_client/v2/model/restriction_query_with_relationships_response.py @@ -0,0 +1,61 @@ +# 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.restriction_query_with_relationships import RestrictionQueryWithRelationships + from datadog_api_client.v2.model.restriction_query_response_included_item import ( + RestrictionQueryResponseIncludedItem, + ) + from datadog_api_client.v2.model.restriction_query_role import RestrictionQueryRole + + +class RestrictionQueryWithRelationshipsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.restriction_query_with_relationships import RestrictionQueryWithRelationships + from datadog_api_client.v2.model.restriction_query_response_included_item import ( + RestrictionQueryResponseIncludedItem, + ) + + return { + "data": (RestrictionQueryWithRelationships,), + "included": ([RestrictionQueryResponseIncludedItem],), + } + + attribute_map = { + "data": "data", + "included": "included", + } + + def __init__( + self_, + data: Union[RestrictionQueryWithRelationships, UnsetType] = unset, + included: Union[List[Union[RestrictionQueryResponseIncludedItem, RestrictionQueryRole]], UnsetType] = unset, + **kwargs, + ): + """ + Response containing information about a single restriction query. + + :param data: Restriction query object returned by the API. + :type data: RestrictionQueryWithRelationships, optional + + :param included: Array of objects related to the restriction query. + :type included: [RestrictionQueryResponseIncludedItem], optional + """ + if data is not unset: + kwargs["data"] = data + if included is not unset: + kwargs["included"] = included + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/restriction_query_without_relationships.py b/src/datadog_api_client/v2/model/restriction_query_without_relationships.py new file mode 100644 index 0000000000..9d361b4ad5 --- /dev/null +++ b/src/datadog_api_client/v2/model/restriction_query_without_relationships.py @@ -0,0 +1,65 @@ +# 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.restriction_query_attributes import RestrictionQueryAttributes + + +class RestrictionQueryWithoutRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.restriction_query_attributes import RestrictionQueryAttributes + + return { + "attributes": (RestrictionQueryAttributes,), + "id": (str,), + "type": (str,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + read_only_vars = { + "type", + } + + def __init__( + self_, + attributes: Union[RestrictionQueryAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + type: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + Restriction query object returned by the API. + + :param attributes: Attributes of the restriction query. + :type attributes: RestrictionQueryAttributes, optional + + :param id: ID of the restriction query. + :type id: str, optional + + :param type: Restriction queries type. + :type type: str, optional + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/restriction_query_without_relationships_response.py b/src/datadog_api_client/v2/model/restriction_query_without_relationships_response.py new file mode 100644 index 0000000000..da5fdd0382 --- /dev/null +++ b/src/datadog_api_client/v2/model/restriction_query_without_relationships_response.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.restriction_query_without_relationships import RestrictionQueryWithoutRelationships + + +class RestrictionQueryWithoutRelationshipsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.restriction_query_without_relationships import ( + RestrictionQueryWithoutRelationships, + ) + + return { + "data": (RestrictionQueryWithoutRelationships,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[RestrictionQueryWithoutRelationships, UnsetType] = unset, **kwargs): + """ + Response containing information about a single restriction query. + + :param data: Restriction query object returned by the API. + :type data: RestrictionQueryWithoutRelationships, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) 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..ea0b06b986 --- /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): + """ + Data provided when creating a team hierarchy link + + :param relationships: The related teams that will be connected by the team hierarchy link + :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..6ebfda9868 --- /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, + ): + """ + The related teams that will be connected by the team hierarchy link + + :param parent_team: Data about each team that will be connected by the team hierarchy link + :type parent_team: TeamHierarchyLinkCreateTeamRelationship + + :param sub_team: Data about each team that will be connected by the team hierarchy link + :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..2685de379f --- /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: Data provided when creating a team hierarchy link + :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..34d717782e --- /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): + """ + This schema defines the attributes about each team that has to be provided when creating a team hierarchy link + + :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..edadef7c0c --- /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): + """ + Data about each team that will be connected by the team hierarchy link + + :param data: This schema defines the attributes about each team that has to be provided when creating a team hierarchy link + :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..6b7f2f6b31 --- /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: When querying team hierarchy links, a set of links for navigation between different pages is included + :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..5b91476847 --- /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 hierarchy links connect different teams. This represents team objects that are connected by the team hierarchy link. + + :param attributes: Team hierarchy links connect different teams. This represents attributes from teams that are connected by the team hierarchy link. + :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..e709ee5534 --- /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 hierarchy links connect different teams. This represents attributes from teams that are connected by the team hierarchy link. + + :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..7e2df39b4e --- /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 hierarchy links connect different teams. This represents team objects that are connected by the team hierarchy link. + :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..f1cdfef7c7 --- /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: When querying team hierarchy links, a set of links for navigation between different pages is included + :type links: TeamsHierarchyLinksResponseLinks, optional + + :param meta: Metadata that is included in the response when querying the team hierarchy links + :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..ac8443da9a --- /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, + ): + """ + When querying team hierarchy links, a set of links for navigation between different pages is included + + :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..e702a58190 --- /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): + """ + Metadata that is included in the response when querying the team hierarchy links + + :param page: Metadata related to paging information that is included in the response when querying the team hierarchy links + :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..60035933bd --- /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, + ): + """ + Metadata related to paging information that is included in the response when querying the team hierarchy links + + :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..ee2e78b85c 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -2458,6 +2458,7 @@ from datadog_api_client.v2.model.logs_query_options import LogsQueryOptions from datadog_api_client.v2.model.logs_response_metadata import LogsResponseMetadata from datadog_api_client.v2.model.logs_response_metadata_page import LogsResponseMetadataPage +from datadog_api_client.v2.model.logs_restriction_queries_type import LogsRestrictionQueriesType from datadog_api_client.v2.model.logs_sort import LogsSort from datadog_api_client.v2.model.logs_sort_order import LogsSortOrder from datadog_api_client.v2.model.logs_storage_tier import LogsStorageTier @@ -3738,6 +3739,26 @@ from datadog_api_client.v2.model.restriction_policy_response import RestrictionPolicyResponse from datadog_api_client.v2.model.restriction_policy_type import RestrictionPolicyType from datadog_api_client.v2.model.restriction_policy_update_request import RestrictionPolicyUpdateRequest +from datadog_api_client.v2.model.restriction_query_attributes import RestrictionQueryAttributes +from datadog_api_client.v2.model.restriction_query_create_attributes import RestrictionQueryCreateAttributes +from datadog_api_client.v2.model.restriction_query_create_data import RestrictionQueryCreateData +from datadog_api_client.v2.model.restriction_query_create_payload import RestrictionQueryCreatePayload +from datadog_api_client.v2.model.restriction_query_list_response import RestrictionQueryListResponse +from datadog_api_client.v2.model.restriction_query_response_included_item import RestrictionQueryResponseIncludedItem +from datadog_api_client.v2.model.restriction_query_role import RestrictionQueryRole +from datadog_api_client.v2.model.restriction_query_role_attribute import RestrictionQueryRoleAttribute +from datadog_api_client.v2.model.restriction_query_roles_response import RestrictionQueryRolesResponse +from datadog_api_client.v2.model.restriction_query_update_attributes import RestrictionQueryUpdateAttributes +from datadog_api_client.v2.model.restriction_query_update_data import RestrictionQueryUpdateData +from datadog_api_client.v2.model.restriction_query_update_payload import RestrictionQueryUpdatePayload +from datadog_api_client.v2.model.restriction_query_with_relationships import RestrictionQueryWithRelationships +from datadog_api_client.v2.model.restriction_query_with_relationships_response import ( + RestrictionQueryWithRelationshipsResponse, +) +from datadog_api_client.v2.model.restriction_query_without_relationships import RestrictionQueryWithoutRelationships +from datadog_api_client.v2.model.restriction_query_without_relationships_response import ( + RestrictionQueryWithoutRelationshipsResponse, +) from datadog_api_client.v2.model.retention_filter import RetentionFilter from datadog_api_client.v2.model.retention_filter_all import RetentionFilterAll from datadog_api_client.v2.model.retention_filter_all_attributes import RetentionFilterAllAttributes @@ -4589,6 +4610,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 +4712,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 @@ -6832,6 +6872,7 @@ "LogsQueryOptions", "LogsResponseMetadata", "LogsResponseMetadataPage", + "LogsRestrictionQueriesType", "LogsSort", "LogsSortOrder", "LogsStorageTier", @@ -7604,6 +7645,22 @@ "RestrictionPolicyResponse", "RestrictionPolicyType", "RestrictionPolicyUpdateRequest", + "RestrictionQueryAttributes", + "RestrictionQueryCreateAttributes", + "RestrictionQueryCreateData", + "RestrictionQueryCreatePayload", + "RestrictionQueryListResponse", + "RestrictionQueryResponseIncludedItem", + "RestrictionQueryRole", + "RestrictionQueryRoleAttribute", + "RestrictionQueryRolesResponse", + "RestrictionQueryUpdateAttributes", + "RestrictionQueryUpdateData", + "RestrictionQueryUpdatePayload", + "RestrictionQueryWithRelationships", + "RestrictionQueryWithRelationshipsResponse", + "RestrictionQueryWithoutRelationships", + "RestrictionQueryWithoutRelationshipsResponse", "RetentionFilter", "RetentionFilterAll", "RetentionFilterAllAttributes", @@ -8231,6 +8288,20 @@ "TeamCreateAttributes", "TeamCreateRelationships", "TeamCreateRequest", + "TeamHierarchyLink", + "TeamHierarchyLinkAttributes", + "TeamHierarchyLinkCreate", + "TeamHierarchyLinkCreateRelationships", + "TeamHierarchyLinkCreateRequest", + "TeamHierarchyLinkCreateTeam", + "TeamHierarchyLinkCreateTeamRelationship", + "TeamHierarchyLinkRelationships", + "TeamHierarchyLinkResponse", + "TeamHierarchyLinkTeam", + "TeamHierarchyLinkTeamAttributes", + "TeamHierarchyLinkTeamRelationship", + "TeamHierarchyLinkType", + "TeamHierarchyLinksResponse", "TeamIncluded", "TeamLink", "TeamLinkAttributes", @@ -8299,6 +8370,9 @@ "TeamUpdateRelationships", "TeamUpdateRequest", "TeamsField", + "TeamsHierarchyLinksResponseLinks", + "TeamsHierarchyLinksResponseMeta", + "TeamsHierarchyLinksResponseMetaPage", "TeamsResponse", "TeamsResponseLinks", "TeamsResponseMeta", diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_restriction_query_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_a_restriction_query_returns_bad_request_response.frozen new file mode 100644 index 0000000000..46f704ffe2 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_restriction_query_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-11-18T19:17:04.509Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_restriction_query_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_a_restriction_query_returns_bad_request_response.yaml new file mode 100644 index 0000000000..74dd28df93 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_restriction_query_returns_bad_request_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"test":"bad_request"}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/logs/config/restriction_queries + response: + body: + string: '{"errors":["API input validation failed: {''_schema'': [{''detail'': + ''Object must include `data` key.'', ''source'': {''pointer'': ''/''}}]}"]}' + headers: + content-type: + - application/json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_restriction_query_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_a_restriction_query_returns_ok_response.frozen new file mode 100644 index 0000000000..e7d3eb34c1 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_restriction_query_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-11-18T19:17:05.128Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_a_restriction_query_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_a_restriction_query_returns_ok_response.yaml new file mode 100644 index 0000000000..8745c0fd3f --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_a_restriction_query_returns_ok_response.yaml @@ -0,0 +1,38 @@ +interactions: +- request: + body: '{"data":{"attributes":{"restriction_query":"env:sandbox"},"type":"logs_restriction_queries"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/logs/config/restriction_queries + response: + body: + string: '{"data":{"type":"logs_restriction_queries","id":"2b5594f8-c4b3-11f0-a05d-da7ad0900002","attributes":{"restriction_query":"env:sandbox","created_at":"2025-11-18T19:17:05.370176+00:00","modified_at":"2025-11-18T19:17:05.370176+00:00"}}} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/logs/config/restriction_queries/2b5594f8-c4b3-11f0-a05d-da7ad0900002 + response: + body: + string: '' + headers: + content-type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +version: 1 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_delete_a_restriction_query_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_a_restriction_query_returns_bad_request_response.frozen new file mode 100644 index 0000000000..606a5c297d --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_a_restriction_query_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-11-18T19:17:06.402Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_a_restriction_query_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_a_restriction_query_returns_bad_request_response.yaml new file mode 100644 index 0000000000..73173abf96 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_a_restriction_query_returns_bad_request_response.yaml @@ -0,0 +1,18 @@ +interactions: +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/logs/config/restriction_queries/malformed_id + response: + body: + string: '{"errors":["uuid is not proper type"]}' + headers: + content-type: + - application/json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_a_restriction_query_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_a_restriction_query_returns_not_found_response.frozen new file mode 100644 index 0000000000..b407dce9fc --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_a_restriction_query_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-11-18T19:17:06.567Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_a_restriction_query_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_a_restriction_query_returns_not_found_response.yaml new file mode 100644 index 0000000000..8aa84c25de --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_a_restriction_query_returns_not_found_response.yaml @@ -0,0 +1,18 @@ +interactions: +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/logs/config/restriction_queries/00000000-0000-0000-0000-000000000000 + response: + body: + string: '{"errors":["Restriction query not found"]}' + headers: + content-type: + - application/json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_a_restriction_query_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_a_restriction_query_returns_ok_response.frozen new file mode 100644 index 0000000000..233ffaffa5 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_a_restriction_query_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-11-18T19:17:06.720Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_a_restriction_query_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_a_restriction_query_returns_ok_response.yaml new file mode 100644 index 0000000000..744620357f --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_a_restriction_query_returns_ok_response.yaml @@ -0,0 +1,54 @@ +interactions: +- request: + body: '{"data":{"attributes":{"restriction_query":"env:sandbox"},"type":"logs_restriction_queries"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/logs/config/restriction_queries + response: + body: + string: '{"data":{"type":"logs_restriction_queries","id":"2c373dc2-c4b3-11f0-8ca7-da7ad0900002","attributes":{"restriction_query":"env:sandbox","created_at":"2025-11-18T19:17:06.848316+00:00","modified_at":"2025-11-18T19:17:06.848316+00:00"}}} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/logs/config/restriction_queries/2c373dc2-c4b3-11f0-8ca7-da7ad0900002 + response: + body: + string: '' + headers: + content-type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/logs/config/restriction_queries/2c373dc2-c4b3-11f0-8ca7-da7ad0900002 + response: + body: + string: '{"errors":["Restriction query not found"]}' + headers: + content-type: + - application/json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_restriction_query_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_a_restriction_query_returns_bad_request_response.frozen new file mode 100644 index 0000000000..35466be503 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_a_restriction_query_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-11-18T19:17:07.277Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_restriction_query_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_a_restriction_query_returns_bad_request_response.yaml new file mode 100644 index 0000000000..4c61300e73 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_a_restriction_query_returns_bad_request_response.yaml @@ -0,0 +1,18 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/logs/config/restriction_queries/malformed_id + response: + body: + string: '{"errors":["uuid is not proper type"]}' + headers: + content-type: + - application/json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_restriction_query_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_a_restriction_query_returns_not_found_response.frozen new file mode 100644 index 0000000000..27aff0c3f0 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_a_restriction_query_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-11-18T19:17:07.461Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_restriction_query_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_a_restriction_query_returns_not_found_response.yaml new file mode 100644 index 0000000000..bc260ac7c9 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_a_restriction_query_returns_not_found_response.yaml @@ -0,0 +1,18 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/logs/config/restriction_queries/00000000-0000-0000-0000-000000000000 + response: + body: + string: '{"errors":["Restriction query not found"]}' + headers: + content-type: + - application/json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_restriction_query_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_a_restriction_query_returns_ok_response.frozen new file mode 100644 index 0000000000..1f26774817 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_a_restriction_query_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-11-18T19:17:07.622Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_a_restriction_query_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_a_restriction_query_returns_ok_response.yaml new file mode 100644 index 0000000000..badf184ba6 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_a_restriction_query_returns_ok_response.yaml @@ -0,0 +1,56 @@ +interactions: +- request: + body: '{"data":{"attributes":{"restriction_query":"env:sandbox"},"type":"logs_restriction_queries"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/logs/config/restriction_queries + response: + body: + string: '{"data":{"type":"logs_restriction_queries","id":"2cc39998-c4b3-11f0-8b4b-da7ad0900002","attributes":{"restriction_query":"env:sandbox","created_at":"2025-11-18T19:17:07.768188+00:00","modified_at":"2025-11-18T19:17:07.768188+00:00"}}} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/logs/config/restriction_queries/2cc39998-c4b3-11f0-8b4b-da7ad0900002 + response: + body: + string: '{"data":{"type":"logs_restriction_queries","id":"2cc39998-c4b3-11f0-8b4b-da7ad0900002","attributes":{"restriction_query":"env:sandbox","created_at":"2025-11-18T19:17:07.768188+00:00","modified_at":"2025-11-18T19:17:07.768188+00:00"},"relationships":{"roles":{"data":[]}}}} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/logs/config/restriction_queries/2cc39998-c4b3-11f0-8b4b-da7ad0900002 + response: + body: + string: '' + headers: + content-type: + - text/html; charset=utf-8 + 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_all_restriction_queries_for_a_given_user_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_all_restriction_queries_for_a_given_user_returns_bad_request_response.frozen new file mode 100644 index 0000000000..57b32bd890 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_all_restriction_queries_for_a_given_user_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-11-18T19:17:08.172Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_all_restriction_queries_for_a_given_user_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_all_restriction_queries_for_a_given_user_returns_bad_request_response.yaml new file mode 100644 index 0000000000..47d9a18751 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_all_restriction_queries_for_a_given_user_returns_bad_request_response.yaml @@ -0,0 +1,18 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/logs/config/restriction_queries/user/malformed_id + response: + body: + string: '{"errors":["uuid is not proper type"]}' + headers: + content-type: + - application/json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_all_restriction_queries_for_a_given_user_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_all_restriction_queries_for_a_given_user_returns_not_found_response.frozen new file mode 100644 index 0000000000..9ee4a5d520 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_all_restriction_queries_for_a_given_user_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-11-18T19:17:08.336Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_all_restriction_queries_for_a_given_user_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_all_restriction_queries_for_a_given_user_returns_not_found_response.yaml new file mode 100644 index 0000000000..2f498fd192 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_all_restriction_queries_for_a_given_user_returns_not_found_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/logs/config/restriction_queries/user/00000000-0000-0000-0000-000000000000 + response: + body: + string: '{"errors":["user with uuid 00000000-0000-0000-0000-000000000000 doesn''t + exist"]}' + headers: + content-type: + - application/json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_restriction_query_for_a_given_role_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_restriction_query_for_a_given_role_returns_bad_request_response.frozen new file mode 100644 index 0000000000..57897532ac --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_restriction_query_for_a_given_role_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-11-18T19:17:08.604Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_restriction_query_for_a_given_role_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_restriction_query_for_a_given_role_returns_bad_request_response.yaml new file mode 100644 index 0000000000..742b271161 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_restriction_query_for_a_given_role_returns_bad_request_response.yaml @@ -0,0 +1,18 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/logs/config/restriction_queries/role/malformed_id + response: + body: + string: '{"errors":["Missing Role malformed_id"]}' + headers: + content-type: + - application/json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_restriction_query_for_a_given_role_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_restriction_query_for_a_given_role_returns_not_found_response.frozen new file mode 100644 index 0000000000..bd0df2da88 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_restriction_query_for_a_given_role_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-11-18T19:17:08.828Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_restriction_query_for_a_given_role_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_restriction_query_for_a_given_role_returns_not_found_response.yaml new file mode 100644 index 0000000000..d7e675f21b --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_restriction_query_for_a_given_role_returns_not_found_response.yaml @@ -0,0 +1,18 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/logs/config/restriction_queries/role/00000000-0000-0000-0000-000000000000 + response: + body: + string: '{"errors":["Missing Role 00000000-0000-0000-0000-000000000000"]}' + headers: + content-type: + - application/json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_restriction_query_for_a_given_role_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_restriction_query_for_a_given_role_returns_ok_response.frozen new file mode 100644 index 0000000000..8dc9f697b0 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_restriction_query_for_a_given_role_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-11-18T19:17:08.994Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_restriction_query_for_a_given_role_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_restriction_query_for_a_given_role_returns_ok_response.yaml new file mode 100644 index 0000000000..8fc3d771d3 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_restriction_query_for_a_given_role_returns_ok_response.yaml @@ -0,0 +1,52 @@ +interactions: +- request: + body: '{"data":{"attributes":{"name":"Test-Get_restriction_query_for_a_given_role_returns_OK_response-1763493428"},"type":"roles"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/roles + response: + body: + string: '{"data":{"id":"2d925300-c4b3-11f0-a252-da7ad0900002","type":"roles","attributes":{"created_at":"2025-11-18T19:17:09.12367Z","modified_at":"2025-11-18T19:17:09.123777Z","name":"Test-Get_restriction_query_for_a_given_role_returns_OK_response-1763493428","team_count":0,"user_count":0},"relationships":{"permissions":{"data":[{"id":"d90f6830-d3d8-11e9-a77a-b3404e5e9ee2","type":"permissions"},{"id":"4441648c-d8b1-11e9-a77a-1b899a04b304","type":"permissions"},{"id":"417ba636-2dce-11eb-84c0-6bce5b0d9de0","type":"permissions"},{"id":"12efc20e-d36c-11eb-a9b8-da7ad0900002","type":"permissions"},{"id":"7605ef24-f376-11eb-b90b-da7ad0900002","type":"permissions"},{"id":"b6bf9ac6-9a59-11ec-8480-da7ad0900002","type":"permissions"},{"id":"f8e941cf-e746-11ec-b22d-da7ad0900002","type":"permissions"},{"id":"6c5ad874-7aff-11ed-a5cd-da7ad0900002","type":"permissions"},{"id":"a8b4d6e8-4ea4-11ee-b482-da7ad0900002","type":"permissions"},{"id":"50c270de-69ee-11ee-9151-da7ad0900002","type":"permissions"}]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/logs/config/restriction_queries/role/2d925300-c4b3-11f0-a252-da7ad0900002 + response: + body: + string: '{"data":[]} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/roles/2d925300-c4b3-11f0-a252-da7ad0900002 + 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_grant_role_to_a_restriction_query_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_grant_role_to_a_restriction_query_returns_bad_request_response.frozen new file mode 100644 index 0000000000..48cf494a95 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_grant_role_to_a_restriction_query_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-11-18T19:17:09.440Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_grant_role_to_a_restriction_query_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_grant_role_to_a_restriction_query_returns_bad_request_response.yaml new file mode 100644 index 0000000000..7bbda31cb1 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_grant_role_to_a_restriction_query_returns_bad_request_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"id":"3653d3c6-0c75-11ea-ad28-fb5701eabc7d","type":"roles"}}' + headers: + accept: + - '*/*' + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/logs/config/restriction_queries/malformed_id/roles + response: + body: + string: '{"errors":["Role with id: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d not + found"]}' + headers: + content-type: + - application/json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_grant_role_to_a_restriction_query_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_grant_role_to_a_restriction_query_returns_not_found_response.frozen new file mode 100644 index 0000000000..f281a86a45 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_grant_role_to_a_restriction_query_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-11-18T19:17:09.623Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_grant_role_to_a_restriction_query_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_grant_role_to_a_restriction_query_returns_not_found_response.yaml new file mode 100644 index 0000000000..2101bbb1f0 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_grant_role_to_a_restriction_query_returns_not_found_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"id":"3653d3c6-0c75-11ea-ad28-fb5701eabc7d","type":"roles"}}' + headers: + accept: + - '*/*' + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/logs/config/restriction_queries/00000000-0000-0000-0000-000000000000/roles + response: + body: + string: '{"errors":["Role with id: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d not + found"]}' + headers: + content-type: + - application/json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_grant_role_to_a_restriction_query_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_grant_role_to_a_restriction_query_returns_ok_response.frozen new file mode 100644 index 0000000000..ac88614fb5 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_grant_role_to_a_restriction_query_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-11-18T19:17:09.783Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_grant_role_to_a_restriction_query_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_grant_role_to_a_restriction_query_returns_ok_response.yaml new file mode 100644 index 0000000000..644301f8f3 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_grant_role_to_a_restriction_query_returns_ok_response.yaml @@ -0,0 +1,88 @@ +interactions: +- request: + body: '{"data":{"attributes":{"restriction_query":"env:sandbox"},"type":"logs_restriction_queries"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/logs/config/restriction_queries + response: + body: + string: '{"data":{"type":"logs_restriction_queries","id":"2e0a0abc-c4b3-11f0-9b1d-da7ad0900002","attributes":{"restriction_query":"env:sandbox","created_at":"2025-11-18T19:17:09.907646+00:00","modified_at":"2025-11-18T19:17:09.907646+00:00"}}} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: '{"data":{"attributes":{"name":"Test-Grant_role_to_a_restriction_query_returns_OK_response-1763493429"},"type":"roles"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/roles + response: + body: + string: '{"data":{"id":"2e209fb6-c4b3-11f0-8483-da7ad0900002","type":"roles","attributes":{"created_at":"2025-11-18T19:17:10.056015Z","modified_at":"2025-11-18T19:17:10.056318Z","name":"Test-Grant_role_to_a_restriction_query_returns_OK_response-1763493429","team_count":0,"user_count":0},"relationships":{"permissions":{"data":[{"id":"d90f6830-d3d8-11e9-a77a-b3404e5e9ee2","type":"permissions"},{"id":"4441648c-d8b1-11e9-a77a-1b899a04b304","type":"permissions"},{"id":"417ba636-2dce-11eb-84c0-6bce5b0d9de0","type":"permissions"},{"id":"12efc20e-d36c-11eb-a9b8-da7ad0900002","type":"permissions"},{"id":"7605ef24-f376-11eb-b90b-da7ad0900002","type":"permissions"},{"id":"b6bf9ac6-9a59-11ec-8480-da7ad0900002","type":"permissions"},{"id":"f8e941cf-e746-11ec-b22d-da7ad0900002","type":"permissions"},{"id":"6c5ad874-7aff-11ed-a5cd-da7ad0900002","type":"permissions"},{"id":"a8b4d6e8-4ea4-11ee-b482-da7ad0900002","type":"permissions"},{"id":"50c270de-69ee-11ee-9151-da7ad0900002","type":"permissions"}]}}}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +- request: + body: '{"data":{"id":"2e209fb6-c4b3-11f0-8483-da7ad0900002","type":"roles"}}' + headers: + accept: + - '*/*' + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/logs/config/restriction_queries/2e0a0abc-c4b3-11f0-9b1d-da7ad0900002/roles + response: + body: + string: '' + headers: + content-type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/roles/2e209fb6-c4b3-11f0-8483-da7ad0900002 + response: + body: + string: '' + headers: {} + status: + code: 204 + message: No Content +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/logs/config/restriction_queries/2e0a0abc-c4b3-11f0-9b1d-da7ad0900002 + response: + body: + string: '' + headers: + content-type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_list_restriction_queries_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_list_restriction_queries_returns_ok_response.frozen new file mode 100644 index 0000000000..d227ca557f --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_restriction_queries_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-11-18T19:17:10.912Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_list_restriction_queries_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_list_restriction_queries_returns_ok_response.yaml new file mode 100644 index 0000000000..8f54d0d4d4 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_restriction_queries_returns_ok_response.yaml @@ -0,0 +1,20 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/logs/config/restriction_queries + response: + body: + string: '{"data":[{"type":"logs_restriction_queries","id":"6358d012-be7e-11f0-8999-da7ad0900002","attributes":{"restriction_query":"env:production","created_at":"2025-11-10T21:44:09.039708+00:00","modified_at":"2025-11-10T21:44:09.164487+00:00"}}]} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_list_roles_for_a_restriction_query_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_list_roles_for_a_restriction_query_returns_bad_request_response.frozen new file mode 100644 index 0000000000..0badf86111 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_roles_for_a_restriction_query_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-11-18T19:17:11.052Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_list_roles_for_a_restriction_query_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_list_roles_for_a_restriction_query_returns_bad_request_response.yaml new file mode 100644 index 0000000000..6f4e62e815 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_roles_for_a_restriction_query_returns_bad_request_response.yaml @@ -0,0 +1,18 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/logs/config/restriction_queries/malformed_id/roles + response: + body: + string: '{"errors":["uuid is not proper type"]}' + headers: + content-type: + - application/json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_list_roles_for_a_restriction_query_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_list_roles_for_a_restriction_query_returns_not_found_response.frozen new file mode 100644 index 0000000000..358663320c --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_roles_for_a_restriction_query_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-11-18T19:17:11.231Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_list_roles_for_a_restriction_query_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_list_roles_for_a_restriction_query_returns_not_found_response.yaml new file mode 100644 index 0000000000..4d59e8e1a8 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_roles_for_a_restriction_query_returns_not_found_response.yaml @@ -0,0 +1,18 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/logs/config/restriction_queries/00000000-0000-0000-0000-000000000000/roles + response: + body: + string: '{"errors":["Restriction query not found"]}' + headers: + content-type: + - application/json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_list_roles_for_a_restriction_query_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_list_roles_for_a_restriction_query_returns_ok_response.frozen new file mode 100644 index 0000000000..5e8d0cb60e --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_roles_for_a_restriction_query_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-11-18T19:17:11.376Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_list_roles_for_a_restriction_query_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_list_roles_for_a_restriction_query_returns_ok_response.yaml new file mode 100644 index 0000000000..e4bb467ac3 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_roles_for_a_restriction_query_returns_ok_response.yaml @@ -0,0 +1,56 @@ +interactions: +- request: + body: '{"data":{"attributes":{"restriction_query":"env:sandbox"},"type":"logs_restriction_queries"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/logs/config/restriction_queries + response: + body: + string: '{"data":{"type":"logs_restriction_queries","id":"2efc1406-c4b3-11f0-a6d9-da7ad0900002","attributes":{"restriction_query":"env:sandbox","created_at":"2025-11-18T19:17:11.492694+00:00","modified_at":"2025-11-18T19:17:11.492694+00:00"}}} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/logs/config/restriction_queries/2efc1406-c4b3-11f0-a6d9-da7ad0900002/roles + response: + body: + string: '{"data":[]} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/logs/config/restriction_queries/2efc1406-c4b3-11f0-a6d9-da7ad0900002 + response: + body: + string: '' + headers: + content-type: + - text/html; charset=utf-8 + 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..6c6d3bf98f 100644 --- a/tests/v2/features/given.json +++ b/tests/v2/features/given.json @@ -679,6 +679,18 @@ "tag": "Logs Metrics", "operationId": "CreateLogsMetric" }, + { + "parameters": [ + { + "name": "body", + "value": "{\"data\": {\"attributes\": {\"restriction_query\": \"env:sandbox\"}, \"type\": \"logs_restriction_queries\"}}" + } + ], + "step": "there is a valid \"restriction_query\" in the system", + "key": "restriction_query", + "tag": "Logs Restriction Queries", + "operationId": "CreateRestrictionQuery" + }, { "parameters": [ { @@ -1169,6 +1181,30 @@ "tag": "Teams", "operationId": "CreateTeam" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"handle\": \"test-handle-2-{{ unique_hash }}\",\n \"name\": \"test-name-2-{{ unique_hash }}\"\n },\n \"type\": \"team\"\n }\n}" + } + ], + "step": "there is a valid \"dd_team_2\" in the system", + "key": "dd_team_2", + "tag": "Teams", + "operationId": "CreateTeam" + }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"team_hierarchy_links\",\n \"relationships\": {\n \"parent_team\": {\n \"data\": {\n \"id\": \"{{ dd_team.data.id }}\",\n \"type\": \"team\"\n }\n },\n \"sub_team\": {\n \"data\": {\n \"id\": \"{{ dd_team_2.data.id }}\",\n \"type\": \"team\"\n }\n }\n }\n }\n}" + } + ], + "step": "there is a valid \"team_hierarchy_link\" in the system", + "key": "team_hierarchy_link", + "tag": "Teams", + "operationId": "AddTeamHierarchyLink" + }, { "source": "data.data[0]", "step": "there is a valid \"team_connection\" in the system", diff --git a/tests/v2/features/logs_restriction_queries.feature b/tests/v2/features/logs_restriction_queries.feature new file mode 100644 index 0000000000..44d65b92fd --- /dev/null +++ b/tests/v2/features/logs_restriction_queries.feature @@ -0,0 +1,287 @@ +@endpoint(logs-restriction-queries) @endpoint(logs-restriction-queries-v2) +Feature: Logs Restriction Queries + **Note: This endpoint is in public beta. If you have any feedback, contact + [Datadog support](https://docs.datadoghq.com/help/).** A Restriction + Query is a logs query that restricts which logs the `logs_read_data` + permission grants read access to. For users whose roles have Restriction + Queries, any log query they make only returns those log events that also + match one of their Restriction Queries. This is true whether the user + queries log events from any log-related feature, including the log + explorer, Live Tail, re-hydration, or a dashboard widget. Restriction + Queries currently only support use of the following components of log + events: - Reserved attributes - The log message - Tags To restrict read + access on log data, add a team tag to log events to indicate which teams + own them, and then scope Restriction Queries to the relevant values of the + team tag. Tags can be applied to log events in many ways, and a log event + can have multiple tags with the same key (like team) and different values. + This means the same log event can be visible to roles whose restriction + queries are scoped to different team values. See [How to Set Up RBAC for + Logs](https://docs.datadoghq.com/logs/guide/logs-rbac/?tab=api#restrict- + access-to-logs) for details on how to add restriction queries. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "LogsRestrictionQueries" API + + @skip-go @skip-java @skip-python @skip-ruby @skip-rust @skip-terraform-config @skip-typescript @skip-validation @team:DataDog/logs-app + Scenario: Create a restriction query returns "Bad Request" response + Given operation "CreateRestrictionQuery" enabled + And new "CreateRestrictionQuery" request + And body with value {"test": "bad_request"} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/logs-app + Scenario: Create a restriction query returns "OK" response + Given operation "CreateRestrictionQuery" enabled + And new "CreateRestrictionQuery" request + And body with value {"data": {"attributes": {"restriction_query": "env:sandbox"}, "type": "logs_restriction_queries"}} + When the request is sent + Then the response status is 200 OK + + @skip-terraform-config @team:DataDog/logs-app + Scenario: Delete a restriction query returns "Bad Request" response + Given operation "DeleteRestrictionQuery" enabled + And new "DeleteRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "malformed_id" + When the request is sent + Then the response status is 400 Bad Request + + @skip-terraform-config @team:DataDog/logs-app + Scenario: Delete a restriction query returns "Not found" response + Given operation "DeleteRestrictionQuery" enabled + And new "DeleteRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "00000000-0000-0000-0000-000000000000" + When the request is sent + Then the response status is 404 Not found + + @team:DataDog/logs-app + Scenario: Delete a restriction query returns "OK" response + Given operation "DeleteRestrictionQuery" enabled + And there is a valid "restriction_query" in the system + And new "DeleteRestrictionQuery" request + And request contains "restriction_query_id" parameter from "restriction_query.data.id" + When the request is sent + Then the response status is 204 OK + + @skip-terraform-config @team:DataDog/logs-app + Scenario: Get a restriction query returns "Bad Request" response + Given operation "GetRestrictionQuery" enabled + And new "GetRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "malformed_id" + When the request is sent + Then the response status is 400 Bad Request + + @skip-terraform-config @team:DataDog/logs-app + Scenario: Get a restriction query returns "Not found" response + Given operation "GetRestrictionQuery" enabled + And new "GetRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "00000000-0000-0000-0000-000000000000" + When the request is sent + Then the response status is 404 Not found + + @team:DataDog/logs-app + Scenario: Get a restriction query returns "OK" response + Given operation "GetRestrictionQuery" enabled + And there is a valid "restriction_query" in the system + And new "GetRestrictionQuery" request + And request contains "restriction_query_id" parameter from "restriction_query.data.id" + When the request is sent + Then the response status is 200 OK + + @skip-terraform-config @team:DataDog/logs-app + Scenario: Get all restriction queries for a given user returns "Bad Request" response + Given operation "ListUserRestrictionQueries" enabled + And new "ListUserRestrictionQueries" request + And request contains "user_id" parameter with value "malformed_id" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/logs-app + Scenario: Get all restriction queries for a given user returns "Not found" response + Given operation "ListUserRestrictionQueries" enabled + And new "ListUserRestrictionQueries" request + And request contains "user_id" parameter with value "00000000-0000-0000-0000-000000000000" + When the request is sent + Then the response status is 400 Bad Request + + @skip @team:DataDog/logs-app + Scenario: Get all restriction queries for a given user returns "OK" response + Given operation "ListUserRestrictionQueries" enabled + And there is a valid "user" in the system + And new "ListUserRestrictionQueries" request + And request contains "user_id" parameter from "user.data.id" + When the request is sent + Then the response status is 200 OK + + @skip-terraform-config @team:DataDog/logs-app + Scenario: Get restriction query for a given role returns "Bad Request" response + Given operation "GetRoleRestrictionQuery" enabled + And new "GetRoleRestrictionQuery" request + And request contains "role_id" parameter with value "malformed_id" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/logs-app + Scenario: Get restriction query for a given role returns "Not found" response + Given operation "GetRoleRestrictionQuery" enabled + And new "GetRoleRestrictionQuery" request + And request contains "role_id" parameter with value "00000000-0000-0000-0000-000000000000" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/logs-app + Scenario: Get restriction query for a given role returns "OK" response + Given operation "GetRoleRestrictionQuery" enabled + And there is a valid "role" in the system + And new "GetRoleRestrictionQuery" request + And request contains "role_id" parameter from "role.data.id" + When the request is sent + Then the response status is 200 OK + + @skip-terraform-config @team:DataDog/logs-app + Scenario: Grant role to a restriction query returns "Bad Request" response + Given operation "AddRoleToRestrictionQuery" enabled + And new "AddRoleToRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "malformed_id" + And body with value {"data": {"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "type": "roles"}} + When the request is sent + Then the response status is 404 Not found + + @skip-terraform-config @team:DataDog/logs-app + Scenario: Grant role to a restriction query returns "Not found" response + Given operation "AddRoleToRestrictionQuery" enabled + And new "AddRoleToRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "00000000-0000-0000-0000-000000000000" + And body with value {"data": {"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "type": "roles"}} + When the request is sent + Then the response status is 404 Not found + + @team:DataDog/logs-app + Scenario: Grant role to a restriction query returns "OK" response + Given operation "AddRoleToRestrictionQuery" enabled + And there is a valid "restriction_query" in the system + And there is a valid "role" in the system + And new "AddRoleToRestrictionQuery" request + And request contains "restriction_query_id" parameter from "restriction_query.data.id" + And body with value {"data": {"id": "{{ role.data.id }}", "type": "roles"}} + When the request is sent + Then the response status is 204 OK + + @skip-terraform-config @team:DataDog/logs-app + Scenario: List restriction queries returns "OK" response + Given operation "ListRestrictionQueries" enabled + And new "ListRestrictionQueries" request + When the request is sent + Then the response status is 200 OK + + @skip-terraform-config @team:DataDog/logs-app + Scenario: List roles for a restriction query returns "Bad Request" response + Given operation "ListRestrictionQueryRoles" enabled + And new "ListRestrictionQueryRoles" request + And request contains "restriction_query_id" parameter with value "malformed_id" + When the request is sent + Then the response status is 400 Bad Request + + @skip-terraform-config @team:DataDog/logs-app + Scenario: List roles for a restriction query returns "Not found" response + Given operation "ListRestrictionQueryRoles" enabled + And new "ListRestrictionQueryRoles" request + And request contains "restriction_query_id" parameter with value "00000000-0000-0000-0000-000000000000" + When the request is sent + Then the response status is 404 Not found + + @team:DataDog/logs-app + Scenario: List roles for a restriction query returns "OK" response + Given operation "ListRestrictionQueryRoles" enabled + And there is a valid "restriction_query" in the system + And new "ListRestrictionQueryRoles" request + And request contains "restriction_query_id" parameter from "restriction_query.data.id" + When the request is sent + Then the response status is 200 OK + + @skip @team:DataDog/logs-app + Scenario: Replace a restriction query returns "Bad Request" response + Given operation "ReplaceRestrictionQuery" enabled + And new "ReplaceRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "malformed_id" + And body with value {"data": {"attributes": {"restriction_query": "env:sandbox"}, "type": "logs_restriction_queries"}} + When the request is sent + Then the response status is 400 Bad Request + + @skip @team:DataDog/logs-app + Scenario: Replace a restriction query returns "Not found" response + Given operation "ReplaceRestrictionQuery" enabled + And new "ReplaceRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "00000000-0000-0000-0000-000000000000" + And body with value {"data": {"attributes": {"restriction_query": "env:sandbox"}, "type": "logs_restriction_queries"}} + When the request is sent + Then the response status is 404 Not found + + @skip @team:DataDog/logs-app + Scenario: Replace a restriction query returns "OK" response + Given operation "ReplaceRestrictionQuery" enabled + And there is a valid "restriction_query" in the system + And new "ReplaceRestrictionQuery" request + And request contains "restriction_query_id" parameter from "restriction_query.data.id" + And body with value {"data": {"attributes": {"restriction_query": "env:staging"}, "type": "logs_restriction_queries"}} + When the request is sent + Then the response status is 200 OK + + @skip @skip-terraform-config @team:DataDog/logs-app + Scenario: Revoke role from a restriction query returns "Bad Request" response + Given operation "RemoveRoleFromRestrictionQuery" enabled + And new "RemoveRoleFromRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "malformed_id" + And body with value {"data": {"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "type": "roles"}} + When the request is sent + Then the response status is 400 Bad Request + + @skip @skip-terraform-config @team:DataDog/logs-app + Scenario: Revoke role from a restriction query returns "Not found" response + Given operation "RemoveRoleFromRestrictionQuery" enabled + And new "RemoveRoleFromRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "00000000-0000-0000-0000-000000000000" + And body with value {"data": {"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "type": "roles"}} + When the request is sent + Then the response status is 404 Not found + + @skip @team:DataDog/logs-app + Scenario: Revoke role from a restriction query returns "OK" response + Given operation "RemoveRoleFromRestrictionQuery" enabled + And there is a valid "restriction_query" in the system + And there is a valid "role" in the system + And new "RemoveRoleFromRestrictionQuery" request + And request contains "restriction_query_id" parameter from "restriction_query.data.id" + And body with value {"data": {"id": "{{ role.data.id }}", "type": "roles"}} + When the request is sent + Then the response status is 204 OK + + @skip @skip-terraform-config @team:DataDog/logs-app + Scenario: Update a restriction query returns "Bad Request" response + Given operation "UpdateRestrictionQuery" enabled + And new "UpdateRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "malformed_id" + And body with value {"data": {"attributes": {"restriction_query": "env:sandbox"}, "type": "logs_restriction_queries"}} + When the request is sent + Then the response status is 400 Bad Request + + @skip @skip-terraform-config @team:DataDog/logs-app + Scenario: Update a restriction query returns "Not found" response + Given operation "UpdateRestrictionQuery" enabled + And new "UpdateRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "00000000-0000-0000-0000-000000000000" + And body with value {"data": {"attributes": {"restriction_query": "env:sandbox"}, "type": "logs_restriction_queries"}} + When the request is sent + Then the response status is 404 Not found + + @skip @team:DataDog/logs-app + Scenario: Update a restriction query returns "OK" response + Given operation "UpdateRestrictionQuery" enabled + And there is a valid "restriction_query" in the system + And new "UpdateRestrictionQuery" request + And request contains "restriction_query_id" parameter from "restriction_query.data.id" + And body with value {"data": {"attributes": {"restriction_query": "env:production"}, "type": "logs_restriction_queries"}} + When the request is sent + Then the response status is 200 OK diff --git a/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..7c226bf60d 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -2443,6 +2443,79 @@ "type": "idempotent" } }, + "ListRestrictionQueries": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "safe" + } + }, + "CreateRestrictionQuery": { + "tag": "Logs Restriction Queries", + "undo": { + "operationId": "DeleteRestrictionQuery", + "parameters": [ + { + "name": "restriction_query_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "GetRoleRestrictionQuery": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "safe" + } + }, + "ListUserRestrictionQueries": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "safe" + } + }, + "DeleteRestrictionQuery": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "idempotent" + } + }, + "GetRestrictionQuery": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "safe" + } + }, + "UpdateRestrictionQuery": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "idempotent" + } + }, + "ReplaceRestrictionQuery": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "idempotent" + } + }, + "RemoveRoleFromRestrictionQuery": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "idempotent" + } + }, + "ListRestrictionQueryRoles": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "safe" + } + }, + "AddRoleToRestrictionQuery": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "safe" + } + }, "ListLogsGet": { "tag": "Logs", "undo": { @@ -4345,6 +4418,37 @@ "type": "unsafe" } }, + "ListTeamHierarchyLinks": { + "tag": "Teams", + "undo": { + "type": "safe" + } + }, + "AddTeamHierarchyLink": { + "tag": "Teams", + "undo": { + "operationId": "RemoveTeamHierarchyLink", + "parameters": [ + { + "name": "link_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "RemoveTeamHierarchyLink": { + "tag": "Teams", + "undo": { + "type": "idempotent" + } + }, + "GetTeamHierarchyLink": { + "tag": "Teams", + "undo": { + "type": "safe" + } + }, "DeleteTeamConnections": { "tag": "Team Connections", "undo": {