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/examples/v2/entity-integration-configs/DeleteEntityIntegrationConfig.ts b/examples/v2/entity-integration-configs/DeleteEntityIntegrationConfig.ts new file mode 100644 index 000000000000..b181bf6afebe --- /dev/null +++ b/examples/v2/entity-integration-configs/DeleteEntityIntegrationConfig.ts @@ -0,0 +1,23 @@ +/** + * Delete an entity integration configuration returns "No Content" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.deleteEntityIntegrationConfig"] = true; +const apiInstance = new v2.EntityIntegrationConfigsApi(configuration); + +const params: v2.EntityIntegrationConfigsApiDeleteEntityIntegrationConfigRequest = + { + integrationId: "github", + }; + +apiInstance + .deleteEntityIntegrationConfig(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/entity-integration-configs/GetEntityIntegrationConfig.ts b/examples/v2/entity-integration-configs/GetEntityIntegrationConfig.ts new file mode 100644 index 000000000000..760b413e886a --- /dev/null +++ b/examples/v2/entity-integration-configs/GetEntityIntegrationConfig.ts @@ -0,0 +1,23 @@ +/** + * Get an entity integration configuration returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.getEntityIntegrationConfig"] = true; +const apiInstance = new v2.EntityIntegrationConfigsApi(configuration); + +const params: v2.EntityIntegrationConfigsApiGetEntityIntegrationConfigRequest = + { + integrationId: "github", + }; + +apiInstance + .getEntityIntegrationConfig(params) + .then((data: v2.EntityIntegrationConfigResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/entity-integration-configs/UpdateEntityIntegrationConfig.ts b/examples/v2/entity-integration-configs/UpdateEntityIntegrationConfig.ts new file mode 100644 index 000000000000..140024524be4 --- /dev/null +++ b/examples/v2/entity-integration-configs/UpdateEntityIntegrationConfig.ts @@ -0,0 +1,34 @@ +/** + * Create or update entity integration configuration returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.updateEntityIntegrationConfig"] = true; +const apiInstance = new v2.EntityIntegrationConfigsApi(configuration); + +const params: v2.EntityIntegrationConfigsApiUpdateEntityIntegrationConfigRequest = + { + body: { + data: { + attributes: { + config: { + enabled_repos: + "[{'github_org_name': 'myorg', 'hostname': 'github.com', 'repo_name': 'myrepo'}]", + }, + }, + type: "entity_integration_config_requests", + }, + }, + integrationId: "github", + }; + +apiInstance + .updateEntityIntegrationConfig(params) + .then((data: v2.EntityIntegrationConfigResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index 0b301beaeabc..4e0830f40389 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -8393,6 +8393,31 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "HamrOrgConnectionResponse", }, + "v2.GetEntityIntegrationConfig": { + "integrationId": { + "type": "string", + "format": "", + }, + "operationResponseType": "EntityIntegrationConfigResponse", + }, + "v2.UpdateEntityIntegrationConfig": { + "integrationId": { + "type": "string", + "format": "", + }, + "body": { + "type": "EntityIntegrationConfigRequest", + "format": "", + }, + "operationResponseType": "EntityIntegrationConfigResponse", + }, + "v2.DeleteEntityIntegrationConfig": { + "integrationId": { + "type": "string", + "format": "", + }, + "operationResponseType": "{}", + }, "v2.ListIncidents": { "include": { "type": "Array", 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-common/configuration.ts b/packages/datadog-api-client-common/configuration.ts index 4de4396e588c..0d4005a34ce0 100644 --- a/packages/datadog-api-client-common/configuration.ts +++ b/packages/datadog-api-client-common/configuration.ts @@ -430,6 +430,9 @@ export function createConfiguration( "v2.updateDeploymentRule": false, "v2.createHamrOrgConnection": false, "v2.getHamrOrgConnection": false, + "v2.deleteEntityIntegrationConfig": false, + "v2.getEntityIntegrationConfig": false, + "v2.updateEntityIntegrationConfig": false, "v2.createGlobalIncidentHandle": false, "v2.createIncident": false, "v2.createIncidentAttachment": false, diff --git a/packages/datadog-api-client-v2/apis/EntityIntegrationConfigsApi.ts b/packages/datadog-api-client-v2/apis/EntityIntegrationConfigsApi.ts new file mode 100644 index 000000000000..c29b5a943d8c --- /dev/null +++ b/packages/datadog-api-client-v2/apis/EntityIntegrationConfigsApi.ts @@ -0,0 +1,528 @@ +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 { EntityIntegrationConfigRequest } from "../models/EntityIntegrationConfigRequest"; +import { EntityIntegrationConfigResponse } from "../models/EntityIntegrationConfigResponse"; +import { JSONAPIErrorResponse } from "../models/JSONAPIErrorResponse"; + +export class EntityIntegrationConfigsApiRequestFactory extends BaseAPIRequestFactory { + public async deleteEntityIntegrationConfig( + integrationId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'deleteEntityIntegrationConfig'"); + if (!_config.unstableOperations["v2.deleteEntityIntegrationConfig"]) { + throw new Error( + "Unstable operation 'deleteEntityIntegrationConfig' is disabled" + ); + } + + // 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 requestContext = _config + .getServer("v2.EntityIntegrationConfigsApi.deleteEntityIntegrationConfig") + .makeRequestContext(localVarPath, HttpMethod.DELETE); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async getEntityIntegrationConfig( + integrationId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'getEntityIntegrationConfig'"); + if (!_config.unstableOperations["v2.getEntityIntegrationConfig"]) { + throw new Error( + "Unstable operation 'getEntityIntegrationConfig' is disabled" + ); + } + + // 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 requestContext = _config + .getServer("v2.EntityIntegrationConfigsApi.getEntityIntegrationConfig") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // 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; + + logger.warn("Using unstable operation 'updateEntityIntegrationConfig'"); + if (!_config.unstableOperations["v2.updateEntityIntegrationConfig"]) { + throw new Error( + "Unstable operation 'updateEntityIntegrationConfig' is disabled" + ); + } + + // 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 requestContext = _config + .getServer("v2.EntityIntegrationConfigsApi.updateEntityIntegrationConfig") + .makeRequestContext(localVarPath, HttpMethod.PUT); + 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, "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 = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 204) { + return; + } + if (response.httpStatusCode === 400 || response.httpStatusCode === 404) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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 = 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 getEntityIntegrationConfig + * @throws ApiException if the response code was not in [200, 299] + */ + public async getEntityIntegrationConfig( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: EntityIntegrationConfigResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "EntityIntegrationConfigResponse" + ) as EntityIntegrationConfigResponse; + return body; + } + if (response.httpStatusCode === 400 || response.httpStatusCode === 404) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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 = 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: EntityIntegrationConfigResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "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 = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: EntityIntegrationConfigResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "EntityIntegrationConfigResponse" + ) as EntityIntegrationConfigResponse; + return body; + } + if (response.httpStatusCode === 400) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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 = 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: EntityIntegrationConfigResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "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; + + public constructor( + configuration: Configuration, + requestFactory?: EntityIntegrationConfigsApiRequestFactory, + responseProcessor?: EntityIntegrationConfigsApiResponseProcessor + ) { + this.configuration = configuration; + this.requestFactory = + requestFactory || + new EntityIntegrationConfigsApiRequestFactory(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/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index aed4b25f94e7..5dde2a421554 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -460,6 +460,13 @@ export { DowntimesApi, } from "./apis/DowntimesApi"; +export { + EntityIntegrationConfigsApiDeleteEntityIntegrationConfigRequest, + EntityIntegrationConfigsApiGetEntityIntegrationConfigRequest, + EntityIntegrationConfigsApiUpdateEntityIntegrationConfigRequest, + EntityIntegrationConfigsApi, +} from "./apis/EntityIntegrationConfigsApi"; + export { EntityRiskScoresApiListEntityRiskScoresRequest, EntityRiskScoresApi, @@ -3078,6 +3085,14 @@ export { EntityContextResponse } from "./models/EntityContextResponse"; export { EntityContextResponseMeta } from "./models/EntityContextResponseMeta"; export { EntityContextRevision } from "./models/EntityContextRevision"; export { EntityData } from "./models/EntityData"; +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 { EntityMeta } from "./models/EntityMeta"; export { EntityRelationships } from "./models/EntityRelationships"; export { EntityResponseArray } from "./models/EntityResponseArray"; diff --git a/packages/datadog-api-client-v2/models/EntityIntegrationConfigAttributes.ts b/packages/datadog-api-client-v2/models/EntityIntegrationConfigAttributes.ts new file mode 100644 index 000000000000..6d6ca8043dfd --- /dev/null +++ b/packages/datadog-api-client-v2/models/EntityIntegrationConfigAttributes.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 { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/EntityIntegrationConfigData.ts b/packages/datadog-api-client-v2/models/EntityIntegrationConfigData.ts new file mode 100644 index 000000000000..a950959f8c06 --- /dev/null +++ b/packages/datadog-api-client-v2/models/EntityIntegrationConfigData.ts @@ -0,0 +1,73 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { EntityIntegrationConfigAttributes } from "./EntityIntegrationConfigAttributes"; +import { EntityIntegrationConfigType } from "./EntityIntegrationConfigType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/EntityIntegrationConfigRequest.ts b/packages/datadog-api-client-v2/models/EntityIntegrationConfigRequest.ts new file mode 100644 index 000000000000..9529427f8251 --- /dev/null +++ b/packages/datadog-api-client-v2/models/EntityIntegrationConfigRequest.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 { EntityIntegrationConfigRequestData } from "./EntityIntegrationConfigRequestData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/EntityIntegrationConfigRequestAttributes.ts b/packages/datadog-api-client-v2/models/EntityIntegrationConfigRequestAttributes.ts new file mode 100644 index 000000000000..953965a5d975 --- /dev/null +++ b/packages/datadog-api-client-v2/models/EntityIntegrationConfigRequestAttributes.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 { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/EntityIntegrationConfigRequestData.ts b/packages/datadog-api-client-v2/models/EntityIntegrationConfigRequestData.ts new file mode 100644 index 000000000000..fd426684fe9a --- /dev/null +++ b/packages/datadog-api-client-v2/models/EntityIntegrationConfigRequestData.ts @@ -0,0 +1,64 @@ +/** + * 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 { EntityIntegrationConfigRequestAttributes } from "./EntityIntegrationConfigRequestAttributes"; +import { EntityIntegrationConfigRequestType } from "./EntityIntegrationConfigRequestType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/EntityIntegrationConfigRequestType.ts b/packages/datadog-api-client-v2/models/EntityIntegrationConfigRequestType.ts new file mode 100644 index 000000000000..ccd840a91daf --- /dev/null +++ b/packages/datadog-api-client-v2/models/EntityIntegrationConfigRequestType.ts @@ -0,0 +1,17 @@ +/** + * 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"; + +/** + * 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/packages/datadog-api-client-v2/models/EntityIntegrationConfigResponse.ts b/packages/datadog-api-client-v2/models/EntityIntegrationConfigResponse.ts new file mode 100644 index 000000000000..1d096259ce4f --- /dev/null +++ b/packages/datadog-api-client-v2/models/EntityIntegrationConfigResponse.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 { EntityIntegrationConfigData } from "./EntityIntegrationConfigData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/EntityIntegrationConfigType.ts b/packages/datadog-api-client-v2/models/EntityIntegrationConfigType.ts new file mode 100644 index 000000000000..1d58257a892d --- /dev/null +++ b/packages/datadog-api-client-v2/models/EntityIntegrationConfigType.ts @@ -0,0 +1,16 @@ +/** + * 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"; + +/** + * 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/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index 27dcc54448f4..d4574c2d1ca6 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -1223,6 +1223,12 @@ import { EntityContextResponse } from "./EntityContextResponse"; import { EntityContextResponseMeta } from "./EntityContextResponseMeta"; import { EntityContextRevision } from "./EntityContextRevision"; import { EntityData } from "./EntityData"; +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 { EntityMeta } from "./EntityMeta"; import { EntityRelationships } from "./EntityRelationships"; import { EntityResponseArray } from "./EntityResponseArray"; @@ -5054,6 +5060,8 @@ const enumsMap: { [key: string]: any[] } = { DowntimeNotifyEndStateTypes: ["alert", "no data", "warn"], DowntimeResourceType: ["downtime"], DowntimeStatus: ["active", "canceled", "ended", "scheduled"], + EntityIntegrationConfigRequestType: ["entity_integration_config_requests"], + EntityIntegrationConfigType: ["entity_integration_configs"], EntityResponseDataRelationshipsIncidentsDataItemsType: ["incident"], EntityResponseDataRelationshipsOncallsDataItemsType: ["oncall"], EntityResponseDataRelationshipsRawSchemaDataType: ["rawSchema"], @@ -8386,6 +8394,13 @@ const typeMap: { [index: string]: any } = { EntityContextResponseMeta: EntityContextResponseMeta, EntityContextRevision: EntityContextRevision, EntityData: EntityData, + EntityIntegrationConfigAttributes: EntityIntegrationConfigAttributes, + EntityIntegrationConfigData: EntityIntegrationConfigData, + EntityIntegrationConfigRequest: EntityIntegrationConfigRequest, + EntityIntegrationConfigRequestAttributes: + EntityIntegrationConfigRequestAttributes, + EntityIntegrationConfigRequestData: EntityIntegrationConfigRequestData, + EntityIntegrationConfigResponse: EntityIntegrationConfigResponse, EntityMeta: EntityMeta, EntityRelationships: EntityRelationships, EntityResponseArray: EntityResponseArray,