diff --git a/.apigentools-info b/.apigentools-info index 7c03b850d8c7..caacb1bd2dea 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-06-06 14:53:28.796747", - "spec_repo_commit": "e591d5d4" + "regenerated": "2025-06-06 17:43:43.689332", + "spec_repo_commit": "01341d5b" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-06-06 14:53:28.812809", - "spec_repo_commit": "e591d5d4" + "regenerated": "2025-06-06 17:43:43.707291", + "spec_repo_commit": "01341d5b" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 5baec1eb2af8..d093ae5abd7a 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -563,6 +563,14 @@ components: required: true schema: type: string + KindID: + description: Entity kind. + in: path + name: kind_id + required: true + schema: + example: my-job + type: string MetricID: description: The name of the log-based metric. in: path @@ -19303,6 +19311,90 @@ components: - index - caseIndex type: object + KindAttributes: + description: Kind attributes. + properties: + description: + description: Short description of the kind. + type: string + displayName: + description: User friendly name of the kind. + type: string + name: + description: The kind name. + example: my-job + minLength: 1 + type: string + type: object + KindData: + description: Schema that defines the structure of a Kind object in the Software + Catalog. + properties: + attributes: + $ref: '#/components/schemas/KindAttributes' + id: + description: A read-only globally unique identifier for the entity generated + by Datadog. User supplied values are ignored. + example: 4b163705-23c0-4573-b2fb-f6cea2163fcb + minLength: 1 + type: string + meta: + $ref: '#/components/schemas/KindMetadata' + type: + description: Kind. + type: string + type: object + KindMetadata: + description: Kind metadata. + properties: + createdAt: + description: The creation time. + type: string + modifiedAt: + description: The modification time. + type: string + type: object + KindObj: + description: Schema for kind. + properties: + description: + description: Short description of the kind. + type: string + displayName: + description: The display name of the kind. Automatically generated if not + provided. + type: string + kind: + description: The name of the kind to create or update. This must be in kebab-case + format. + example: my-job + type: string + required: + - kind + type: object + KindRaw: + description: Kind definition in raw JSON or YAML representation. + example: 'kind: service + + displayName: Service + + description: A service entity in the catalog. + + ' + type: string + KindResponseData: + description: List of kind responses. + items: + $ref: '#/components/schemas/KindData' + type: array + KindResponseMeta: + description: Kind response metadata. + properties: + count: + description: Total kinds count. + format: int64 + type: integer + type: object Layer: description: Encapsulates a layer resource, holding attributes like rotation details, plus relationships to the members covering that layer. @@ -19789,6 +19881,14 @@ components: meta: $ref: '#/components/schemas/HistoricalJobListMeta' type: object + ListKindCatalogResponse: + description: List kind response. + properties: + data: + $ref: '#/components/schemas/KindResponseData' + meta: + $ref: '#/components/schemas/KindResponseMeta' + type: object ListPipelinesResponse: description: Represents the response payload containing a list of pipelines and associated metadata. @@ -39531,6 +39631,19 @@ components: description: Upsert entity response included item. oneOf: - $ref: '#/components/schemas/EntityResponseIncludedSchema' + UpsertCatalogKindRequest: + description: Create or update kind request. + oneOf: + - $ref: '#/components/schemas/KindObj' + - $ref: '#/components/schemas/KindRaw' + UpsertCatalogKindResponse: + description: Upsert kind response. + properties: + data: + $ref: '#/components/schemas/KindResponseData' + meta: + $ref: '#/components/schemas/KindResponseMeta' + type: object Urgency: description: Specifies the level of urgency for a routing rule (low, high, or dynamic). @@ -43768,6 +43881,105 @@ paths: summary: Delete a single entity tags: - Software Catalog + /api/v2/catalog/kind: + get: + description: Get a list of entity kinds from Software Catalog. + operationId: ListCatalogKind + parameters: + - $ref: '#/components/parameters/PageOffset' + - description: Maximum number of kinds in the response. + example: 100 + in: query + name: page[limit] + required: false + schema: + default: 100 + format: int64 + type: integer + - $ref: '#/components/parameters/FilterByID' + - $ref: '#/components/parameters/FilterByName' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListKindCatalogResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_service_catalog_read + summary: Get a list of entity kinds + tags: + - Software Catalog + x-pagination: + limitParam: page[limit] + pageOffsetParam: page[offset] + resultsPath: data + post: + description: Create or update kinds in Software Catalog. + operationId: UpsertCatalogKind + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpsertCatalogKindRequest' + description: Kind YAML or JSON. + required: true + responses: + '202': + content: + application/json: + schema: + $ref: '#/components/schemas/UpsertCatalogKindResponse' + description: ACCEPTED + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_service_catalog_write + summary: Create or update kinds + tags: + - Software Catalog + x-codegen-request-body-name: body + /api/v2/catalog/kind/{kind_id}: + delete: + description: Delete a single kind in Software Catalog. + operationId: DeleteCatalogKind + parameters: + - $ref: '#/components/parameters/KindID' + responses: + '204': + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - apm_service_catalog_write + summary: Delete a single kind + tags: + - Software Catalog /api/v2/catalog/relation: get: description: Get a list of entity relations from Software Catalog. diff --git a/examples/v2/software-catalog/DeleteCatalogKind.ts b/examples/v2/software-catalog/DeleteCatalogKind.ts new file mode 100644 index 000000000000..867953efcf76 --- /dev/null +++ b/examples/v2/software-catalog/DeleteCatalogKind.ts @@ -0,0 +1,21 @@ +/** + * Delete a single kind returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.SoftwareCatalogApi(configuration); + +const params: v2.SoftwareCatalogApiDeleteCatalogKindRequest = { + kindId: "my-job", +}; + +apiInstance + .deleteCatalogKind(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/software-catalog/ListCatalogKind.ts b/examples/v2/software-catalog/ListCatalogKind.ts new file mode 100644 index 000000000000..ed492349350c --- /dev/null +++ b/examples/v2/software-catalog/ListCatalogKind.ts @@ -0,0 +1,17 @@ +/** + * Get a list of entity kinds returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.SoftwareCatalogApi(configuration); + +apiInstance + .listCatalogKind() + .then((data: v2.ListKindCatalogResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/software-catalog/ListCatalogKind_3806205775.ts b/examples/v2/software-catalog/ListCatalogKind_3806205775.ts new file mode 100644 index 000000000000..2f2d840c39ef --- /dev/null +++ b/examples/v2/software-catalog/ListCatalogKind_3806205775.ts @@ -0,0 +1,18 @@ +/** + * Get a list of entity kinds returns "OK" response with pagination + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.SoftwareCatalogApi(configuration); + +(async () => { + try { + for await (const item of apiInstance.listCatalogKindWithPagination()) { + console.log(item); + } + } catch (error) { + console.error(error); + } +})(); diff --git a/examples/v2/software-catalog/UpsertCatalogKind.ts b/examples/v2/software-catalog/UpsertCatalogKind.ts new file mode 100644 index 000000000000..37335905b5e2 --- /dev/null +++ b/examples/v2/software-catalog/UpsertCatalogKind.ts @@ -0,0 +1,23 @@ +/** + * Create or update kinds returns "ACCEPTED" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.SoftwareCatalogApi(configuration); + +const params: v2.SoftwareCatalogApiUpsertCatalogKindRequest = { + body: { + kind: "my-job", + }, +}; + +apiInstance + .upsertCatalogKind(params) + .then((data: v2.UpsertCatalogKindResponse) => { + 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 a772be9576f1..f1d1efd029ea 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -3097,6 +3097,39 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "void", }, + "v2.ListCatalogKind": { + "pageOffset": { + "type": "number", + "format": "int64", + }, + "pageLimit": { + "type": "number", + "format": "int64", + }, + "filterId": { + "type": "string", + "format": "", + }, + "filterName": { + "type": "string", + "format": "", + }, + "operationResponseType": "ListKindCatalogResponse", + }, + "v2.UpsertCatalogKind": { + "body": { + "type": "UpsertCatalogKindRequest", + "format": "", + }, + "operationResponseType": "UpsertCatalogKindResponse", + }, + "v2.DeleteCatalogKind": { + "kindId": { + "type": "string", + "format": "", + }, + "operationResponseType": "void", + }, "v2.ListCatalogRelation": { "pageOffset": { "type": "number", diff --git a/features/v2/given.json b/features/v2/given.json index 794ed14f84fc..dd414a687e94 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -108,6 +108,18 @@ "tag": "Software Catalog", "operationId": "UpsertCatalogEntity" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"kind\": \"my-job\",\n \"displayName\": \"My Job\",\n \"description\": \"A job entity in the catalog.\"\n}" + } + ], + "step": "there is a valid kind", + "key": "kind", + "tag": "Software Catalog", + "operationId": "UpsertCatalogKind" + }, { "parameters": [ { diff --git a/features/v2/software_catalog.feature b/features/v2/software_catalog.feature index afb04f1b1864..070e066a944a 100644 --- a/features/v2/software_catalog.feature +++ b/features/v2/software_catalog.feature @@ -28,6 +28,20 @@ Feature: Software Catalog When the request is sent Then the response status is 500 Internal Server Error + @generated @skip @team:DataDog/service-catalog + Scenario: Create or update kinds returns "ACCEPTED" response + Given new "UpsertCatalogKind" request + And body with value {"kind": "my-job"} + When the request is sent + Then the response status is 202 ACCEPTED + + @generated @skip @team:DataDog/service-catalog + Scenario: Create or update kinds returns "Bad Request" response + Given new "UpsertCatalogKind" request + And body with value {"kind": "my-job"} + When the request is sent + Then the response status is 400 Bad Request + @team:DataDog/service-catalog Scenario: Create or update software catalog entity using schema v3 returns "ACCEPTED" response Given new "UpsertCatalogEntity" request @@ -59,6 +73,27 @@ Feature: Software Catalog When the request is sent Then the response status is 204 OK + @generated @skip @team:DataDog/service-catalog + Scenario: Delete a single kind returns "Bad Request" response + Given new "DeleteCatalogKind" request + And request contains "kind_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: Delete a single kind returns "Not Found" response + Given new "DeleteCatalogKind" request + And request contains "kind_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/service-catalog + Scenario: Delete a single kind returns "OK" response + Given new "DeleteCatalogKind" request + And request contains "kind_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 OK + @skip @team:DataDog/service-catalog Scenario: Delete an entity returns "Not Found" response Given new "DeleteCatalogEntity" request @@ -79,6 +114,24 @@ Feature: Software Catalog When the request with pagination is sent Then the response status is 200 OK + @generated @skip @team:DataDog/service-catalog + Scenario: Get a list of entity kinds returns "Bad Request" response + Given new "ListCatalogKind" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/service-catalog + Scenario: Get a list of entity kinds returns "OK" response + Given new "ListCatalogKind" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/service-catalog @with-pagination + Scenario: Get a list of entity kinds returns "OK" response with pagination + Given new "ListCatalogKind" request + When the request with pagination is sent + Then the response status is 200 OK + @replay-only @team:DataDog/service-catalog Scenario: Get a list of entity relations returns "OK" response Given new "ListCatalogRelation" request diff --git a/features/v2/undo.json b/features/v2/undo.json index a7a5bb3ac1ec..2d33b5cd7166 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -471,6 +471,31 @@ "type": "idempotent" } }, + "ListCatalogKind": { + "tag": "Software Catalog", + "undo": { + "type": "safe" + } + }, + "UpsertCatalogKind": { + "tag": "Software Catalog", + "undo": { + "operationId": "DeleteCatalogKind", + "parameters": [ + { + "name": "kind_id", + "source": "data[0].id" + } + ], + "type": "unsafe" + } + }, + "DeleteCatalogKind": { + "tag": "Software Catalog", + "undo": { + "type": "idempotent" + } + }, "ListCatalogRelation": { "tag": "Software Catalog", "undo": { diff --git a/packages/datadog-api-client-v2/apis/SoftwareCatalogApi.ts b/packages/datadog-api-client-v2/apis/SoftwareCatalogApi.ts index 48ee086c9515..b6f85d58d3d5 100644 --- a/packages/datadog-api-client-v2/apis/SoftwareCatalogApi.ts +++ b/packages/datadog-api-client-v2/apis/SoftwareCatalogApi.ts @@ -19,13 +19,17 @@ import { ApiException } from "../../datadog-api-client-common/exception"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { EntityData } from "../models/EntityData"; import { IncludeType } from "../models/IncludeType"; +import { KindData } from "../models/KindData"; import { ListEntityCatalogResponse } from "../models/ListEntityCatalogResponse"; +import { ListKindCatalogResponse } from "../models/ListKindCatalogResponse"; import { ListRelationCatalogResponse } from "../models/ListRelationCatalogResponse"; import { RelationIncludeType } from "../models/RelationIncludeType"; import { RelationResponse } from "../models/RelationResponse"; import { RelationType } from "../models/RelationType"; import { UpsertCatalogEntityRequest } from "../models/UpsertCatalogEntityRequest"; import { UpsertCatalogEntityResponse } from "../models/UpsertCatalogEntityResponse"; +import { UpsertCatalogKindRequest } from "../models/UpsertCatalogKindRequest"; +import { UpsertCatalogKindResponse } from "../models/UpsertCatalogKindResponse"; export class SoftwareCatalogApiRequestFactory extends BaseAPIRequestFactory { public async deleteCatalogEntity( @@ -62,6 +66,40 @@ export class SoftwareCatalogApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async deleteCatalogKind( + kindId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'kindId' is not null or undefined + if (kindId === null || kindId === undefined) { + throw new RequiredError("kindId", "deleteCatalogKind"); + } + + // Path Params + const localVarPath = "/api/v2/catalog/kind/{kind_id}".replace( + "{kind_id}", + encodeURIComponent(String(kindId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.SoftwareCatalogApi.deleteCatalogKind") + .makeRequestContext(localVarPath, HttpMethod.DELETE); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "AuthZ", + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async listCatalogEntity( pageOffset?: number, pageLimit?: number, @@ -169,6 +207,65 @@ export class SoftwareCatalogApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async listCatalogKind( + pageOffset?: number, + pageLimit?: number, + filterId?: string, + filterName?: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // Path Params + const localVarPath = "/api/v2/catalog/kind"; + + // Make Request Context + const requestContext = _config + .getServer("v2.SoftwareCatalogApi.listCatalogKind") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (pageOffset !== undefined) { + requestContext.setQueryParam( + "page[offset]", + ObjectSerializer.serialize(pageOffset, "number", "int64"), + "" + ); + } + if (pageLimit !== undefined) { + requestContext.setQueryParam( + "page[limit]", + ObjectSerializer.serialize(pageLimit, "number", "int64"), + "" + ); + } + if (filterId !== undefined) { + requestContext.setQueryParam( + "filter[id]", + ObjectSerializer.serialize(filterId, "string", ""), + "" + ); + } + if (filterName !== undefined) { + requestContext.setQueryParam( + "filter[name]", + ObjectSerializer.serialize(filterName, "string", ""), + "" + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "AuthZ", + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async listCatalogRelation( pageOffset?: number, pageLimit?: number, @@ -285,6 +382,48 @@ export class SoftwareCatalogApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + + public async upsertCatalogKind( + body: UpsertCatalogKindRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "upsertCatalogKind"); + } + + // Path Params + const localVarPath = "/api/v2/catalog/kind"; + + // Make Request Context + const requestContext = _config + .getServer("v2.SoftwareCatalogApi.upsertCatalogKind") + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "UpsertCatalogKindRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "AuthZ", + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } } export class SoftwareCatalogApiResponseProcessor { @@ -345,6 +484,63 @@ export class SoftwareCatalogApiResponseProcessor { ); } + /** + * 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 deleteCatalogKind + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteCatalogKind(response: ResponseContext): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 204) { + return; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: void = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "void", + "" + ) as void; + 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 @@ -403,6 +599,68 @@ export class SoftwareCatalogApiResponseProcessor { ); } + /** + * 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 listCatalogKind + * @throws ApiException if the response code was not in [200, 299] + */ + public async listCatalogKind( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: ListKindCatalogResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ListKindCatalogResponse" + ) as ListKindCatalogResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: ListKindCatalogResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ListKindCatalogResponse", + "" + ) as ListKindCatalogResponse; + 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 @@ -522,6 +780,68 @@ export class SoftwareCatalogApiResponseProcessor { '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 upsertCatalogKind + * @throws ApiException if the response code was not in [200, 299] + */ + public async upsertCatalogKind( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 202) { + const body: UpsertCatalogKindResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "UpsertCatalogKindResponse" + ) as UpsertCatalogKindResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: UpsertCatalogKindResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "UpsertCatalogKindResponse", + "" + ) as UpsertCatalogKindResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } } export interface SoftwareCatalogApiDeleteCatalogEntityRequest { @@ -532,6 +852,14 @@ export interface SoftwareCatalogApiDeleteCatalogEntityRequest { entityId: string; } +export interface SoftwareCatalogApiDeleteCatalogKindRequest { + /** + * Entity kind. + * @type string + */ + kindId: string; +} + export interface SoftwareCatalogApiListCatalogEntityRequest { /** * Specific offset to use as the beginning of the returned page. @@ -585,6 +913,29 @@ export interface SoftwareCatalogApiListCatalogEntityRequest { include?: IncludeType; } +export interface SoftwareCatalogApiListCatalogKindRequest { + /** + * Specific offset to use as the beginning of the returned page. + * @type number + */ + pageOffset?: number; + /** + * Maximum number of kinds in the response. + * @type number + */ + pageLimit?: number; + /** + * Filter entities by UUID. + * @type string + */ + filterId?: string; + /** + * Filter entities by name. + * @type string + */ + filterName?: string; +} + export interface SoftwareCatalogApiListCatalogRelationRequest { /** * Specific offset to use as the beginning of the returned page. @@ -626,6 +977,14 @@ export interface SoftwareCatalogApiUpsertCatalogEntityRequest { body: UpsertCatalogEntityRequest; } +export interface SoftwareCatalogApiUpsertCatalogKindRequest { + /** + * Kind YAML or JSON. + * @type UpsertCatalogKindRequest + */ + body: UpsertCatalogKindRequest; +} + export class SoftwareCatalogApi { private requestFactory: SoftwareCatalogApiRequestFactory; private responseProcessor: SoftwareCatalogApiResponseProcessor; @@ -664,6 +1023,27 @@ export class SoftwareCatalogApi { }); } + /** + * Delete a single kind in Software Catalog. + * @param param The request object + */ + public deleteCatalogKind( + param: SoftwareCatalogApiDeleteCatalogKindRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.deleteCatalogKind( + param.kindId, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.deleteCatalogKind(responseContext); + }); + }); + } + /** * Get a list of entities from Software Catalog. * @param param The request object @@ -746,6 +1126,76 @@ export class SoftwareCatalogApi { } } + /** + * Get a list of entity kinds from Software Catalog. + * @param param The request object + */ + public listCatalogKind( + param: SoftwareCatalogApiListCatalogKindRequest = {}, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.listCatalogKind( + param.pageOffset, + param.pageLimit, + param.filterId, + param.filterName, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listCatalogKind(responseContext); + }); + }); + } + + /** + * Provide a paginated version of listCatalogKind returning a generator with all the items. + */ + public async *listCatalogKindWithPagination( + param: SoftwareCatalogApiListCatalogKindRequest = {}, + options?: Configuration + ): AsyncGenerator { + let pageSize = 100; + if (param.pageLimit !== undefined) { + pageSize = param.pageLimit; + } + param.pageLimit = pageSize; + while (true) { + const requestContext = await this.requestFactory.listCatalogKind( + param.pageOffset, + param.pageLimit, + param.filterId, + param.filterName, + options + ); + const responseContext = await this.configuration.httpApi.send( + requestContext + ); + + const response = await this.responseProcessor.listCatalogKind( + responseContext + ); + const responseData = response.data; + if (responseData === undefined) { + break; + } + const results = responseData; + for (const item of results) { + yield item; + } + if (results.length < pageSize) { + break; + } + if (param.pageOffset === undefined) { + param.pageOffset = pageSize; + } else { + param.pageOffset = param.pageOffset + pageSize; + } + } + } + /** * Get a list of entity relations from Software Catalog. * @param param The request object @@ -840,4 +1290,25 @@ export class SoftwareCatalogApi { }); }); } + + /** + * Create or update kinds in Software Catalog. + * @param param The request object + */ + public upsertCatalogKind( + param: SoftwareCatalogApiUpsertCatalogKindRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.upsertCatalogKind( + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.upsertCatalogKind(responseContext); + }); + }); + } } diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index a867c30d862a..6032adb352df 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -646,9 +646,12 @@ export { export { SoftwareCatalogApiDeleteCatalogEntityRequest, + SoftwareCatalogApiDeleteCatalogKindRequest, SoftwareCatalogApiListCatalogEntityRequest, + SoftwareCatalogApiListCatalogKindRequest, SoftwareCatalogApiListCatalogRelationRequest, SoftwareCatalogApiUpsertCatalogEntityRequest, + SoftwareCatalogApiUpsertCatalogKindRequest, SoftwareCatalogApi, } from "./apis/SoftwareCatalogApi"; @@ -1870,6 +1873,11 @@ export { JobDefinitionFromRule } from "./models/JobDefinitionFromRule"; export { JSONAPIErrorItem } from "./models/JSONAPIErrorItem"; export { JSONAPIErrorItemSource } from "./models/JSONAPIErrorItemSource"; export { JSONAPIErrorResponse } from "./models/JSONAPIErrorResponse"; +export { KindAttributes } from "./models/KindAttributes"; +export { KindData } from "./models/KindData"; +export { KindMetadata } from "./models/KindMetadata"; +export { KindObj } from "./models/KindObj"; +export { KindResponseMeta } from "./models/KindResponseMeta"; export { Layer } from "./models/Layer"; export { LayerAttributes } from "./models/LayerAttributes"; export { LayerAttributesInterval } from "./models/LayerAttributesInterval"; @@ -1906,6 +1914,7 @@ export { ListFindingsMeta } from "./models/ListFindingsMeta"; export { ListFindingsPage } from "./models/ListFindingsPage"; export { ListFindingsResponse } from "./models/ListFindingsResponse"; export { ListHistoricalJobsResponse } from "./models/ListHistoricalJobsResponse"; +export { ListKindCatalogResponse } from "./models/ListKindCatalogResponse"; export { ListPipelinesResponse } from "./models/ListPipelinesResponse"; export { ListPipelinesResponseMeta } from "./models/ListPipelinesResponseMeta"; export { ListPowerpacksResponse } from "./models/ListPowerpacksResponse"; @@ -3175,6 +3184,8 @@ export { UpdateWorkflowResponse } from "./models/UpdateWorkflowResponse"; export { UpsertCatalogEntityRequest } from "./models/UpsertCatalogEntityRequest"; export { UpsertCatalogEntityResponse } from "./models/UpsertCatalogEntityResponse"; export { UpsertCatalogEntityResponseIncludedItem } from "./models/UpsertCatalogEntityResponseIncludedItem"; +export { UpsertCatalogKindRequest } from "./models/UpsertCatalogKindRequest"; +export { UpsertCatalogKindResponse } from "./models/UpsertCatalogKindResponse"; export { Urgency } from "./models/Urgency"; export { UrlParam } from "./models/UrlParam"; export { UrlParamUpdate } from "./models/UrlParamUpdate"; diff --git a/packages/datadog-api-client-v2/models/KindAttributes.ts b/packages/datadog-api-client-v2/models/KindAttributes.ts new file mode 100644 index 000000000000..87715b65dfa2 --- /dev/null +++ b/packages/datadog-api-client-v2/models/KindAttributes.ts @@ -0,0 +1,68 @@ +/** + * 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"; + +/** + * Kind attributes. + */ +export class KindAttributes { + /** + * Short description of the kind. + */ + "description"?: string; + /** + * User friendly name of the kind. + */ + "displayName"?: string; + /** + * The kind name. + */ + "name"?: 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 = { + description: { + baseName: "description", + type: "string", + }, + displayName: { + baseName: "displayName", + type: "string", + }, + name: { + baseName: "name", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return KindAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/KindData.ts b/packages/datadog-api-client-v2/models/KindData.ts new file mode 100644 index 000000000000..4e4737eca0b6 --- /dev/null +++ b/packages/datadog-api-client-v2/models/KindData.ts @@ -0,0 +1,78 @@ +/** + * 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 { KindAttributes } from "./KindAttributes"; +import { KindMetadata } from "./KindMetadata"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Schema that defines the structure of a Kind object in the Software Catalog. + */ +export class KindData { + /** + * Kind attributes. + */ + "attributes"?: KindAttributes; + /** + * A read-only globally unique identifier for the entity generated by Datadog. User supplied values are ignored. + */ + "id"?: string; + /** + * Kind metadata. + */ + "meta"?: KindMetadata; + /** + * Kind. + */ + "type"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "KindAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + meta: { + baseName: "meta", + type: "KindMetadata", + }, + type: { + baseName: "type", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return KindData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/KindMetadata.ts b/packages/datadog-api-client-v2/models/KindMetadata.ts new file mode 100644 index 000000000000..ef6c0364f180 --- /dev/null +++ b/packages/datadog-api-client-v2/models/KindMetadata.ts @@ -0,0 +1,60 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Kind metadata. + */ +export class KindMetadata { + /** + * The creation time. + */ + "createdAt"?: string; + /** + * The modification time. + */ + "modifiedAt"?: 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 = { + createdAt: { + baseName: "createdAt", + type: "string", + }, + modifiedAt: { + baseName: "modifiedAt", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return KindMetadata.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/KindObj.ts b/packages/datadog-api-client-v2/models/KindObj.ts new file mode 100644 index 000000000000..df5f9bc80734 --- /dev/null +++ b/packages/datadog-api-client-v2/models/KindObj.ts @@ -0,0 +1,69 @@ +/** + * 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"; + +/** + * Schema for kind. + */ +export class KindObj { + /** + * Short description of the kind. + */ + "description"?: string; + /** + * The display name of the kind. Automatically generated if not provided. + */ + "displayName"?: string; + /** + * The name of the kind to create or update. This must be in kebab-case format. + */ + "kind": 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 = { + description: { + baseName: "description", + type: "string", + }, + displayName: { + baseName: "displayName", + type: "string", + }, + kind: { + baseName: "kind", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return KindObj.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/KindResponseMeta.ts b/packages/datadog-api-client-v2/models/KindResponseMeta.ts new file mode 100644 index 000000000000..31375b89c91e --- /dev/null +++ b/packages/datadog-api-client-v2/models/KindResponseMeta.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"; + +/** + * Kind response metadata. + */ +export class KindResponseMeta { + /** + * Total kinds count. + */ + "count"?: 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 = { + count: { + baseName: "count", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return KindResponseMeta.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ListKindCatalogResponse.ts b/packages/datadog-api-client-v2/models/ListKindCatalogResponse.ts new file mode 100644 index 000000000000..ad418ce2460a --- /dev/null +++ b/packages/datadog-api-client-v2/models/ListKindCatalogResponse.ts @@ -0,0 +1,62 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { KindData } from "./KindData"; +import { KindResponseMeta } from "./KindResponseMeta"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * List kind response. + */ +export class ListKindCatalogResponse { + /** + * List of kind responses. + */ + "data"?: Array; + /** + * Kind response metadata. + */ + "meta"?: KindResponseMeta; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + }, + meta: { + baseName: "meta", + type: "KindResponseMeta", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ListKindCatalogResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index 7ace9854b8f2..2f4f8995ae07 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -877,6 +877,11 @@ import { JobCreateResponse } from "./JobCreateResponse"; import { JobCreateResponseData } from "./JobCreateResponseData"; import { JobDefinition } from "./JobDefinition"; import { JobDefinitionFromRule } from "./JobDefinitionFromRule"; +import { KindAttributes } from "./KindAttributes"; +import { KindData } from "./KindData"; +import { KindMetadata } from "./KindMetadata"; +import { KindObj } from "./KindObj"; +import { KindResponseMeta } from "./KindResponseMeta"; import { Layer } from "./Layer"; import { LayerAttributes } from "./LayerAttributes"; import { LayerAttributesInterval } from "./LayerAttributesInterval"; @@ -909,6 +914,7 @@ import { ListFindingsMeta } from "./ListFindingsMeta"; import { ListFindingsPage } from "./ListFindingsPage"; import { ListFindingsResponse } from "./ListFindingsResponse"; import { ListHistoricalJobsResponse } from "./ListHistoricalJobsResponse"; +import { ListKindCatalogResponse } from "./ListKindCatalogResponse"; import { ListPipelinesResponse } from "./ListPipelinesResponse"; import { ListPipelinesResponseMeta } from "./ListPipelinesResponseMeta"; import { ListPowerpacksResponse } from "./ListPowerpacksResponse"; @@ -1840,6 +1846,7 @@ import { UpdateRuleResponseData } from "./UpdateRuleResponseData"; import { UpdateWorkflowRequest } from "./UpdateWorkflowRequest"; import { UpdateWorkflowResponse } from "./UpdateWorkflowResponse"; import { UpsertCatalogEntityResponse } from "./UpsertCatalogEntityResponse"; +import { UpsertCatalogKindResponse } from "./UpsertCatalogKindResponse"; import { UrlParam } from "./UrlParam"; import { UrlParamUpdate } from "./UrlParamUpdate"; import { UsageApplicationSecurityMonitoringResponse } from "./UsageApplicationSecurityMonitoringResponse"; @@ -4167,6 +4174,11 @@ const typeMap: { [index: string]: any } = { JobCreateResponseData: JobCreateResponseData, JobDefinition: JobDefinition, JobDefinitionFromRule: JobDefinitionFromRule, + KindAttributes: KindAttributes, + KindData: KindData, + KindMetadata: KindMetadata, + KindObj: KindObj, + KindResponseMeta: KindResponseMeta, Layer: Layer, LayerAttributes: LayerAttributes, LayerAttributesInterval: LayerAttributesInterval, @@ -4200,6 +4212,7 @@ const typeMap: { [index: string]: any } = { ListFindingsPage: ListFindingsPage, ListFindingsResponse: ListFindingsResponse, ListHistoricalJobsResponse: ListHistoricalJobsResponse, + ListKindCatalogResponse: ListKindCatalogResponse, ListPipelinesResponse: ListPipelinesResponse, ListPipelinesResponseMeta: ListPipelinesResponseMeta, ListPowerpacksResponse: ListPowerpacksResponse, @@ -5311,6 +5324,7 @@ const typeMap: { [index: string]: any } = { UpdateWorkflowRequest: UpdateWorkflowRequest, UpdateWorkflowResponse: UpdateWorkflowResponse, UpsertCatalogEntityResponse: UpsertCatalogEntityResponse, + UpsertCatalogKindResponse: UpsertCatalogKindResponse, UrlParam: UrlParam, UrlParamUpdate: UrlParamUpdate, UsageApplicationSecurityMonitoringResponse: @@ -5740,6 +5754,7 @@ const oneOfMap: { [index: string]: string[] } = { ], UpsertCatalogEntityRequest: ["EntityV3", "string"], UpsertCatalogEntityResponseIncludedItem: ["EntityResponseIncludedSchema"], + UpsertCatalogKindRequest: ["KindObj", "string"], UserResponseIncludedItem: ["Organization", "Permission", "Role"], UserTeamIncluded: ["User", "Team"], XRayServicesList: ["XRayServicesIncludeAll", "XRayServicesIncludeOnly"], diff --git a/packages/datadog-api-client-v2/models/UpsertCatalogKindRequest.ts b/packages/datadog-api-client-v2/models/UpsertCatalogKindRequest.ts new file mode 100644 index 000000000000..8368be9328b4 --- /dev/null +++ b/packages/datadog-api-client-v2/models/UpsertCatalogKindRequest.ts @@ -0,0 +1,14 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { KindObj } from "./KindObj"; + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Create or update kind request. + */ + +export type UpsertCatalogKindRequest = KindObj | string | UnparsedObject; diff --git a/packages/datadog-api-client-v2/models/UpsertCatalogKindResponse.ts b/packages/datadog-api-client-v2/models/UpsertCatalogKindResponse.ts new file mode 100644 index 000000000000..1320f7892098 --- /dev/null +++ b/packages/datadog-api-client-v2/models/UpsertCatalogKindResponse.ts @@ -0,0 +1,62 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { KindData } from "./KindData"; +import { KindResponseMeta } from "./KindResponseMeta"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Upsert kind response. + */ +export class UpsertCatalogKindResponse { + /** + * List of kind responses. + */ + "data"?: Array; + /** + * Kind response metadata. + */ + "meta"?: KindResponseMeta; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + }, + meta: { + baseName: "meta", + type: "KindResponseMeta", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return UpsertCatalogKindResponse.attributeTypeMap; + } + + public constructor() {} +}