diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 922424a28dcb..cb64b3bf5b79 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -11515,6 +11515,35 @@ components: $ref: '#/components/schemas/ConfluentResourceResponseData' type: array type: object + ConnectedTeamRef: + description: Reference to a team from an external system. + properties: + data: + $ref: '#/components/schemas/ConnectedTeamRefData' + type: object + ConnectedTeamRefData: + description: Reference to connected external team. + properties: + id: + description: The connected team ID as it is referenced throughout the Datadog + ecosystem. + example: '@GitHubOrg/team-handle' + type: string + type: + $ref: '#/components/schemas/ConnectedTeamRefDataType' + required: + - id + - type + type: object + ConnectedTeamRefDataType: + default: github_team + description: External team resource type. + enum: + - github_team + example: github_team + type: string + x-enum-varnames: + - GITHUB_TEAM Connection: description: The definition of `Connection` object. properties: @@ -11579,6 +11608,50 @@ components: - label - tags type: object + ConnectionsPagePagination: + description: Page-based pagination metadata. + properties: + first_number: + description: The first page number. + format: int64 + type: integer + last_number: + description: The last page number. + format: int64 + type: integer + next_number: + description: The next page number. + format: int64 + nullable: true + type: integer + number: + description: The current page number. + format: int64 + type: integer + prev_number: + description: The previous page number. + format: int64 + nullable: true + type: integer + size: + description: The page size. + format: int64 + type: integer + total: + description: Total connections matching request. + format: int64 + type: integer + type: + description: Pagination type. + example: number_size + type: string + type: object + ConnectionsResponseMeta: + description: Connections response metadata. + properties: + page: + $ref: '#/components/schemas/ConnectionsPagePagination' + type: object Container: description: Container object. properties: @@ -51345,6 +51418,111 @@ components: - handle - name type: object + TeamConnection: + description: A relationship between a Datadog team and a team from another external + system. + properties: + attributes: + $ref: '#/components/schemas/TeamConnectionAttributes' + id: + description: The unique identifier of the team connection. + example: 12345678-1234-5678-9abc-123456789012 + type: string + relationships: + $ref: '#/components/schemas/TeamConnectionRelationships' + type: + $ref: '#/components/schemas/TeamConnectionType' + required: + - id + - type + type: object + TeamConnectionAttributes: + description: Attributes of the team connection. + properties: + managed_by: + description: The entity that manages this team connection. + example: github_sync + type: string + source: + description: The name of the external source. + example: github + type: string + type: object + TeamConnectionCreateData: + description: Data for creating a team connection. + properties: + attributes: + $ref: '#/components/schemas/TeamConnectionAttributes' + relationships: + $ref: '#/components/schemas/TeamConnectionRelationships' + type: + $ref: '#/components/schemas/TeamConnectionType' + required: + - type + type: object + TeamConnectionCreateRequest: + description: Request for creating team connections. + properties: + data: + description: Array of team connections to create. + items: + $ref: '#/components/schemas/TeamConnectionCreateData' + type: array + required: + - data + type: object + TeamConnectionDeleteRequest: + description: Request for deleting team connections. + properties: + data: + description: Array of team connection IDs to delete. + items: + $ref: '#/components/schemas/TeamConnectionDeleteRequestDataItem' + type: array + required: + - data + type: object + TeamConnectionDeleteRequestDataItem: + description: A collection of connection ids to delete. + properties: + id: + description: The unique identifier of the team connection to delete. + example: 12345678-1234-5678-9abc-123456789012 + type: string + type: + $ref: '#/components/schemas/TeamConnectionType' + required: + - id + - type + type: object + TeamConnectionRelationships: + description: Relationships of the team connection. + properties: + connected_team: + $ref: '#/components/schemas/ConnectedTeamRef' + team: + $ref: '#/components/schemas/TeamRef' + type: object + TeamConnectionType: + default: team_connection + description: Team connection resource type. + enum: + - team_connection + example: team_connection + type: string + x-enum-varnames: + - TEAM_CONNECTION + TeamConnectionsResponse: + description: Response containing information about multiple team connections. + properties: + data: + description: Array of team connections. + items: + $ref: '#/components/schemas/TeamConnection' + type: array + meta: + $ref: '#/components/schemas/ConnectionsResponseMeta' + type: object TeamCreate: description: Team create properties: @@ -51762,6 +51940,34 @@ components: $ref: '#/components/schemas/TeamPermissionSetting' type: array type: object + TeamRef: + description: Reference to a Datadog team. + properties: + data: + $ref: '#/components/schemas/TeamRefData' + type: object + TeamRefData: + description: Reference to a Datadog team. + properties: + id: + description: The Datadog team ID. + example: 87654321-4321-8765-dcba-210987654321 + type: string + type: + $ref: '#/components/schemas/TeamRefDataType' + required: + - id + - type + type: object + TeamRefDataType: + default: team + description: Datadog team resource type. + enum: + - team + example: team + type: string + x-enum-varnames: + - TEAM TeamReference: description: Provides a reference to a team, including ID, type, and basic attributes/relationships. properties: @@ -80787,6 +80993,166 @@ paths: permissions: - teams_read - teams_manage + /api/v2/team/connections: + delete: + description: Delete multiple team connections. + operationId: DeleteTeamConnections + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TeamConnectionDeleteRequest' + required: true + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Delete team connections + tags: + - Team Connections + x-permission: + operator: OR + permissions: + - teams_read + x-unstable: '**Note**: This endpoint is in Preview. To request access, fill + out this [form](https://www.datadoghq.com/product-preview/github-integration-for-teams/). + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + get: + description: Returns all team connections. + operationId: ListTeamConnections + parameters: + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/PageNumber' + - description: Filter team connections by external source systems. + explode: false + in: query + name: filter[sources] + required: false + schema: + items: + example: github + type: string + type: array + style: form + - description: Filter team connections by Datadog team IDs. + explode: false + in: query + name: filter[team_ids] + required: false + schema: + items: + example: 12345678-1234-5678-9abc-123456789012 + type: string + type: array + style: form + - description: Filter team connections by connected team IDs from external systems. + explode: false + in: query + name: filter[connected_team_ids] + required: false + schema: + items: + example: '@MyGitHubAccount/my-team-name' + type: string + type: array + style: form + - description: Filter team connections by connection IDs. + explode: false + in: query + name: filter[connection_ids] + required: false + schema: + items: + example: 12345678-1234-5678-9abc-123456789012 + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamConnectionsResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: List team connections + tags: + - Team Connections + x-pagination: + limitParam: page[size] + pageParam: page[number] + resultsPath: data + x-permission: + operator: OR + permissions: + - teams_read + x-unstable: '**Note**: This endpoint is in Preview. To request access, fill + out this [form](https://www.datadoghq.com/product-preview/github-integration-for-teams/). + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Create multiple team connections. + operationId: CreateTeamConnections + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TeamConnectionCreateRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamConnectionsResponse' + description: Created + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '409': + $ref: '#/components/responses/ConflictResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Create team connections + tags: + - Team Connections + x-permission: + operator: OR + permissions: + - teams_read + x-unstable: '**Note**: This endpoint is in Preview. To request access, fill + out this [form](https://www.datadoghq.com/product-preview/github-integration-for-teams/). + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/team/sync: post: description: 'This endpoint attempts to link your existing Datadog teams with @@ -83992,6 +84358,9 @@ tags: use Datadog\u2019s API to\nmanage both test types programmatically.\n\nFor more information about Synthetics, see the [Synthetics overview](https://docs.datadoghq.com/synthetics/)." name: Synthetics +- description: View and manage relationships between Datadog teams and teams from + external sources, such as GitHub. + name: Team Connections - description: View and manage teams within Datadog. See the [Teams page](https://docs.datadoghq.com/account_management/teams/) for more information. name: Teams diff --git a/examples/v2/team-connections/CreateTeamConnections.ts b/examples/v2/team-connections/CreateTeamConnections.ts new file mode 100644 index 000000000000..ade91479cf25 --- /dev/null +++ b/examples/v2/team-connections/CreateTeamConnections.ts @@ -0,0 +1,49 @@ +/** + * Create team connections returns "Created" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.createTeamConnections"] = true; +const apiInstance = new v2.TeamConnectionsApi(configuration); + +// there is a valid "dd_team" in the system +const DD_TEAM_DATA_ID = process.env.DD_TEAM_DATA_ID as string; + +const params: v2.TeamConnectionsApiCreateTeamConnectionsRequest = { + body: { + data: [ + { + type: "team_connection", + attributes: { + source: "github", + managedBy: "datadog", + }, + relationships: { + team: { + data: { + id: DD_TEAM_DATA_ID, + type: "team", + }, + }, + connectedTeam: { + data: { + id: "@MyGitHubAccount/my-team-name", + type: "github_team", + }, + }, + }, + }, + ], + }, +}; + +apiInstance + .createTeamConnections(params) + .then((data: v2.TeamConnectionsResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/team-connections/DeleteTeamConnections.ts b/examples/v2/team-connections/DeleteTeamConnections.ts new file mode 100644 index 000000000000..246210ff00a4 --- /dev/null +++ b/examples/v2/team-connections/DeleteTeamConnections.ts @@ -0,0 +1,29 @@ +/** + * Delete team connections returns "No Content" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.deleteTeamConnections"] = true; +const apiInstance = new v2.TeamConnectionsApi(configuration); + +const params: v2.TeamConnectionsApiDeleteTeamConnectionsRequest = { + body: { + data: [ + { + id: "12345678-1234-5678-9abc-123456789012", + type: "team_connection", + }, + ], + }, +}; + +apiInstance + .deleteTeamConnections(params) + .then((data: any) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/team-connections/ListTeamConnections.ts b/examples/v2/team-connections/ListTeamConnections.ts new file mode 100644 index 000000000000..2aa4f33a1565 --- /dev/null +++ b/examples/v2/team-connections/ListTeamConnections.ts @@ -0,0 +1,18 @@ +/** + * List team connections returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.listTeamConnections"] = true; +const apiInstance = new v2.TeamConnectionsApi(configuration); + +apiInstance + .listTeamConnections() + .then((data: v2.TeamConnectionsResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/team-connections/ListTeamConnections_1473516764.ts b/examples/v2/team-connections/ListTeamConnections_1473516764.ts new file mode 100644 index 000000000000..9de523cb6e1f --- /dev/null +++ b/examples/v2/team-connections/ListTeamConnections_1473516764.ts @@ -0,0 +1,23 @@ +/** + * List team connections with filters returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.listTeamConnections"] = true; +const apiInstance = new v2.TeamConnectionsApi(configuration); + +const params: v2.TeamConnectionsApiListTeamConnectionsRequest = { + pageSize: 10, + filterSources: ["github"], +}; + +apiInstance + .listTeamConnections(params) + .then((data: v2.TeamConnectionsResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/team-connections/ListTeamConnections_2418873869.ts b/examples/v2/team-connections/ListTeamConnections_2418873869.ts new file mode 100644 index 000000000000..7ffe51bfce9c --- /dev/null +++ b/examples/v2/team-connections/ListTeamConnections_2418873869.ts @@ -0,0 +1,19 @@ +/** + * List team connections returns "OK" response with pagination + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.listTeamConnections"] = true; +const apiInstance = new v2.TeamConnectionsApi(configuration); + +(async () => { + try { + for await (const item of apiInstance.listTeamConnectionsWithPagination()) { + console.log(item); + } + } catch (error) { + console.error(error); + } +})(); diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index 337479f4de67..6f2a638fbd06 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -8900,6 +8900,47 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "UserTeamsResponse", }, + "v2.ListTeamConnections": { + "pageSize": { + "type": "number", + "format": "int64", + }, + "pageNumber": { + "type": "number", + "format": "int64", + }, + "filterSources": { + "type": "Array", + "format": "", + }, + "filterTeamIds": { + "type": "Array", + "format": "", + }, + "filterConnectedTeamIds": { + "type": "Array", + "format": "", + }, + "filterConnectionIds": { + "type": "Array", + "format": "", + }, + "operationResponseType": "TeamConnectionsResponse", + }, + "v2.CreateTeamConnections": { + "body": { + "type": "TeamConnectionCreateRequest", + "format": "", + }, + "operationResponseType": "TeamConnectionsResponse", + }, + "v2.DeleteTeamConnections": { + "body": { + "type": "TeamConnectionDeleteRequest", + "format": "", + }, + "operationResponseType": "{}", + }, "v2.ListIncidentTeams": { "include": { "type": "IncidentRelatedObject", diff --git a/features/v2/given.json b/features/v2/given.json index 12852be0f21b..b67e2d5adcd8 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -1141,6 +1141,13 @@ "tag": "Teams", "operationId": "CreateTeam" }, + { + "source": "data.data[0]", + "step": "there is a valid \"team_connection\" in the system", + "key": "team_connection", + "tag": "Team Connections", + "operationId": "CreateTeamConnections" + }, { "parameters": [ { diff --git a/features/v2/team_connections.feature b/features/v2/team_connections.feature new file mode 100644 index 000000000000..7bbce889e1ec --- /dev/null +++ b/features/v2/team_connections.feature @@ -0,0 +1,93 @@ +@endpoint(team-connections) @endpoint(team-connections-v2) +Feature: Team Connections + View and manage relationships between Datadog teams and teams from + external sources, such as GitHub. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "TeamConnections" API + + @skip @team:DataDog/aaa-omg + Scenario: Create team connections returns "Bad Request" response + Given operation "CreateTeamConnections" enabled + And new "CreateTeamConnections" request + And body with value {"data": [{"attributes": {"source": "github"}, "relationships": {"connected_team": {"data": {"id": "@MyGitHubAccount/my-team-name", "type": "github_team"}}, "team": {"data": {"type": "team"}}}, "type": "team_connection"}]} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-omg + Scenario: Create team connections returns "Conflict" response + Given operation "CreateTeamConnections" enabled + And new "CreateTeamConnections" request + And body with value {"data": [{"attributes": {"managed_by": "github_sync", "source": "github"}, "relationships": {"connected_team": {"data": {"id": "@GitHubOrg/team-handle", "type": "github_team"}}, "team": {"data": {"id": "87654321-4321-8765-dcba-210987654321", "type": "team"}}}, "type": "team_connection"}]} + When the request is sent + Then the response status is 409 Conflict + + @skip @team:DataDog/aaa-omg + Scenario: Create team connections returns "Created" response + Given operation "CreateTeamConnections" enabled + And new "CreateTeamConnections" request + And there is a valid "dd_team" in the system + And body with value {"data": [{"type": "team_connection", "attributes": {"source": "github", "managed_by": "datadog"}, "relationships": {"team": {"data": {"id": "{{ dd_team.data.id }}", "type": "team"}}, "connected_team": {"data": {"id": "@MyGitHubAccount/my-team-name", "type": "github_team"}}}}]} + When the request is sent + Then the response status is 201 Created + And the response "data.data[0].attributes.source" is equal to "github" + And the response "data.data[0].attributes.managed_by" is equal to "datadog" + And the response "data.data[0].relationships.team.data.id" is equal to "{{ dd_team.data.id }}" + And the response "data.data[0].relationships.connected_team.data.id" is equal to "@MyGitHubAccount/my-team-name" + And the response "data.data[0].type" is equal to "team_connection" + + @skip @team:DataDog/aaa-omg + Scenario: Delete team connections returns "Bad Request" response + Given operation "DeleteTeamConnections" enabled + And new "DeleteTeamConnections" request + And body with value {"data": [{"type": "team_connection"}]} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-omg + Scenario: Delete team connections returns "No Content" response + Given operation "DeleteTeamConnections" enabled + And new "DeleteTeamConnections" request + And body with value {"data": [{"id": "12345678-1234-5678-9abc-123456789012", "type": "team_connection"}]} + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/aaa-omg + Scenario: Delete team connections returns "Not Found" response + Given operation "DeleteTeamConnections" enabled + And new "DeleteTeamConnections" request + And body with value {"data": [{"id": "12345678-1234-5678-9abc-123456789012", "type": "team_connection"}]} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/aaa-omg + Scenario: List team connections returns "Bad Request" response + Given operation "ListTeamConnections" enabled + And new "ListTeamConnections" request + When the request is sent + Then the response status is 400 Bad Request + + @skip @team:DataDog/aaa-omg + Scenario: List team connections returns "OK" response + Given operation "ListTeamConnections" enabled + And new "ListTeamConnections" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/aaa-omg @with-pagination + Scenario: List team connections returns "OK" response with pagination + Given operation "ListTeamConnections" enabled + And new "ListTeamConnections" request + When the request with pagination is sent + Then the response status is 200 OK + + @skip @team:DataDog/aaa-omg + Scenario: List team connections with filters returns "OK" response + Given operation "ListTeamConnections" enabled + And new "ListTeamConnections" request + And request contains "filter[sources]" parameter with value ["github"] + And request contains "page[size]" parameter with value 10 + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/undo.json b/features/v2/undo.json index cd8c18bf0780..d25ca0a4dba2 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -4268,6 +4268,25 @@ "type": "unsafe" } }, + "DeleteTeamConnections": { + "tag": "Team Connections", + "undo": { + "type": "idempotent" + } + }, + "ListTeamConnections": { + "tag": "Team Connections", + "undo": { + "type": "safe" + } + }, + "CreateTeamConnections": { + "tag": "Team Connections", + "undo": { + "operationId": "DeleteTeamConnections", + "type": "unsafe" + } + }, "SyncTeams": { "tag": "Teams", "undo": { diff --git a/packages/datadog-api-client-common/configuration.ts b/packages/datadog-api-client-common/configuration.ts index 19e45a751aa1..a53c96397093 100644 --- a/packages/datadog-api-client-common/configuration.ts +++ b/packages/datadog-api-client-common/configuration.ts @@ -350,6 +350,9 @@ export function createConfiguration( "v2.listMemberTeams": false, "v2.removeMemberTeam": false, "v2.syncTeams": false, + "v2.createTeamConnections": false, + "v2.deleteTeamConnections": false, + "v2.listTeamConnections": false, "v2.createIncidentTeam": false, "v2.deleteIncidentTeam": false, "v2.getIncidentTeam": false, diff --git a/packages/datadog-api-client-v2/apis/TeamConnectionsApi.ts b/packages/datadog-api-client-v2/apis/TeamConnectionsApi.ts new file mode 100644 index 000000000000..cc9fda91b816 --- /dev/null +++ b/packages/datadog-api-client-v2/apis/TeamConnectionsApi.ts @@ -0,0 +1,556 @@ +import { + BaseAPIRequestFactory, + RequiredError, +} from "../../datadog-api-client-common/baseapi"; +import { + Configuration, + applySecurityAuthentication, +} from "../../datadog-api-client-common/configuration"; +import { + RequestContext, + HttpMethod, + ResponseContext, +} from "../../datadog-api-client-common/http/http"; + +import { logger } from "../../../logger"; +import { ObjectSerializer } from "../models/ObjectSerializer"; +import { ApiException } from "../../datadog-api-client-common/exception"; + +import { APIErrorResponse } from "../models/APIErrorResponse"; +import { TeamConnection } from "../models/TeamConnection"; +import { TeamConnectionCreateRequest } from "../models/TeamConnectionCreateRequest"; +import { TeamConnectionDeleteRequest } from "../models/TeamConnectionDeleteRequest"; +import { TeamConnectionsResponse } from "../models/TeamConnectionsResponse"; + +export class TeamConnectionsApiRequestFactory extends BaseAPIRequestFactory { + public async createTeamConnections( + body: TeamConnectionCreateRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'createTeamConnections'"); + if (!_config.unstableOperations["v2.createTeamConnections"]) { + throw new Error("Unstable operation 'createTeamConnections' is disabled"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createTeamConnections"); + } + + // Path Params + const localVarPath = "/api/v2/team/connections"; + + // Make Request Context + const requestContext = _config + .getServer("v2.TeamConnectionsApi.createTeamConnections") + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "TeamConnectionCreateRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + + public async deleteTeamConnections( + body: TeamConnectionDeleteRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'deleteTeamConnections'"); + if (!_config.unstableOperations["v2.deleteTeamConnections"]) { + throw new Error("Unstable operation 'deleteTeamConnections' is disabled"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "deleteTeamConnections"); + } + + // Path Params + const localVarPath = "/api/v2/team/connections"; + + // Make Request Context + const requestContext = _config + .getServer("v2.TeamConnectionsApi.deleteTeamConnections") + .makeRequestContext(localVarPath, HttpMethod.DELETE); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "TeamConnectionDeleteRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + + public async listTeamConnections( + pageSize?: number, + pageNumber?: number, + filterSources?: Array, + filterTeamIds?: Array, + filterConnectedTeamIds?: Array, + filterConnectionIds?: Array, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'listTeamConnections'"); + if (!_config.unstableOperations["v2.listTeamConnections"]) { + throw new Error("Unstable operation 'listTeamConnections' is disabled"); + } + + // Path Params + const localVarPath = "/api/v2/team/connections"; + + // Make Request Context + const requestContext = _config + .getServer("v2.TeamConnectionsApi.listTeamConnections") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (pageSize !== undefined) { + requestContext.setQueryParam( + "page[size]", + ObjectSerializer.serialize(pageSize, "number", "int64"), + "" + ); + } + if (pageNumber !== undefined) { + requestContext.setQueryParam( + "page[number]", + ObjectSerializer.serialize(pageNumber, "number", "int64"), + "" + ); + } + if (filterSources !== undefined) { + requestContext.setQueryParam( + "filter[sources]", + ObjectSerializer.serialize(filterSources, "Array", ""), + "csv" + ); + } + if (filterTeamIds !== undefined) { + requestContext.setQueryParam( + "filter[team_ids]", + ObjectSerializer.serialize(filterTeamIds, "Array", ""), + "csv" + ); + } + if (filterConnectedTeamIds !== undefined) { + requestContext.setQueryParam( + "filter[connected_team_ids]", + ObjectSerializer.serialize(filterConnectedTeamIds, "Array", ""), + "csv" + ); + } + if (filterConnectionIds !== undefined) { + requestContext.setQueryParam( + "filter[connection_ids]", + ObjectSerializer.serialize(filterConnectionIds, "Array", ""), + "csv" + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } +} + +export class TeamConnectionsApiResponseProcessor { + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createTeamConnections + * @throws ApiException if the response code was not in [200, 299] + */ + public async createTeamConnections( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 201) { + const body: TeamConnectionsResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "TeamConnectionsResponse" + ) as TeamConnectionsResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 409 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: TeamConnectionsResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "TeamConnectionsResponse", + "" + ) as TeamConnectionsResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to deleteTeamConnections + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteTeamConnections(response: ResponseContext): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 204) { + return; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + return; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to listTeamConnections + * @throws ApiException if the response code was not in [200, 299] + */ + public async listTeamConnections( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: TeamConnectionsResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "TeamConnectionsResponse" + ) as TeamConnectionsResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: TeamConnectionsResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "TeamConnectionsResponse", + "" + ) as TeamConnectionsResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } +} + +export interface TeamConnectionsApiCreateTeamConnectionsRequest { + /** + * @type TeamConnectionCreateRequest + */ + body: TeamConnectionCreateRequest; +} + +export interface TeamConnectionsApiDeleteTeamConnectionsRequest { + /** + * @type TeamConnectionDeleteRequest + */ + body: TeamConnectionDeleteRequest; +} + +export interface TeamConnectionsApiListTeamConnectionsRequest { + /** + * Size for a given page. The maximum allowed value is 100. + * @type number + */ + pageSize?: number; + /** + * Specific page number to return. + * @type number + */ + pageNumber?: number; + /** + * Filter team connections by external source systems. + * @type Array + */ + filterSources?: Array; + /** + * Filter team connections by Datadog team IDs. + * @type Array + */ + filterTeamIds?: Array; + /** + * Filter team connections by connected team IDs from external systems. + * @type Array + */ + filterConnectedTeamIds?: Array; + /** + * Filter team connections by connection IDs. + * @type Array + */ + filterConnectionIds?: Array; +} + +export class TeamConnectionsApi { + private requestFactory: TeamConnectionsApiRequestFactory; + private responseProcessor: TeamConnectionsApiResponseProcessor; + private configuration: Configuration; + + public constructor( + configuration: Configuration, + requestFactory?: TeamConnectionsApiRequestFactory, + responseProcessor?: TeamConnectionsApiResponseProcessor + ) { + this.configuration = configuration; + this.requestFactory = + requestFactory || new TeamConnectionsApiRequestFactory(configuration); + this.responseProcessor = + responseProcessor || new TeamConnectionsApiResponseProcessor(); + } + + /** + * Create multiple team connections. + * @param param The request object + */ + public createTeamConnections( + param: TeamConnectionsApiCreateTeamConnectionsRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.createTeamConnections( + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createTeamConnections(responseContext); + }); + }); + } + + /** + * Delete multiple team connections. + * @param param The request object + */ + public deleteTeamConnections( + param: TeamConnectionsApiDeleteTeamConnectionsRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.deleteTeamConnections( + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.deleteTeamConnections(responseContext); + }); + }); + } + + /** + * Returns all team connections. + * @param param The request object + */ + public listTeamConnections( + param: TeamConnectionsApiListTeamConnectionsRequest = {}, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.listTeamConnections( + param.pageSize, + param.pageNumber, + param.filterSources, + param.filterTeamIds, + param.filterConnectedTeamIds, + param.filterConnectionIds, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listTeamConnections(responseContext); + }); + }); + } + + /** + * Provide a paginated version of listTeamConnections returning a generator with all the items. + */ + public async *listTeamConnectionsWithPagination( + param: TeamConnectionsApiListTeamConnectionsRequest = {}, + options?: Configuration + ): AsyncGenerator { + let pageSize = 10; + if (param.pageSize !== undefined) { + pageSize = param.pageSize; + } + param.pageSize = pageSize; + param.pageNumber = 0; + while (true) { + const requestContext = await this.requestFactory.listTeamConnections( + param.pageSize, + param.pageNumber, + param.filterSources, + param.filterTeamIds, + param.filterConnectedTeamIds, + param.filterConnectionIds, + options + ); + const responseContext = await this.configuration.httpApi.send( + requestContext + ); + + const response = await this.responseProcessor.listTeamConnections( + responseContext + ); + const responseData = response.data; + if (responseData === undefined) { + break; + } + const results = responseData; + for (const item of results) { + yield item; + } + if (results.length < pageSize) { + break; + } + param.pageNumber = param.pageNumber + 1; + } + } +} diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index d8a798bb18fe..e5f2573ec8fc 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -849,6 +849,13 @@ export { SyntheticsApi, } from "./apis/SyntheticsApi"; +export { + TeamConnectionsApiCreateTeamConnectionsRequest, + TeamConnectionsApiDeleteTeamConnectionsRequest, + TeamConnectionsApiListTeamConnectionsRequest, + TeamConnectionsApi, +} from "./apis/TeamConnectionsApi"; + export { TeamsApiAddMemberTeamRequest, TeamsApiCreateTeamRequest, @@ -1553,10 +1560,15 @@ export { ConfluentResourceResponseAttributes } from "./models/ConfluentResourceR export { ConfluentResourceResponseData } from "./models/ConfluentResourceResponseData"; export { ConfluentResourcesResponse } from "./models/ConfluentResourcesResponse"; export { ConfluentResourceType } from "./models/ConfluentResourceType"; +export { ConnectedTeamRef } from "./models/ConnectedTeamRef"; +export { ConnectedTeamRefData } from "./models/ConnectedTeamRefData"; +export { ConnectedTeamRefDataType } from "./models/ConnectedTeamRefDataType"; export { Connection } from "./models/Connection"; export { ConnectionEnv } from "./models/ConnectionEnv"; export { ConnectionEnvEnv } from "./models/ConnectionEnvEnv"; export { ConnectionGroup } from "./models/ConnectionGroup"; +export { ConnectionsPagePagination } from "./models/ConnectionsPagePagination"; +export { ConnectionsResponseMeta } from "./models/ConnectionsResponseMeta"; export { Container } from "./models/Container"; export { ContainerAttributes } from "./models/ContainerAttributes"; export { ContainerGroup } from "./models/ContainerGroup"; @@ -4133,6 +4145,15 @@ export { TableRowResourceDataType } from "./models/TableRowResourceDataType"; export { TagFilter } from "./models/TagFilter"; export { Team } from "./models/Team"; export { TeamAttributes } from "./models/TeamAttributes"; +export { TeamConnection } from "./models/TeamConnection"; +export { TeamConnectionAttributes } from "./models/TeamConnectionAttributes"; +export { TeamConnectionCreateData } from "./models/TeamConnectionCreateData"; +export { TeamConnectionCreateRequest } from "./models/TeamConnectionCreateRequest"; +export { TeamConnectionDeleteRequest } from "./models/TeamConnectionDeleteRequest"; +export { TeamConnectionDeleteRequestDataItem } from "./models/TeamConnectionDeleteRequestDataItem"; +export { TeamConnectionRelationships } from "./models/TeamConnectionRelationships"; +export { TeamConnectionsResponse } from "./models/TeamConnectionsResponse"; +export { TeamConnectionType } from "./models/TeamConnectionType"; export { TeamCreate } from "./models/TeamCreate"; export { TeamCreateAttributes } from "./models/TeamCreateAttributes"; export { TeamCreateRelationships } from "./models/TeamCreateRelationships"; @@ -4166,6 +4187,9 @@ export { TeamPermissionSettingUpdate } from "./models/TeamPermissionSettingUpdat export { TeamPermissionSettingUpdateAttributes } from "./models/TeamPermissionSettingUpdateAttributes"; export { TeamPermissionSettingUpdateRequest } from "./models/TeamPermissionSettingUpdateRequest"; export { TeamPermissionSettingValue } from "./models/TeamPermissionSettingValue"; +export { TeamRef } from "./models/TeamRef"; +export { TeamRefData } from "./models/TeamRefData"; +export { TeamRefDataType } from "./models/TeamRefDataType"; export { TeamReference } from "./models/TeamReference"; export { TeamReferenceAttributes } from "./models/TeamReferenceAttributes"; export { TeamReferenceType } from "./models/TeamReferenceType"; diff --git a/packages/datadog-api-client-v2/models/ConnectedTeamRef.ts b/packages/datadog-api-client-v2/models/ConnectedTeamRef.ts new file mode 100644 index 000000000000..63c26b83fac7 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ConnectedTeamRef.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ConnectedTeamRefData } from "./ConnectedTeamRefData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Reference to a team from an external system. + */ +export class ConnectedTeamRef { + /** + * Reference to connected external team. + */ + "data"?: ConnectedTeamRefData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "ConnectedTeamRefData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ConnectedTeamRef.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ConnectedTeamRefData.ts b/packages/datadog-api-client-v2/models/ConnectedTeamRefData.ts new file mode 100644 index 000000000000..753369a3b534 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ConnectedTeamRefData.ts @@ -0,0 +1,63 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ConnectedTeamRefDataType } from "./ConnectedTeamRefDataType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Reference to connected external team. + */ +export class ConnectedTeamRefData { + /** + * The connected team ID as it is referenced throughout the Datadog ecosystem. + */ + "id": string; + /** + * External team resource type. + */ + "type": ConnectedTeamRefDataType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "ConnectedTeamRefDataType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ConnectedTeamRefData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ConnectedTeamRefDataType.ts b/packages/datadog-api-client-v2/models/ConnectedTeamRefDataType.ts new file mode 100644 index 000000000000..3cc6d0e9bda6 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ConnectedTeamRefDataType.ts @@ -0,0 +1,14 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * External team resource type. + */ + +export type ConnectedTeamRefDataType = typeof GITHUB_TEAM | UnparsedObject; +export const GITHUB_TEAM = "github_team"; diff --git a/packages/datadog-api-client-v2/models/ConnectionsPagePagination.ts b/packages/datadog-api-client-v2/models/ConnectionsPagePagination.ts new file mode 100644 index 000000000000..4307b7083721 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ConnectionsPagePagination.ts @@ -0,0 +1,115 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Page-based pagination metadata. + */ +export class ConnectionsPagePagination { + /** + * The first page number. + */ + "firstNumber"?: number; + /** + * The last page number. + */ + "lastNumber"?: number; + /** + * The next page number. + */ + "nextNumber"?: number; + /** + * The current page number. + */ + "number"?: number; + /** + * The previous page number. + */ + "prevNumber"?: number; + /** + * The page size. + */ + "size"?: number; + /** + * Total connections matching request. + */ + "total"?: number; + /** + * Pagination type. + */ + "type"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + firstNumber: { + baseName: "first_number", + type: "number", + format: "int64", + }, + lastNumber: { + baseName: "last_number", + type: "number", + format: "int64", + }, + nextNumber: { + baseName: "next_number", + type: "number", + format: "int64", + }, + number: { + baseName: "number", + type: "number", + format: "int64", + }, + prevNumber: { + baseName: "prev_number", + type: "number", + format: "int64", + }, + size: { + baseName: "size", + type: "number", + format: "int64", + }, + total: { + baseName: "total", + type: "number", + format: "int64", + }, + type: { + baseName: "type", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ConnectionsPagePagination.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ConnectionsResponseMeta.ts b/packages/datadog-api-client-v2/models/ConnectionsResponseMeta.ts new file mode 100644 index 000000000000..b1f3153d3c1c --- /dev/null +++ b/packages/datadog-api-client-v2/models/ConnectionsResponseMeta.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ConnectionsPagePagination } from "./ConnectionsPagePagination"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Connections response metadata. + */ +export class ConnectionsResponseMeta { + /** + * Page-based pagination metadata. + */ + "page"?: ConnectionsPagePagination; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + page: { + baseName: "page", + type: "ConnectionsPagePagination", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ConnectionsResponseMeta.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index 5e6e4f75751b..5c939c7f03ea 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -470,9 +470,13 @@ import { ConfluentResourceResponse } from "./ConfluentResourceResponse"; import { ConfluentResourceResponseAttributes } from "./ConfluentResourceResponseAttributes"; import { ConfluentResourceResponseData } from "./ConfluentResourceResponseData"; import { ConfluentResourcesResponse } from "./ConfluentResourcesResponse"; +import { ConnectedTeamRef } from "./ConnectedTeamRef"; +import { ConnectedTeamRefData } from "./ConnectedTeamRefData"; import { Connection } from "./Connection"; import { ConnectionEnv } from "./ConnectionEnv"; import { ConnectionGroup } from "./ConnectionGroup"; +import { ConnectionsPagePagination } from "./ConnectionsPagePagination"; +import { ConnectionsResponseMeta } from "./ConnectionsResponseMeta"; import { Container } from "./Container"; import { ContainerAttributes } from "./ContainerAttributes"; import { ContainerGroup } from "./ContainerGroup"; @@ -2392,6 +2396,14 @@ import { TableRowResourceDataAttributes } from "./TableRowResourceDataAttributes import { TagFilter } from "./TagFilter"; import { Team } from "./Team"; import { TeamAttributes } from "./TeamAttributes"; +import { TeamConnection } from "./TeamConnection"; +import { TeamConnectionAttributes } from "./TeamConnectionAttributes"; +import { TeamConnectionCreateData } from "./TeamConnectionCreateData"; +import { TeamConnectionCreateRequest } from "./TeamConnectionCreateRequest"; +import { TeamConnectionDeleteRequest } from "./TeamConnectionDeleteRequest"; +import { TeamConnectionDeleteRequestDataItem } from "./TeamConnectionDeleteRequestDataItem"; +import { TeamConnectionRelationships } from "./TeamConnectionRelationships"; +import { TeamConnectionsResponse } from "./TeamConnectionsResponse"; import { TeamCreate } from "./TeamCreate"; import { TeamCreateAttributes } from "./TeamCreateAttributes"; import { TeamCreateRelationships } from "./TeamCreateRelationships"; @@ -2416,6 +2428,8 @@ import { TeamPermissionSettingUpdate } from "./TeamPermissionSettingUpdate"; import { TeamPermissionSettingUpdateAttributes } from "./TeamPermissionSettingUpdateAttributes"; import { TeamPermissionSettingUpdateRequest } from "./TeamPermissionSettingUpdateRequest"; import { TeamPermissionSettingsResponse } from "./TeamPermissionSettingsResponse"; +import { TeamRef } from "./TeamRef"; +import { TeamRefData } from "./TeamRefData"; import { TeamReference } from "./TeamReference"; import { TeamReferenceAttributes } from "./TeamReferenceAttributes"; import { TeamRelationships } from "./TeamRelationships"; @@ -2929,6 +2943,7 @@ const enumsMap: { [key: string]: any[] } = { ConfigCatSDKKeyType: ["ConfigCatSDKKey"], ConfluentAccountType: ["confluent-cloud-accounts"], ConfluentResourceType: ["confluent-cloud-resources"], + ConnectedTeamRefDataType: ["github_team"], ConnectionEnvEnv: ["default"], ContainerGroupType: ["container_group"], ContainerImageGroupType: ["container_image_group"], @@ -4070,6 +4085,7 @@ const enumsMap: { [key: string]: any[] } = { ], TableResultV2DataType: ["reference_table"], TableRowResourceDataType: ["row"], + TeamConnectionType: ["team_connection"], TeamLinkType: ["team_links"], TeamOnCallRespondersDataRelationshipsEscalationsDataItemsType: [ "escalation_policy_steps", @@ -4085,6 +4101,7 @@ const enumsMap: { [key: string]: any[] } = { "user_access_manage", "teams_manage", ], + TeamRefDataType: ["team"], TeamReferenceType: ["teams"], TeamRoutingRulesDataRelationshipsRulesDataItemsType: ["team_routing_rules"], TeamRoutingRulesDataType: ["team_routing_rules"], @@ -4809,9 +4826,13 @@ const typeMap: { [index: string]: any } = { ConfluentResourceResponseAttributes: ConfluentResourceResponseAttributes, ConfluentResourceResponseData: ConfluentResourceResponseData, ConfluentResourcesResponse: ConfluentResourcesResponse, + ConnectedTeamRef: ConnectedTeamRef, + ConnectedTeamRefData: ConnectedTeamRefData, Connection: Connection, ConnectionEnv: ConnectionEnv, ConnectionGroup: ConnectionGroup, + ConnectionsPagePagination: ConnectionsPagePagination, + ConnectionsResponseMeta: ConnectionsResponseMeta, Container: Container, ContainerAttributes: ContainerAttributes, ContainerGroup: ContainerGroup, @@ -7093,6 +7114,14 @@ const typeMap: { [index: string]: any } = { TagFilter: TagFilter, Team: Team, TeamAttributes: TeamAttributes, + TeamConnection: TeamConnection, + TeamConnectionAttributes: TeamConnectionAttributes, + TeamConnectionCreateData: TeamConnectionCreateData, + TeamConnectionCreateRequest: TeamConnectionCreateRequest, + TeamConnectionDeleteRequest: TeamConnectionDeleteRequest, + TeamConnectionDeleteRequestDataItem: TeamConnectionDeleteRequestDataItem, + TeamConnectionRelationships: TeamConnectionRelationships, + TeamConnectionsResponse: TeamConnectionsResponse, TeamCreate: TeamCreate, TeamCreateAttributes: TeamCreateAttributes, TeamCreateRelationships: TeamCreateRelationships, @@ -7121,6 +7150,8 @@ const typeMap: { [index: string]: any } = { TeamPermissionSettingUpdateAttributes: TeamPermissionSettingUpdateAttributes, TeamPermissionSettingUpdateRequest: TeamPermissionSettingUpdateRequest, TeamPermissionSettingsResponse: TeamPermissionSettingsResponse, + TeamRef: TeamRef, + TeamRefData: TeamRefData, TeamReference: TeamReference, TeamReferenceAttributes: TeamReferenceAttributes, TeamRelationships: TeamRelationships, diff --git a/packages/datadog-api-client-v2/models/TeamConnection.ts b/packages/datadog-api-client-v2/models/TeamConnection.ts new file mode 100644 index 000000000000..62e75920d032 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamConnection.ts @@ -0,0 +1,81 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamConnectionAttributes } from "./TeamConnectionAttributes"; +import { TeamConnectionRelationships } from "./TeamConnectionRelationships"; +import { TeamConnectionType } from "./TeamConnectionType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A relationship between a Datadog team and a team from another external system. + */ +export class TeamConnection { + /** + * Attributes of the team connection. + */ + "attributes"?: TeamConnectionAttributes; + /** + * The unique identifier of the team connection. + */ + "id": string; + /** + * Relationships of the team connection. + */ + "relationships"?: TeamConnectionRelationships; + /** + * Team connection resource type. + */ + "type": TeamConnectionType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "TeamConnectionAttributes", + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + relationships: { + baseName: "relationships", + type: "TeamConnectionRelationships", + }, + type: { + baseName: "type", + type: "TeamConnectionType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamConnection.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamConnectionAttributes.ts b/packages/datadog-api-client-v2/models/TeamConnectionAttributes.ts new file mode 100644 index 000000000000..46c0b4700ae4 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamConnectionAttributes.ts @@ -0,0 +1,60 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes of the team connection. + */ +export class TeamConnectionAttributes { + /** + * The entity that manages this team connection. + */ + "managedBy"?: string; + /** + * The name of the external source. + */ + "source"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + managedBy: { + baseName: "managed_by", + type: "string", + }, + source: { + baseName: "source", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamConnectionAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamConnectionCreateData.ts b/packages/datadog-api-client-v2/models/TeamConnectionCreateData.ts new file mode 100644 index 000000000000..4eab40772da5 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamConnectionCreateData.ts @@ -0,0 +1,72 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamConnectionAttributes } from "./TeamConnectionAttributes"; +import { TeamConnectionRelationships } from "./TeamConnectionRelationships"; +import { TeamConnectionType } from "./TeamConnectionType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data for creating a team connection. + */ +export class TeamConnectionCreateData { + /** + * Attributes of the team connection. + */ + "attributes"?: TeamConnectionAttributes; + /** + * Relationships of the team connection. + */ + "relationships"?: TeamConnectionRelationships; + /** + * Team connection resource type. + */ + "type": TeamConnectionType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "TeamConnectionAttributes", + }, + relationships: { + baseName: "relationships", + type: "TeamConnectionRelationships", + }, + type: { + baseName: "type", + type: "TeamConnectionType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamConnectionCreateData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamConnectionCreateRequest.ts b/packages/datadog-api-client-v2/models/TeamConnectionCreateRequest.ts new file mode 100644 index 000000000000..4efceaec30f1 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamConnectionCreateRequest.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamConnectionCreateData } from "./TeamConnectionCreateData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Request for creating team connections. + */ +export class TeamConnectionCreateRequest { + /** + * Array of team connections to create. + */ + "data": Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamConnectionCreateRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamConnectionDeleteRequest.ts b/packages/datadog-api-client-v2/models/TeamConnectionDeleteRequest.ts new file mode 100644 index 000000000000..29cfbd269faa --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamConnectionDeleteRequest.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamConnectionDeleteRequestDataItem } from "./TeamConnectionDeleteRequestDataItem"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Request for deleting team connections. + */ +export class TeamConnectionDeleteRequest { + /** + * Array of team connection IDs to delete. + */ + "data": Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamConnectionDeleteRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamConnectionDeleteRequestDataItem.ts b/packages/datadog-api-client-v2/models/TeamConnectionDeleteRequestDataItem.ts new file mode 100644 index 000000000000..0e60aabeec33 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamConnectionDeleteRequestDataItem.ts @@ -0,0 +1,63 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamConnectionType } from "./TeamConnectionType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A collection of connection ids to delete. + */ +export class TeamConnectionDeleteRequestDataItem { + /** + * The unique identifier of the team connection to delete. + */ + "id": string; + /** + * Team connection resource type. + */ + "type": TeamConnectionType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "TeamConnectionType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamConnectionDeleteRequestDataItem.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamConnectionRelationships.ts b/packages/datadog-api-client-v2/models/TeamConnectionRelationships.ts new file mode 100644 index 000000000000..bf0940a819d2 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamConnectionRelationships.ts @@ -0,0 +1,62 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ConnectedTeamRef } from "./ConnectedTeamRef"; +import { TeamRef } from "./TeamRef"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Relationships of the team connection. + */ +export class TeamConnectionRelationships { + /** + * Reference to a team from an external system. + */ + "connectedTeam"?: ConnectedTeamRef; + /** + * Reference to a Datadog team. + */ + "team"?: TeamRef; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + connectedTeam: { + baseName: "connected_team", + type: "ConnectedTeamRef", + }, + team: { + baseName: "team", + type: "TeamRef", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamConnectionRelationships.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamConnectionType.ts b/packages/datadog-api-client-v2/models/TeamConnectionType.ts new file mode 100644 index 000000000000..ec16c9c1eeea --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamConnectionType.ts @@ -0,0 +1,14 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Team connection resource type. + */ + +export type TeamConnectionType = typeof TEAM_CONNECTION | UnparsedObject; +export const TEAM_CONNECTION = "team_connection"; diff --git a/packages/datadog-api-client-v2/models/TeamConnectionsResponse.ts b/packages/datadog-api-client-v2/models/TeamConnectionsResponse.ts new file mode 100644 index 000000000000..0ad5f5649023 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamConnectionsResponse.ts @@ -0,0 +1,62 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ConnectionsResponseMeta } from "./ConnectionsResponseMeta"; +import { TeamConnection } from "./TeamConnection"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response containing information about multiple team connections. + */ +export class TeamConnectionsResponse { + /** + * Array of team connections. + */ + "data"?: Array; + /** + * Connections response metadata. + */ + "meta"?: ConnectionsResponseMeta; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + }, + meta: { + baseName: "meta", + type: "ConnectionsResponseMeta", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamConnectionsResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamRef.ts b/packages/datadog-api-client-v2/models/TeamRef.ts new file mode 100644 index 000000000000..2c8dbdfa6b84 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamRef.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamRefData } from "./TeamRefData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Reference to a Datadog team. + */ +export class TeamRef { + /** + * Reference to a Datadog team. + */ + "data"?: TeamRefData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "TeamRefData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamRef.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamRefData.ts b/packages/datadog-api-client-v2/models/TeamRefData.ts new file mode 100644 index 000000000000..54761f2dd29b --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamRefData.ts @@ -0,0 +1,63 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamRefDataType } from "./TeamRefDataType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Reference to a Datadog team. + */ +export class TeamRefData { + /** + * The Datadog team ID. + */ + "id": string; + /** + * Datadog team resource type. + */ + "type": TeamRefDataType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "TeamRefDataType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamRefData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamRefDataType.ts b/packages/datadog-api-client-v2/models/TeamRefDataType.ts new file mode 100644 index 000000000000..3e54e966d7df --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamRefDataType.ts @@ -0,0 +1,14 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Datadog team resource type. + */ + +export type TeamRefDataType = typeof TEAM | UnparsedObject; +export const TEAM = "team";