From 256f2a55b744b7e512d84ce8b8466ae57588dfd6 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 22 May 2026 13:56:07 +0000 Subject: [PATCH] Regenerate client from commit 66bd9ba of spec repo --- .generator/schemas/v2/openapi.yaml | 281 +++++++++ .../v2/entity_integration_configs.feature | 77 +++ features/v2/undo.json | 18 + packages/datadog-api-client/README.md | 1 + .../src/support/scenarios_model_mapping.ts | 25 + .../entity_integration_configs/.yarnrc.yml | 1 + services/entity_integration_configs/README.md | 44 ++ .../entity_integration_configs/package.json | 43 ++ .../entity_integration_configs/src/index.ts | 3 + .../src/v2/EntityIntegrationConfigsApi.ts | 567 ++++++++++++++++++ .../src/v2/index.ts | 19 + .../src/v2/models/APIErrorResponse.ts | 45 ++ .../EntityIntegrationConfigAttributes.ts | 64 ++ .../v2/models/EntityIntegrationConfigData.ts | 66 ++ .../models/EntityIntegrationConfigRequest.ts | 47 ++ ...ntityIntegrationConfigRequestAttributes.ts | 45 ++ .../EntityIntegrationConfigRequestData.ts | 57 ++ .../EntityIntegrationConfigRequestType.ts | 10 + .../models/EntityIntegrationConfigResponse.ts | 47 ++ .../v2/models/EntityIntegrationConfigType.ts | 9 + .../src/v2/models/JSONAPIErrorItem.ts | 78 +++ .../src/v2/models/JSONAPIErrorItemSource.ts | 60 ++ .../src/v2/models/JSONAPIErrorResponse.ts | 47 ++ .../src/v2/models/TypingInfo.ts | 33 + .../entity_integration_configs/tsconfig.json | 28 + yarn.lock | 9 + 26 files changed, 1724 insertions(+) create mode 100644 features/v2/entity_integration_configs.feature create mode 100644 services/entity_integration_configs/.yarnrc.yml create mode 100644 services/entity_integration_configs/README.md create mode 100644 services/entity_integration_configs/package.json create mode 100644 services/entity_integration_configs/src/index.ts create mode 100644 services/entity_integration_configs/src/v2/EntityIntegrationConfigsApi.ts create mode 100644 services/entity_integration_configs/src/v2/index.ts create mode 100644 services/entity_integration_configs/src/v2/models/APIErrorResponse.ts create mode 100644 services/entity_integration_configs/src/v2/models/EntityIntegrationConfigAttributes.ts create mode 100644 services/entity_integration_configs/src/v2/models/EntityIntegrationConfigData.ts create mode 100644 services/entity_integration_configs/src/v2/models/EntityIntegrationConfigRequest.ts create mode 100644 services/entity_integration_configs/src/v2/models/EntityIntegrationConfigRequestAttributes.ts create mode 100644 services/entity_integration_configs/src/v2/models/EntityIntegrationConfigRequestData.ts create mode 100644 services/entity_integration_configs/src/v2/models/EntityIntegrationConfigRequestType.ts create mode 100644 services/entity_integration_configs/src/v2/models/EntityIntegrationConfigResponse.ts create mode 100644 services/entity_integration_configs/src/v2/models/EntityIntegrationConfigType.ts create mode 100644 services/entity_integration_configs/src/v2/models/JSONAPIErrorItem.ts create mode 100644 services/entity_integration_configs/src/v2/models/JSONAPIErrorItemSource.ts create mode 100644 services/entity_integration_configs/src/v2/models/JSONAPIErrorResponse.ts create mode 100644 services/entity_integration_configs/src/v2/models/TypingInfo.ts create mode 100644 services/entity_integration_configs/tsconfig.json diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 97213ec2fe9e..aa59f26ddf77 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -435,6 +435,14 @@ components: schema: example: "service:myservice" type: string + EntityIntegrationConfigID: + description: The identifier of the integration whose configuration is being managed. Supported values are `github`, `jira`, and `pagerduty`. + in: path + name: integration_id + required: true + schema: + example: github + type: string FastlyAccountID: description: Fastly Account id. in: path @@ -27199,6 +27207,103 @@ components: description: Entity. type: string type: object + EntityIntegrationConfigAttributes: + description: The organization ID, integration identifier, and integration-specific configuration payload for an entity integration configuration. + properties: + config: + $ref: "#/components/schemas/EntityIntegrationConfigPayload" + integration_id: + description: The identifier of the integration this configuration applies to (for example, `github`, `jira`, or `pagerduty`). + example: github + type: string + org_id: + description: The Datadog organization identifier that owns this configuration. + example: 1234 + format: int64 + type: integer + required: + - org_id + - integration_id + - config + type: object + EntityIntegrationConfigData: + description: JSON:API resource object for an entity integration configuration. + properties: + attributes: + $ref: "#/components/schemas/EntityIntegrationConfigAttributes" + id: + description: Unique identifier of the entity integration configuration. + example: 01HJABCD12345678ABCDEFGHIJ + type: string + type: + $ref: "#/components/schemas/EntityIntegrationConfigType" + required: + - id + - type + - attributes + type: object + EntityIntegrationConfigPayload: + additionalProperties: {} + description: Integration-specific configuration payload. The shape of this object depends on the integration identified by the path parameter. For `github`, the object must contain an `enabled_repos` array. For `jira`, it must contain an `enabled_projects` array. For `pagerduty`, it must contain an `accounts` array. + example: + enabled_repos: + - github_org_name: myorg + hostname: github.com + repo_name: myrepo + type: object + EntityIntegrationConfigRequest: + description: Request body used to create or replace the configuration for a given integration. + properties: + data: + $ref: "#/components/schemas/EntityIntegrationConfigRequestData" + required: + - data + type: object + EntityIntegrationConfigRequestAttributes: + description: Attributes used to create or update an entity integration configuration. + properties: + config: + $ref: "#/components/schemas/EntityIntegrationConfigPayload" + required: + - config + type: object + EntityIntegrationConfigRequestData: + description: JSON:API resource object used in a request to create or update an entity integration configuration. + properties: + attributes: + $ref: "#/components/schemas/EntityIntegrationConfigRequestAttributes" + type: + $ref: "#/components/schemas/EntityIntegrationConfigRequestType" + required: + - type + - attributes + type: object + EntityIntegrationConfigRequestType: + default: entity_integration_config_requests + description: JSON:API resource type for the entity integration configuration create or update request. Always `entity_integration_config_requests`. + enum: + - entity_integration_config_requests + example: entity_integration_config_requests + type: string + x-enum-varnames: + - ENTITY_INTEGRATION_CONFIG_REQUESTS + EntityIntegrationConfigResponse: + description: JSON:API document containing a single entity integration configuration resource. + properties: + data: + $ref: "#/components/schemas/EntityIntegrationConfigData" + required: + - data + type: object + EntityIntegrationConfigType: + default: entity_integration_configs + description: JSON:API resource type for an entity integration configuration. Always `entity_integration_configs`. + enum: + - entity_integration_configs + example: entity_integration_configs + type: string + x-enum-varnames: + - ENTITY_INTEGRATION_CONFIGS EntityMeta: description: Entity metadata. properties: @@ -114501,6 +114606,180 @@ paths: x-unstable: |- **Note**: This endpoint is in public beta and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/idp/entity_integrations/{integration_id}: + delete: + description: Delete the configuration stored for a given integration in the caller's organization. + operationId: DeleteEntityIntegrationConfig + parameters: + - $ref: "#/components/parameters/EntityIntegrationConfigID" + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Delete an entity integration configuration + tags: + - Entity Integration Configs + x-permission: + operator: OR + permissions: + - manage_integrations + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + get: + description: Retrieve the configuration currently stored for a given integration in the caller's organization. + operationId: GetEntityIntegrationConfig + parameters: + - $ref: "#/components/parameters/EntityIntegrationConfigID" + responses: + "200": + content: + application/json: + example: + data: + attributes: + config: + enabled_repos: + - github_org_name: myorg + hostname: github.com + repo_name: myrepo + integration_id: github + org_id: 1234 + id: 01HJABCD12345678ABCDEFGHIJ + type: entity_integration_configs + schema: + $ref: "#/components/schemas/EntityIntegrationConfigResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get an entity integration configuration + tags: + - Entity Integration Configs + x-permission: + operator: OR + permissions: + - integrations_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + put: + description: |- + Create or replace the configuration for a given integration in the caller's organization. The shape of `data.attributes.config` depends on the integration: + + - For `github`: `config` must contain an `enabled_repos` array of objects with `hostname`, `github_org_name`, and `repo_name`. + - For `jira`: `config` must contain an `enabled_projects` array of objects with `hostname`, `account_id`, and `project_key`. + - For `pagerduty`: `config` must contain an `accounts` array of objects with a required `enabled` boolean and an optional `subdomain` string. + operationId: UpdateEntityIntegrationConfig + parameters: + - $ref: "#/components/parameters/EntityIntegrationConfigID" + requestBody: + content: + application/json: + examples: + default: + summary: GitHub integration configuration + value: + data: + attributes: + config: + enabled_repos: + - github_org_name: myorg + hostname: github.com + repo_name: myrepo + type: entity_integration_config_requests + jira: + summary: Jira integration configuration + value: + data: + attributes: + config: + enabled_projects: + - account_id: "123456789" + hostname: mycompany.atlassian.net + project_key: AAA + type: entity_integration_config_requests + pagerduty: + summary: PagerDuty integration configuration + value: + data: + attributes: + config: + accounts: + - enabled: true + subdomain: mycompany + type: entity_integration_config_requests + schema: + $ref: "#/components/schemas/EntityIntegrationConfigRequest" + required: true + responses: + "200": + content: + application/json: + example: + data: + attributes: + config: + enabled_repos: + - github_org_name: myorg + hostname: github.com + repo_name: myrepo + integration_id: github + org_id: 1234 + id: 01HJABCD12345678ABCDEFGHIJ + type: entity_integration_configs + schema: + $ref: "#/components/schemas/EntityIntegrationConfigResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create or update entity integration configuration + tags: + - Entity Integration Configs + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - integrations_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/incidents: get: description: >- @@ -161782,6 +162061,8 @@ tags: scopes from alerting. Downtime settings, which can be scheduled with start and end times, prevent all alerting related to specified Datadog tags. name: Downtimes + - description: Manage per-integration configurations for the Internal Developer Portal (IDP). These configurations control which external resources (for example, GitHub repositories, Jira projects, or PagerDuty services) are synced as entities into the Software Catalog. + name: Entity Integration Configs - description: Retrieves security risk scores for entities in your organization. name: Entity Risk Scores - description: View and manage issues within Error Tracking. See the [Error Tracking page](https://docs.datadoghq.com/error_tracking/) for more information. diff --git a/features/v2/entity_integration_configs.feature b/features/v2/entity_integration_configs.feature new file mode 100644 index 000000000000..3a672f8e40c6 --- /dev/null +++ b/features/v2/entity_integration_configs.feature @@ -0,0 +1,77 @@ +@endpoint(entity-integration-configs) @endpoint(entity-integration-configs-v2) +Feature: Entity Integration Configs + Manage per-integration configurations for the Internal Developer Portal + (IDP). These configurations control which external resources (for example, + GitHub repositories, Jira projects, or PagerDuty services) are synced as + entities into the Software Catalog. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "EntityIntegrationConfigs" API + + @generated @skip @team:DataDog/idp + Scenario: Create or update entity integration configuration returns "Bad Request" response + Given operation "UpdateEntityIntegrationConfig" enabled + And new "UpdateEntityIntegrationConfig" request + And request contains "integration_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"config": {"enabled_repos": [{"github_org_name": "myorg", "hostname": "github.com", "repo_name": "myrepo"}]}}, "type": "entity_integration_config_requests"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/idp + Scenario: Create or update entity integration configuration returns "OK" response + Given operation "UpdateEntityIntegrationConfig" enabled + And new "UpdateEntityIntegrationConfig" request + And request contains "integration_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"config": {"enabled_repos": [{"github_org_name": "myorg", "hostname": "github.com", "repo_name": "myrepo"}]}}, "type": "entity_integration_config_requests"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/idp + Scenario: Delete an entity integration configuration returns "Bad Request" response + Given operation "DeleteEntityIntegrationConfig" enabled + And new "DeleteEntityIntegrationConfig" request + And request contains "integration_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/idp + Scenario: Delete an entity integration configuration returns "No Content" response + Given operation "DeleteEntityIntegrationConfig" enabled + And new "DeleteEntityIntegrationConfig" request + And request contains "integration_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/idp + Scenario: Delete an entity integration configuration returns "Not Found" response + Given operation "DeleteEntityIntegrationConfig" enabled + And new "DeleteEntityIntegrationConfig" request + And request contains "integration_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/idp + Scenario: Get an entity integration configuration returns "Bad Request" response + Given operation "GetEntityIntegrationConfig" enabled + And new "GetEntityIntegrationConfig" request + And request contains "integration_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/idp + Scenario: Get an entity integration configuration returns "Not Found" response + Given operation "GetEntityIntegrationConfig" enabled + And new "GetEntityIntegrationConfig" request + And request contains "integration_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/idp + Scenario: Get an entity integration configuration returns "OK" response + Given operation "GetEntityIntegrationConfig" enabled + And new "GetEntityIntegrationConfig" request + And request contains "integration_id" parameter from "REPLACE.ME" + 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 7a8309d2ceff..239b1a7a03f1 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -2550,6 +2550,24 @@ "type": "unsafe" } }, + "DeleteEntityIntegrationConfig": { + "tag": "Entity Integration Configs", + "undo": { + "type": "idempotent" + } + }, + "GetEntityIntegrationConfig": { + "tag": "Entity Integration Configs", + "undo": { + "type": "safe" + } + }, + "UpdateEntityIntegrationConfig": { + "tag": "Entity Integration Configs", + "undo": { + "type": "idempotent" + } + }, "ListIncidents": { "tag": "Incidents", "undo": { diff --git a/packages/datadog-api-client/README.md b/packages/datadog-api-client/README.md index c8fd41dbf166..a9e37547d099 100644 --- a/packages/datadog-api-client/README.md +++ b/packages/datadog-api-client/README.md @@ -388,6 +388,7 @@ apiInstance | Domain Allowlist | @datadog/datadog-api-client-domain-allowlist | [README.md](../../services/domain-allowlist/README.md) | | DORA Metrics | @datadog/datadog-api-client-dora-metrics | [README.md](../../services/dora-metrics/README.md) | | Downtimes | @datadog/datadog-api-client-downtimes | [README.md](../../services/downtimes/README.md) | +| Entity Integration Configs | @datadog/datadog-api-client-entity-integration-configs | [README.md](../../services/entity-integration-configs/README.md) | | Entity Risk Scores | @datadog/datadog-api-client-entity-risk-scores | [README.md](../../services/entity-risk-scores/README.md) | | Error Tracking | @datadog/datadog-api-client-error-tracking | [README.md](../../services/error-tracking/README.md) | | Events | @datadog/datadog-api-client-events | [README.md](../../services/events/README.md) | diff --git a/private/bdd_runner/src/support/scenarios_model_mapping.ts b/private/bdd_runner/src/support/scenarios_model_mapping.ts index 00c031ed925d..a224e76dd177 100644 --- a/private/bdd_runner/src/support/scenarios_model_mapping.ts +++ b/private/bdd_runner/src/support/scenarios_model_mapping.ts @@ -8405,6 +8405,31 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = { }, operationResponseType: "HamrOrgConnectionResponse", }, + "EntityIntegrationConfigsApi.V2.GetEntityIntegrationConfig": { + integrationId: { + type: "string", + format: "", + }, + operationResponseType: "EntityIntegrationConfigResponse", + }, + "EntityIntegrationConfigsApi.V2.UpdateEntityIntegrationConfig": { + integrationId: { + type: "string", + format: "", + }, + body: { + type: "EntityIntegrationConfigRequest", + format: "", + }, + operationResponseType: "EntityIntegrationConfigResponse", + }, + "EntityIntegrationConfigsApi.V2.DeleteEntityIntegrationConfig": { + integrationId: { + type: "string", + format: "", + }, + operationResponseType: "{}", + }, "IncidentsApi.V2.ListIncidents": { include: { type: "Array", diff --git a/services/entity_integration_configs/.yarnrc.yml b/services/entity_integration_configs/.yarnrc.yml new file mode 100644 index 000000000000..3186f3f0795a --- /dev/null +++ b/services/entity_integration_configs/.yarnrc.yml @@ -0,0 +1 @@ +nodeLinker: node-modules diff --git a/services/entity_integration_configs/README.md b/services/entity_integration_configs/README.md new file mode 100644 index 000000000000..ddeb578d86c0 --- /dev/null +++ b/services/entity_integration_configs/README.md @@ -0,0 +1,44 @@ +# @datadog/datadog-api-client-entity-integration-configs + +## Description + +Manage per-integration configurations for the Internal Developer Portal (IDP). These configurations control which external resources (for example, GitHub repositories, Jira projects, or PagerDuty services) are synced as entities into the Software Catalog. + +## Navigation + +- [Installation](#installation) +- [Getting Started](#getting-started) + +## Installation + +```sh +# NPM +npm install @datadog/datadog-api-client-entity-integration-configs +# Yarn +yarn add @datadog/datadog-api-client-entity-integration-configs +``` + +## Getting Started +```ts +import { createConfiguration } from "@datadog/datadog-api-client"; +import { EntityIntegrationConfigsApiV2 } from "@datadog/datadog-api-client-entity-integration-configs"; +import { v2 } from "@datadog/datadog-api-client-entity-integration-configs"; + +const configuration = createConfiguration(); +// Enable unstable operations +const configurationOpts = { + unstableOperations: { + "EntityIntegrationConfigsApi.v2.getEntityIntegrationConfig": true + } +} + +const configuration = createConfiguration(configurationOpts); +const apiInstance = new EntityIntegrationConfigsApiV2(configuration); +const params = {/* parameters */}; + +apiInstance.getEntityIntegrationConfig(params).then((data) => { + console.log("API called successfully. Returned data: " + JSON.stringify(data)); +}).catch((error) => { + console.error("Error calling API: " + error); +}); +``` \ No newline at end of file diff --git a/services/entity_integration_configs/package.json b/services/entity_integration_configs/package.json new file mode 100644 index 000000000000..d57005499581 --- /dev/null +++ b/services/entity_integration_configs/package.json @@ -0,0 +1,43 @@ +{ + "name": "@datadog/datadog-api-client-entity-integration-configs", + "description": "", + "author": "", + "keywords": [ + "api", + "fetch", + "typescript" + ], + "license": "Apache-2.0", + "licenses": [ + { + "type": "Apache-2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/DataDog/datadog-api-client-typescript.git", + "directory": "services/entity-integration-configs" + }, + "files": [ + "dist/**/*" + ], + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "scripts": { + "prepack": "yarn workspace @datadog/datadog-api-client build && yarn build", + "build": "yarn generate-version-files && tsc", + "generate-version-files": "node -p \"'export const version = ' + JSON.stringify(require('./package.json').version)\" > src/version.ts" + }, + "dependencies": { + "@datadog/datadog-api-client": "^2.0.0-beta.2" + }, + "devDependencies": { + "typescript": "5.8.3" + }, + "engines": { + "node": ">=18.0.0" + }, + "version": "0.0.1", + "packageManager": "yarn@4.9.1" +} diff --git a/services/entity_integration_configs/src/index.ts b/services/entity_integration_configs/src/index.ts new file mode 100644 index 000000000000..4f94d6a7a645 --- /dev/null +++ b/services/entity_integration_configs/src/index.ts @@ -0,0 +1,3 @@ +export * as v2 from "./v2"; + +export { EntityIntegrationConfigsApi as EntityIntegrationConfigsApiV2 } from "./v2/EntityIntegrationConfigsApi"; diff --git a/services/entity_integration_configs/src/v2/EntityIntegrationConfigsApi.ts b/services/entity_integration_configs/src/v2/EntityIntegrationConfigsApi.ts new file mode 100644 index 000000000000..4242b16c657f --- /dev/null +++ b/services/entity_integration_configs/src/v2/EntityIntegrationConfigsApi.ts @@ -0,0 +1,567 @@ +import { + ApiException, + BaseAPIRequestFactory, + BaseServerConfiguration, + buildUserAgent, + Configuration, + createConfiguration, + deserialize, + getPreferredMediaType, + HttpMethod, + isBrowser, + logger, + normalizeMediaType, + parse, + RequiredError, + RequestContext, + ResponseContext, + serialize, + ServerConfiguration, + stringify, + applySecurityAuthentication, +} from "@datadog/datadog-api-client"; + +import { TypingInfo } from "./models/TypingInfo"; +import { APIErrorResponse } from "./models/APIErrorResponse"; +import { EntityIntegrationConfigRequest } from "./models/EntityIntegrationConfigRequest"; +import { EntityIntegrationConfigResponse } from "./models/EntityIntegrationConfigResponse"; +import { JSONAPIErrorResponse } from "./models/JSONAPIErrorResponse"; +import { version } from "../version"; + +export class EntityIntegrationConfigsApiRequestFactory extends BaseAPIRequestFactory { + public userAgent: string | undefined; + + public constructor(configuration: Configuration) { + super(configuration); + if (!isBrowser) { + this.userAgent = buildUserAgent("entity-integration-configs", version); + } + } + public async deleteEntityIntegrationConfig( + integrationId: string, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if ( + !_config.unstableOperations[ + "EntityIntegrationConfigsApi.v2.deleteEntityIntegrationConfig" + ] + ) { + throw new Error( + "Unstable operation 'deleteEntityIntegrationConfig' is disabled. Enable it by setting `configuration.unstableOperations['EntityIntegrationConfigsApi.v2.deleteEntityIntegrationConfig'] = true`", + ); + } + + // verify required parameter 'integrationId' is not null or undefined + if (integrationId === null || integrationId === undefined) { + throw new RequiredError("integrationId", "deleteEntityIntegrationConfig"); + } + + // Path Params + const localVarPath = + "/api/v2/idp/entity_integrations/{integration_id}".replace( + "{integration_id}", + encodeURIComponent(String(integrationId)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "EntityIntegrationConfigsApi.v2.deleteEntityIntegrationConfig", + EntityIntegrationConfigsApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.DELETE, + overrides, + ); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async getEntityIntegrationConfig( + integrationId: string, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if ( + !_config.unstableOperations[ + "EntityIntegrationConfigsApi.v2.getEntityIntegrationConfig" + ] + ) { + throw new Error( + "Unstable operation 'getEntityIntegrationConfig' is disabled. Enable it by setting `configuration.unstableOperations['EntityIntegrationConfigsApi.v2.getEntityIntegrationConfig'] = true`", + ); + } + + // verify required parameter 'integrationId' is not null or undefined + if (integrationId === null || integrationId === undefined) { + throw new RequiredError("integrationId", "getEntityIntegrationConfig"); + } + + // Path Params + const localVarPath = + "/api/v2/idp/entity_integrations/{integration_id}".replace( + "{integration_id}", + encodeURIComponent(String(integrationId)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "EntityIntegrationConfigsApi.v2.getEntityIntegrationConfig", + EntityIntegrationConfigsApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.GET, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async updateEntityIntegrationConfig( + integrationId: string, + body: EntityIntegrationConfigRequest, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if ( + !_config.unstableOperations[ + "EntityIntegrationConfigsApi.v2.updateEntityIntegrationConfig" + ] + ) { + throw new Error( + "Unstable operation 'updateEntityIntegrationConfig' is disabled. Enable it by setting `configuration.unstableOperations['EntityIntegrationConfigsApi.v2.updateEntityIntegrationConfig'] = true`", + ); + } + + // verify required parameter 'integrationId' is not null or undefined + if (integrationId === null || integrationId === undefined) { + throw new RequiredError("integrationId", "updateEntityIntegrationConfig"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "updateEntityIntegrationConfig"); + } + + // Path Params + const localVarPath = + "/api/v2/idp/entity_integrations/{integration_id}".replace( + "{integration_id}", + encodeURIComponent(String(integrationId)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "EntityIntegrationConfigsApi.v2.updateEntityIntegrationConfig", + EntityIntegrationConfigsApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.PUT, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Body Params + const contentType = getPreferredMediaType(["application/json"]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = stringify( + serialize(body, TypingInfo, "EntityIntegrationConfigRequest", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } +} + +export class EntityIntegrationConfigsApiResponseProcessor { + /** + * 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 deleteEntityIntegrationConfig + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteEntityIntegrationConfig( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 204) { + return; + } + if (response.httpStatusCode === 400 || response.httpStatusCode === 404) { + const bodyText = parse(await response.body.text(), contentType); + let body: JSONAPIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "JSONAPIErrorResponse", + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException( + response.httpStatusCode, + body, + ); + } + if (response.httpStatusCode === 403 || response.httpStatusCode === 429) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "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 getEntityIntegrationConfig + * @throws ApiException if the response code was not in [200, 299] + */ + public async getEntityIntegrationConfig( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: EntityIntegrationConfigResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "EntityIntegrationConfigResponse", + ) as EntityIntegrationConfigResponse; + return body; + } + if (response.httpStatusCode === 400 || response.httpStatusCode === 404) { + const bodyText = parse(await response.body.text(), contentType); + let body: JSONAPIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "JSONAPIErrorResponse", + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException( + response.httpStatusCode, + body, + ); + } + if (response.httpStatusCode === 403 || response.httpStatusCode === 429) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "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: EntityIntegrationConfigResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "EntityIntegrationConfigResponse", + "", + ) as EntityIntegrationConfigResponse; + 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 updateEntityIntegrationConfig + * @throws ApiException if the response code was not in [200, 299] + */ + public async updateEntityIntegrationConfig( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: EntityIntegrationConfigResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "EntityIntegrationConfigResponse", + ) as EntityIntegrationConfigResponse; + return body; + } + if (response.httpStatusCode === 400) { + const bodyText = parse(await response.body.text(), contentType); + let body: JSONAPIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "JSONAPIErrorResponse", + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException( + response.httpStatusCode, + body, + ); + } + if (response.httpStatusCode === 403 || response.httpStatusCode === 429) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "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: EntityIntegrationConfigResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "EntityIntegrationConfigResponse", + "", + ) as EntityIntegrationConfigResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } +} + +export interface EntityIntegrationConfigsApiDeleteEntityIntegrationConfigRequest { + /** + * The identifier of the integration whose configuration is being managed. Supported values are `github`, `jira`, and `pagerduty`. + * @type string + */ + integrationId: string; +} + +export interface EntityIntegrationConfigsApiGetEntityIntegrationConfigRequest { + /** + * The identifier of the integration whose configuration is being managed. Supported values are `github`, `jira`, and `pagerduty`. + * @type string + */ + integrationId: string; +} + +export interface EntityIntegrationConfigsApiUpdateEntityIntegrationConfigRequest { + /** + * The identifier of the integration whose configuration is being managed. Supported values are `github`, `jira`, and `pagerduty`. + * @type string + */ + integrationId: string; + /** + * @type EntityIntegrationConfigRequest + */ + body: EntityIntegrationConfigRequest; +} + +export class EntityIntegrationConfigsApi { + private requestFactory: EntityIntegrationConfigsApiRequestFactory; + private responseProcessor: EntityIntegrationConfigsApiResponseProcessor; + private configuration: Configuration; + + static operationServers: { [key: string]: BaseServerConfiguration[] } = {}; + + public constructor( + configuration?: Configuration, + requestFactory?: EntityIntegrationConfigsApiRequestFactory, + responseProcessor?: EntityIntegrationConfigsApiResponseProcessor, + ) { + this.configuration = configuration || createConfiguration(); + this.requestFactory = + requestFactory || + new EntityIntegrationConfigsApiRequestFactory(this.configuration); + this.responseProcessor = + responseProcessor || new EntityIntegrationConfigsApiResponseProcessor(); + } + + /** + * Delete the configuration stored for a given integration in the caller's organization. + * @param param The request object + */ + public deleteEntityIntegrationConfig( + param: EntityIntegrationConfigsApiDeleteEntityIntegrationConfigRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = + this.requestFactory.deleteEntityIntegrationConfig( + param.integrationId, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.deleteEntityIntegrationConfig( + responseContext, + ); + }); + }); + } + + /** + * Retrieve the configuration currently stored for a given integration in the caller's organization. + * @param param The request object + */ + public getEntityIntegrationConfig( + param: EntityIntegrationConfigsApiGetEntityIntegrationConfigRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = + this.requestFactory.getEntityIntegrationConfig( + param.integrationId, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getEntityIntegrationConfig( + responseContext, + ); + }); + }); + } + + /** + * Create or replace the configuration for a given integration in the caller's organization. The shape of `data.attributes.config` depends on the integration: + * + * - For `github`: `config` must contain an `enabled_repos` array of objects with `hostname`, `github_org_name`, and `repo_name`. + * - For `jira`: `config` must contain an `enabled_projects` array of objects with `hostname`, `account_id`, and `project_key`. + * - For `pagerduty`: `config` must contain an `accounts` array of objects with a required `enabled` boolean and an optional `subdomain` string. + * @param param The request object + */ + public updateEntityIntegrationConfig( + param: EntityIntegrationConfigsApiUpdateEntityIntegrationConfigRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = + this.requestFactory.updateEntityIntegrationConfig( + param.integrationId, + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.updateEntityIntegrationConfig( + responseContext, + ); + }); + }); + } +} diff --git a/services/entity_integration_configs/src/v2/index.ts b/services/entity_integration_configs/src/v2/index.ts new file mode 100644 index 000000000000..8e2d9a809065 --- /dev/null +++ b/services/entity_integration_configs/src/v2/index.ts @@ -0,0 +1,19 @@ +export { + EntityIntegrationConfigsApiDeleteEntityIntegrationConfigRequest, + EntityIntegrationConfigsApiGetEntityIntegrationConfigRequest, + EntityIntegrationConfigsApiUpdateEntityIntegrationConfigRequest, + EntityIntegrationConfigsApi, +} from "./EntityIntegrationConfigsApi"; + +export { APIErrorResponse } from "./models/APIErrorResponse"; +export { EntityIntegrationConfigAttributes } from "./models/EntityIntegrationConfigAttributes"; +export { EntityIntegrationConfigData } from "./models/EntityIntegrationConfigData"; +export { EntityIntegrationConfigRequest } from "./models/EntityIntegrationConfigRequest"; +export { EntityIntegrationConfigRequestAttributes } from "./models/EntityIntegrationConfigRequestAttributes"; +export { EntityIntegrationConfigRequestData } from "./models/EntityIntegrationConfigRequestData"; +export { EntityIntegrationConfigRequestType } from "./models/EntityIntegrationConfigRequestType"; +export { EntityIntegrationConfigResponse } from "./models/EntityIntegrationConfigResponse"; +export { EntityIntegrationConfigType } from "./models/EntityIntegrationConfigType"; +export { JSONAPIErrorItem } from "./models/JSONAPIErrorItem"; +export { JSONAPIErrorItemSource } from "./models/JSONAPIErrorItemSource"; +export { JSONAPIErrorResponse } from "./models/JSONAPIErrorResponse"; diff --git a/services/entity_integration_configs/src/v2/models/APIErrorResponse.ts b/services/entity_integration_configs/src/v2/models/APIErrorResponse.ts new file mode 100644 index 000000000000..58d6c35b80f0 --- /dev/null +++ b/services/entity_integration_configs/src/v2/models/APIErrorResponse.ts @@ -0,0 +1,45 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * API error response. + */ +export class APIErrorResponse { + /** + * A list of errors. + */ + "errors": 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 = { + errors: { + baseName: "errors", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return APIErrorResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/entity_integration_configs/src/v2/models/EntityIntegrationConfigAttributes.ts b/services/entity_integration_configs/src/v2/models/EntityIntegrationConfigAttributes.ts new file mode 100644 index 000000000000..3b5f89c0ca0c --- /dev/null +++ b/services/entity_integration_configs/src/v2/models/EntityIntegrationConfigAttributes.ts @@ -0,0 +1,64 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * The organization ID, integration identifier, and integration-specific configuration payload for an entity integration configuration. + */ +export class EntityIntegrationConfigAttributes { + /** + * Integration-specific configuration payload. The shape of this object depends on the integration identified by the path parameter. For `github`, the object must contain an `enabled_repos` array. For `jira`, it must contain an `enabled_projects` array. For `pagerduty`, it must contain an `accounts` array. + */ + "config": { [key: string]: any }; + /** + * The identifier of the integration this configuration applies to (for example, `github`, `jira`, or `pagerduty`). + */ + "integrationId": string; + /** + * The Datadog organization identifier that owns this configuration. + */ + "orgId": number; + /** + * 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 = { + config: { + baseName: "config", + type: "{ [key: string]: any; }", + required: true, + }, + integrationId: { + baseName: "integration_id", + type: "string", + required: true, + }, + orgId: { + baseName: "org_id", + type: "number", + required: true, + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return EntityIntegrationConfigAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/entity_integration_configs/src/v2/models/EntityIntegrationConfigData.ts b/services/entity_integration_configs/src/v2/models/EntityIntegrationConfigData.ts new file mode 100644 index 000000000000..8e1b95e3434d --- /dev/null +++ b/services/entity_integration_configs/src/v2/models/EntityIntegrationConfigData.ts @@ -0,0 +1,66 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { EntityIntegrationConfigAttributes } from "./EntityIntegrationConfigAttributes"; +import { EntityIntegrationConfigType } from "./EntityIntegrationConfigType"; + +/** + * JSON:API resource object for an entity integration configuration. + */ +export class EntityIntegrationConfigData { + /** + * The organization ID, integration identifier, and integration-specific configuration payload for an entity integration configuration. + */ + "attributes": EntityIntegrationConfigAttributes; + /** + * Unique identifier of the entity integration configuration. + */ + "id": string; + /** + * JSON:API resource type for an entity integration configuration. Always `entity_integration_configs`. + */ + "type": EntityIntegrationConfigType; + /** + * 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: "EntityIntegrationConfigAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "EntityIntegrationConfigType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return EntityIntegrationConfigData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/entity_integration_configs/src/v2/models/EntityIntegrationConfigRequest.ts b/services/entity_integration_configs/src/v2/models/EntityIntegrationConfigRequest.ts new file mode 100644 index 000000000000..ea25fc02f52b --- /dev/null +++ b/services/entity_integration_configs/src/v2/models/EntityIntegrationConfigRequest.ts @@ -0,0 +1,47 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { EntityIntegrationConfigRequestData } from "./EntityIntegrationConfigRequestData"; + +/** + * Request body used to create or replace the configuration for a given integration. + */ +export class EntityIntegrationConfigRequest { + /** + * JSON:API resource object used in a request to create or update an entity integration configuration. + */ + "data": EntityIntegrationConfigRequestData; + /** + * 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: "EntityIntegrationConfigRequestData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return EntityIntegrationConfigRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/entity_integration_configs/src/v2/models/EntityIntegrationConfigRequestAttributes.ts b/services/entity_integration_configs/src/v2/models/EntityIntegrationConfigRequestAttributes.ts new file mode 100644 index 000000000000..f1920c2a50e3 --- /dev/null +++ b/services/entity_integration_configs/src/v2/models/EntityIntegrationConfigRequestAttributes.ts @@ -0,0 +1,45 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Attributes used to create or update an entity integration configuration. + */ +export class EntityIntegrationConfigRequestAttributes { + /** + * Integration-specific configuration payload. The shape of this object depends on the integration identified by the path parameter. For `github`, the object must contain an `enabled_repos` array. For `jira`, it must contain an `enabled_projects` array. For `pagerduty`, it must contain an `accounts` array. + */ + "config": { [key: string]: any }; + /** + * 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 = { + config: { + baseName: "config", + type: "{ [key: string]: any; }", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return EntityIntegrationConfigRequestAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/entity_integration_configs/src/v2/models/EntityIntegrationConfigRequestData.ts b/services/entity_integration_configs/src/v2/models/EntityIntegrationConfigRequestData.ts new file mode 100644 index 000000000000..c5bc4fabf76b --- /dev/null +++ b/services/entity_integration_configs/src/v2/models/EntityIntegrationConfigRequestData.ts @@ -0,0 +1,57 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { EntityIntegrationConfigRequestAttributes } from "./EntityIntegrationConfigRequestAttributes"; +import { EntityIntegrationConfigRequestType } from "./EntityIntegrationConfigRequestType"; + +/** + * JSON:API resource object used in a request to create or update an entity integration configuration. + */ +export class EntityIntegrationConfigRequestData { + /** + * Attributes used to create or update an entity integration configuration. + */ + "attributes": EntityIntegrationConfigRequestAttributes; + /** + * JSON:API resource type for the entity integration configuration create or update request. Always `entity_integration_config_requests`. + */ + "type": EntityIntegrationConfigRequestType; + /** + * 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: "EntityIntegrationConfigRequestAttributes", + required: true, + }, + type: { + baseName: "type", + type: "EntityIntegrationConfigRequestType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return EntityIntegrationConfigRequestData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/entity_integration_configs/src/v2/models/EntityIntegrationConfigRequestType.ts b/services/entity_integration_configs/src/v2/models/EntityIntegrationConfigRequestType.ts new file mode 100644 index 000000000000..560a6d9fa6af --- /dev/null +++ b/services/entity_integration_configs/src/v2/models/EntityIntegrationConfigRequestType.ts @@ -0,0 +1,10 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * JSON:API resource type for the entity integration configuration create or update request. Always `entity_integration_config_requests`. + */ +export type EntityIntegrationConfigRequestType = + | typeof ENTITY_INTEGRATION_CONFIG_REQUESTS + | UnparsedObject; +export const ENTITY_INTEGRATION_CONFIG_REQUESTS = + "entity_integration_config_requests"; diff --git a/services/entity_integration_configs/src/v2/models/EntityIntegrationConfigResponse.ts b/services/entity_integration_configs/src/v2/models/EntityIntegrationConfigResponse.ts new file mode 100644 index 000000000000..d600b4437f6a --- /dev/null +++ b/services/entity_integration_configs/src/v2/models/EntityIntegrationConfigResponse.ts @@ -0,0 +1,47 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { EntityIntegrationConfigData } from "./EntityIntegrationConfigData"; + +/** + * JSON:API document containing a single entity integration configuration resource. + */ +export class EntityIntegrationConfigResponse { + /** + * JSON:API resource object for an entity integration configuration. + */ + "data": EntityIntegrationConfigData; + /** + * 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: "EntityIntegrationConfigData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return EntityIntegrationConfigResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/entity_integration_configs/src/v2/models/EntityIntegrationConfigType.ts b/services/entity_integration_configs/src/v2/models/EntityIntegrationConfigType.ts new file mode 100644 index 000000000000..0dad29e238a4 --- /dev/null +++ b/services/entity_integration_configs/src/v2/models/EntityIntegrationConfigType.ts @@ -0,0 +1,9 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * JSON:API resource type for an entity integration configuration. Always `entity_integration_configs`. + */ +export type EntityIntegrationConfigType = + | typeof ENTITY_INTEGRATION_CONFIGS + | UnparsedObject; +export const ENTITY_INTEGRATION_CONFIGS = "entity_integration_configs"; diff --git a/services/entity_integration_configs/src/v2/models/JSONAPIErrorItem.ts b/services/entity_integration_configs/src/v2/models/JSONAPIErrorItem.ts new file mode 100644 index 000000000000..a1ca45cd463c --- /dev/null +++ b/services/entity_integration_configs/src/v2/models/JSONAPIErrorItem.ts @@ -0,0 +1,78 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { JSONAPIErrorItemSource } from "./JSONAPIErrorItemSource"; + +/** + * API error response body + */ +export class JSONAPIErrorItem { + /** + * A human-readable explanation specific to this occurrence of the error. + */ + "detail"?: string; + /** + * Non-standard meta-information about the error + */ + "meta"?: { [key: string]: any }; + /** + * References to the source of the error. + */ + "source"?: JSONAPIErrorItemSource; + /** + * Status code of the response. + */ + "status"?: string; + /** + * Short human-readable summary of the error. + */ + "title"?: 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 = { + detail: { + baseName: "detail", + type: "string", + }, + meta: { + baseName: "meta", + type: "{ [key: string]: any; }", + }, + source: { + baseName: "source", + type: "JSONAPIErrorItemSource", + }, + status: { + baseName: "status", + type: "string", + }, + title: { + baseName: "title", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return JSONAPIErrorItem.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/entity_integration_configs/src/v2/models/JSONAPIErrorItemSource.ts b/services/entity_integration_configs/src/v2/models/JSONAPIErrorItemSource.ts new file mode 100644 index 000000000000..5889114315fa --- /dev/null +++ b/services/entity_integration_configs/src/v2/models/JSONAPIErrorItemSource.ts @@ -0,0 +1,60 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * References to the source of the error. + */ +export class JSONAPIErrorItemSource { + /** + * A string indicating the name of a single request header which caused the error. + */ + "header"?: string; + /** + * A string indicating which URI query parameter caused the error. + */ + "parameter"?: string; + /** + * A JSON pointer to the value in the request document that caused the error. + */ + "pointer"?: 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 = { + header: { + baseName: "header", + type: "string", + }, + parameter: { + baseName: "parameter", + type: "string", + }, + pointer: { + baseName: "pointer", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return JSONAPIErrorItemSource.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/entity_integration_configs/src/v2/models/JSONAPIErrorResponse.ts b/services/entity_integration_configs/src/v2/models/JSONAPIErrorResponse.ts new file mode 100644 index 000000000000..68aa04ffc27b --- /dev/null +++ b/services/entity_integration_configs/src/v2/models/JSONAPIErrorResponse.ts @@ -0,0 +1,47 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { JSONAPIErrorItem } from "./JSONAPIErrorItem"; + +/** + * API error response. + */ +export class JSONAPIErrorResponse { + /** + * A list of errors. + */ + "errors": 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 = { + errors: { + baseName: "errors", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return JSONAPIErrorResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/entity_integration_configs/src/v2/models/TypingInfo.ts b/services/entity_integration_configs/src/v2/models/TypingInfo.ts new file mode 100644 index 000000000000..78c172a596be --- /dev/null +++ b/services/entity_integration_configs/src/v2/models/TypingInfo.ts @@ -0,0 +1,33 @@ +import { ModelTypingInfo } from "@datadog/datadog-api-client"; + +import { APIErrorResponse } from "./APIErrorResponse"; +import { EntityIntegrationConfigAttributes } from "./EntityIntegrationConfigAttributes"; +import { EntityIntegrationConfigData } from "./EntityIntegrationConfigData"; +import { EntityIntegrationConfigRequest } from "./EntityIntegrationConfigRequest"; +import { EntityIntegrationConfigRequestAttributes } from "./EntityIntegrationConfigRequestAttributes"; +import { EntityIntegrationConfigRequestData } from "./EntityIntegrationConfigRequestData"; +import { EntityIntegrationConfigResponse } from "./EntityIntegrationConfigResponse"; +import { JSONAPIErrorItem } from "./JSONAPIErrorItem"; +import { JSONAPIErrorItemSource } from "./JSONAPIErrorItemSource"; +import { JSONAPIErrorResponse } from "./JSONAPIErrorResponse"; + +export const TypingInfo: ModelTypingInfo = { + enumsMap: { + EntityIntegrationConfigRequestType: ["entity_integration_config_requests"], + EntityIntegrationConfigType: ["entity_integration_configs"], + }, + oneOfMap: {}, + typeMap: { + APIErrorResponse: APIErrorResponse, + EntityIntegrationConfigAttributes: EntityIntegrationConfigAttributes, + EntityIntegrationConfigData: EntityIntegrationConfigData, + EntityIntegrationConfigRequest: EntityIntegrationConfigRequest, + EntityIntegrationConfigRequestAttributes: + EntityIntegrationConfigRequestAttributes, + EntityIntegrationConfigRequestData: EntityIntegrationConfigRequestData, + EntityIntegrationConfigResponse: EntityIntegrationConfigResponse, + JSONAPIErrorItem: JSONAPIErrorItem, + JSONAPIErrorItemSource: JSONAPIErrorItemSource, + JSONAPIErrorResponse: JSONAPIErrorResponse, + }, +}; diff --git a/services/entity_integration_configs/tsconfig.json b/services/entity_integration_configs/tsconfig.json new file mode 100644 index 000000000000..d6c32bfb893c --- /dev/null +++ b/services/entity_integration_configs/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "strict": true, + /* Basic Options */ + "target": "es6", + "module": "commonjs", + "moduleResolution": "node", + "declaration": true, + + "esModuleInterop": true, + "resolveJsonModule": true, + + "noImplicitAny": true, + "noImplicitThis": true, + + /* Additional Checks */ + "noUnusedLocals": false /* Report errors on unused locals. */, // TODO: reenable (unused imports!) + "noUnusedParameters": false /* Report errors on unused parameters. */, // TODO: set to true again + "noImplicitReturns": true /* Report error when not all code paths in function return a value. */, + "noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */, + + "sourceMap": true, + "outDir": "./dist", + "lib": ["es6", "es7"] + }, + "exclude": ["dist", "node_modules", "tests"], + "include": ["src"] +} diff --git a/yarn.lock b/yarn.lock index 9ea34016097e..e8f646185899 100644 --- a/yarn.lock +++ b/yarn.lock @@ -649,6 +649,15 @@ __metadata: languageName: unknown linkType: soft +"@datadog/datadog-api-client-entity-integration-configs@workspace:services/entity_integration_configs": + version: 0.0.0-use.local + resolution: "@datadog/datadog-api-client-entity-integration-configs@workspace:services/entity_integration_configs" + dependencies: + "@datadog/datadog-api-client": "npm:^2.0.0-beta.2" + typescript: "npm:5.8.3" + languageName: unknown + linkType: soft + "@datadog/datadog-api-client-entity-risk-scores@workspace:services/entity_risk_scores": version: 0.0.0-use.local resolution: "@datadog/datadog-api-client-entity-risk-scores@workspace:services/entity_risk_scores"