From 3f2927ab50b8eb4d654166b1023b17ca83aa999a Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 1 Dec 2025 09:55:24 +0000 Subject: [PATCH] Regenerate client from commit f011d9e of spec repo --- .generator/schemas/v2/openapi.yaml | 470 +++++++++++++++++- ...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 +++++ 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 | 15 + features/v2/given.json | 24 + features/v2/teams.feature | 83 ++++ features/v2/undo.json | 31 ++ lib/datadog_api_client/inflector.rb | 17 + lib/datadog_api_client/v2/api/teams_api.rb | 303 +++++++++++ .../relationship_to_user_team_permission.rb | 8 + .../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 +++++++ 49 files changed, 4349 insertions(+), 4 deletions(-) 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/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 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..2a824238ce4a 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -41410,6 +41410,7 @@ components: type: object RelationshipToUserTeamPermissionData: description: Related user team permission data + nullable: true properties: id: description: The ID of the user team permission @@ -51804,7 +51805,11 @@ components: items: description: String identifier of the module type: string + nullable: true type: array + is_managed: + description: Whether the team is managed from an external source + type: boolean link_count: description: The number of links belonging to the team format: int32 @@ -51836,6 +51841,7 @@ components: items: description: String identifier of the module type: string + nullable: true type: array required: - handle @@ -52016,6 +52022,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 +53106,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: @@ -81999,6 +82280,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 +82718,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 +82777,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 +82830,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 +82881,7 @@ paths: operator: OR permissions: - teams_read + x-sunset: '2026-06-01' x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' diff --git a/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/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..c7c5ed631f01 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -3102,6 +3102,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..64b50d8057c8 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -1169,6 +1169,30 @@ "tag": "Teams", "operationId": "CreateTeam" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"handle\": \"test-handle-2-{{ unique_hash }}\",\n \"name\": \"test-name-2-{{ unique_hash }}\"\n },\n \"type\": \"team\"\n }\n}" + } + ], + "step": "there is a valid \"dd_team_2\" in the system", + "key": "dd_team_2", + "tag": "Teams", + "operationId": "CreateTeam" + }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"team_hierarchy_links\",\n \"relationships\": {\n \"parent_team\": {\n \"data\": {\n \"id\": \"{{ dd_team.data.id }}\",\n \"type\": \"team\"\n }\n },\n \"sub_team\": {\n \"data\": {\n \"id\": \"{{ dd_team_2.data.id }}\",\n \"type\": \"team\"\n }\n }\n }\n }\n}" + } + ], + "step": "there is a valid \"team_hierarchy_link\" in the system", + "key": "team_hierarchy_link", + "tag": "Teams", + "operationId": "AddTeamHierarchyLink" + }, { "source": "data.data[0]", "step": "there is a valid \"team_connection\" in the system", diff --git a/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..86540fc397a8 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -4345,6 +4345,37 @@ "type": "unsafe" } }, + "ListTeamHierarchyLinks": { + "tag": "Teams", + "undo": { + "type": "safe" + } + }, + "AddTeamHierarchyLink": { + "tag": "Teams", + "undo": { + "operationId": "RemoveTeamHierarchyLink", + "parameters": [ + { + "name": "link_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "RemoveTeamHierarchyLink": { + "tag": "Teams", + "undo": { + "type": "idempotent" + } + }, + "GetTeamHierarchyLink": { + "tag": "Teams", + "undo": { + "type": "safe" + } + }, "DeleteTeamConnections": { "tag": "Team Connections", "undo": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 427fdcf8659c..16789a3fab82 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -4212,6 +4212,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 +4278,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", 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/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/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