From 5bf626a3bf1b48dff3cbf1a3e9b6ac135f6438e0 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 1 Dec 2025 14:55:26 +0000 Subject: [PATCH] Regenerate client from commit 979bb6b of spec repo --- .generator/schemas/v2/openapi.yaml | 1204 ++++++++++++++++- ...-query-returns-Bad-Request-response.frozen | 1 + ...ion-query-returns-Bad-Request-response.yml | 25 + ...striction-query-returns-OK-response.frozen | 1 + ...-restriction-query-returns-OK-response.yml | 44 + ...-query-returns-Bad-Request-response.frozen | 1 + ...ion-query-returns-Bad-Request-response.yml | 20 + ...on-query-returns-Not-found-response.frozen | 1 + ...ction-query-returns-Not-found-response.yml | 20 + ...striction-query-returns-OK-response.frozen | 1 + ...-restriction-query-returns-OK-response.yml | 62 + ...-query-returns-Bad-Request-response.frozen | 1 + ...ion-query-returns-Bad-Request-response.yml | 20 + ...on-query-returns-Not-found-response.frozen | 1 + ...ction-query-returns-Not-found-response.yml | 20 + ...striction-query-returns-OK-response.frozen | 1 + ...-restriction-query-returns-OK-response.yml | 64 + ...n-user-returns-Bad-Request-response.frozen | 1 + ...iven-user-returns-Bad-Request-response.yml | 20 + ...ven-user-returns-Not-found-response.frozen | 1 + ...-given-user-returns-Not-found-response.yml | 21 + ...n-role-returns-Bad-Request-response.frozen | 1 + ...iven-role-returns-Bad-Request-response.yml | 20 + ...ven-role-returns-Not-found-response.frozen | 1 + ...-given-role-returns-Not-found-response.yml | 20 + ...or-a-given-role-returns-OK-response.frozen | 1 + ...y-for-a-given-role-returns-OK-response.yml | 60 + ...-query-returns-Bad-Request-response.frozen | 1 + ...ion-query-returns-Bad-Request-response.yml | 25 + ...on-query-returns-Not-found-response.frozen | 1 + ...ction-query-returns-Not-found-response.yml | 25 + ...striction-query-returns-OK-response.frozen | 1 + ...-restriction-query-returns-OK-response.yml | 104 ++ ...riction-queries-returns-OK-response.frozen | 1 + ...estriction-queries-returns-OK-response.yml | 22 + ...-query-returns-Bad-Request-response.frozen | 1 + ...ion-query-returns-Bad-Request-response.yml | 20 + ...on-query-returns-Not-found-response.frozen | 1 + ...ction-query-returns-Not-found-response.yml | 20 + ...striction-query-returns-OK-response.frozen | 1 + ...-restriction-query-returns-OK-response.yml | 64 + ...archy-link-returns-CREATED-response.frozen | 1 + ...ierarchy-link-returns-CREATED-response.yml | 116 ++ ...rchy-link-returns-Conflict-response.frozen | 1 + ...erarchy-link-returns-Conflict-response.yml | 142 ++ ...-hierarchy-link-returns-OK-response.frozen | 1 + ...eam-hierarchy-link-returns-OK-response.yml | 116 ++ ...archy-link-returns-SUCCESS-response.frozen | 1 + ...ierarchy-link-returns-SUCCESS-response.yml | 116 ++ ...returns-API-error-response-response.frozen | 1 + ...nk-returns-API-error-response-response.yml | 20 + ...-hierarchy-link-returns-OK-response.frozen | 1 + ...eam-hierarchy-link-returns-OK-response.yml | 134 ++ ...hierarchy-links-returns-OK-response.frozen | 1 + ...am-hierarchy-links-returns-OK-response.yml | 134 ++ ...returns-API-error-response-response.frozen | 1 + ...nk-returns-API-error-response-response.yml | 21 + ...hy-link-returns-No-Content-response.frozen | 1 + ...archy-link-returns-No-Content-response.yml | 135 ++ .../AddRoleToRestrictionQuery.rb | 21 + .../CreateRestrictionQuery.rb | 17 + .../DeleteRestrictionQuery.rb | 11 + .../GetRestrictionQuery.rb | 11 + .../GetRoleRestrictionQuery.rb | 11 + .../ListRestrictionQueries.rb | 8 + .../ListRestrictionQueryRoles.rb | 11 + .../ListUserRestrictionQueries.rb | 11 + .../RemoveRoleFromRestrictionQuery.rb | 21 + .../ReplaceRestrictionQuery.rb | 20 + .../UpdateRestrictionQuery.rb | 20 + examples/v2/teams/AddTeamHierarchyLink.rb | 31 + examples/v2/teams/GetTeamHierarchyLink.rb | 8 + examples/v2/teams/ListTeamHierarchyLinks.rb | 15 + .../ListTeamHierarchyLinks_3360757486.rb | 5 + examples/v2/teams/RemoveTeamHierarchyLink.rb | 8 + features/scenarios_model_mapping.rb | 55 + features/v2/given.json | 36 + features/v2/logs_restriction_queries.feature | 287 ++++ features/v2/teams.feature | 83 ++ features/v2/undo.json | 104 ++ lib/datadog_api_client/configuration.rb | 11 + lib/datadog_api_client/inflector.rb | 35 + .../v2/api/logs_restriction_queries_api.rb | 842 ++++++++++++ lib/datadog_api_client/v2/api/teams_api.rb | 303 +++++ .../models/logs_restriction_queries_type.rb | 26 + .../relationship_to_user_team_permission.rb | 8 + .../v2/models/restriction_query_attributes.rb | 165 +++ .../restriction_query_create_attributes.rb | 123 ++ .../models/restriction_query_create_data.rb | 115 ++ .../restriction_query_create_payload.rb | 105 ++ .../models/restriction_query_list_response.rb | 107 ++ ...estriction_query_response_included_item.rb | 62 + .../v2/models/restriction_query_role.rb | 165 +++ .../restriction_query_role_attribute.rb | 105 ++ .../restriction_query_roles_response.rb | 107 ++ .../restriction_query_update_attributes.rb | 123 ++ .../models/restriction_query_update_data.rb | 115 ++ .../restriction_query_update_payload.rb | 105 ++ .../restriction_query_with_relationships.rb | 135 ++ ...ction_query_with_relationships_response.rb | 117 ++ ...restriction_query_without_relationships.rb | 125 ++ ...on_query_without_relationships_response.rb | 105 ++ .../v2/models/team_attributes.rb | 14 +- .../v2/models/team_hierarchy_link.rb | 175 +++ .../models/team_hierarchy_link_attributes.rb | 144 ++ .../v2/models/team_hierarchy_link_create.rb | 144 ++ ...eam_hierarchy_link_create_relationships.rb | 144 ++ .../team_hierarchy_link_create_request.rb | 123 ++ .../models/team_hierarchy_link_create_team.rb | 144 ++ ...hierarchy_link_create_team_relationship.rb | 123 ++ .../team_hierarchy_link_relationships.rb | 144 ++ .../v2/models/team_hierarchy_link_response.rb | 127 ++ .../v2/models/team_hierarchy_link_team.rb | 154 +++ .../team_hierarchy_link_team_attributes.rb | 223 +++ .../team_hierarchy_link_team_relationship.rb | 123 ++ .../v2/models/team_hierarchy_link_type.rb | 26 + .../models/team_hierarchy_links_response.rb | 139 ++ .../teams_hierarchy_links_response_links.rb | 156 +++ .../teams_hierarchy_links_response_meta.rb | 105 ++ ...eams_hierarchy_links_response_meta_page.rb | 184 +++ 120 files changed, 9149 insertions(+), 4 deletions(-) create mode 100644 cassettes/features/v2/logs_restriction_queries/Create-a-restriction-query-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/logs_restriction_queries/Create-a-restriction-query-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/logs_restriction_queries/Create-a-restriction-query-returns-OK-response.frozen create mode 100644 cassettes/features/v2/logs_restriction_queries/Create-a-restriction-query-returns-OK-response.yml create mode 100644 cassettes/features/v2/logs_restriction_queries/Delete-a-restriction-query-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/logs_restriction_queries/Delete-a-restriction-query-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/logs_restriction_queries/Delete-a-restriction-query-returns-Not-found-response.frozen create mode 100644 cassettes/features/v2/logs_restriction_queries/Delete-a-restriction-query-returns-Not-found-response.yml create mode 100644 cassettes/features/v2/logs_restriction_queries/Delete-a-restriction-query-returns-OK-response.frozen create mode 100644 cassettes/features/v2/logs_restriction_queries/Delete-a-restriction-query-returns-OK-response.yml create mode 100644 cassettes/features/v2/logs_restriction_queries/Get-a-restriction-query-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/logs_restriction_queries/Get-a-restriction-query-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/logs_restriction_queries/Get-a-restriction-query-returns-Not-found-response.frozen create mode 100644 cassettes/features/v2/logs_restriction_queries/Get-a-restriction-query-returns-Not-found-response.yml create mode 100644 cassettes/features/v2/logs_restriction_queries/Get-a-restriction-query-returns-OK-response.frozen create mode 100644 cassettes/features/v2/logs_restriction_queries/Get-a-restriction-query-returns-OK-response.yml create mode 100644 cassettes/features/v2/logs_restriction_queries/Get-all-restriction-queries-for-a-given-user-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/logs_restriction_queries/Get-all-restriction-queries-for-a-given-user-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/logs_restriction_queries/Get-all-restriction-queries-for-a-given-user-returns-Not-found-response.frozen create mode 100644 cassettes/features/v2/logs_restriction_queries/Get-all-restriction-queries-for-a-given-user-returns-Not-found-response.yml create mode 100644 cassettes/features/v2/logs_restriction_queries/Get-restriction-query-for-a-given-role-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/logs_restriction_queries/Get-restriction-query-for-a-given-role-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/logs_restriction_queries/Get-restriction-query-for-a-given-role-returns-Not-found-response.frozen create mode 100644 cassettes/features/v2/logs_restriction_queries/Get-restriction-query-for-a-given-role-returns-Not-found-response.yml create mode 100644 cassettes/features/v2/logs_restriction_queries/Get-restriction-query-for-a-given-role-returns-OK-response.frozen create mode 100644 cassettes/features/v2/logs_restriction_queries/Get-restriction-query-for-a-given-role-returns-OK-response.yml create mode 100644 cassettes/features/v2/logs_restriction_queries/Grant-role-to-a-restriction-query-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/logs_restriction_queries/Grant-role-to-a-restriction-query-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/logs_restriction_queries/Grant-role-to-a-restriction-query-returns-Not-found-response.frozen create mode 100644 cassettes/features/v2/logs_restriction_queries/Grant-role-to-a-restriction-query-returns-Not-found-response.yml create mode 100644 cassettes/features/v2/logs_restriction_queries/Grant-role-to-a-restriction-query-returns-OK-response.frozen create mode 100644 cassettes/features/v2/logs_restriction_queries/Grant-role-to-a-restriction-query-returns-OK-response.yml create mode 100644 cassettes/features/v2/logs_restriction_queries/List-restriction-queries-returns-OK-response.frozen create mode 100644 cassettes/features/v2/logs_restriction_queries/List-restriction-queries-returns-OK-response.yml create mode 100644 cassettes/features/v2/logs_restriction_queries/List-roles-for-a-restriction-query-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/logs_restriction_queries/List-roles-for-a-restriction-query-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/logs_restriction_queries/List-roles-for-a-restriction-query-returns-Not-found-response.frozen create mode 100644 cassettes/features/v2/logs_restriction_queries/List-roles-for-a-restriction-query-returns-Not-found-response.yml create mode 100644 cassettes/features/v2/logs_restriction_queries/List-roles-for-a-restriction-query-returns-OK-response.frozen create mode 100644 cassettes/features/v2/logs_restriction_queries/List-roles-for-a-restriction-query-returns-OK-response.yml create mode 100644 cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-CREATED-response.frozen create mode 100644 cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-CREATED-response.yml create mode 100644 cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-Conflict-response.frozen create mode 100644 cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-Conflict-response.yml create mode 100644 cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-OK-response.frozen create mode 100644 cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-OK-response.yml create mode 100644 cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-SUCCESS-response.frozen create mode 100644 cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-SUCCESS-response.yml create mode 100644 cassettes/features/v2/teams/Get-a-team-hierarchy-link-returns-API-error-response-response.frozen create mode 100644 cassettes/features/v2/teams/Get-a-team-hierarchy-link-returns-API-error-response-response.yml create mode 100644 cassettes/features/v2/teams/Get-a-team-hierarchy-link-returns-OK-response.frozen create mode 100644 cassettes/features/v2/teams/Get-a-team-hierarchy-link-returns-OK-response.yml create mode 100644 cassettes/features/v2/teams/Get-team-hierarchy-links-returns-OK-response.frozen create mode 100644 cassettes/features/v2/teams/Get-team-hierarchy-links-returns-OK-response.yml create mode 100644 cassettes/features/v2/teams/Remove-a-team-hierarchy-link-returns-API-error-response-response.frozen create mode 100644 cassettes/features/v2/teams/Remove-a-team-hierarchy-link-returns-API-error-response-response.yml create mode 100644 cassettes/features/v2/teams/Remove-a-team-hierarchy-link-returns-No-Content-response.frozen create mode 100644 cassettes/features/v2/teams/Remove-a-team-hierarchy-link-returns-No-Content-response.yml create mode 100644 examples/v2/logs-restriction-queries/AddRoleToRestrictionQuery.rb create mode 100644 examples/v2/logs-restriction-queries/CreateRestrictionQuery.rb create mode 100644 examples/v2/logs-restriction-queries/DeleteRestrictionQuery.rb create mode 100644 examples/v2/logs-restriction-queries/GetRestrictionQuery.rb create mode 100644 examples/v2/logs-restriction-queries/GetRoleRestrictionQuery.rb create mode 100644 examples/v2/logs-restriction-queries/ListRestrictionQueries.rb create mode 100644 examples/v2/logs-restriction-queries/ListRestrictionQueryRoles.rb create mode 100644 examples/v2/logs-restriction-queries/ListUserRestrictionQueries.rb create mode 100644 examples/v2/logs-restriction-queries/RemoveRoleFromRestrictionQuery.rb create mode 100644 examples/v2/logs-restriction-queries/ReplaceRestrictionQuery.rb create mode 100644 examples/v2/logs-restriction-queries/UpdateRestrictionQuery.rb create mode 100644 examples/v2/teams/AddTeamHierarchyLink.rb create mode 100644 examples/v2/teams/GetTeamHierarchyLink.rb create mode 100644 examples/v2/teams/ListTeamHierarchyLinks.rb create mode 100644 examples/v2/teams/ListTeamHierarchyLinks_3360757486.rb create mode 100644 examples/v2/teams/RemoveTeamHierarchyLink.rb create mode 100644 features/v2/logs_restriction_queries.feature create mode 100644 lib/datadog_api_client/v2/api/logs_restriction_queries_api.rb create mode 100644 lib/datadog_api_client/v2/models/logs_restriction_queries_type.rb create mode 100644 lib/datadog_api_client/v2/models/restriction_query_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/restriction_query_create_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/restriction_query_create_data.rb create mode 100644 lib/datadog_api_client/v2/models/restriction_query_create_payload.rb create mode 100644 lib/datadog_api_client/v2/models/restriction_query_list_response.rb create mode 100644 lib/datadog_api_client/v2/models/restriction_query_response_included_item.rb create mode 100644 lib/datadog_api_client/v2/models/restriction_query_role.rb create mode 100644 lib/datadog_api_client/v2/models/restriction_query_role_attribute.rb create mode 100644 lib/datadog_api_client/v2/models/restriction_query_roles_response.rb create mode 100644 lib/datadog_api_client/v2/models/restriction_query_update_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/restriction_query_update_data.rb create mode 100644 lib/datadog_api_client/v2/models/restriction_query_update_payload.rb create mode 100644 lib/datadog_api_client/v2/models/restriction_query_with_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/restriction_query_with_relationships_response.rb create mode 100644 lib/datadog_api_client/v2/models/restriction_query_without_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/restriction_query_without_relationships_response.rb create mode 100644 lib/datadog_api_client/v2/models/team_hierarchy_link.rb create mode 100644 lib/datadog_api_client/v2/models/team_hierarchy_link_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/team_hierarchy_link_create.rb create mode 100644 lib/datadog_api_client/v2/models/team_hierarchy_link_create_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/team_hierarchy_link_create_request.rb create mode 100644 lib/datadog_api_client/v2/models/team_hierarchy_link_create_team.rb create mode 100644 lib/datadog_api_client/v2/models/team_hierarchy_link_create_team_relationship.rb create mode 100644 lib/datadog_api_client/v2/models/team_hierarchy_link_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/team_hierarchy_link_response.rb create mode 100644 lib/datadog_api_client/v2/models/team_hierarchy_link_team.rb create mode 100644 lib/datadog_api_client/v2/models/team_hierarchy_link_team_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/team_hierarchy_link_team_relationship.rb create mode 100644 lib/datadog_api_client/v2/models/team_hierarchy_link_type.rb create mode 100644 lib/datadog_api_client/v2/models/team_hierarchy_links_response.rb create mode 100644 lib/datadog_api_client/v2/models/teams_hierarchy_links_response_links.rb create mode 100644 lib/datadog_api_client/v2/models/teams_hierarchy_links_response_meta.rb create mode 100644 lib/datadog_api_client/v2/models/teams_hierarchy_links_response_meta_page.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 9bceb715496a..6bc8997cfde4 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -945,6 +945,27 @@ components: required: true schema: type: string + RestrictionQueryID: + description: The ID of the restriction query. + in: path + name: restriction_query_id + required: true + schema: + type: string + RestrictionQueryRoleID: + description: The ID of the role. + in: path + name: role_id + required: true + schema: + type: string + RestrictionQueryUserID: + description: The ID of the user. + in: path + name: user_id + required: true + schema: + type: string RetentionFilterIdParam: description: The ID of the retention filter. in: path @@ -30501,6 +30522,15 @@ components: example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ== type: string type: object + LogsRestrictionQueriesType: + default: logs_restriction_queries + description: Restriction query resource type. + enum: + - logs_restriction_queries + example: logs_restriction_queries + type: string + x-enum-varnames: + - LOGS_RESTRICTION_QUERIES LogsSort: description: Sort parameters when querying logs. enum: @@ -41410,6 +41440,7 @@ components: type: object RelationshipToUserTeamPermissionData: description: Related user team permission data + nullable: true properties: id: description: The ID of the user team permission @@ -41838,6 +41869,191 @@ components: required: - data type: object + RestrictionQueryAttributes: + description: Attributes of the restriction query. + properties: + created_at: + description: Creation time of the restriction query. + example: '2020-03-17T21:06:44.000Z' + format: date-time + readOnly: true + type: string + last_modifier_email: + description: Email of the user who last modified this restriction query. + example: user@example.com + readOnly: true + type: string + last_modifier_name: + description: Name of the user who last modified this restriction query. + example: John Doe + readOnly: true + type: string + modified_at: + description: Time of last restriction query modification. + example: '2020-03-17T21:15:15.000Z' + format: date-time + readOnly: true + type: string + restriction_query: + description: The query that defines the restriction. Only the content matching + the query can be returned. + example: env:sandbox + type: string + role_count: + description: Number of roles associated with this restriction query. + example: 3 + format: int64 + readOnly: true + type: integer + user_count: + description: Number of users associated with this restriction query. + example: 5 + format: int64 + readOnly: true + type: integer + type: object + RestrictionQueryCreateAttributes: + description: Attributes of the created restriction query. + properties: + restriction_query: + description: The restriction query. + example: env:sandbox + type: string + required: + - restriction_query + type: object + RestrictionQueryCreateData: + description: Data related to the creation of a restriction query. + properties: + attributes: + $ref: '#/components/schemas/RestrictionQueryCreateAttributes' + type: + $ref: '#/components/schemas/LogsRestrictionQueriesType' + type: object + RestrictionQueryCreatePayload: + description: Create a restriction query. + properties: + data: + $ref: '#/components/schemas/RestrictionQueryCreateData' + type: object + RestrictionQueryListResponse: + description: Response containing information about multiple restriction queries. + properties: + data: + description: Array of returned restriction queries. + items: + $ref: '#/components/schemas/RestrictionQueryWithoutRelationships' + type: array + type: object + RestrictionQueryResponseIncludedItem: + description: An object related to a restriction query. + oneOf: + - $ref: '#/components/schemas/RestrictionQueryRole' + RestrictionQueryRole: + description: Partial role object. + properties: + attributes: + $ref: '#/components/schemas/RestrictionQueryRoleAttribute' + id: + description: ID of the role. + example: + type: string + type: + $ref: '#/components/schemas/RolesType' + required: + - type + - id + - attributes + type: object + RestrictionQueryRoleAttribute: + description: Attributes of the role for a restriction query. + properties: + name: + description: The role name. + example: Datadog Admin Role + type: string + type: object + RestrictionQueryRolesResponse: + description: Response containing information about roles attached to a restriction + query. + properties: + data: + description: Array of roles. + items: + $ref: '#/components/schemas/RestrictionQueryRole' + type: array + type: object + RestrictionQueryUpdateAttributes: + description: Attributes of the edited restriction query. + properties: + restriction_query: + description: The restriction query. + example: env:sandbox + type: string + required: + - restriction_query + type: object + RestrictionQueryUpdateData: + description: Data related to the update of a restriction query. + properties: + attributes: + $ref: '#/components/schemas/RestrictionQueryUpdateAttributes' + type: + $ref: '#/components/schemas/LogsRestrictionQueriesType' + type: object + RestrictionQueryUpdatePayload: + description: Update a restriction query. + properties: + data: + $ref: '#/components/schemas/RestrictionQueryUpdateData' + type: object + RestrictionQueryWithRelationships: + description: Restriction query object returned by the API. + properties: + attributes: + $ref: '#/components/schemas/RestrictionQueryAttributes' + id: + description: ID of the restriction query. + example: 79a0e60a-644a-11ea-ad29-43329f7f58b5 + type: string + relationships: + $ref: '#/components/schemas/UserRelationships' + type: + $ref: '#/components/schemas/LogsRestrictionQueriesType' + type: object + RestrictionQueryWithRelationshipsResponse: + description: Response containing information about a single restriction query. + properties: + data: + $ref: '#/components/schemas/RestrictionQueryWithRelationships' + included: + description: Array of objects related to the restriction query. + items: + $ref: '#/components/schemas/RestrictionQueryResponseIncludedItem' + type: array + type: object + RestrictionQueryWithoutRelationships: + description: Restriction query object returned by the API. + properties: + attributes: + $ref: '#/components/schemas/RestrictionQueryAttributes' + id: + description: ID of the restriction query. + example: 79a0e60a-644a-11ea-ad29-43329f7f58b5 + type: string + type: + default: logs_restriction_queries + description: Restriction queries type. + example: logs_restriction_queries + readOnly: true + type: string + type: object + RestrictionQueryWithoutRelationshipsResponse: + description: Response containing information about a single restriction query. + properties: + data: + $ref: '#/components/schemas/RestrictionQueryWithoutRelationships' + type: object RetentionFilter: description: The definition of the retention filter. properties: @@ -51804,7 +52020,11 @@ components: items: description: String identifier of the module type: string + nullable: true type: array + is_managed: + description: Whether the team is managed from an external source + type: boolean link_count: description: The number of links belonging to the team format: int32 @@ -51836,6 +52056,7 @@ components: items: description: String identifier of the module type: string + nullable: true type: array required: - handle @@ -52016,6 +52237,211 @@ components: required: - data type: object + TeamHierarchyLink: + description: Team hierarchy link + properties: + attributes: + $ref: '#/components/schemas/TeamHierarchyLinkAttributes' + id: + description: The team hierarchy link's identifier + example: b8626d7e-cedd-11eb-abf5-da7ad0900001 + type: string + relationships: + $ref: '#/components/schemas/TeamHierarchyLinkRelationships' + type: + $ref: '#/components/schemas/TeamHierarchyLinkType' + required: + - attributes + - id + - type + type: object + TeamHierarchyLinkAttributes: + description: Team hierarchy link attributes + properties: + created_at: + description: Timestamp when the team hierarchy link was created + example: '' + format: date-time + type: string + provisioned_by: + description: The provisioner of the team hierarchy link + example: system + type: string + required: + - provisioned_by + - created_at + type: object + TeamHierarchyLinkCreate: + description: Data provided when creating a team hierarchy link + properties: + relationships: + $ref: '#/components/schemas/TeamHierarchyLinkCreateRelationships' + type: + $ref: '#/components/schemas/TeamHierarchyLinkType' + required: + - relationships + - type + type: object + TeamHierarchyLinkCreateRelationships: + description: The related teams that will be connected by the team hierarchy + link + properties: + parent_team: + $ref: '#/components/schemas/TeamHierarchyLinkCreateTeamRelationship' + sub_team: + $ref: '#/components/schemas/TeamHierarchyLinkCreateTeamRelationship' + required: + - parent_team + - sub_team + type: object + TeamHierarchyLinkCreateRequest: + description: Request to create a team hierarchy link + properties: + data: + $ref: '#/components/schemas/TeamHierarchyLinkCreate' + required: + - data + type: object + TeamHierarchyLinkCreateTeam: + description: This schema defines the attributes about each team that has to + be provided when creating a team hierarchy link + properties: + id: + description: The team's identifier + example: 692e8073-12c4-4c71-8408-5090bd44c9c8 + type: string + type: + $ref: '#/components/schemas/TeamType' + required: + - id + - type + type: object + TeamHierarchyLinkCreateTeamRelationship: + description: Data about each team that will be connected by the team hierarchy + link + properties: + data: + $ref: '#/components/schemas/TeamHierarchyLinkCreateTeam' + required: + - data + type: object + TeamHierarchyLinkRelationships: + description: Team hierarchy link relationships + properties: + parent_team: + $ref: '#/components/schemas/TeamHierarchyLinkTeamRelationship' + sub_team: + $ref: '#/components/schemas/TeamHierarchyLinkTeamRelationship' + required: + - parent_team + - sub_team + type: object + TeamHierarchyLinkResponse: + description: Team hierarchy link response + properties: + data: + $ref: '#/components/schemas/TeamHierarchyLink' + included: + description: Included teams + items: + $ref: '#/components/schemas/TeamHierarchyLinkTeam' + type: array + links: + $ref: '#/components/schemas/TeamsHierarchyLinksResponseLinks' + type: object + TeamHierarchyLinkTeam: + description: Team hierarchy links connect different teams. This represents team + objects that are connected by the team hierarchy link. + properties: + attributes: + $ref: '#/components/schemas/TeamHierarchyLinkTeamAttributes' + id: + description: The team's identifier + example: 692e8073-12c4-4c71-8408-5090bd44c9c8 + type: string + type: + $ref: '#/components/schemas/TeamType' + required: + - id + - type + type: object + TeamHierarchyLinkTeamAttributes: + description: Team hierarchy links connect different teams. This represents attributes + from teams that are connected by the team hierarchy link. + properties: + avatar: + description: The team's avatar + nullable: true + type: string + banner: + description: The team's banner + format: int64 + type: integer + handle: + description: The team's handle + example: team-handle + type: string + is_managed: + description: Whether the team is managed + type: boolean + is_open_membership: + description: Whether the team has open membership + type: boolean + link_count: + description: The number of links for the team + format: int64 + type: integer + name: + description: The team's name + example: Team Name + type: string + summary: + description: The team's summary + nullable: true + type: string + user_count: + description: The number of users in the team + format: int64 + type: integer + required: + - handle + - name + type: object + TeamHierarchyLinkTeamRelationship: + description: Team hierarchy link team relationship + properties: + data: + $ref: '#/components/schemas/TeamHierarchyLinkTeam' + required: + - data + type: object + TeamHierarchyLinkType: + default: team_hierarchy_links + description: Team hierarchy link type + enum: + - team_hierarchy_links + example: team_hierarchy_links + type: string + x-enum-varnames: + - TEAM_HIERARCHY_LINKS + TeamHierarchyLinksResponse: + description: Team hierarchy links response + properties: + data: + description: Team hierarchy links response data + items: + $ref: '#/components/schemas/TeamHierarchyLink' + type: array + included: + description: Included teams + items: + $ref: '#/components/schemas/TeamHierarchyLinkTeam' + type: array + links: + $ref: '#/components/schemas/TeamsHierarchyLinksResponseLinks' + meta: + $ref: '#/components/schemas/TeamsHierarchyLinksResponseMeta' + type: object TeamIncluded: description: Included resources related to the team oneOf: @@ -52895,6 +53321,76 @@ components: - LINK_COUNT - TEAM_LINKS - USER_TEAM_PERMISSIONS + TeamsHierarchyLinksResponseLinks: + description: When querying team hierarchy links, a set of links for navigation + between different pages is included + properties: + first: + description: Link to the first page. + nullable: true + type: string + last: + description: Link to the last page. + nullable: true + type: string + next: + description: Link to the next page. + nullable: true + type: string + prev: + description: Link to the previous page. + nullable: true + type: string + self: + description: Link to the current object. + type: string + type: object + TeamsHierarchyLinksResponseMeta: + description: Metadata that is included in the response when querying the team + hierarchy links + properties: + page: + $ref: '#/components/schemas/TeamsHierarchyLinksResponseMetaPage' + type: object + TeamsHierarchyLinksResponseMetaPage: + description: Metadata related to paging information that is included in the + response when querying the team hierarchy links + properties: + first_number: + description: First page number. + format: int64 + type: integer + last_number: + description: Last page number. + format: int64 + type: integer + next_number: + description: Next page number. + format: int64 + nullable: true + type: integer + number: + description: Page number. + format: int64 + type: integer + prev_number: + description: Previous page number. + format: int64 + nullable: true + type: integer + size: + description: Page size. + format: int64 + type: integer + total: + description: Total number of results. + format: int64 + type: integer + type: + description: Pagination type. + example: number_size + type: string + type: object TeamsResponse: description: Response with multiple teams properties: @@ -70264,6 +70760,487 @@ paths: operator: OR permissions: - logs_generate_metrics + /api/v2/logs/config/restriction_queries: + get: + description: Returns all restriction queries, including their names and IDs. + operationId: ListRestrictionQueries + parameters: + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/PageNumber' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryListResponse' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List restriction queries + tags: + - Logs Restriction Queries + x-permission: + operator: OR + permissions: + - logs_read_config + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Create a new restriction query for your organization. + operationId: CreateRestrictionQuery + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryCreatePayload' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryWithoutRelationshipsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create a restriction query + tags: + - Logs Restriction Queries + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - user_access_manage + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/logs/config/restriction_queries/role/{role_id}: + get: + description: Get restriction query for a given role. + operationId: GetRoleRestrictionQuery + parameters: + - $ref: '#/components/parameters/RestrictionQueryRoleID' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryListResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get restriction query for a given role + tags: + - Logs Restriction Queries + x-permission: + operator: OR + permissions: + - logs_read_config + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/logs/config/restriction_queries/user/{user_id}: + get: + description: Get all restriction queries for a given user. + operationId: ListUserRestrictionQueries + parameters: + - $ref: '#/components/parameters/RestrictionQueryUserID' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryListResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get all restriction queries for a given user + tags: + - Logs Restriction Queries + x-permission: + operator: OR + permissions: + - logs_read_config + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/logs/config/restriction_queries/{restriction_query_id}: + delete: + description: Deletes a restriction query. + operationId: DeleteRestrictionQuery + parameters: + - $ref: '#/components/parameters/RestrictionQueryID' + responses: + '204': + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete a restriction query + tags: + - Logs Restriction Queries + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - user_access_manage + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + get: + description: Get a restriction query in the organization specified by the restriction + query's `restriction_query_id`. + operationId: GetRestrictionQuery + parameters: + - $ref: '#/components/parameters/RestrictionQueryID' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryWithRelationshipsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get a restriction query + tags: + - Logs Restriction Queries + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - logs_read_config + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + patch: + description: Edit a restriction query. + operationId: UpdateRestrictionQuery + parameters: + - $ref: '#/components/parameters/RestrictionQueryID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryUpdatePayload' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryWithoutRelationshipsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update a restriction query + tags: + - Logs Restriction Queries + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - user_access_manage + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + put: + description: Replace a restriction query. + operationId: ReplaceRestrictionQuery + parameters: + - $ref: '#/components/parameters/RestrictionQueryID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryUpdatePayload' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryWithoutRelationshipsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Replace a restriction query + tags: + - Logs Restriction Queries + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - user_access_manage + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/logs/config/restriction_queries/{restriction_query_id}/roles: + delete: + description: Removes a role from a restriction query. + operationId: RemoveRoleFromRestrictionQuery + parameters: + - $ref: '#/components/parameters/RestrictionQueryID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RelationshipToRole' + required: true + responses: + '204': + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Revoke role from a restriction query + tags: + - Logs Restriction Queries + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - user_access_manage + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + get: + description: Returns all roles that have a given restriction query. + operationId: ListRestrictionQueryRoles + parameters: + - $ref: '#/components/parameters/RestrictionQueryID' + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/PageNumber' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RestrictionQueryRolesResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List roles for a restriction query + tags: + - Logs Restriction Queries + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - logs_read_config + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: 'Adds a role to a restriction query. + + + **Note**: This operation automatically grants the `logs_read_data` permission + to the role if it doesn''t already have it.' + operationId: AddRoleToRestrictionQuery + parameters: + - $ref: '#/components/parameters/RestrictionQueryID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RelationshipToRole' + required: true + responses: + '204': + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Authentication error + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Grant role to a restriction query + tags: + - Logs Restriction Queries + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - user_access_manage + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/logs/events: get: description: 'List endpoint returns logs that match a log search query. @@ -81999,6 +82976,170 @@ paths: permissions: - teams_read - teams_manage + /api/v2/team-hierarchy-links: + get: + description: List all team hierarchy links that match the provided filters. + operationId: ListTeamHierarchyLinks + parameters: + - $ref: '#/components/parameters/PageNumber' + - $ref: '#/components/parameters/PageSize' + - description: Filter by parent team ID + in: query + name: filter[parent_team] + required: false + schema: + type: string + - description: Filter by sub team ID + in: query + name: filter[sub_team] + required: false + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamHierarchyLinksResponse' + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Get team hierarchy links + tags: + - Teams + x-pagination: + limitParam: page[size] + pageParam: page[number] + resultsPath: data + x-permission: + operator: OR + permissions: + - teams_read + post: + description: Create a new team hierarchy link between a parent team and a sub + team. + operationId: AddTeamHierarchyLink + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TeamHierarchyLinkCreateRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamHierarchyLinkResponse' + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Conflict + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + - teams_manage + summary: Create a team hierarchy link + tags: + - Teams + x-permission: + operator: AND + permissions: + - teams_read + - teams_manage + /api/v2/team-hierarchy-links/{link_id}: + delete: + description: Remove a team hierarchy link by the given link_id. + operationId: RemoveTeamHierarchyLink + parameters: + - description: The team hierarchy link's identifier + in: path + name: link_id + required: true + schema: + type: string + responses: + '204': + description: No Content + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + - teams_manage + summary: Remove a team hierarchy link + tags: + - Teams + x-permission: + operator: AND + permissions: + - teams_read + - teams_manage + get: + description: Get a single team hierarchy link for the given link_id. + operationId: GetTeamHierarchyLink + parameters: + - description: The team hierarchy link's identifier + in: path + name: link_id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamHierarchyLinkResponse' + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Get a team hierarchy link + tags: + - Teams + x-permission: + operator: OR + permissions: + - teams_read /api/v2/team/connections: delete: description: Delete multiple team connections. @@ -82273,7 +83414,13 @@ paths: If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/team/{super_team_id}/member_teams: get: - description: Get all member teams. + deprecated: true + description: 'Get all member teams. + + + **Note**: This API is deprecated. For team hierarchy relationships (parent-child + + teams), use the team hierarchy links API: `GET /api/v2/team-hierarchy-links`.' operationId: ListMemberTeams parameters: - description: None @@ -82326,14 +83473,20 @@ paths: operator: OR permissions: - teams_read + x-sunset: '2026-06-01' x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' post: + deprecated: true description: 'Add a member team. Adds the team given by the `id` in the body as a member team of the super - team.' + team. + + + **Note**: This API is deprecated. For creating team hierarchy links, use the + team hierarchy links API: `POST /api/v2/team-hierarchy-links`.' operationId: AddMemberTeam parameters: - description: None @@ -82373,12 +83526,18 @@ paths: operator: OR permissions: - teams_read + x-sunset: '2026-06-01' x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/team/{super_team_id}/member_teams/{member_team_id}: delete: - description: Remove a super team's member team identified by `member_team_id`. + deprecated: true + description: 'Remove a super team''s member team identified by `member_team_id`. + + + **Note**: This API is deprecated. For deleting team hierarchy links, use the + team hierarchy links API: `DELETE /api/v2/team-hierarchy-links/{link_id}`.' operationId: RemoveMemberTeam parameters: - description: None @@ -82418,6 +83577,7 @@ paths: operator: OR permissions: - teams_read + x-sunset: '2026-06-01' x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' @@ -85210,6 +86370,44 @@ tags: description: Find out more at url: https://docs.datadoghq.com/logs/logs_to_metrics/ name: Logs Metrics +- description: '**Note: This endpoint is in public beta. If you have any feedback, + contact [Datadog support](https://docs.datadoghq.com/help/).** + + + A Restriction Query is a logs query that restricts which logs the `logs_read_data` + permission grants read access to. + + For users whose roles have Restriction Queries, any log query they make only returns + those log events that also match + + one of their Restriction Queries. This is true whether the user queries log events + from any log-related feature, including + + the log explorer, Live Tail, re-hydration, or a dashboard widget. + + + Restriction Queries currently only support use of the following components of + log events: + + + - Reserved attributes + + - The log message + + - Tags + + + To restrict read access on log data, add a team tag to log events to indicate + which teams own them, and then scope Restriction Queries to the relevant values + of the team tag. Tags can be applied to log events in many ways, and a log event + can have multiple tags with the same key (like team) and different values. This + means the same log event can be visible to roles whose restriction queries are + scoped to different team values. + + + See [How to Set Up RBAC for Logs](https://docs.datadoghq.com/logs/guide/logs-rbac/?tab=api#restrict-access-to-logs) + for details on how to add restriction queries.' + name: Logs Restriction Queries - description: "The metrics endpoint allows you to:\n\n- Post metrics data so it can be graphed on Datadog\u2019s dashboards\n- Query metrics from any time period (timeseries and scalar)\n- Modify tag configurations for metrics\n- View tags diff --git a/cassettes/features/v2/logs_restriction_queries/Create-a-restriction-query-returns-Bad-Request-response.frozen b/cassettes/features/v2/logs_restriction_queries/Create-a-restriction-query-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..46f704ffe2a2 --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/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/cassettes/features/v2/logs_restriction_queries/Create-a-restriction-query-returns-Bad-Request-response.yml b/cassettes/features/v2/logs_restriction_queries/Create-a-restriction-query-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..2ffc87023095 --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/Create-a-restriction-query-returns-Bad-Request-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Tue, 18 Nov 2025 19:17:04 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/logs_restriction_queries/Create-a-restriction-query-returns-OK-response.frozen b/cassettes/features/v2/logs_restriction_queries/Create-a-restriction-query-returns-OK-response.frozen new file mode 100644 index 000000000000..e7d3eb34c15f --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/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/cassettes/features/v2/logs_restriction_queries/Create-a-restriction-query-returns-OK-response.yml b/cassettes/features/v2/logs_restriction_queries/Create-a-restriction-query-returns-OK-response.yml new file mode 100644 index 000000000000..745170798dfa --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/Create-a-restriction-query-returns-OK-response.yml @@ -0,0 +1,44 @@ +http_interactions: +- recorded_at: Tue, 18 Nov 2025 19:17:05 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Tue, 18 Nov 2025 19:17:05 GMT + 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: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/logs_restriction_queries/Delete-a-restriction-query-returns-Bad-Request-response.frozen b/cassettes/features/v2/logs_restriction_queries/Delete-a-restriction-query-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..606a5c297d19 --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/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/cassettes/features/v2/logs_restriction_queries/Delete-a-restriction-query-returns-Bad-Request-response.yml b/cassettes/features/v2/logs_restriction_queries/Delete-a-restriction-query-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..337de4a80fac --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/Delete-a-restriction-query-returns-Bad-Request-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Tue, 18 Nov 2025 19:17:06 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/logs/config/restriction_queries/malformed_id + response: + body: + encoding: UTF-8 + string: '{"errors":["uuid is not proper type"]}' + headers: + Content-Type: + - application/json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/logs_restriction_queries/Delete-a-restriction-query-returns-Not-found-response.frozen b/cassettes/features/v2/logs_restriction_queries/Delete-a-restriction-query-returns-Not-found-response.frozen new file mode 100644 index 000000000000..b407dce9fcaf --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/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/cassettes/features/v2/logs_restriction_queries/Delete-a-restriction-query-returns-Not-found-response.yml b/cassettes/features/v2/logs_restriction_queries/Delete-a-restriction-query-returns-Not-found-response.yml new file mode 100644 index 000000000000..339559fb720e --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/Delete-a-restriction-query-returns-Not-found-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Tue, 18 Nov 2025 19:17:06 GMT + 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: + encoding: UTF-8 + string: '{"errors":["Restriction query not found"]}' + headers: + Content-Type: + - application/json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/logs_restriction_queries/Delete-a-restriction-query-returns-OK-response.frozen b/cassettes/features/v2/logs_restriction_queries/Delete-a-restriction-query-returns-OK-response.frozen new file mode 100644 index 000000000000..233ffaffa5cc --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/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/cassettes/features/v2/logs_restriction_queries/Delete-a-restriction-query-returns-OK-response.yml b/cassettes/features/v2/logs_restriction_queries/Delete-a-restriction-query-returns-OK-response.yml new file mode 100644 index 000000000000..6eceaea84d0a --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/Delete-a-restriction-query-returns-OK-response.yml @@ -0,0 +1,62 @@ +http_interactions: +- recorded_at: Tue, 18 Nov 2025 19:17:06 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Tue, 18 Nov 2025 19:17:06 GMT + 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: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +- recorded_at: Tue, 18 Nov 2025 19:17:06 GMT + 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: + encoding: UTF-8 + string: '{"errors":["Restriction query not found"]}' + headers: + Content-Type: + - application/json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/logs_restriction_queries/Get-a-restriction-query-returns-Bad-Request-response.frozen b/cassettes/features/v2/logs_restriction_queries/Get-a-restriction-query-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..35466be50386 --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/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/cassettes/features/v2/logs_restriction_queries/Get-a-restriction-query-returns-Bad-Request-response.yml b/cassettes/features/v2/logs_restriction_queries/Get-a-restriction-query-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..d3e1f1d5a41c --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/Get-a-restriction-query-returns-Bad-Request-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Tue, 18 Nov 2025 19:17:07 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/logs/config/restriction_queries/malformed_id + response: + body: + encoding: UTF-8 + string: '{"errors":["uuid is not proper type"]}' + headers: + Content-Type: + - application/json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/logs_restriction_queries/Get-a-restriction-query-returns-Not-found-response.frozen b/cassettes/features/v2/logs_restriction_queries/Get-a-restriction-query-returns-Not-found-response.frozen new file mode 100644 index 000000000000..27aff0c3f076 --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/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/cassettes/features/v2/logs_restriction_queries/Get-a-restriction-query-returns-Not-found-response.yml b/cassettes/features/v2/logs_restriction_queries/Get-a-restriction-query-returns-Not-found-response.yml new file mode 100644 index 000000000000..afffb41feeb7 --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/Get-a-restriction-query-returns-Not-found-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Tue, 18 Nov 2025 19:17:07 GMT + 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: + encoding: UTF-8 + string: '{"errors":["Restriction query not found"]}' + headers: + Content-Type: + - application/json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/logs_restriction_queries/Get-a-restriction-query-returns-OK-response.frozen b/cassettes/features/v2/logs_restriction_queries/Get-a-restriction-query-returns-OK-response.frozen new file mode 100644 index 000000000000..1f267748178e --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/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/cassettes/features/v2/logs_restriction_queries/Get-a-restriction-query-returns-OK-response.yml b/cassettes/features/v2/logs_restriction_queries/Get-a-restriction-query-returns-OK-response.yml new file mode 100644 index 000000000000..54b5c2e0f4e0 --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/Get-a-restriction-query-returns-OK-response.yml @@ -0,0 +1,64 @@ +http_interactions: +- recorded_at: Tue, 18 Nov 2025 19:17:07 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Tue, 18 Nov 2025 19:17:07 GMT + 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: + encoding: UTF-8 + 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 +- recorded_at: Tue, 18 Nov 2025 19:17:07 GMT + 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: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/logs_restriction_queries/Get-all-restriction-queries-for-a-given-user-returns-Bad-Request-response.frozen b/cassettes/features/v2/logs_restriction_queries/Get-all-restriction-queries-for-a-given-user-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..57b32bd89043 --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/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/cassettes/features/v2/logs_restriction_queries/Get-all-restriction-queries-for-a-given-user-returns-Bad-Request-response.yml b/cassettes/features/v2/logs_restriction_queries/Get-all-restriction-queries-for-a-given-user-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..4f5493cb4063 --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/Get-all-restriction-queries-for-a-given-user-returns-Bad-Request-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Tue, 18 Nov 2025 19:17:08 GMT + 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: + encoding: UTF-8 + string: '{"errors":["uuid is not proper type"]}' + headers: + Content-Type: + - application/json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/logs_restriction_queries/Get-all-restriction-queries-for-a-given-user-returns-Not-found-response.frozen b/cassettes/features/v2/logs_restriction_queries/Get-all-restriction-queries-for-a-given-user-returns-Not-found-response.frozen new file mode 100644 index 000000000000..9ee4a5d52067 --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/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/cassettes/features/v2/logs_restriction_queries/Get-all-restriction-queries-for-a-given-user-returns-Not-found-response.yml b/cassettes/features/v2/logs_restriction_queries/Get-all-restriction-queries-for-a-given-user-returns-Not-found-response.yml new file mode 100644 index 000000000000..bacb25d17911 --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/Get-all-restriction-queries-for-a-given-user-returns-Not-found-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Tue, 18 Nov 2025 19:17:08 GMT + 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: + encoding: UTF-8 + string: '{"errors":["user with uuid 00000000-0000-0000-0000-000000000000 doesn''t + exist"]}' + headers: + Content-Type: + - application/json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/logs_restriction_queries/Get-restriction-query-for-a-given-role-returns-Bad-Request-response.frozen b/cassettes/features/v2/logs_restriction_queries/Get-restriction-query-for-a-given-role-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..57897532acf1 --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/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/cassettes/features/v2/logs_restriction_queries/Get-restriction-query-for-a-given-role-returns-Bad-Request-response.yml b/cassettes/features/v2/logs_restriction_queries/Get-restriction-query-for-a-given-role-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..c9ce040de2e6 --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/Get-restriction-query-for-a-given-role-returns-Bad-Request-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Tue, 18 Nov 2025 19:17:08 GMT + 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: + encoding: UTF-8 + string: '{"errors":["Missing Role malformed_id"]}' + headers: + Content-Type: + - application/json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/logs_restriction_queries/Get-restriction-query-for-a-given-role-returns-Not-found-response.frozen b/cassettes/features/v2/logs_restriction_queries/Get-restriction-query-for-a-given-role-returns-Not-found-response.frozen new file mode 100644 index 000000000000..bd0df2da885a --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/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/cassettes/features/v2/logs_restriction_queries/Get-restriction-query-for-a-given-role-returns-Not-found-response.yml b/cassettes/features/v2/logs_restriction_queries/Get-restriction-query-for-a-given-role-returns-Not-found-response.yml new file mode 100644 index 000000000000..225822aeef68 --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/Get-restriction-query-for-a-given-role-returns-Not-found-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Tue, 18 Nov 2025 19:17:08 GMT + 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: + encoding: UTF-8 + string: '{"errors":["Missing Role 00000000-0000-0000-0000-000000000000"]}' + headers: + Content-Type: + - application/json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/logs_restriction_queries/Get-restriction-query-for-a-given-role-returns-OK-response.frozen b/cassettes/features/v2/logs_restriction_queries/Get-restriction-query-for-a-given-role-returns-OK-response.frozen new file mode 100644 index 000000000000..8dc9f697b0c1 --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/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/cassettes/features/v2/logs_restriction_queries/Get-restriction-query-for-a-given-role-returns-OK-response.yml b/cassettes/features/v2/logs_restriction_queries/Get-restriction-query-for-a-given-role-returns-OK-response.yml new file mode 100644 index 000000000000..2c2111715e36 --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/Get-restriction-query-for-a-given-role-returns-OK-response.yml @@ -0,0 +1,60 @@ +http_interactions: +- recorded_at: Tue, 18 Nov 2025 19:17:08 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Tue, 18 Nov 2025 19:17:08 GMT + 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: + encoding: UTF-8 + string: '{"data":[]} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Tue, 18 Nov 2025 19:17:08 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/roles/2d925300-c4b3-11f0-a252-da7ad0900002 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/logs_restriction_queries/Grant-role-to-a-restriction-query-returns-Bad-Request-response.frozen b/cassettes/features/v2/logs_restriction_queries/Grant-role-to-a-restriction-query-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..48cf494a95d9 --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/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/cassettes/features/v2/logs_restriction_queries/Grant-role-to-a-restriction-query-returns-Bad-Request-response.yml b/cassettes/features/v2/logs_restriction_queries/Grant-role-to-a-restriction-query-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..60f54ceaf24f --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/Grant-role-to-a-restriction-query-returns-Bad-Request-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Tue, 18 Nov 2025 19:17:09 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + string: '{"errors":["Role with id: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d not + found"]}' + headers: + Content-Type: + - application/json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/logs_restriction_queries/Grant-role-to-a-restriction-query-returns-Not-found-response.frozen b/cassettes/features/v2/logs_restriction_queries/Grant-role-to-a-restriction-query-returns-Not-found-response.frozen new file mode 100644 index 000000000000..f281a86a45c1 --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/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/cassettes/features/v2/logs_restriction_queries/Grant-role-to-a-restriction-query-returns-Not-found-response.yml b/cassettes/features/v2/logs_restriction_queries/Grant-role-to-a-restriction-query-returns-Not-found-response.yml new file mode 100644 index 000000000000..9b13129cb754 --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/Grant-role-to-a-restriction-query-returns-Not-found-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Tue, 18 Nov 2025 19:17:09 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + string: '{"errors":["Role with id: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d not + found"]}' + headers: + Content-Type: + - application/json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/logs_restriction_queries/Grant-role-to-a-restriction-query-returns-OK-response.frozen b/cassettes/features/v2/logs_restriction_queries/Grant-role-to-a-restriction-query-returns-OK-response.frozen new file mode 100644 index 000000000000..ac88614fb58e --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/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/cassettes/features/v2/logs_restriction_queries/Grant-role-to-a-restriction-query-returns-OK-response.yml b/cassettes/features/v2/logs_restriction_queries/Grant-role-to-a-restriction-query-returns-OK-response.yml new file mode 100644 index 000000000000..696541cec297 --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/Grant-role-to-a-restriction-query-returns-OK-response.yml @@ -0,0 +1,104 @@ +http_interactions: +- recorded_at: Tue, 18 Nov 2025 19:17:09 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Tue, 18 Nov 2025 19:17:09 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Tue, 18 Nov 2025 19:17:09 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +- recorded_at: Tue, 18 Nov 2025 19:17:09 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/roles/2e209fb6-c4b3-11f0-8483-da7ad0900002 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Tue, 18 Nov 2025 19:17:09 GMT + 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: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/logs_restriction_queries/List-restriction-queries-returns-OK-response.frozen b/cassettes/features/v2/logs_restriction_queries/List-restriction-queries-returns-OK-response.frozen new file mode 100644 index 000000000000..d227ca557fac --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/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/cassettes/features/v2/logs_restriction_queries/List-restriction-queries-returns-OK-response.yml b/cassettes/features/v2/logs_restriction_queries/List-restriction-queries-returns-OK-response.yml new file mode 100644 index 000000000000..b2fcc4607744 --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/List-restriction-queries-returns-OK-response.yml @@ -0,0 +1,22 @@ +http_interactions: +- recorded_at: Tue, 18 Nov 2025 19:17:10 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/logs/config/restriction_queries + response: + body: + encoding: UTF-8 + 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 +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/logs_restriction_queries/List-roles-for-a-restriction-query-returns-Bad-Request-response.frozen b/cassettes/features/v2/logs_restriction_queries/List-roles-for-a-restriction-query-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..0badf8611124 --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/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/cassettes/features/v2/logs_restriction_queries/List-roles-for-a-restriction-query-returns-Bad-Request-response.yml b/cassettes/features/v2/logs_restriction_queries/List-roles-for-a-restriction-query-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..61537acbc2b0 --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/List-roles-for-a-restriction-query-returns-Bad-Request-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Tue, 18 Nov 2025 19:17:11 GMT + 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: + encoding: UTF-8 + string: '{"errors":["uuid is not proper type"]}' + headers: + Content-Type: + - application/json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/logs_restriction_queries/List-roles-for-a-restriction-query-returns-Not-found-response.frozen b/cassettes/features/v2/logs_restriction_queries/List-roles-for-a-restriction-query-returns-Not-found-response.frozen new file mode 100644 index 000000000000..358663320c35 --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/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/cassettes/features/v2/logs_restriction_queries/List-roles-for-a-restriction-query-returns-Not-found-response.yml b/cassettes/features/v2/logs_restriction_queries/List-roles-for-a-restriction-query-returns-Not-found-response.yml new file mode 100644 index 000000000000..2e2b755593f8 --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/List-roles-for-a-restriction-query-returns-Not-found-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Tue, 18 Nov 2025 19:17:11 GMT + 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: + encoding: UTF-8 + string: '{"errors":["Restriction query not found"]}' + headers: + Content-Type: + - application/json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/logs_restriction_queries/List-roles-for-a-restriction-query-returns-OK-response.frozen b/cassettes/features/v2/logs_restriction_queries/List-roles-for-a-restriction-query-returns-OK-response.frozen new file mode 100644 index 000000000000..5e8d0cb60e01 --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/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/cassettes/features/v2/logs_restriction_queries/List-roles-for-a-restriction-query-returns-OK-response.yml b/cassettes/features/v2/logs_restriction_queries/List-roles-for-a-restriction-query-returns-OK-response.yml new file mode 100644 index 000000000000..f18e6889e719 --- /dev/null +++ b/cassettes/features/v2/logs_restriction_queries/List-roles-for-a-restriction-query-returns-OK-response.yml @@ -0,0 +1,64 @@ +http_interactions: +- recorded_at: Tue, 18 Nov 2025 19:17:11 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Tue, 18 Nov 2025 19:17:11 GMT + 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: + encoding: UTF-8 + string: '{"data":[]} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Tue, 18 Nov 2025 19:17:11 GMT + 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: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - text/html; charset=utf-8 + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-CREATED-response.frozen b/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-CREATED-response.frozen new file mode 100644 index 000000000000..5ca151ab8b74 --- /dev/null +++ b/cassettes/features/v2/teams/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/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-CREATED-response.yml b/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-CREATED-response.yml new file mode 100644 index 000000000000..58d94721e8ed --- /dev/null +++ b/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-CREATED-response.yml @@ -0,0 +1,116 @@ +http_interactions: +- recorded_at: Mon, 24 Nov 2025 14:29:58 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Mon, 24 Nov 2025 14:29:58 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Mon, 24 Nov 2025 14:29:58 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Mon, 24 Nov 2025 14:29:58 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links/c53bed14-1c0a-4895-b845-1c04be086ba0 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 24 Nov 2025 14:29:58 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/e1c6ab08-0325-4df7-aea1-6bec76692d55 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 24 Nov 2025 14:29:58 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/551c947a-0f0f-4ff0-8c41-0ceddabe3551 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-Conflict-response.frozen b/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-Conflict-response.frozen new file mode 100644 index 000000000000..4da94657eeb9 --- /dev/null +++ b/cassettes/features/v2/teams/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/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-Conflict-response.yml b/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-Conflict-response.yml new file mode 100644 index 000000000000..04ec7e6559e3 --- /dev/null +++ b/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-Conflict-response.yml @@ -0,0 +1,142 @@ +http_interactions: +- recorded_at: Mon, 24 Nov 2025 17:06:46 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Mon, 24 Nov 2025 17:06:46 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Mon, 24 Nov 2025 17:06:46 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Mon, 24 Nov 2025 17:06:46 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Mon, 24 Nov 2025 17:06:46 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links/e980108e-d535-4bdf-84ca-5e8f84a68480 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 24 Nov 2025 17:06:46 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/21296c73-c9e2-4889-a33f-417d2974b2bd + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 24 Nov 2025 17:06:46 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/4a9a1845-0ba7-4a6f-a34d-6e72a4ffda87 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-OK-response.frozen b/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-OK-response.frozen new file mode 100644 index 000000000000..bf8a8d4fa45a --- /dev/null +++ b/cassettes/features/v2/teams/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/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-OK-response.yml b/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-OK-response.yml new file mode 100644 index 000000000000..410142736219 --- /dev/null +++ b/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-OK-response.yml @@ -0,0 +1,116 @@ +http_interactions: +- recorded_at: Mon, 24 Nov 2025 16:01:16 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Mon, 24 Nov 2025 16:01:16 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Mon, 24 Nov 2025 16:01:16 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Mon, 24 Nov 2025 16:01:16 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links/6cf86539-2c6e-497e-8cef-0b285ff05514 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 24 Nov 2025 16:01:16 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/790428f6-10bc-427d-bf36-f53ca3c197e0 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 24 Nov 2025 16:01:16 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/d5b049f4-59f1-474d-ad98-5a7342a8961f + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-SUCCESS-response.frozen b/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-SUCCESS-response.frozen new file mode 100644 index 000000000000..e4ed51cc8673 --- /dev/null +++ b/cassettes/features/v2/teams/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/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-SUCCESS-response.yml b/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-SUCCESS-response.yml new file mode 100644 index 000000000000..b32ea2b6611e --- /dev/null +++ b/cassettes/features/v2/teams/Create-a-team-hierarchy-link-returns-SUCCESS-response.yml @@ -0,0 +1,116 @@ +http_interactions: +- recorded_at: Mon, 24 Nov 2025 15:48:39 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Mon, 24 Nov 2025 15:48:39 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Mon, 24 Nov 2025 15:48:39 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Mon, 24 Nov 2025 15:48:39 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links/fb94d43b-fe10-4c5f-ae7c-4ad745428651 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 24 Nov 2025 15:48:39 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/2d096572-eb6a-4579-ba38-b4247cf75e17 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 24 Nov 2025 15:48:39 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/b85e63cd-1d9f-4b71-a47c-f5a99d4a4afd + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/teams/Get-a-team-hierarchy-link-returns-API-error-response-response.frozen b/cassettes/features/v2/teams/Get-a-team-hierarchy-link-returns-API-error-response-response.frozen new file mode 100644 index 000000000000..21b6221c0da9 --- /dev/null +++ b/cassettes/features/v2/teams/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/cassettes/features/v2/teams/Get-a-team-hierarchy-link-returns-API-error-response-response.yml b/cassettes/features/v2/teams/Get-a-team-hierarchy-link-returns-API-error-response-response.yml new file mode 100644 index 000000000000..8b9d86a8ebd5 --- /dev/null +++ b/cassettes/features/v2/teams/Get-a-team-hierarchy-link-returns-API-error-response-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Mon, 24 Nov 2025 13:19:11 GMT + 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: + encoding: UTF-8 + 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 +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/teams/Get-a-team-hierarchy-link-returns-OK-response.frozen b/cassettes/features/v2/teams/Get-a-team-hierarchy-link-returns-OK-response.frozen new file mode 100644 index 000000000000..be8e0fd4a382 --- /dev/null +++ b/cassettes/features/v2/teams/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/cassettes/features/v2/teams/Get-a-team-hierarchy-link-returns-OK-response.yml b/cassettes/features/v2/teams/Get-a-team-hierarchy-link-returns-OK-response.yml new file mode 100644 index 000000000000..bf537e795665 --- /dev/null +++ b/cassettes/features/v2/teams/Get-a-team-hierarchy-link-returns-OK-response.yml @@ -0,0 +1,134 @@ +http_interactions: +- recorded_at: Mon, 24 Nov 2025 17:07:09 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Mon, 24 Nov 2025 17:07:09 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Mon, 24 Nov 2025 17:07:09 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Mon, 24 Nov 2025 17:07:09 GMT + 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: + encoding: UTF-8 + 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 +- recorded_at: Mon, 24 Nov 2025 17:07:09 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links/5401e712-de1b-4deb-ac35-2c6ee1943ad0 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 24 Nov 2025 17:07:09 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/196bcc55-bd30-4cfd-8549-b3d255a0517b + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 24 Nov 2025 17:07:09 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/fafeac94-42b4-4469-91e8-0ae5ca3f564b + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/teams/Get-team-hierarchy-links-returns-OK-response.frozen b/cassettes/features/v2/teams/Get-team-hierarchy-links-returns-OK-response.frozen new file mode 100644 index 000000000000..1d3731961ea6 --- /dev/null +++ b/cassettes/features/v2/teams/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/cassettes/features/v2/teams/Get-team-hierarchy-links-returns-OK-response.yml b/cassettes/features/v2/teams/Get-team-hierarchy-links-returns-OK-response.yml new file mode 100644 index 000000000000..4e524c0d9220 --- /dev/null +++ b/cassettes/features/v2/teams/Get-team-hierarchy-links-returns-OK-response.yml @@ -0,0 +1,134 @@ +http_interactions: +- recorded_at: Mon, 24 Nov 2025 17:18:13 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Mon, 24 Nov 2025 17:18:13 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Mon, 24 Nov 2025 17:18:13 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Mon, 24 Nov 2025 17:18:13 GMT + 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: + encoding: UTF-8 + 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 +- recorded_at: Mon, 24 Nov 2025 17:18:13 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links/61509612-5bb0-42c5-a16e-bf4920acf473 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 24 Nov 2025 17:18:13 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/61b0ab36-c1e5-47fd-898a-ba9bfc860e9d + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 24 Nov 2025 17:18:13 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/d1baf3de-7316-43b5-8582-dc887acc26ef + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/teams/Remove-a-team-hierarchy-link-returns-API-error-response-response.frozen b/cassettes/features/v2/teams/Remove-a-team-hierarchy-link-returns-API-error-response-response.frozen new file mode 100644 index 000000000000..73f686747b4d --- /dev/null +++ b/cassettes/features/v2/teams/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/cassettes/features/v2/teams/Remove-a-team-hierarchy-link-returns-API-error-response-response.yml b/cassettes/features/v2/teams/Remove-a-team-hierarchy-link-returns-API-error-response-response.yml new file mode 100644 index 000000000000..1a6617b84e3f --- /dev/null +++ b/cassettes/features/v2/teams/Remove-a-team-hierarchy-link-returns-API-error-response-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Mon, 24 Nov 2025 13:14:20 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links/aaa11111-aa11-aa11-aaaa-aaaaaa111111 + response: + body: + encoding: UTF-8 + 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 +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/teams/Remove-a-team-hierarchy-link-returns-No-Content-response.frozen b/cassettes/features/v2/teams/Remove-a-team-hierarchy-link-returns-No-Content-response.frozen new file mode 100644 index 000000000000..be1311ed7c9b --- /dev/null +++ b/cassettes/features/v2/teams/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/cassettes/features/v2/teams/Remove-a-team-hierarchy-link-returns-No-Content-response.yml b/cassettes/features/v2/teams/Remove-a-team-hierarchy-link-returns-No-Content-response.yml new file mode 100644 index 000000000000..2e5dc20cd246 --- /dev/null +++ b/cassettes/features/v2/teams/Remove-a-team-hierarchy-link-returns-No-Content-response.yml @@ -0,0 +1,135 @@ +http_interactions: +- recorded_at: Mon, 24 Nov 2025 17:08:01 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Mon, 24 Nov 2025 17:08:01 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Mon, 24 Nov 2025 17:08:01 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Mon, 24 Nov 2025 17:08:01 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links/185446b8-1e88-419c-b266-3933f1411b6e + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 24 Nov 2025 17:08:01 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team-hierarchy-links/185446b8-1e88-419c-b266-3933f1411b6e + response: + body: + encoding: UTF-8 + 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 +- recorded_at: Mon, 24 Nov 2025 17:08:01 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/120aeb27-ca42-4e38-a9e4-6497b8f9407c + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Mon, 24 Nov 2025 17:08:01 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/eaf01981-6b63-41ba-b49f-30449c50e865 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/examples/v2/logs-restriction-queries/AddRoleToRestrictionQuery.rb b/examples/v2/logs-restriction-queries/AddRoleToRestrictionQuery.rb new file mode 100644 index 000000000000..fd873f8bc4ae --- /dev/null +++ b/examples/v2/logs-restriction-queries/AddRoleToRestrictionQuery.rb @@ -0,0 +1,21 @@ +# Grant role to a restriction query returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.add_role_to_restriction_query".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LogsRestrictionQueriesAPI.new + +# there is a valid "restriction_query" in the system +RESTRICTION_QUERY_DATA_ID = ENV["RESTRICTION_QUERY_DATA_ID"] + +# there is a valid "role" in the system +ROLE_DATA_ID = ENV["ROLE_DATA_ID"] + +body = DatadogAPIClient::V2::RelationshipToRole.new({ + data: DatadogAPIClient::V2::RelationshipToRoleData.new({ + id: ROLE_DATA_ID, + type: DatadogAPIClient::V2::RolesType::ROLES, + }), +}) +api_instance.add_role_to_restriction_query(RESTRICTION_QUERY_DATA_ID, body) diff --git a/examples/v2/logs-restriction-queries/CreateRestrictionQuery.rb b/examples/v2/logs-restriction-queries/CreateRestrictionQuery.rb new file mode 100644 index 000000000000..aaeb09d88703 --- /dev/null +++ b/examples/v2/logs-restriction-queries/CreateRestrictionQuery.rb @@ -0,0 +1,17 @@ +# Create a restriction query returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_restriction_query".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LogsRestrictionQueriesAPI.new + +body = DatadogAPIClient::V2::RestrictionQueryCreatePayload.new({ + data: DatadogAPIClient::V2::RestrictionQueryCreateData.new({ + attributes: DatadogAPIClient::V2::RestrictionQueryCreateAttributes.new({ + restriction_query: "env:sandbox", + }), + type: DatadogAPIClient::V2::LogsRestrictionQueriesType::LOGS_RESTRICTION_QUERIES, + }), +}) +p api_instance.create_restriction_query(body) diff --git a/examples/v2/logs-restriction-queries/DeleteRestrictionQuery.rb b/examples/v2/logs-restriction-queries/DeleteRestrictionQuery.rb new file mode 100644 index 000000000000..0d0c2be194c5 --- /dev/null +++ b/examples/v2/logs-restriction-queries/DeleteRestrictionQuery.rb @@ -0,0 +1,11 @@ +# Delete a restriction query returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_restriction_query".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LogsRestrictionQueriesAPI.new + +# there is a valid "restriction_query" in the system +RESTRICTION_QUERY_DATA_ID = ENV["RESTRICTION_QUERY_DATA_ID"] +api_instance.delete_restriction_query(RESTRICTION_QUERY_DATA_ID) diff --git a/examples/v2/logs-restriction-queries/GetRestrictionQuery.rb b/examples/v2/logs-restriction-queries/GetRestrictionQuery.rb new file mode 100644 index 000000000000..94c9aad0e580 --- /dev/null +++ b/examples/v2/logs-restriction-queries/GetRestrictionQuery.rb @@ -0,0 +1,11 @@ +# Get a restriction query returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_restriction_query".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LogsRestrictionQueriesAPI.new + +# there is a valid "restriction_query" in the system +RESTRICTION_QUERY_DATA_ID = ENV["RESTRICTION_QUERY_DATA_ID"] +p api_instance.get_restriction_query(RESTRICTION_QUERY_DATA_ID) diff --git a/examples/v2/logs-restriction-queries/GetRoleRestrictionQuery.rb b/examples/v2/logs-restriction-queries/GetRoleRestrictionQuery.rb new file mode 100644 index 000000000000..229012a9f1d2 --- /dev/null +++ b/examples/v2/logs-restriction-queries/GetRoleRestrictionQuery.rb @@ -0,0 +1,11 @@ +# Get restriction query for a given role returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_role_restriction_query".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LogsRestrictionQueriesAPI.new + +# there is a valid "role" in the system +ROLE_DATA_ID = ENV["ROLE_DATA_ID"] +p api_instance.get_role_restriction_query(ROLE_DATA_ID) diff --git a/examples/v2/logs-restriction-queries/ListRestrictionQueries.rb b/examples/v2/logs-restriction-queries/ListRestrictionQueries.rb new file mode 100644 index 000000000000..8fd35d278bfd --- /dev/null +++ b/examples/v2/logs-restriction-queries/ListRestrictionQueries.rb @@ -0,0 +1,8 @@ +# List restriction queries returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_restriction_queries".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LogsRestrictionQueriesAPI.new +p api_instance.list_restriction_queries() diff --git a/examples/v2/logs-restriction-queries/ListRestrictionQueryRoles.rb b/examples/v2/logs-restriction-queries/ListRestrictionQueryRoles.rb new file mode 100644 index 000000000000..0f7a67337df4 --- /dev/null +++ b/examples/v2/logs-restriction-queries/ListRestrictionQueryRoles.rb @@ -0,0 +1,11 @@ +# List roles for a restriction query returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_restriction_query_roles".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LogsRestrictionQueriesAPI.new + +# there is a valid "restriction_query" in the system +RESTRICTION_QUERY_DATA_ID = ENV["RESTRICTION_QUERY_DATA_ID"] +p api_instance.list_restriction_query_roles(RESTRICTION_QUERY_DATA_ID) diff --git a/examples/v2/logs-restriction-queries/ListUserRestrictionQueries.rb b/examples/v2/logs-restriction-queries/ListUserRestrictionQueries.rb new file mode 100644 index 000000000000..4137e9ab0182 --- /dev/null +++ b/examples/v2/logs-restriction-queries/ListUserRestrictionQueries.rb @@ -0,0 +1,11 @@ +# Get all restriction queries for a given user returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_user_restriction_queries".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LogsRestrictionQueriesAPI.new + +# there is a valid "user" in the system +USER_DATA_ID = ENV["USER_DATA_ID"] +p api_instance.list_user_restriction_queries(USER_DATA_ID) diff --git a/examples/v2/logs-restriction-queries/RemoveRoleFromRestrictionQuery.rb b/examples/v2/logs-restriction-queries/RemoveRoleFromRestrictionQuery.rb new file mode 100644 index 000000000000..956a5bf1b798 --- /dev/null +++ b/examples/v2/logs-restriction-queries/RemoveRoleFromRestrictionQuery.rb @@ -0,0 +1,21 @@ +# Revoke role from a restriction query returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.remove_role_from_restriction_query".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LogsRestrictionQueriesAPI.new + +# there is a valid "restriction_query" in the system +RESTRICTION_QUERY_DATA_ID = ENV["RESTRICTION_QUERY_DATA_ID"] + +# there is a valid "role" in the system +ROLE_DATA_ID = ENV["ROLE_DATA_ID"] + +body = DatadogAPIClient::V2::RelationshipToRole.new({ + data: DatadogAPIClient::V2::RelationshipToRoleData.new({ + id: ROLE_DATA_ID, + type: DatadogAPIClient::V2::RolesType::ROLES, + }), +}) +api_instance.remove_role_from_restriction_query(RESTRICTION_QUERY_DATA_ID, body) diff --git a/examples/v2/logs-restriction-queries/ReplaceRestrictionQuery.rb b/examples/v2/logs-restriction-queries/ReplaceRestrictionQuery.rb new file mode 100644 index 000000000000..39ae74837e64 --- /dev/null +++ b/examples/v2/logs-restriction-queries/ReplaceRestrictionQuery.rb @@ -0,0 +1,20 @@ +# Replace a restriction query returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.replace_restriction_query".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LogsRestrictionQueriesAPI.new + +# there is a valid "restriction_query" in the system +RESTRICTION_QUERY_DATA_ID = ENV["RESTRICTION_QUERY_DATA_ID"] + +body = DatadogAPIClient::V2::RestrictionQueryUpdatePayload.new({ + data: DatadogAPIClient::V2::RestrictionQueryUpdateData.new({ + attributes: DatadogAPIClient::V2::RestrictionQueryUpdateAttributes.new({ + restriction_query: "env:staging", + }), + type: DatadogAPIClient::V2::LogsRestrictionQueriesType::LOGS_RESTRICTION_QUERIES, + }), +}) +p api_instance.replace_restriction_query(RESTRICTION_QUERY_DATA_ID, body) diff --git a/examples/v2/logs-restriction-queries/UpdateRestrictionQuery.rb b/examples/v2/logs-restriction-queries/UpdateRestrictionQuery.rb new file mode 100644 index 000000000000..41e204920c26 --- /dev/null +++ b/examples/v2/logs-restriction-queries/UpdateRestrictionQuery.rb @@ -0,0 +1,20 @@ +# Update a restriction query returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_restriction_query".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LogsRestrictionQueriesAPI.new + +# there is a valid "restriction_query" in the system +RESTRICTION_QUERY_DATA_ID = ENV["RESTRICTION_QUERY_DATA_ID"] + +body = DatadogAPIClient::V2::RestrictionQueryUpdatePayload.new({ + data: DatadogAPIClient::V2::RestrictionQueryUpdateData.new({ + attributes: DatadogAPIClient::V2::RestrictionQueryUpdateAttributes.new({ + restriction_query: "env:production", + }), + type: DatadogAPIClient::V2::LogsRestrictionQueriesType::LOGS_RESTRICTION_QUERIES, + }), +}) +p api_instance.update_restriction_query(RESTRICTION_QUERY_DATA_ID, body) diff --git a/examples/v2/teams/AddTeamHierarchyLink.rb b/examples/v2/teams/AddTeamHierarchyLink.rb new file mode 100644 index 000000000000..a30e768a798d --- /dev/null +++ b/examples/v2/teams/AddTeamHierarchyLink.rb @@ -0,0 +1,31 @@ +# Create a team hierarchy link returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::TeamsAPI.new + +# there is a valid "dd_team" in the system +DD_TEAM_DATA_ID = ENV["DD_TEAM_DATA_ID"] + +# there is a valid "dd_team_2" in the system +DD_TEAM_2_DATA_ID = ENV["DD_TEAM_2_DATA_ID"] + +body = DatadogAPIClient::V2::TeamHierarchyLinkCreateRequest.new({ + data: DatadogAPIClient::V2::TeamHierarchyLinkCreate.new({ + relationships: DatadogAPIClient::V2::TeamHierarchyLinkCreateRelationships.new({ + parent_team: DatadogAPIClient::V2::TeamHierarchyLinkCreateTeamRelationship.new({ + data: DatadogAPIClient::V2::TeamHierarchyLinkCreateTeam.new({ + id: DD_TEAM_DATA_ID, + type: DatadogAPIClient::V2::TeamType::TEAM, + }), + }), + sub_team: DatadogAPIClient::V2::TeamHierarchyLinkCreateTeamRelationship.new({ + data: DatadogAPIClient::V2::TeamHierarchyLinkCreateTeam.new({ + id: DD_TEAM_2_DATA_ID, + type: DatadogAPIClient::V2::TeamType::TEAM, + }), + }), + }), + type: DatadogAPIClient::V2::TeamHierarchyLinkType::TEAM_HIERARCHY_LINKS, + }), +}) +p api_instance.add_team_hierarchy_link(body) diff --git a/examples/v2/teams/GetTeamHierarchyLink.rb b/examples/v2/teams/GetTeamHierarchyLink.rb new file mode 100644 index 000000000000..66661f335fa1 --- /dev/null +++ b/examples/v2/teams/GetTeamHierarchyLink.rb @@ -0,0 +1,8 @@ +# Get a team hierarchy link returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::TeamsAPI.new + +# there is a valid "team_hierarchy_link" in the system +TEAM_HIERARCHY_LINK_DATA_ID = ENV["TEAM_HIERARCHY_LINK_DATA_ID"] +p api_instance.get_team_hierarchy_link(TEAM_HIERARCHY_LINK_DATA_ID) diff --git a/examples/v2/teams/ListTeamHierarchyLinks.rb b/examples/v2/teams/ListTeamHierarchyLinks.rb new file mode 100644 index 000000000000..80ac140d5e15 --- /dev/null +++ b/examples/v2/teams/ListTeamHierarchyLinks.rb @@ -0,0 +1,15 @@ +# Get team hierarchy links returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::TeamsAPI.new + +# there is a valid "team_hierarchy_link" in the system +TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_PARENT_TEAM_DATA_ID = ENV["TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_PARENT_TEAM_DATA_ID"] +TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_SUB_TEAM_DATA_ID = ENV["TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_SUB_TEAM_DATA_ID"] +opts = { + filter_parent_team: TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_PARENT_TEAM_DATA_ID, + filter_sub_team: TEAM_HIERARCHY_LINK_DATA_RELATIONSHIPS_SUB_TEAM_DATA_ID, + page_number: 0, + page_size: 100, +} +p api_instance.list_team_hierarchy_links(opts) diff --git a/examples/v2/teams/ListTeamHierarchyLinks_3360757486.rb b/examples/v2/teams/ListTeamHierarchyLinks_3360757486.rb new file mode 100644 index 000000000000..3baec7cb0d3c --- /dev/null +++ b/examples/v2/teams/ListTeamHierarchyLinks_3360757486.rb @@ -0,0 +1,5 @@ +# Get team hierarchy links returns "OK" response with pagination + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::TeamsAPI.new +api_instance.list_team_hierarchy_links_with_pagination() { |item| puts item } diff --git a/examples/v2/teams/RemoveTeamHierarchyLink.rb b/examples/v2/teams/RemoveTeamHierarchyLink.rb new file mode 100644 index 000000000000..94c638a60ec1 --- /dev/null +++ b/examples/v2/teams/RemoveTeamHierarchyLink.rb @@ -0,0 +1,8 @@ +# Remove a team hierarchy link returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::TeamsAPI.new + +# there is a valid "team_hierarchy_link" in the system +TEAM_HIERARCHY_LINK_DATA_ID = ENV["TEAM_HIERARCHY_LINK_DATA_ID"] +api_instance.remove_team_hierarchy_link(TEAM_HIERARCHY_LINK_DATA_ID) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 15e1897d6c51..d85bc628294d 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2380,6 +2380,46 @@ "metric_id" => "String", "body" => "LogsMetricUpdateRequest", }, + "v2.ListRestrictionQueries" => { + "page_size" => "Integer", + "page_number" => "Integer", + }, + "v2.CreateRestrictionQuery" => { + "body" => "RestrictionQueryCreatePayload", + }, + "v2.GetRoleRestrictionQuery" => { + "role_id" => "String", + }, + "v2.ListUserRestrictionQueries" => { + "user_id" => "String", + }, + "v2.DeleteRestrictionQuery" => { + "restriction_query_id" => "String", + }, + "v2.GetRestrictionQuery" => { + "restriction_query_id" => "String", + }, + "v2.UpdateRestrictionQuery" => { + "restriction_query_id" => "String", + "body" => "RestrictionQueryUpdatePayload", + }, + "v2.ReplaceRestrictionQuery" => { + "restriction_query_id" => "String", + "body" => "RestrictionQueryUpdatePayload", + }, + "v2.RemoveRoleFromRestrictionQuery" => { + "restriction_query_id" => "String", + "body" => "RelationshipToRole", + }, + "v2.ListRestrictionQueryRoles" => { + "restriction_query_id" => "String", + "page_size" => "Integer", + "page_number" => "Integer", + }, + "v2.AddRoleToRestrictionQuery" => { + "restriction_query_id" => "String", + "body" => "RelationshipToRole", + }, "v2.ListTagConfigurations" => { "filter_configured" => "Boolean", "filter_tags_configured" => "String", @@ -3102,6 +3142,21 @@ "v2.CreateTeam" => { "body" => "TeamCreateRequest", }, + "v2.ListTeamHierarchyLinks" => { + "page_number" => "Integer", + "page_size" => "Integer", + "filter_parent_team" => "String", + "filter_sub_team" => "String", + }, + "v2.AddTeamHierarchyLink" => { + "body" => "TeamHierarchyLinkCreateRequest", + }, + "v2.RemoveTeamHierarchyLink" => { + "link_id" => "String", + }, + "v2.GetTeamHierarchyLink" => { + "link_id" => "String", + }, "v2.GetTeamSync" => { "filter_source" => "TeamSyncAttributesSource", }, diff --git a/features/v2/given.json b/features/v2/given.json index 198c7af1b51d..6c6d3bf98f4c 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -679,6 +679,18 @@ "tag": "Logs Metrics", "operationId": "CreateLogsMetric" }, + { + "parameters": [ + { + "name": "body", + "value": "{\"data\": {\"attributes\": {\"restriction_query\": \"env:sandbox\"}, \"type\": \"logs_restriction_queries\"}}" + } + ], + "step": "there is a valid \"restriction_query\" in the system", + "key": "restriction_query", + "tag": "Logs Restriction Queries", + "operationId": "CreateRestrictionQuery" + }, { "parameters": [ { @@ -1169,6 +1181,30 @@ "tag": "Teams", "operationId": "CreateTeam" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"handle\": \"test-handle-2-{{ unique_hash }}\",\n \"name\": \"test-name-2-{{ unique_hash }}\"\n },\n \"type\": \"team\"\n }\n}" + } + ], + "step": "there is a valid \"dd_team_2\" in the system", + "key": "dd_team_2", + "tag": "Teams", + "operationId": "CreateTeam" + }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"team_hierarchy_links\",\n \"relationships\": {\n \"parent_team\": {\n \"data\": {\n \"id\": \"{{ dd_team.data.id }}\",\n \"type\": \"team\"\n }\n },\n \"sub_team\": {\n \"data\": {\n \"id\": \"{{ dd_team_2.data.id }}\",\n \"type\": \"team\"\n }\n }\n }\n }\n}" + } + ], + "step": "there is a valid \"team_hierarchy_link\" in the system", + "key": "team_hierarchy_link", + "tag": "Teams", + "operationId": "AddTeamHierarchyLink" + }, { "source": "data.data[0]", "step": "there is a valid \"team_connection\" in the system", diff --git a/features/v2/logs_restriction_queries.feature b/features/v2/logs_restriction_queries.feature new file mode 100644 index 000000000000..44d65b92fd5c --- /dev/null +++ b/features/v2/logs_restriction_queries.feature @@ -0,0 +1,287 @@ +@endpoint(logs-restriction-queries) @endpoint(logs-restriction-queries-v2) +Feature: Logs Restriction Queries + **Note: This endpoint is in public beta. If you have any feedback, contact + [Datadog support](https://docs.datadoghq.com/help/).** A Restriction + Query is a logs query that restricts which logs the `logs_read_data` + permission grants read access to. For users whose roles have Restriction + Queries, any log query they make only returns those log events that also + match one of their Restriction Queries. This is true whether the user + queries log events from any log-related feature, including the log + explorer, Live Tail, re-hydration, or a dashboard widget. Restriction + Queries currently only support use of the following components of log + events: - Reserved attributes - The log message - Tags To restrict read + access on log data, add a team tag to log events to indicate which teams + own them, and then scope Restriction Queries to the relevant values of the + team tag. Tags can be applied to log events in many ways, and a log event + can have multiple tags with the same key (like team) and different values. + This means the same log event can be visible to roles whose restriction + queries are scoped to different team values. See [How to Set Up RBAC for + Logs](https://docs.datadoghq.com/logs/guide/logs-rbac/?tab=api#restrict- + access-to-logs) for details on how to add restriction queries. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "LogsRestrictionQueries" API + + @skip-go @skip-java @skip-python @skip-ruby @skip-rust @skip-terraform-config @skip-typescript @skip-validation @team:DataDog/logs-app + Scenario: Create a restriction query returns "Bad Request" response + Given operation "CreateRestrictionQuery" enabled + And new "CreateRestrictionQuery" request + And body with value {"test": "bad_request"} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/logs-app + Scenario: Create a restriction query returns "OK" response + Given operation "CreateRestrictionQuery" enabled + And new "CreateRestrictionQuery" request + And body with value {"data": {"attributes": {"restriction_query": "env:sandbox"}, "type": "logs_restriction_queries"}} + When the request is sent + Then the response status is 200 OK + + @skip-terraform-config @team:DataDog/logs-app + Scenario: Delete a restriction query returns "Bad Request" response + Given operation "DeleteRestrictionQuery" enabled + And new "DeleteRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "malformed_id" + When the request is sent + Then the response status is 400 Bad Request + + @skip-terraform-config @team:DataDog/logs-app + Scenario: Delete a restriction query returns "Not found" response + Given operation "DeleteRestrictionQuery" enabled + And new "DeleteRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "00000000-0000-0000-0000-000000000000" + When the request is sent + Then the response status is 404 Not found + + @team:DataDog/logs-app + Scenario: Delete a restriction query returns "OK" response + Given operation "DeleteRestrictionQuery" enabled + And there is a valid "restriction_query" in the system + And new "DeleteRestrictionQuery" request + And request contains "restriction_query_id" parameter from "restriction_query.data.id" + When the request is sent + Then the response status is 204 OK + + @skip-terraform-config @team:DataDog/logs-app + Scenario: Get a restriction query returns "Bad Request" response + Given operation "GetRestrictionQuery" enabled + And new "GetRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "malformed_id" + When the request is sent + Then the response status is 400 Bad Request + + @skip-terraform-config @team:DataDog/logs-app + Scenario: Get a restriction query returns "Not found" response + Given operation "GetRestrictionQuery" enabled + And new "GetRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "00000000-0000-0000-0000-000000000000" + When the request is sent + Then the response status is 404 Not found + + @team:DataDog/logs-app + Scenario: Get a restriction query returns "OK" response + Given operation "GetRestrictionQuery" enabled + And there is a valid "restriction_query" in the system + And new "GetRestrictionQuery" request + And request contains "restriction_query_id" parameter from "restriction_query.data.id" + When the request is sent + Then the response status is 200 OK + + @skip-terraform-config @team:DataDog/logs-app + Scenario: Get all restriction queries for a given user returns "Bad Request" response + Given operation "ListUserRestrictionQueries" enabled + And new "ListUserRestrictionQueries" request + And request contains "user_id" parameter with value "malformed_id" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/logs-app + Scenario: Get all restriction queries for a given user returns "Not found" response + Given operation "ListUserRestrictionQueries" enabled + And new "ListUserRestrictionQueries" request + And request contains "user_id" parameter with value "00000000-0000-0000-0000-000000000000" + When the request is sent + Then the response status is 400 Bad Request + + @skip @team:DataDog/logs-app + Scenario: Get all restriction queries for a given user returns "OK" response + Given operation "ListUserRestrictionQueries" enabled + And there is a valid "user" in the system + And new "ListUserRestrictionQueries" request + And request contains "user_id" parameter from "user.data.id" + When the request is sent + Then the response status is 200 OK + + @skip-terraform-config @team:DataDog/logs-app + Scenario: Get restriction query for a given role returns "Bad Request" response + Given operation "GetRoleRestrictionQuery" enabled + And new "GetRoleRestrictionQuery" request + And request contains "role_id" parameter with value "malformed_id" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/logs-app + Scenario: Get restriction query for a given role returns "Not found" response + Given operation "GetRoleRestrictionQuery" enabled + And new "GetRoleRestrictionQuery" request + And request contains "role_id" parameter with value "00000000-0000-0000-0000-000000000000" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/logs-app + Scenario: Get restriction query for a given role returns "OK" response + Given operation "GetRoleRestrictionQuery" enabled + And there is a valid "role" in the system + And new "GetRoleRestrictionQuery" request + And request contains "role_id" parameter from "role.data.id" + When the request is sent + Then the response status is 200 OK + + @skip-terraform-config @team:DataDog/logs-app + Scenario: Grant role to a restriction query returns "Bad Request" response + Given operation "AddRoleToRestrictionQuery" enabled + And new "AddRoleToRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "malformed_id" + And body with value {"data": {"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "type": "roles"}} + When the request is sent + Then the response status is 404 Not found + + @skip-terraform-config @team:DataDog/logs-app + Scenario: Grant role to a restriction query returns "Not found" response + Given operation "AddRoleToRestrictionQuery" enabled + And new "AddRoleToRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "00000000-0000-0000-0000-000000000000" + And body with value {"data": {"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "type": "roles"}} + When the request is sent + Then the response status is 404 Not found + + @team:DataDog/logs-app + Scenario: Grant role to a restriction query returns "OK" response + Given operation "AddRoleToRestrictionQuery" enabled + And there is a valid "restriction_query" in the system + And there is a valid "role" in the system + And new "AddRoleToRestrictionQuery" request + And request contains "restriction_query_id" parameter from "restriction_query.data.id" + And body with value {"data": {"id": "{{ role.data.id }}", "type": "roles"}} + When the request is sent + Then the response status is 204 OK + + @skip-terraform-config @team:DataDog/logs-app + Scenario: List restriction queries returns "OK" response + Given operation "ListRestrictionQueries" enabled + And new "ListRestrictionQueries" request + When the request is sent + Then the response status is 200 OK + + @skip-terraform-config @team:DataDog/logs-app + Scenario: List roles for a restriction query returns "Bad Request" response + Given operation "ListRestrictionQueryRoles" enabled + And new "ListRestrictionQueryRoles" request + And request contains "restriction_query_id" parameter with value "malformed_id" + When the request is sent + Then the response status is 400 Bad Request + + @skip-terraform-config @team:DataDog/logs-app + Scenario: List roles for a restriction query returns "Not found" response + Given operation "ListRestrictionQueryRoles" enabled + And new "ListRestrictionQueryRoles" request + And request contains "restriction_query_id" parameter with value "00000000-0000-0000-0000-000000000000" + When the request is sent + Then the response status is 404 Not found + + @team:DataDog/logs-app + Scenario: List roles for a restriction query returns "OK" response + Given operation "ListRestrictionQueryRoles" enabled + And there is a valid "restriction_query" in the system + And new "ListRestrictionQueryRoles" request + And request contains "restriction_query_id" parameter from "restriction_query.data.id" + When the request is sent + Then the response status is 200 OK + + @skip @team:DataDog/logs-app + Scenario: Replace a restriction query returns "Bad Request" response + Given operation "ReplaceRestrictionQuery" enabled + And new "ReplaceRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "malformed_id" + And body with value {"data": {"attributes": {"restriction_query": "env:sandbox"}, "type": "logs_restriction_queries"}} + When the request is sent + Then the response status is 400 Bad Request + + @skip @team:DataDog/logs-app + Scenario: Replace a restriction query returns "Not found" response + Given operation "ReplaceRestrictionQuery" enabled + And new "ReplaceRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "00000000-0000-0000-0000-000000000000" + And body with value {"data": {"attributes": {"restriction_query": "env:sandbox"}, "type": "logs_restriction_queries"}} + When the request is sent + Then the response status is 404 Not found + + @skip @team:DataDog/logs-app + Scenario: Replace a restriction query returns "OK" response + Given operation "ReplaceRestrictionQuery" enabled + And there is a valid "restriction_query" in the system + And new "ReplaceRestrictionQuery" request + And request contains "restriction_query_id" parameter from "restriction_query.data.id" + And body with value {"data": {"attributes": {"restriction_query": "env:staging"}, "type": "logs_restriction_queries"}} + When the request is sent + Then the response status is 200 OK + + @skip @skip-terraform-config @team:DataDog/logs-app + Scenario: Revoke role from a restriction query returns "Bad Request" response + Given operation "RemoveRoleFromRestrictionQuery" enabled + And new "RemoveRoleFromRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "malformed_id" + And body with value {"data": {"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "type": "roles"}} + When the request is sent + Then the response status is 400 Bad Request + + @skip @skip-terraform-config @team:DataDog/logs-app + Scenario: Revoke role from a restriction query returns "Not found" response + Given operation "RemoveRoleFromRestrictionQuery" enabled + And new "RemoveRoleFromRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "00000000-0000-0000-0000-000000000000" + And body with value {"data": {"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "type": "roles"}} + When the request is sent + Then the response status is 404 Not found + + @skip @team:DataDog/logs-app + Scenario: Revoke role from a restriction query returns "OK" response + Given operation "RemoveRoleFromRestrictionQuery" enabled + And there is a valid "restriction_query" in the system + And there is a valid "role" in the system + And new "RemoveRoleFromRestrictionQuery" request + And request contains "restriction_query_id" parameter from "restriction_query.data.id" + And body with value {"data": {"id": "{{ role.data.id }}", "type": "roles"}} + When the request is sent + Then the response status is 204 OK + + @skip @skip-terraform-config @team:DataDog/logs-app + Scenario: Update a restriction query returns "Bad Request" response + Given operation "UpdateRestrictionQuery" enabled + And new "UpdateRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "malformed_id" + And body with value {"data": {"attributes": {"restriction_query": "env:sandbox"}, "type": "logs_restriction_queries"}} + When the request is sent + Then the response status is 400 Bad Request + + @skip @skip-terraform-config @team:DataDog/logs-app + Scenario: Update a restriction query returns "Not found" response + Given operation "UpdateRestrictionQuery" enabled + And new "UpdateRestrictionQuery" request + And request contains "restriction_query_id" parameter with value "00000000-0000-0000-0000-000000000000" + And body with value {"data": {"attributes": {"restriction_query": "env:sandbox"}, "type": "logs_restriction_queries"}} + When the request is sent + Then the response status is 404 Not found + + @skip @team:DataDog/logs-app + Scenario: Update a restriction query returns "OK" response + Given operation "UpdateRestrictionQuery" enabled + And there is a valid "restriction_query" in the system + And new "UpdateRestrictionQuery" request + And request contains "restriction_query_id" parameter from "restriction_query.data.id" + And body with value {"data": {"attributes": {"restriction_query": "env:production"}, "type": "logs_restriction_queries"}} + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/teams.feature b/features/v2/teams.feature index bf11bd0316d6..faa1ca0889d5 100644 --- a/features/v2/teams.feature +++ b/features/v2/teams.feature @@ -43,6 +43,25 @@ Feature: Teams When the request is sent Then the response status is 200 Represents a user's association to a team + @team:DataDog/aaa-omg + Scenario: Create a team hierarchy link returns "Conflict" response + Given new "AddTeamHierarchyLink" request + And there is a valid "dd_team" in the system + And there is a valid "dd_team_2" in the system + And there is a valid "team_hierarchy_link" in the system + And body with value {"data": {"relationships": {"parent_team": {"data": {"id": "{{team_hierarchy_link.data.relationships.parent_team.data.id}}", "type": "team"}}, "sub_team": {"data": {"id": "{{team_hierarchy_link.data.relationships.sub_team.data.id}}", "type": "team"}}}, "type": "team_hierarchy_links"}} + When the request is sent + Then the response status is 409 Conflict + + @team:DataDog/aaa-omg + Scenario: Create a team hierarchy link returns "OK" response + Given new "AddTeamHierarchyLink" request + And there is a valid "dd_team" in the system + And there is a valid "dd_team_2" in the system + And body with value {"data": {"relationships": {"parent_team": {"data": {"id": "{{dd_team.data.id}}", "type": "team"}}, "sub_team": {"data": {"id": "{{dd_team_2.data.id}}", "type": "team"}}}, "type": "team_hierarchy_links"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/aaa-omg Scenario: Create a team link returns "API error response." response Given new "CreateTeamLink" request @@ -96,6 +115,28 @@ Feature: Teams And the response "data.attributes.visible_modules" is equal to ["m1","m2"] And the response "data.attributes.hidden_modules" is equal to ["m3"] + @team:DataDog/aaa-omg + Scenario: Get a team hierarchy link returns "API error response." response + Given new "GetTeamHierarchyLink" request + And request contains "link_id" parameter with value "aaa11111-aa11-aa11-aaaa-aaaaaa111111" + When the request is sent + Then the response status is 404 API error response. + + @team:DataDog/aaa-omg + Scenario: Get a team hierarchy link returns "OK" response + Given new "GetTeamHierarchyLink" request + And there is a valid "dd_team" in the system + And there is a valid "dd_team_2" in the system + And there is a valid "team_hierarchy_link" in the system + And request contains "link_id" parameter from "team_hierarchy_link.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "{{ team_hierarchy_link.data.id }}" + And the response "data.relationships.parent_team.data.id" is equal to "{{ dd_team.data.id }}" + And the response "data.relationships.sub_team.data.id" is equal to "{{ dd_team_2.data.id }}" + And the response "included" has item with field "id" with value "{{ dd_team.data.id }}" + And the response "included" has item with field "id" with value "{{ dd_team_2.data.id }}" + @team:DataDog/aaa-omg Scenario: Get a team link returns "API error response." response Given new "GetTeamLink" request @@ -211,6 +252,31 @@ Feature: Teams When the request is sent Then the response status is 200 OK + @team:DataDog/aaa-omg + Scenario: Get team hierarchy links returns "OK" response + Given new "ListTeamHierarchyLinks" request + And there is a valid "dd_team" in the system + And there is a valid "dd_team_2" in the system + And there is a valid "team_hierarchy_link" in the system + And request contains "filter[parent_team]" parameter from "team_hierarchy_link.data.relationships.parent_team.data.id" + And request contains "filter[sub_team]" parameter from "team_hierarchy_link.data.relationships.sub_team.data.id" + And request contains "page[number]" parameter with value 0 + And request contains "page[size]" parameter with value 100 + When the request is sent + Then the response status is 200 OK + And the response "data" has length 1 + And the response "data[0].id" is equal to "{{ team_hierarchy_link.data.id }}" + And the response "data[0].relationships.parent_team.data.id" is equal to "{{ dd_team.data.id }}" + And the response "data[0].relationships.sub_team.data.id" is equal to "{{ dd_team_2.data.id }}" + And the response "included" has item with field "id" with value "{{ dd_team.data.id }}" + And the response "included" has item with field "id" with value "{{ dd_team_2.data.id }}" + + @generated @skip @team:DataDog/aaa-omg @with-pagination + Scenario: Get team hierarchy links returns "OK" response with pagination + Given new "ListTeamHierarchyLinks" request + When the request with pagination is sent + Then the response status is 200 OK + @team:DataDog/aaa-omg Scenario: Get team memberships returns "API error response." response Given new "GetTeamMemberships" request @@ -293,6 +359,23 @@ Feature: Teams When the request is sent Then the response status is 204 No Content + @team:DataDog/aaa-omg + Scenario: Remove a team hierarchy link returns "API error response." response + Given new "RemoveTeamHierarchyLink" request + And request contains "link_id" parameter with value "aaa11111-aa11-aa11-aaaa-aaaaaa111111" + When the request is sent + Then the response status is 404 API error response. + + @team:DataDog/aaa-omg + Scenario: Remove a team hierarchy link returns "No Content" response + Given new "RemoveTeamHierarchyLink" request + And there is a valid "dd_team" in the system + And there is a valid "dd_team_2" in the system + And there is a valid "team_hierarchy_link" in the system + And request contains "link_id" parameter from "team_hierarchy_link.data.id" + When the request is sent + Then the response status is 204 No Content + @team:DataDog/aaa-omg Scenario: Remove a team link returns "API error response." response Given new "DeleteTeamLink" request diff --git a/features/v2/undo.json b/features/v2/undo.json index 3799e64e630d..7c226bf60d33 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -2443,6 +2443,79 @@ "type": "idempotent" } }, + "ListRestrictionQueries": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "safe" + } + }, + "CreateRestrictionQuery": { + "tag": "Logs Restriction Queries", + "undo": { + "operationId": "DeleteRestrictionQuery", + "parameters": [ + { + "name": "restriction_query_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "GetRoleRestrictionQuery": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "safe" + } + }, + "ListUserRestrictionQueries": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "safe" + } + }, + "DeleteRestrictionQuery": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "idempotent" + } + }, + "GetRestrictionQuery": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "safe" + } + }, + "UpdateRestrictionQuery": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "idempotent" + } + }, + "ReplaceRestrictionQuery": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "idempotent" + } + }, + "RemoveRoleFromRestrictionQuery": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "idempotent" + } + }, + "ListRestrictionQueryRoles": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "safe" + } + }, + "AddRoleToRestrictionQuery": { + "tag": "Logs Restriction Queries", + "undo": { + "type": "safe" + } + }, "ListLogsGet": { "tag": "Logs", "undo": { @@ -4345,6 +4418,37 @@ "type": "unsafe" } }, + "ListTeamHierarchyLinks": { + "tag": "Teams", + "undo": { + "type": "safe" + } + }, + "AddTeamHierarchyLink": { + "tag": "Teams", + "undo": { + "operationId": "RemoveTeamHierarchyLink", + "parameters": [ + { + "name": "link_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "RemoveTeamHierarchyLink": { + "tag": "Teams", + "undo": { + "type": "idempotent" + } + }, + "GetTeamHierarchyLink": { + "tag": "Teams", + "undo": { + "type": "safe" + } + }, "DeleteTeamConnections": { "tag": "Team Connections", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 63e87298198b..e650d69e5176 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -279,6 +279,17 @@ def initialize "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/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 427fdcf8659c..b5a2184aca0c 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2823,6 +2823,7 @@ def overrides "v2.logs_query_options" => "LogsQueryOptions", "v2.logs_response_metadata" => "LogsResponseMetadata", "v2.logs_response_metadata_page" => "LogsResponseMetadataPage", + "v2.logs_restriction_queries_type" => "LogsRestrictionQueriesType", "v2.logs_sort" => "LogsSort", "v2.logs_sort_order" => "LogsSortOrder", "v2.logs_storage_tier" => "LogsStorageTier", @@ -3540,6 +3541,22 @@ def overrides "v2.restriction_policy_response" => "RestrictionPolicyResponse", "v2.restriction_policy_type" => "RestrictionPolicyType", "v2.restriction_policy_update_request" => "RestrictionPolicyUpdateRequest", + "v2.restriction_query_attributes" => "RestrictionQueryAttributes", + "v2.restriction_query_create_attributes" => "RestrictionQueryCreateAttributes", + "v2.restriction_query_create_data" => "RestrictionQueryCreateData", + "v2.restriction_query_create_payload" => "RestrictionQueryCreatePayload", + "v2.restriction_query_list_response" => "RestrictionQueryListResponse", + "v2.restriction_query_response_included_item" => "RestrictionQueryResponseIncludedItem", + "v2.restriction_query_role" => "RestrictionQueryRole", + "v2.restriction_query_role_attribute" => "RestrictionQueryRoleAttribute", + "v2.restriction_query_roles_response" => "RestrictionQueryRolesResponse", + "v2.restriction_query_update_attributes" => "RestrictionQueryUpdateAttributes", + "v2.restriction_query_update_data" => "RestrictionQueryUpdateData", + "v2.restriction_query_update_payload" => "RestrictionQueryUpdatePayload", + "v2.restriction_query_without_relationships" => "RestrictionQueryWithoutRelationships", + "v2.restriction_query_without_relationships_response" => "RestrictionQueryWithoutRelationshipsResponse", + "v2.restriction_query_with_relationships" => "RestrictionQueryWithRelationships", + "v2.restriction_query_with_relationships_response" => "RestrictionQueryWithRelationshipsResponse", "v2.retention_filter" => "RetentionFilter", "v2.retention_filter_all" => "RetentionFilterAll", "v2.retention_filter_all_attributes" => "RetentionFilterAllAttributes", @@ -4212,6 +4229,20 @@ def overrides "v2.team_create_attributes" => "TeamCreateAttributes", "v2.team_create_relationships" => "TeamCreateRelationships", "v2.team_create_request" => "TeamCreateRequest", + "v2.team_hierarchy_link" => "TeamHierarchyLink", + "v2.team_hierarchy_link_attributes" => "TeamHierarchyLinkAttributes", + "v2.team_hierarchy_link_create" => "TeamHierarchyLinkCreate", + "v2.team_hierarchy_link_create_relationships" => "TeamHierarchyLinkCreateRelationships", + "v2.team_hierarchy_link_create_request" => "TeamHierarchyLinkCreateRequest", + "v2.team_hierarchy_link_create_team" => "TeamHierarchyLinkCreateTeam", + "v2.team_hierarchy_link_create_team_relationship" => "TeamHierarchyLinkCreateTeamRelationship", + "v2.team_hierarchy_link_relationships" => "TeamHierarchyLinkRelationships", + "v2.team_hierarchy_link_response" => "TeamHierarchyLinkResponse", + "v2.team_hierarchy_links_response" => "TeamHierarchyLinksResponse", + "v2.team_hierarchy_link_team" => "TeamHierarchyLinkTeam", + "v2.team_hierarchy_link_team_attributes" => "TeamHierarchyLinkTeamAttributes", + "v2.team_hierarchy_link_team_relationship" => "TeamHierarchyLinkTeamRelationship", + "v2.team_hierarchy_link_type" => "TeamHierarchyLinkType", "v2.team_included" => "TeamIncluded", "v2.team_link" => "TeamLink", "v2.team_link_attributes" => "TeamLinkAttributes", @@ -4264,6 +4295,9 @@ def overrides "v2.team_routing_rules_request_data_type" => "TeamRoutingRulesRequestDataType", "v2.team_routing_rules_request_rule" => "TeamRoutingRulesRequestRule", "v2.teams_field" => "TeamsField", + "v2.teams_hierarchy_links_response_links" => "TeamsHierarchyLinksResponseLinks", + "v2.teams_hierarchy_links_response_meta" => "TeamsHierarchyLinksResponseMeta", + "v2.teams_hierarchy_links_response_meta_page" => "TeamsHierarchyLinksResponseMetaPage", "v2.teams_response" => "TeamsResponse", "v2.teams_response_links" => "TeamsResponseLinks", "v2.teams_response_meta" => "TeamsResponseMeta", @@ -4579,6 +4613,7 @@ def overrides "v2.logs_archives_api" => "LogsArchivesAPI", "v2.logs_custom_destinations_api" => "LogsCustomDestinationsAPI", "v2.logs_metrics_api" => "LogsMetricsAPI", + "v2.logs_restriction_queries_api" => "LogsRestrictionQueriesAPI", "v2.metrics_api" => "MetricsAPI", "v2.microsoft_teams_integration_api" => "MicrosoftTeamsIntegrationAPI", "v2.monitors_api" => "MonitorsAPI", diff --git a/lib/datadog_api_client/v2/api/logs_restriction_queries_api.rb b/lib/datadog_api_client/v2/api/logs_restriction_queries_api.rb new file mode 100644 index 000000000000..67dbeb449ebb --- /dev/null +++ b/lib/datadog_api_client/v2/api/logs_restriction_queries_api.rb @@ -0,0 +1,842 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'cgi' + +module DatadogAPIClient::V2 + class LogsRestrictionQueriesAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Grant role to a restriction query. + # + # @see #add_role_to_restriction_query_with_http_info + def add_role_to_restriction_query(restriction_query_id, body, opts = {}) + add_role_to_restriction_query_with_http_info(restriction_query_id, body, opts) + nil + end + + # 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 [String] The ID of the restriction query. + # @param body [RelationshipToRole] + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def add_role_to_restriction_query_with_http_info(restriction_query_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.add_role_to_restriction_query".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.add_role_to_restriction_query") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.add_role_to_restriction_query")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.add_role_to_restriction_query ...' + end + # verify the required parameter 'restriction_query_id' is set + if @api_client.config.client_side_validation && restriction_query_id.nil? + fail ArgumentError, "Missing the required parameter 'restriction_query_id' when calling LogsRestrictionQueriesAPI.add_role_to_restriction_query" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling LogsRestrictionQueriesAPI.add_role_to_restriction_query" + end + # resource path + local_var_path = '/api/v2/logs/config/restriction_queries/{restriction_query_id}/roles'.sub('{restriction_query_id}', CGI.escape(restriction_query_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :add_role_to_restriction_query, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LogsRestrictionQueriesAPI#add_role_to_restriction_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Create a restriction query. + # + # @see #create_restriction_query_with_http_info + def create_restriction_query(body, opts = {}) + data, _status_code, _headers = create_restriction_query_with_http_info(body, opts) + data + end + + # Create a restriction query. + # + # Create a new restriction query for your organization. + # + # @param body [RestrictionQueryCreatePayload] + # @param opts [Hash] the optional parameters + # @return [Array<(RestrictionQueryWithoutRelationshipsResponse, Integer, Hash)>] RestrictionQueryWithoutRelationshipsResponse data, response status code and response headers + def create_restriction_query_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_restriction_query".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_restriction_query") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_restriction_query")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.create_restriction_query ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling LogsRestrictionQueriesAPI.create_restriction_query" + end + # resource path + local_var_path = '/api/v2/logs/config/restriction_queries' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'RestrictionQueryWithoutRelationshipsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_restriction_query, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LogsRestrictionQueriesAPI#create_restriction_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete a restriction query. + # + # @see #delete_restriction_query_with_http_info + def delete_restriction_query(restriction_query_id, opts = {}) + delete_restriction_query_with_http_info(restriction_query_id, opts) + nil + end + + # Delete a restriction query. + # + # Deletes a restriction query. + # + # @param restriction_query_id [String] The ID of the restriction query. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_restriction_query_with_http_info(restriction_query_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_restriction_query".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_restriction_query") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_restriction_query")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.delete_restriction_query ...' + end + # verify the required parameter 'restriction_query_id' is set + if @api_client.config.client_side_validation && restriction_query_id.nil? + fail ArgumentError, "Missing the required parameter 'restriction_query_id' when calling LogsRestrictionQueriesAPI.delete_restriction_query" + end + # resource path + local_var_path = '/api/v2/logs/config/restriction_queries/{restriction_query_id}'.sub('{restriction_query_id}', CGI.escape(restriction_query_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_restriction_query, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LogsRestrictionQueriesAPI#delete_restriction_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get a restriction query. + # + # @see #get_restriction_query_with_http_info + def get_restriction_query(restriction_query_id, opts = {}) + data, _status_code, _headers = get_restriction_query_with_http_info(restriction_query_id, opts) + data + end + + # Get a restriction query. + # + # Get a restriction query in the organization specified by the restriction query's `restriction_query_id`. + # + # @param restriction_query_id [String] The ID of the restriction query. + # @param opts [Hash] the optional parameters + # @return [Array<(RestrictionQueryWithRelationshipsResponse, Integer, Hash)>] RestrictionQueryWithRelationshipsResponse data, response status code and response headers + def get_restriction_query_with_http_info(restriction_query_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_restriction_query".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_restriction_query") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_restriction_query")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.get_restriction_query ...' + end + # verify the required parameter 'restriction_query_id' is set + if @api_client.config.client_side_validation && restriction_query_id.nil? + fail ArgumentError, "Missing the required parameter 'restriction_query_id' when calling LogsRestrictionQueriesAPI.get_restriction_query" + end + # resource path + local_var_path = '/api/v2/logs/config/restriction_queries/{restriction_query_id}'.sub('{restriction_query_id}', CGI.escape(restriction_query_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'RestrictionQueryWithRelationshipsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_restriction_query, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LogsRestrictionQueriesAPI#get_restriction_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get restriction query for a given role. + # + # @see #get_role_restriction_query_with_http_info + def get_role_restriction_query(role_id, opts = {}) + data, _status_code, _headers = get_role_restriction_query_with_http_info(role_id, opts) + data + end + + # Get restriction query for a given role. + # + # Get restriction query for a given role. + # + # @param role_id [String] The ID of the role. + # @param opts [Hash] the optional parameters + # @return [Array<(RestrictionQueryListResponse, Integer, Hash)>] RestrictionQueryListResponse data, response status code and response headers + def get_role_restriction_query_with_http_info(role_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_role_restriction_query".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_role_restriction_query") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_role_restriction_query")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.get_role_restriction_query ...' + end + # verify the required parameter 'role_id' is set + if @api_client.config.client_side_validation && role_id.nil? + fail ArgumentError, "Missing the required parameter 'role_id' when calling LogsRestrictionQueriesAPI.get_role_restriction_query" + end + # resource path + local_var_path = '/api/v2/logs/config/restriction_queries/role/{role_id}'.sub('{role_id}', CGI.escape(role_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'RestrictionQueryListResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_role_restriction_query, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LogsRestrictionQueriesAPI#get_role_restriction_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List restriction queries. + # + # @see #list_restriction_queries_with_http_info + def list_restriction_queries(opts = {}) + data, _status_code, _headers = list_restriction_queries_with_http_info(opts) + data + end + + # List restriction queries. + # + # Returns all restriction queries, including their names and IDs. + # + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. + # @option opts [Integer] :page_number Specific page number to return. + # @return [Array<(RestrictionQueryListResponse, Integer, Hash)>] RestrictionQueryListResponse data, response status code and response headers + def list_restriction_queries_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_restriction_queries".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_restriction_queries") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_restriction_queries")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.list_restriction_queries ...' + end + # resource path + local_var_path = '/api/v2/logs/config/restriction_queries' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'RestrictionQueryListResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_restriction_queries, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LogsRestrictionQueriesAPI#list_restriction_queries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List roles for a restriction query. + # + # @see #list_restriction_query_roles_with_http_info + def list_restriction_query_roles(restriction_query_id, opts = {}) + data, _status_code, _headers = list_restriction_query_roles_with_http_info(restriction_query_id, opts) + data + end + + # List roles for a restriction query. + # + # Returns all roles that have a given restriction query. + # + # @param restriction_query_id [String] The ID of the restriction query. + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. + # @option opts [Integer] :page_number Specific page number to return. + # @return [Array<(RestrictionQueryRolesResponse, Integer, Hash)>] RestrictionQueryRolesResponse data, response status code and response headers + def list_restriction_query_roles_with_http_info(restriction_query_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_restriction_query_roles".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_restriction_query_roles") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_restriction_query_roles")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.list_restriction_query_roles ...' + end + # verify the required parameter 'restriction_query_id' is set + if @api_client.config.client_side_validation && restriction_query_id.nil? + fail ArgumentError, "Missing the required parameter 'restriction_query_id' when calling LogsRestrictionQueriesAPI.list_restriction_query_roles" + end + # resource path + local_var_path = '/api/v2/logs/config/restriction_queries/{restriction_query_id}/roles'.sub('{restriction_query_id}', CGI.escape(restriction_query_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'RestrictionQueryRolesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_restriction_query_roles, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LogsRestrictionQueriesAPI#list_restriction_query_roles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get all restriction queries for a given user. + # + # @see #list_user_restriction_queries_with_http_info + def list_user_restriction_queries(user_id, opts = {}) + data, _status_code, _headers = list_user_restriction_queries_with_http_info(user_id, opts) + data + end + + # Get all restriction queries for a given user. + # + # Get all restriction queries for a given user. + # + # @param user_id [String] The ID of the user. + # @param opts [Hash] the optional parameters + # @return [Array<(RestrictionQueryListResponse, Integer, Hash)>] RestrictionQueryListResponse data, response status code and response headers + def list_user_restriction_queries_with_http_info(user_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_user_restriction_queries".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_user_restriction_queries") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_user_restriction_queries")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.list_user_restriction_queries ...' + end + # verify the required parameter 'user_id' is set + if @api_client.config.client_side_validation && user_id.nil? + fail ArgumentError, "Missing the required parameter 'user_id' when calling LogsRestrictionQueriesAPI.list_user_restriction_queries" + end + # resource path + local_var_path = '/api/v2/logs/config/restriction_queries/user/{user_id}'.sub('{user_id}', CGI.escape(user_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'RestrictionQueryListResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_user_restriction_queries, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LogsRestrictionQueriesAPI#list_user_restriction_queries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Revoke role from a restriction query. + # + # @see #remove_role_from_restriction_query_with_http_info + def remove_role_from_restriction_query(restriction_query_id, body, opts = {}) + remove_role_from_restriction_query_with_http_info(restriction_query_id, body, opts) + nil + end + + # Revoke role from a restriction query. + # + # Removes a role from a restriction query. + # + # @param restriction_query_id [String] The ID of the restriction query. + # @param body [RelationshipToRole] + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def remove_role_from_restriction_query_with_http_info(restriction_query_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.remove_role_from_restriction_query".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.remove_role_from_restriction_query") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.remove_role_from_restriction_query")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.remove_role_from_restriction_query ...' + end + # verify the required parameter 'restriction_query_id' is set + if @api_client.config.client_side_validation && restriction_query_id.nil? + fail ArgumentError, "Missing the required parameter 'restriction_query_id' when calling LogsRestrictionQueriesAPI.remove_role_from_restriction_query" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling LogsRestrictionQueriesAPI.remove_role_from_restriction_query" + end + # resource path + local_var_path = '/api/v2/logs/config/restriction_queries/{restriction_query_id}/roles'.sub('{restriction_query_id}', CGI.escape(restriction_query_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :remove_role_from_restriction_query, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LogsRestrictionQueriesAPI#remove_role_from_restriction_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Replace a restriction query. + # + # @see #replace_restriction_query_with_http_info + def replace_restriction_query(restriction_query_id, body, opts = {}) + data, _status_code, _headers = replace_restriction_query_with_http_info(restriction_query_id, body, opts) + data + end + + # Replace a restriction query. + # + # Replace a restriction query. + # + # @param restriction_query_id [String] The ID of the restriction query. + # @param body [RestrictionQueryUpdatePayload] + # @param opts [Hash] the optional parameters + # @return [Array<(RestrictionQueryWithoutRelationshipsResponse, Integer, Hash)>] RestrictionQueryWithoutRelationshipsResponse data, response status code and response headers + def replace_restriction_query_with_http_info(restriction_query_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.replace_restriction_query".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.replace_restriction_query") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.replace_restriction_query")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.replace_restriction_query ...' + end + # verify the required parameter 'restriction_query_id' is set + if @api_client.config.client_side_validation && restriction_query_id.nil? + fail ArgumentError, "Missing the required parameter 'restriction_query_id' when calling LogsRestrictionQueriesAPI.replace_restriction_query" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling LogsRestrictionQueriesAPI.replace_restriction_query" + end + # resource path + local_var_path = '/api/v2/logs/config/restriction_queries/{restriction_query_id}'.sub('{restriction_query_id}', CGI.escape(restriction_query_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'RestrictionQueryWithoutRelationshipsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :replace_restriction_query, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LogsRestrictionQueriesAPI#replace_restriction_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update a restriction query. + # + # @see #update_restriction_query_with_http_info + def update_restriction_query(restriction_query_id, body, opts = {}) + data, _status_code, _headers = update_restriction_query_with_http_info(restriction_query_id, body, opts) + data + end + + # Update a restriction query. + # + # Edit a restriction query. + # + # @param restriction_query_id [String] The ID of the restriction query. + # @param body [RestrictionQueryUpdatePayload] + # @param opts [Hash] the optional parameters + # @return [Array<(RestrictionQueryWithoutRelationshipsResponse, Integer, Hash)>] RestrictionQueryWithoutRelationshipsResponse data, response status code and response headers + def update_restriction_query_with_http_info(restriction_query_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_restriction_query".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_restriction_query") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_restriction_query")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LogsRestrictionQueriesAPI.update_restriction_query ...' + end + # verify the required parameter 'restriction_query_id' is set + if @api_client.config.client_side_validation && restriction_query_id.nil? + fail ArgumentError, "Missing the required parameter 'restriction_query_id' when calling LogsRestrictionQueriesAPI.update_restriction_query" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling LogsRestrictionQueriesAPI.update_restriction_query" + end + # resource path + local_var_path = '/api/v2/logs/config/restriction_queries/{restriction_query_id}'.sub('{restriction_query_id}', CGI.escape(restriction_query_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'RestrictionQueryWithoutRelationshipsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_restriction_query, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: LogsRestrictionQueriesAPI#update_restriction_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/datadog_api_client/v2/api/teams_api.rb b/lib/datadog_api_client/v2/api/teams_api.rb index 96bff506dfd9..f33f44e17753 100644 --- a/lib/datadog_api_client/v2/api/teams_api.rb +++ b/lib/datadog_api_client/v2/api/teams_api.rb @@ -36,11 +36,16 @@ def add_member_team(super_team_id, body, opts = {}) # 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`. + # + # @deprecated This API is deprecated. + # # @param super_team_id [String] None # @param body [AddMemberTeamRequest] # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def add_member_team_with_http_info(super_team_id, body, opts = {}) + warn "[DEPRECATION] `AddMemberTeam` is deprecated." unstable_enabled = @api_client.config.unstable_operations["v2.add_member_team".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.add_member_team") @@ -102,6 +107,73 @@ def add_member_team_with_http_info(super_team_id, body, opts = {}) return data, status_code, headers end + # Create a team hierarchy link. + # + # @see #add_team_hierarchy_link_with_http_info + def add_team_hierarchy_link(body, opts = {}) + data, _status_code, _headers = add_team_hierarchy_link_with_http_info(body, opts) + data + end + + # Create a team hierarchy link. + # + # Create a new team hierarchy link between a parent team and a sub team. + # + # @param body [TeamHierarchyLinkCreateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(TeamHierarchyLinkResponse, Integer, Hash)>] TeamHierarchyLinkResponse data, response status code and response headers + def add_team_hierarchy_link_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TeamsAPI.add_team_hierarchy_link ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling TeamsAPI.add_team_hierarchy_link" + end + # resource path + local_var_path = '/api/v2/team-hierarchy-links' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'TeamHierarchyLinkResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :add_team_hierarchy_link, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: TeamsAPI#add_team_hierarchy_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create a team. # # @see #create_team_with_http_info @@ -584,6 +656,71 @@ def get_team_with_http_info(team_id, opts = {}) return data, status_code, headers end + # Get a team hierarchy link. + # + # @see #get_team_hierarchy_link_with_http_info + def get_team_hierarchy_link(link_id, opts = {}) + data, _status_code, _headers = get_team_hierarchy_link_with_http_info(link_id, opts) + data + end + + # Get a team hierarchy link. + # + # Get a single team hierarchy link for the given link_id. + # + # @param link_id [String] The team hierarchy link's identifier + # @param opts [Hash] the optional parameters + # @return [Array<(TeamHierarchyLinkResponse, Integer, Hash)>] TeamHierarchyLinkResponse data, response status code and response headers + def get_team_hierarchy_link_with_http_info(link_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TeamsAPI.get_team_hierarchy_link ...' + end + # verify the required parameter 'link_id' is set + if @api_client.config.client_side_validation && link_id.nil? + fail ArgumentError, "Missing the required parameter 'link_id' when calling TeamsAPI.get_team_hierarchy_link" + end + # resource path + local_var_path = '/api/v2/team-hierarchy-links/{link_id}'.sub('{link_id}', CGI.escape(link_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'TeamHierarchyLinkResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_team_hierarchy_link, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: TeamsAPI#get_team_hierarchy_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get a team link. # # @see #get_team_link_with_http_info @@ -1038,6 +1175,11 @@ def list_member_teams(super_team_id, opts = {}) # # 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`. + # + # @deprecated This API is deprecated. + # # @param super_team_id [String] None # @param opts [Hash] the optional parameters # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. @@ -1045,6 +1187,7 @@ def list_member_teams(super_team_id, opts = {}) # @option opts [Array] :fields_team List of fields that need to be fetched. # @return [Array<(TeamsResponse, Integer, Hash)>] TeamsResponse data, response status code and response headers def list_member_teams_with_http_info(super_team_id, opts = {}) + warn "[DEPRECATION] `ListMemberTeams` is deprecated." unstable_enabled = @api_client.config.unstable_operations["v2.list_member_teams".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_member_teams") @@ -1125,6 +1268,96 @@ def list_member_teams_with_pagination(super_team_id, opts = {}) end end + # Get team hierarchy links. + # + # @see #list_team_hierarchy_links_with_http_info + def list_team_hierarchy_links(opts = {}) + data, _status_code, _headers = list_team_hierarchy_links_with_http_info(opts) + data + end + + # Get team hierarchy links. + # + # List all team hierarchy links that match the provided filters. + # + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page_number Specific page number to return. + # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. + # @option opts [String] :filter_parent_team Filter by parent team ID + # @option opts [String] :filter_sub_team Filter by sub team ID + # @return [Array<(TeamHierarchyLinksResponse, Integer, Hash)>] TeamHierarchyLinksResponse data, response status code and response headers + def list_team_hierarchy_links_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TeamsAPI.list_team_hierarchy_links ...' + end + # resource path + local_var_path = '/api/v2/team-hierarchy-links' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'filter[parent_team]'] = opts[:'filter_parent_team'] if !opts[:'filter_parent_team'].nil? + query_params[:'filter[sub_team]'] = opts[:'filter_sub_team'] if !opts[:'filter_sub_team'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'TeamHierarchyLinksResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_team_hierarchy_links, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: TeamsAPI#list_team_hierarchy_links\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get team hierarchy links. + # + # Provide a paginated version of {#list_team_hierarchy_links}, returning all items. + # + # To use it you need to use a block: list_team_hierarchy_links_with_pagination { |item| p item } + # + # @yield [TeamHierarchyLink] Paginated items + def list_team_hierarchy_links_with_pagination(opts = {}) + api_version = "V2" + page_size = @api_client.get_attribute_from_path(opts, "page_size", 10) + @api_client.set_attribute_from_path(api_version, opts, "page_size", Integer, page_size) + @api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, 0) + while true do + response = list_team_hierarchy_links(opts) + @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } + if @api_client.get_attribute_from_path(response, "data").length < page_size + break + end + @api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, @api_client.get_attribute_from_path(opts, "page_number", 0) + 1) + end + end + # Get all teams. # # @see #list_teams_with_http_info @@ -1239,11 +1472,16 @@ def remove_member_team(super_team_id, member_team_id, opts = {}) # # 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}`. + # + # @deprecated This API is deprecated. + # # @param super_team_id [String] None # @param member_team_id [String] None # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def remove_member_team_with_http_info(super_team_id, member_team_id, opts = {}) + warn "[DEPRECATION] `RemoveMemberTeam` is deprecated." unstable_enabled = @api_client.config.unstable_operations["v2.remove_member_team".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.remove_member_team") @@ -1303,6 +1541,71 @@ def remove_member_team_with_http_info(super_team_id, member_team_id, opts = {}) return data, status_code, headers end + # Remove a team hierarchy link. + # + # @see #remove_team_hierarchy_link_with_http_info + def remove_team_hierarchy_link(link_id, opts = {}) + remove_team_hierarchy_link_with_http_info(link_id, opts) + nil + end + + # Remove a team hierarchy link. + # + # Remove a team hierarchy link by the given link_id. + # + # @param link_id [String] The team hierarchy link's identifier + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def remove_team_hierarchy_link_with_http_info(link_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TeamsAPI.remove_team_hierarchy_link ...' + end + # verify the required parameter 'link_id' is set + if @api_client.config.client_side_validation && link_id.nil? + fail ArgumentError, "Missing the required parameter 'link_id' when calling TeamsAPI.remove_team_hierarchy_link" + end + # resource path + local_var_path = '/api/v2/team-hierarchy-links/{link_id}'.sub('{link_id}', CGI.escape(link_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :remove_team_hierarchy_link, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: TeamsAPI#remove_team_hierarchy_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Link Teams with GitHub Teams. # # @see #sync_teams_with_http_info diff --git a/lib/datadog_api_client/v2/models/logs_restriction_queries_type.rb b/lib/datadog_api_client/v2/models/logs_restriction_queries_type.rb new file mode 100644 index 000000000000..cf3d1a381987 --- /dev/null +++ b/lib/datadog_api_client/v2/models/logs_restriction_queries_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Restriction query resource type. + class LogsRestrictionQueriesType + include BaseEnumModel + + LOGS_RESTRICTION_QUERIES = "logs_restriction_queries".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/relationship_to_user_team_permission.rb b/lib/datadog_api_client/v2/models/relationship_to_user_team_permission.rb index eece02fd4e80..a2abda5524e2 100644 --- a/lib/datadog_api_client/v2/models/relationship_to_user_team_permission.rb +++ b/lib/datadog_api_client/v2/models/relationship_to_user_team_permission.rb @@ -47,6 +47,14 @@ def self.openapi_types } end + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'data', + ]) + end + # Initializes the object # @param attributes [Hash] Model attributes in the form of hash # @!visibility private diff --git a/lib/datadog_api_client/v2/models/restriction_query_attributes.rb b/lib/datadog_api_client/v2/models/restriction_query_attributes.rb new file mode 100644 index 000000000000..0f88ebe69878 --- /dev/null +++ b/lib/datadog_api_client/v2/models/restriction_query_attributes.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of the restriction query. + class RestrictionQueryAttributes + include BaseGenericModel + + # Creation time of the restriction query. + attr_accessor :created_at + + # Email of the user who last modified this restriction query. + attr_accessor :last_modifier_email + + # Name of the user who last modified this restriction query. + attr_accessor :last_modifier_name + + # Time of last restriction query modification. + attr_accessor :modified_at + + # The query that defines the restriction. Only the content matching the query can be returned. + attr_accessor :restriction_query + + # Number of roles associated with this restriction query. + attr_accessor :role_count + + # Number of users associated with this restriction query. + attr_accessor :user_count + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.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' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'last_modifier_email' => :'String', + :'last_modifier_name' => :'String', + :'modified_at' => :'Time', + :'restriction_query' => :'String', + :'role_count' => :'Integer', + :'user_count' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RestrictionQueryAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'last_modifier_email') + self.last_modifier_email = attributes[:'last_modifier_email'] + end + + if attributes.key?(:'last_modifier_name') + self.last_modifier_name = attributes[:'last_modifier_name'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'restriction_query') + self.restriction_query = attributes[:'restriction_query'] + end + + if attributes.key?(:'role_count') + self.role_count = attributes[:'role_count'] + end + + if attributes.key?(:'user_count') + self.user_count = attributes[:'user_count'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_at == o.created_at && + last_modifier_email == o.last_modifier_email && + last_modifier_name == o.last_modifier_name && + modified_at == o.modified_at && + restriction_query == o.restriction_query && + role_count == o.role_count && + user_count == o.user_count && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, last_modifier_email, last_modifier_name, modified_at, restriction_query, role_count, user_count, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/restriction_query_create_attributes.rb b/lib/datadog_api_client/v2/models/restriction_query_create_attributes.rb new file mode 100644 index 000000000000..db820fba835e --- /dev/null +++ b/lib/datadog_api_client/v2/models/restriction_query_create_attributes.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of the created restriction query. + class RestrictionQueryCreateAttributes + include BaseGenericModel + + # The restriction query. + attr_reader :restriction_query + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'restriction_query' => :'restriction_query' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'restriction_query' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RestrictionQueryCreateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'restriction_query') + self.restriction_query = attributes[:'restriction_query'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @restriction_query.nil? + true + end + + # Custom attribute writer method with validation + # @param restriction_query [Object] Object to be assigned + # @!visibility private + def restriction_query=(restriction_query) + if restriction_query.nil? + fail ArgumentError, 'invalid value for "restriction_query", restriction_query cannot be nil.' + end + @restriction_query = restriction_query + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + restriction_query == o.restriction_query && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [restriction_query, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/restriction_query_create_data.rb b/lib/datadog_api_client/v2/models/restriction_query_create_data.rb new file mode 100644 index 000000000000..ee9251d2e151 --- /dev/null +++ b/lib/datadog_api_client/v2/models/restriction_query_create_data.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data related to the creation of a restriction query. + class RestrictionQueryCreateData + include BaseGenericModel + + # Attributes of the created restriction query. + attr_accessor :attributes + + # Restriction query resource type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'RestrictionQueryCreateAttributes', + :'type' => :'LogsRestrictionQueriesType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RestrictionQueryCreateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/restriction_query_create_payload.rb b/lib/datadog_api_client/v2/models/restriction_query_create_payload.rb new file mode 100644 index 000000000000..4b9bb5171a73 --- /dev/null +++ b/lib/datadog_api_client/v2/models/restriction_query_create_payload.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Create a restriction query. + class RestrictionQueryCreatePayload + include BaseGenericModel + + # Data related to the creation of a restriction query. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'RestrictionQueryCreateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RestrictionQueryCreatePayload` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/restriction_query_list_response.rb b/lib/datadog_api_client/v2/models/restriction_query_list_response.rb new file mode 100644 index 000000000000..0aeeb7f82da3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/restriction_query_list_response.rb @@ -0,0 +1,107 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing information about multiple restriction queries. + class RestrictionQueryListResponse + include BaseGenericModel + + # Array of returned restriction queries. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RestrictionQueryListResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/restriction_query_response_included_item.rb b/lib/datadog_api_client/v2/models/restriction_query_response_included_item.rb new file mode 100644 index 000000000000..14d7112d1ffa --- /dev/null +++ b/lib/datadog_api_client/v2/models/restriction_query_response_included_item.rb @@ -0,0 +1,62 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # An object related to a restriction query. + module RestrictionQueryResponseIncludedItem + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'RestrictionQueryRole' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/restriction_query_role.rb b/lib/datadog_api_client/v2/models/restriction_query_role.rb new file mode 100644 index 000000000000..bf974be7cd19 --- /dev/null +++ b/lib/datadog_api_client/v2/models/restriction_query_role.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Partial role object. + class RestrictionQueryRole + include BaseGenericModel + + # Attributes of the role for a restriction query. + attr_reader :attributes + + # ID of the role. + attr_reader :id + + # Roles type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'RestrictionQueryRoleAttribute', + :'id' => :'String', + :'type' => :'RolesType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RestrictionQueryRole` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/restriction_query_role_attribute.rb b/lib/datadog_api_client/v2/models/restriction_query_role_attribute.rb new file mode 100644 index 000000000000..3f634ea831e5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/restriction_query_role_attribute.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of the role for a restriction query. + class RestrictionQueryRoleAttribute + include BaseGenericModel + + # The role name. + attr_accessor :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RestrictionQueryRoleAttribute` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/restriction_query_roles_response.rb b/lib/datadog_api_client/v2/models/restriction_query_roles_response.rb new file mode 100644 index 000000000000..a0c2f48dd5bb --- /dev/null +++ b/lib/datadog_api_client/v2/models/restriction_query_roles_response.rb @@ -0,0 +1,107 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing information about roles attached to a restriction query. + class RestrictionQueryRolesResponse + include BaseGenericModel + + # Array of roles. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RestrictionQueryRolesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/restriction_query_update_attributes.rb b/lib/datadog_api_client/v2/models/restriction_query_update_attributes.rb new file mode 100644 index 000000000000..9dff7072fcfe --- /dev/null +++ b/lib/datadog_api_client/v2/models/restriction_query_update_attributes.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of the edited restriction query. + class RestrictionQueryUpdateAttributes + include BaseGenericModel + + # The restriction query. + attr_reader :restriction_query + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'restriction_query' => :'restriction_query' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'restriction_query' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RestrictionQueryUpdateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'restriction_query') + self.restriction_query = attributes[:'restriction_query'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @restriction_query.nil? + true + end + + # Custom attribute writer method with validation + # @param restriction_query [Object] Object to be assigned + # @!visibility private + def restriction_query=(restriction_query) + if restriction_query.nil? + fail ArgumentError, 'invalid value for "restriction_query", restriction_query cannot be nil.' + end + @restriction_query = restriction_query + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + restriction_query == o.restriction_query && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [restriction_query, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/restriction_query_update_data.rb b/lib/datadog_api_client/v2/models/restriction_query_update_data.rb new file mode 100644 index 000000000000..6d368e9930ba --- /dev/null +++ b/lib/datadog_api_client/v2/models/restriction_query_update_data.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data related to the update of a restriction query. + class RestrictionQueryUpdateData + include BaseGenericModel + + # Attributes of the edited restriction query. + attr_accessor :attributes + + # Restriction query resource type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'RestrictionQueryUpdateAttributes', + :'type' => :'LogsRestrictionQueriesType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RestrictionQueryUpdateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/restriction_query_update_payload.rb b/lib/datadog_api_client/v2/models/restriction_query_update_payload.rb new file mode 100644 index 000000000000..68afbe119ea9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/restriction_query_update_payload.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Update a restriction query. + class RestrictionQueryUpdatePayload + include BaseGenericModel + + # Data related to the update of a restriction query. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'RestrictionQueryUpdateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RestrictionQueryUpdatePayload` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/restriction_query_with_relationships.rb b/lib/datadog_api_client/v2/models/restriction_query_with_relationships.rb new file mode 100644 index 000000000000..739a232c30d7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/restriction_query_with_relationships.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Restriction query object returned by the API. + class RestrictionQueryWithRelationships + include BaseGenericModel + + # Attributes of the restriction query. + attr_accessor :attributes + + # ID of the restriction query. + attr_accessor :id + + # Relationships of the user object. + attr_accessor :relationships + + # Restriction query resource type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'RestrictionQueryAttributes', + :'id' => :'String', + :'relationships' => :'UserRelationships', + :'type' => :'LogsRestrictionQueriesType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RestrictionQueryWithRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/restriction_query_with_relationships_response.rb b/lib/datadog_api_client/v2/models/restriction_query_with_relationships_response.rb new file mode 100644 index 000000000000..2a32ef9583ff --- /dev/null +++ b/lib/datadog_api_client/v2/models/restriction_query_with_relationships_response.rb @@ -0,0 +1,117 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing information about a single restriction query. + class RestrictionQueryWithRelationshipsResponse + include BaseGenericModel + + # Restriction query object returned by the API. + attr_accessor :data + + # Array of objects related to the restriction query. + attr_accessor :included + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'RestrictionQueryWithRelationships', + :'included' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RestrictionQueryWithRelationshipsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + included == o.included && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/restriction_query_without_relationships.rb b/lib/datadog_api_client/v2/models/restriction_query_without_relationships.rb new file mode 100644 index 000000000000..d593704eceb2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/restriction_query_without_relationships.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Restriction query object returned by the API. + class RestrictionQueryWithoutRelationships + include BaseGenericModel + + # Attributes of the restriction query. + attr_accessor :attributes + + # ID of the restriction query. + attr_accessor :id + + # Restriction queries type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'RestrictionQueryAttributes', + :'id' => :'String', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RestrictionQueryWithoutRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/restriction_query_without_relationships_response.rb b/lib/datadog_api_client/v2/models/restriction_query_without_relationships_response.rb new file mode 100644 index 000000000000..3dea0cd10997 --- /dev/null +++ b/lib/datadog_api_client/v2/models/restriction_query_without_relationships_response.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing information about a single restriction query. + class RestrictionQueryWithoutRelationshipsResponse + include BaseGenericModel + + # Restriction query object returned by the API. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'RestrictionQueryWithoutRelationships' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RestrictionQueryWithoutRelationshipsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/team_attributes.rb b/lib/datadog_api_client/v2/models/team_attributes.rb index 0e1b15cb3811..ce7277f30711 100644 --- a/lib/datadog_api_client/v2/models/team_attributes.rb +++ b/lib/datadog_api_client/v2/models/team_attributes.rb @@ -39,6 +39,9 @@ class TeamAttributes # Collection of hidden modules for the team attr_accessor :hidden_modules + # Whether the team is managed from an external source + attr_accessor :is_managed + # The number of links belonging to the team attr_reader :link_count @@ -69,6 +72,7 @@ def self.attribute_map :'description' => :'description', :'handle' => :'handle', :'hidden_modules' => :'hidden_modules', + :'is_managed' => :'is_managed', :'link_count' => :'link_count', :'modified_at' => :'modified_at', :'name' => :'name', @@ -88,6 +92,7 @@ def self.openapi_types :'description' => :'String', :'handle' => :'String', :'hidden_modules' => :'Array', + :'is_managed' => :'Boolean', :'link_count' => :'Integer', :'modified_at' => :'Time', :'name' => :'String', @@ -104,7 +109,9 @@ def self.openapi_nullable :'avatar', :'banner', :'description', + :'hidden_modules', :'summary', + :'visible_modules', ]) end @@ -152,6 +159,10 @@ def initialize(attributes = {}) end end + if attributes.key?(:'is_managed') + self.is_managed = attributes[:'is_managed'] + end + if attributes.key?(:'link_count') self.link_count = attributes[:'link_count'] end @@ -281,6 +292,7 @@ def ==(o) description == o.description && handle == o.handle && hidden_modules == o.hidden_modules && + is_managed == o.is_managed && link_count == o.link_count && modified_at == o.modified_at && name == o.name && @@ -294,7 +306,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [avatar, banner, created_at, description, handle, hidden_modules, link_count, modified_at, name, summary, user_count, visible_modules, additional_properties].hash + [avatar, banner, created_at, description, handle, hidden_modules, is_managed, link_count, modified_at, name, summary, user_count, visible_modules, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/team_hierarchy_link.rb b/lib/datadog_api_client/v2/models/team_hierarchy_link.rb new file mode 100644 index 000000000000..6a123133872f --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_hierarchy_link.rb @@ -0,0 +1,175 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Team hierarchy link + class TeamHierarchyLink + include BaseGenericModel + + # Team hierarchy link attributes + attr_reader :attributes + + # The team hierarchy link's identifier + attr_reader :id + + # Team hierarchy link relationships + attr_accessor :relationships + + # Team hierarchy link type + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'TeamHierarchyLinkAttributes', + :'id' => :'String', + :'relationships' => :'TeamHierarchyLinkRelationships', + :'type' => :'TeamHierarchyLinkType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamHierarchyLink` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/team_hierarchy_link_attributes.rb b/lib/datadog_api_client/v2/models/team_hierarchy_link_attributes.rb new file mode 100644 index 000000000000..e6dc55c80135 --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_hierarchy_link_attributes.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Team hierarchy link attributes + class TeamHierarchyLinkAttributes + include BaseGenericModel + + # Timestamp when the team hierarchy link was created + attr_reader :created_at + + # The provisioner of the team hierarchy link + attr_reader :provisioned_by + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_at' => :'created_at', + :'provisioned_by' => :'provisioned_by' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'provisioned_by' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamHierarchyLinkAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'provisioned_by') + self.provisioned_by = attributes[:'provisioned_by'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created_at.nil? + return false if @provisioned_by.nil? + true + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param provisioned_by [Object] Object to be assigned + # @!visibility private + def provisioned_by=(provisioned_by) + if provisioned_by.nil? + fail ArgumentError, 'invalid value for "provisioned_by", provisioned_by cannot be nil.' + end + @provisioned_by = provisioned_by + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_at == o.created_at && + provisioned_by == o.provisioned_by && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, provisioned_by, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/team_hierarchy_link_create.rb b/lib/datadog_api_client/v2/models/team_hierarchy_link_create.rb new file mode 100644 index 000000000000..4fd53aafd4ec --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_hierarchy_link_create.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data provided when creating a team hierarchy link + class TeamHierarchyLinkCreate + include BaseGenericModel + + # The related teams that will be connected by the team hierarchy link + attr_reader :relationships + + # Team hierarchy link type + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'relationships' => :'TeamHierarchyLinkCreateRelationships', + :'type' => :'TeamHierarchyLinkType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamHierarchyLinkCreate` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @relationships.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param relationships [Object] Object to be assigned + # @!visibility private + def relationships=(relationships) + if relationships.nil? + fail ArgumentError, 'invalid value for "relationships", relationships cannot be nil.' + end + @relationships = relationships + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/team_hierarchy_link_create_relationships.rb b/lib/datadog_api_client/v2/models/team_hierarchy_link_create_relationships.rb new file mode 100644 index 000000000000..bba599d772d7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_hierarchy_link_create_relationships.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The related teams that will be connected by the team hierarchy link + class TeamHierarchyLinkCreateRelationships + include BaseGenericModel + + # Data about each team that will be connected by the team hierarchy link + attr_reader :parent_team + + # Data about each team that will be connected by the team hierarchy link + attr_reader :sub_team + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'parent_team' => :'parent_team', + :'sub_team' => :'sub_team' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'parent_team' => :'TeamHierarchyLinkCreateTeamRelationship', + :'sub_team' => :'TeamHierarchyLinkCreateTeamRelationship' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamHierarchyLinkCreateRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'parent_team') + self.parent_team = attributes[:'parent_team'] + end + + if attributes.key?(:'sub_team') + self.sub_team = attributes[:'sub_team'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @parent_team.nil? + return false if @sub_team.nil? + true + end + + # Custom attribute writer method with validation + # @param parent_team [Object] Object to be assigned + # @!visibility private + def parent_team=(parent_team) + if parent_team.nil? + fail ArgumentError, 'invalid value for "parent_team", parent_team cannot be nil.' + end + @parent_team = parent_team + end + + # Custom attribute writer method with validation + # @param sub_team [Object] Object to be assigned + # @!visibility private + def sub_team=(sub_team) + if sub_team.nil? + fail ArgumentError, 'invalid value for "sub_team", sub_team cannot be nil.' + end + @sub_team = sub_team + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + parent_team == o.parent_team && + sub_team == o.sub_team && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [parent_team, sub_team, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/team_hierarchy_link_create_request.rb b/lib/datadog_api_client/v2/models/team_hierarchy_link_create_request.rb new file mode 100644 index 000000000000..7a6330c0da03 --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_hierarchy_link_create_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to create a team hierarchy link + class TeamHierarchyLinkCreateRequest + include BaseGenericModel + + # Data provided when creating a team hierarchy link + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'TeamHierarchyLinkCreate' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamHierarchyLinkCreateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/team_hierarchy_link_create_team.rb b/lib/datadog_api_client/v2/models/team_hierarchy_link_create_team.rb new file mode 100644 index 000000000000..7eec7efad6fa --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_hierarchy_link_create_team.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # This schema defines the attributes about each team that has to be provided when creating a team hierarchy link + class TeamHierarchyLinkCreateTeam + include BaseGenericModel + + # The team's identifier + attr_reader :id + + # Team type + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'TeamType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamHierarchyLinkCreateTeam` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/team_hierarchy_link_create_team_relationship.rb b/lib/datadog_api_client/v2/models/team_hierarchy_link_create_team_relationship.rb new file mode 100644 index 000000000000..5a47a57c246e --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_hierarchy_link_create_team_relationship.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data about each team that will be connected by the team hierarchy link + class TeamHierarchyLinkCreateTeamRelationship + include BaseGenericModel + + # This schema defines the attributes about each team that has to be provided when creating a team hierarchy link + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'TeamHierarchyLinkCreateTeam' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamHierarchyLinkCreateTeamRelationship` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/team_hierarchy_link_relationships.rb b/lib/datadog_api_client/v2/models/team_hierarchy_link_relationships.rb new file mode 100644 index 000000000000..18da59b263d2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_hierarchy_link_relationships.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Team hierarchy link relationships + class TeamHierarchyLinkRelationships + include BaseGenericModel + + # Team hierarchy link team relationship + attr_reader :parent_team + + # Team hierarchy link team relationship + attr_reader :sub_team + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'parent_team' => :'parent_team', + :'sub_team' => :'sub_team' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'parent_team' => :'TeamHierarchyLinkTeamRelationship', + :'sub_team' => :'TeamHierarchyLinkTeamRelationship' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamHierarchyLinkRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'parent_team') + self.parent_team = attributes[:'parent_team'] + end + + if attributes.key?(:'sub_team') + self.sub_team = attributes[:'sub_team'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @parent_team.nil? + return false if @sub_team.nil? + true + end + + # Custom attribute writer method with validation + # @param parent_team [Object] Object to be assigned + # @!visibility private + def parent_team=(parent_team) + if parent_team.nil? + fail ArgumentError, 'invalid value for "parent_team", parent_team cannot be nil.' + end + @parent_team = parent_team + end + + # Custom attribute writer method with validation + # @param sub_team [Object] Object to be assigned + # @!visibility private + def sub_team=(sub_team) + if sub_team.nil? + fail ArgumentError, 'invalid value for "sub_team", sub_team cannot be nil.' + end + @sub_team = sub_team + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + parent_team == o.parent_team && + sub_team == o.sub_team && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [parent_team, sub_team, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/team_hierarchy_link_response.rb b/lib/datadog_api_client/v2/models/team_hierarchy_link_response.rb new file mode 100644 index 000000000000..98bd6b23cc84 --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_hierarchy_link_response.rb @@ -0,0 +1,127 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Team hierarchy link response + class TeamHierarchyLinkResponse + include BaseGenericModel + + # Team hierarchy link + attr_accessor :data + + # Included teams + attr_accessor :included + + # When querying team hierarchy links, a set of links for navigation between different pages is included + attr_accessor :links + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included', + :'links' => :'links' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'TeamHierarchyLink', + :'included' => :'Array', + :'links' => :'TeamsHierarchyLinksResponseLinks' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamHierarchyLinkResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = value + end + end + + if attributes.key?(:'links') + self.links = attributes[:'links'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + included == o.included && + links == o.links && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, links, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/team_hierarchy_link_team.rb b/lib/datadog_api_client/v2/models/team_hierarchy_link_team.rb new file mode 100644 index 000000000000..b64ea5d59f79 --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_hierarchy_link_team.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Team hierarchy links connect different teams. This represents team objects that are connected by the team hierarchy link. + class TeamHierarchyLinkTeam + include BaseGenericModel + + # Team hierarchy links connect different teams. This represents attributes from teams that are connected by the team hierarchy link. + attr_accessor :attributes + + # The team's identifier + attr_reader :id + + # Team type + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'TeamHierarchyLinkTeamAttributes', + :'id' => :'String', + :'type' => :'TeamType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamHierarchyLinkTeam` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/team_hierarchy_link_team_attributes.rb b/lib/datadog_api_client/v2/models/team_hierarchy_link_team_attributes.rb new file mode 100644 index 000000000000..85d6d36b0bbb --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_hierarchy_link_team_attributes.rb @@ -0,0 +1,223 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Team hierarchy links connect different teams. This represents attributes from teams that are connected by the team hierarchy link. + class TeamHierarchyLinkTeamAttributes + include BaseGenericModel + + # The team's avatar + attr_accessor :avatar + + # The team's banner + attr_accessor :banner + + # The team's handle + attr_reader :handle + + # Whether the team is managed + attr_accessor :is_managed + + # Whether the team has open membership + attr_accessor :is_open_membership + + # The number of links for the team + attr_accessor :link_count + + # The team's name + attr_reader :name + + # The team's summary + attr_accessor :summary + + # The number of users in the team + attr_accessor :user_count + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.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' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'avatar' => :'String', + :'banner' => :'Integer', + :'handle' => :'String', + :'is_managed' => :'Boolean', + :'is_open_membership' => :'Boolean', + :'link_count' => :'Integer', + :'name' => :'String', + :'summary' => :'String', + :'user_count' => :'Integer' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'avatar', + :'summary', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamHierarchyLinkTeamAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'avatar') + self.avatar = attributes[:'avatar'] + end + + if attributes.key?(:'banner') + self.banner = attributes[:'banner'] + end + + if attributes.key?(:'handle') + self.handle = attributes[:'handle'] + end + + if attributes.key?(:'is_managed') + self.is_managed = attributes[:'is_managed'] + end + + if attributes.key?(:'is_open_membership') + self.is_open_membership = attributes[:'is_open_membership'] + end + + if attributes.key?(:'link_count') + self.link_count = attributes[:'link_count'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'summary') + self.summary = attributes[:'summary'] + end + + if attributes.key?(:'user_count') + self.user_count = attributes[:'user_count'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @handle.nil? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param handle [Object] Object to be assigned + # @!visibility private + def handle=(handle) + if handle.nil? + fail ArgumentError, 'invalid value for "handle", handle cannot be nil.' + end + @handle = handle + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + avatar == o.avatar && + banner == o.banner && + handle == o.handle && + is_managed == o.is_managed && + is_open_membership == o.is_open_membership && + link_count == o.link_count && + name == o.name && + summary == o.summary && + user_count == o.user_count && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [avatar, banner, handle, is_managed, is_open_membership, link_count, name, summary, user_count, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/team_hierarchy_link_team_relationship.rb b/lib/datadog_api_client/v2/models/team_hierarchy_link_team_relationship.rb new file mode 100644 index 000000000000..3b5e43f12cb4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_hierarchy_link_team_relationship.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Team hierarchy link team relationship + class TeamHierarchyLinkTeamRelationship + include BaseGenericModel + + # Team hierarchy links connect different teams. This represents team objects that are connected by the team hierarchy link. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'TeamHierarchyLinkTeam' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamHierarchyLinkTeamRelationship` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/team_hierarchy_link_type.rb b/lib/datadog_api_client/v2/models/team_hierarchy_link_type.rb new file mode 100644 index 000000000000..aedf483f2c5a --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_hierarchy_link_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Team hierarchy link type + class TeamHierarchyLinkType + include BaseEnumModel + + TEAM_HIERARCHY_LINKS = "team_hierarchy_links".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/team_hierarchy_links_response.rb b/lib/datadog_api_client/v2/models/team_hierarchy_links_response.rb new file mode 100644 index 000000000000..fc471c36d3c3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_hierarchy_links_response.rb @@ -0,0 +1,139 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Team hierarchy links response + class TeamHierarchyLinksResponse + include BaseGenericModel + + # Team hierarchy links response data + attr_accessor :data + + # Included teams + attr_accessor :included + + # When querying team hierarchy links, a set of links for navigation between different pages is included + attr_accessor :links + + # Metadata that is included in the response when querying the team hierarchy links + attr_accessor :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included', + :'links' => :'links', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'included' => :'Array', + :'links' => :'TeamsHierarchyLinksResponseLinks', + :'meta' => :'TeamsHierarchyLinksResponseMeta' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamHierarchyLinksResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = value + end + end + + if attributes.key?(:'links') + self.links = attributes[:'links'] + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + included == o.included && + links == o.links && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, links, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/teams_hierarchy_links_response_links.rb b/lib/datadog_api_client/v2/models/teams_hierarchy_links_response_links.rb new file mode 100644 index 000000000000..ac7be7445f9b --- /dev/null +++ b/lib/datadog_api_client/v2/models/teams_hierarchy_links_response_links.rb @@ -0,0 +1,156 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # When querying team hierarchy links, a set of links for navigation between different pages is included + class TeamsHierarchyLinksResponseLinks + include BaseGenericModel + + # Link to the first page. + attr_accessor :first + + # Link to the last page. + attr_accessor :last + + # Link to the next page. + attr_accessor :_next + + # Link to the previous page. + attr_accessor :prev + + # Link to the current object. + attr_accessor :_self + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'first' => :'first', + :'last' => :'last', + :'_next' => :'next', + :'prev' => :'prev', + :'_self' => :'self' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'first' => :'String', + :'last' => :'String', + :'_next' => :'String', + :'prev' => :'String', + :'_self' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'first', + :'last', + :'_next', + :'prev', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamsHierarchyLinksResponseLinks` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'first') + self.first = attributes[:'first'] + end + + if attributes.key?(:'last') + self.last = attributes[:'last'] + end + + if attributes.key?(:'_next') + self._next = attributes[:'_next'] + end + + if attributes.key?(:'prev') + self.prev = attributes[:'prev'] + end + + if attributes.key?(:'_self') + self._self = attributes[:'_self'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + first == o.first && + last == o.last && + _next == o._next && + prev == o.prev && + _self == o._self && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [first, last, _next, prev, _self, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/teams_hierarchy_links_response_meta.rb b/lib/datadog_api_client/v2/models/teams_hierarchy_links_response_meta.rb new file mode 100644 index 000000000000..a312d0c1798d --- /dev/null +++ b/lib/datadog_api_client/v2/models/teams_hierarchy_links_response_meta.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Metadata that is included in the response when querying the team hierarchy links + class TeamsHierarchyLinksResponseMeta + include BaseGenericModel + + # Metadata related to paging information that is included in the response when querying the team hierarchy links + attr_accessor :page + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'page' => :'page' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'page' => :'TeamsHierarchyLinksResponseMetaPage' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamsHierarchyLinksResponseMeta` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'page') + self.page = attributes[:'page'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + page == o.page && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [page, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/teams_hierarchy_links_response_meta_page.rb b/lib/datadog_api_client/v2/models/teams_hierarchy_links_response_meta_page.rb new file mode 100644 index 000000000000..4269a2ee1f51 --- /dev/null +++ b/lib/datadog_api_client/v2/models/teams_hierarchy_links_response_meta_page.rb @@ -0,0 +1,184 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Metadata related to paging information that is included in the response when querying the team hierarchy links + class TeamsHierarchyLinksResponseMetaPage + include BaseGenericModel + + # First page number. + attr_accessor :first_number + + # Last page number. + attr_accessor :last_number + + # Next page number. + attr_accessor :next_number + + # Page number. + attr_accessor :number + + # Previous page number. + attr_accessor :prev_number + + # Page size. + attr_accessor :size + + # Total number of results. + attr_accessor :total + + # Pagination type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.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' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'first_number' => :'Integer', + :'last_number' => :'Integer', + :'next_number' => :'Integer', + :'number' => :'Integer', + :'prev_number' => :'Integer', + :'size' => :'Integer', + :'total' => :'Integer', + :'type' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'next_number', + :'prev_number', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TeamsHierarchyLinksResponseMetaPage` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'first_number') + self.first_number = attributes[:'first_number'] + end + + if attributes.key?(:'last_number') + self.last_number = attributes[:'last_number'] + end + + if attributes.key?(:'next_number') + self.next_number = attributes[:'next_number'] + end + + if attributes.key?(:'number') + self.number = attributes[:'number'] + end + + if attributes.key?(:'prev_number') + self.prev_number = attributes[:'prev_number'] + end + + if attributes.key?(:'size') + self.size = attributes[:'size'] + end + + if attributes.key?(:'total') + self.total = attributes[:'total'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + first_number == o.first_number && + last_number == o.last_number && + next_number == o.next_number && + number == o.number && + prev_number == o.prev_number && + size == o.size && + total == o.total && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [first_number, last_number, next_number, number, prev_number, size, total, type, additional_properties].hash + end + end +end