From fdfe0a030722f2891bccc1fa8b680bd929114e45 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 12 Oct 2022 15:46:55 +0000 Subject: [PATCH] Regenerate client from commit 889e44c2 of spec repo --- .apigentools-info | 8 +-- .generator/schemas/v2/openapi.yaml | 26 +++++----- .../CreateOrUpdateServiceDefinitions.ts | 6 ++- .../ListServiceDefinitions.ts | 2 +- .../apis/ServiceDefinitionApi.ts | 52 +++++++++---------- packages/datadog-api-client-v2/index.ts | 4 +- .../models/ObjectSerializer.ts | 8 +-- ....ts => ServiceDefinitionCreateResponse.ts} | 8 +-- .../models/ServiceDefinitionV1Version.ts | 4 +- ...e.ts => ServiceDefinitionsListResponse.ts} | 4 +- 10 files changed, 62 insertions(+), 60 deletions(-) rename packages/datadog-api-client-v2/models/{ServiceDefinitionListResponse.ts => ServiceDefinitionCreateResponse.ts} (79%) rename packages/datadog-api-client-v2/models/{ServiceDefinitionsCreateResponse.ts => ServiceDefinitionsListResponse.ts} (88%) diff --git a/.apigentools-info b/.apigentools-info index 66db1fd5dbb7..a0ae0ba192e9 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2022-10-11 16:21:59.043800", - "spec_repo_commit": "c90265b2" + "regenerated": "2022-10-12 15:45:07.927269", + "spec_repo_commit": "889e44c2" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2022-10-11 16:21:59.066264", - "spec_repo_commit": "c90265b2" + "regenerated": "2022-10-12 15:45:07.947277", + "spec_repo_commit": "889e44c2" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 2f96dba665fa..710280209227 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -8379,6 +8379,15 @@ components: required: - data type: object + ServiceDefinitionCreateResponse: + description: Create service definitions response. + properties: + data: + description: Create service definitions response payload. + items: + $ref: '#/components/schemas/ServiceDefinitionData' + type: array + type: object ServiceDefinitionData: description: Service definition data. properties: @@ -8402,15 +8411,6 @@ components: data: $ref: '#/components/schemas/ServiceDefinitionData' type: object - ServiceDefinitionListResponse: - description: Get service definitions response. - properties: - data: - description: Get service definitions response payload. - items: - $ref: '#/components/schemas/ServiceDefinitionData' - type: array - type: object ServiceDefinitionMeta: description: Metadata about a service definition. properties: @@ -8588,7 +8588,7 @@ components: example: v1 type: string x-enum-varnames: - - v1 + - V1 ServiceDefinitionV2: description: Service definition V2 for providing service metadata and integrations. properties: @@ -8832,7 +8832,7 @@ components: oneOf: - $ref: '#/components/schemas/ServiceDefinitionV2' - $ref: '#/components/schemas/ServiceDefinitionRaw' - ServiceDefinitionsCreateResponse: + ServiceDefinitionsListResponse: description: Create service definitions response. properties: data: @@ -14400,7 +14400,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ServiceDefinitionsCreateResponse' + $ref: '#/components/schemas/ServiceDefinitionsListResponse' description: OK '403': $ref: '#/components/responses/ForbiddenResponse' @@ -14424,7 +14424,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ServiceDefinitionListResponse' + $ref: '#/components/schemas/ServiceDefinitionCreateResponse' description: CREATED '400': $ref: '#/components/responses/BadRequestResponse' diff --git a/examples/v2/service-definition/CreateOrUpdateServiceDefinitions.ts b/examples/v2/service-definition/CreateOrUpdateServiceDefinitions.ts index 882780270d7d..5d0bec539792 100644 --- a/examples/v2/service-definition/CreateOrUpdateServiceDefinitions.ts +++ b/examples/v2/service-definition/CreateOrUpdateServiceDefinitions.ts @@ -26,7 +26,9 @@ const params: v2.ServiceDefinitionApiCreateOrUpdateServiceDefinitionsRequest = { url: "https://gdrive/mydoc", }, ], - extensions: {}, + extensions: { + myorgextension: "extensionvalue", + }, integrations: { opsgenie: { region: "US", @@ -56,7 +58,7 @@ const params: v2.ServiceDefinitionApiCreateOrUpdateServiceDefinitionsRequest = { apiInstance .createOrUpdateServiceDefinitions(params) - .then((data: v2.ServiceDefinitionListResponse) => { + .then((data: v2.ServiceDefinitionCreateResponse) => { console.log( "API called successfully. Returned data: " + JSON.stringify(data) ); diff --git a/examples/v2/service-definition/ListServiceDefinitions.ts b/examples/v2/service-definition/ListServiceDefinitions.ts index a14436b9e1ee..4bcaaa819ffe 100644 --- a/examples/v2/service-definition/ListServiceDefinitions.ts +++ b/examples/v2/service-definition/ListServiceDefinitions.ts @@ -9,7 +9,7 @@ const apiInstance = new v2.ServiceDefinitionApi(configuration); apiInstance .listServiceDefinitions() - .then((data: v2.ServiceDefinitionsCreateResponse) => { + .then((data: v2.ServiceDefinitionsListResponse) => { console.log( "API called successfully. Returned data: " + JSON.stringify(data) ); diff --git a/packages/datadog-api-client-v2/apis/ServiceDefinitionApi.ts b/packages/datadog-api-client-v2/apis/ServiceDefinitionApi.ts index d8ad80ef3e3d..824abe467b14 100644 --- a/packages/datadog-api-client-v2/apis/ServiceDefinitionApi.ts +++ b/packages/datadog-api-client-v2/apis/ServiceDefinitionApi.ts @@ -18,10 +18,10 @@ import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; import { APIErrorResponse } from "../models/APIErrorResponse"; +import { ServiceDefinitionCreateResponse } from "../models/ServiceDefinitionCreateResponse"; import { ServiceDefinitionGetResponse } from "../models/ServiceDefinitionGetResponse"; -import { ServiceDefinitionListResponse } from "../models/ServiceDefinitionListResponse"; import { ServiceDefinitionsCreateRequest } from "../models/ServiceDefinitionsCreateRequest"; -import { ServiceDefinitionsCreateResponse } from "../models/ServiceDefinitionsCreateResponse"; +import { ServiceDefinitionsListResponse } from "../models/ServiceDefinitionsListResponse"; export class ServiceDefinitionApiRequestFactory extends BaseAPIRequestFactory { public async createOrUpdateServiceDefinitions( @@ -176,15 +176,16 @@ export class ServiceDefinitionApiResponseProcessor { */ public async createOrUpdateServiceDefinitions( response: ResponseContext - ): Promise { + ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); if (response.httpStatusCode == 200) { - const body: ServiceDefinitionListResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "ServiceDefinitionListResponse" - ) as ServiceDefinitionListResponse; + const body: ServiceDefinitionCreateResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ServiceDefinitionCreateResponse" + ) as ServiceDefinitionCreateResponse; return body; } if ( @@ -215,11 +216,12 @@ export class ServiceDefinitionApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: ServiceDefinitionListResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "ServiceDefinitionListResponse", - "" - ) as ServiceDefinitionListResponse; + const body: ServiceDefinitionCreateResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ServiceDefinitionCreateResponse", + "" + ) as ServiceDefinitionCreateResponse; return body; } @@ -362,16 +364,15 @@ export class ServiceDefinitionApiResponseProcessor { */ public async listServiceDefinitions( response: ResponseContext - ): Promise { + ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); if (response.httpStatusCode == 200) { - const body: ServiceDefinitionsCreateResponse = - ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "ServiceDefinitionsCreateResponse" - ) as ServiceDefinitionsCreateResponse; + const body: ServiceDefinitionsListResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ServiceDefinitionsListResponse" + ) as ServiceDefinitionsListResponse; return body; } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { @@ -397,12 +398,11 @@ export class ServiceDefinitionApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: ServiceDefinitionsCreateResponse = - ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "ServiceDefinitionsCreateResponse", - "" - ) as ServiceDefinitionsCreateResponse; + const body: ServiceDefinitionsListResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ServiceDefinitionsListResponse", + "" + ) as ServiceDefinitionsListResponse; return body; } @@ -462,7 +462,7 @@ export class ServiceDefinitionApi { public createOrUpdateServiceDefinitions( param: ServiceDefinitionApiCreateOrUpdateServiceDefinitionsRequest, options?: Configuration - ): Promise { + ): Promise { const requestContextPromise = this.requestFactory.createOrUpdateServiceDefinitions(param.body, options); return requestContextPromise.then((requestContext) => { @@ -526,7 +526,7 @@ export class ServiceDefinitionApi { */ public listServiceDefinitions( options?: Configuration - ): Promise { + ): Promise { const requestContextPromise = this.requestFactory.listServiceDefinitions(options); return requestContextPromise.then((requestContext) => { diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index 7a77d3722c5e..4c54ca050af8 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -753,14 +753,14 @@ export { SecurityMonitoringTriageUser } from "./models/SecurityMonitoringTriageU export { ServiceAccountCreateAttributes } from "./models/ServiceAccountCreateAttributes"; export { ServiceAccountCreateData } from "./models/ServiceAccountCreateData"; export { ServiceAccountCreateRequest } from "./models/ServiceAccountCreateRequest"; +export { ServiceDefinitionCreateResponse } from "./models/ServiceDefinitionCreateResponse"; export { ServiceDefinitionData } from "./models/ServiceDefinitionData"; export { ServiceDefinitionDataAttributes } from "./models/ServiceDefinitionDataAttributes"; export { ServiceDefinitionGetResponse } from "./models/ServiceDefinitionGetResponse"; -export { ServiceDefinitionListResponse } from "./models/ServiceDefinitionListResponse"; export { ServiceDefinitionMeta } from "./models/ServiceDefinitionMeta"; export { ServiceDefinitionSchema } from "./models/ServiceDefinitionSchema"; export { ServiceDefinitionsCreateRequest } from "./models/ServiceDefinitionsCreateRequest"; -export { ServiceDefinitionsCreateResponse } from "./models/ServiceDefinitionsCreateResponse"; +export { ServiceDefinitionsListResponse } from "./models/ServiceDefinitionsListResponse"; export { ServiceDefinitionV1 } from "./models/ServiceDefinitionV1"; export { ServiceDefinitionV1Contact } from "./models/ServiceDefinitionV1Contact"; export { ServiceDefinitionV1Info } from "./models/ServiceDefinitionV1Info"; diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index 7970be5cb9de..c546ee2bb528 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -396,10 +396,10 @@ import { SecurityMonitoringTriageUser } from "./SecurityMonitoringTriageUser"; import { ServiceAccountCreateAttributes } from "./ServiceAccountCreateAttributes"; import { ServiceAccountCreateData } from "./ServiceAccountCreateData"; import { ServiceAccountCreateRequest } from "./ServiceAccountCreateRequest"; +import { ServiceDefinitionCreateResponse } from "./ServiceDefinitionCreateResponse"; import { ServiceDefinitionData } from "./ServiceDefinitionData"; import { ServiceDefinitionDataAttributes } from "./ServiceDefinitionDataAttributes"; import { ServiceDefinitionGetResponse } from "./ServiceDefinitionGetResponse"; -import { ServiceDefinitionListResponse } from "./ServiceDefinitionListResponse"; import { ServiceDefinitionMeta } from "./ServiceDefinitionMeta"; import { ServiceDefinitionV1 } from "./ServiceDefinitionV1"; import { ServiceDefinitionV1Contact } from "./ServiceDefinitionV1Contact"; @@ -415,7 +415,7 @@ import { ServiceDefinitionV2Link } from "./ServiceDefinitionV2Link"; import { ServiceDefinitionV2Opsgenie } from "./ServiceDefinitionV2Opsgenie"; import { ServiceDefinitionV2Repo } from "./ServiceDefinitionV2Repo"; import { ServiceDefinitionV2Slack } from "./ServiceDefinitionV2Slack"; -import { ServiceDefinitionsCreateResponse } from "./ServiceDefinitionsCreateResponse"; +import { ServiceDefinitionsListResponse } from "./ServiceDefinitionsListResponse"; import { UsageApplicationSecurityMonitoringResponse } from "./UsageApplicationSecurityMonitoringResponse"; import { UsageAttributesObject } from "./UsageAttributesObject"; import { UsageDataObject } from "./UsageDataObject"; @@ -1162,10 +1162,10 @@ const typeMap: { [index: string]: any } = { ServiceAccountCreateAttributes: ServiceAccountCreateAttributes, ServiceAccountCreateData: ServiceAccountCreateData, ServiceAccountCreateRequest: ServiceAccountCreateRequest, + ServiceDefinitionCreateResponse: ServiceDefinitionCreateResponse, ServiceDefinitionData: ServiceDefinitionData, ServiceDefinitionDataAttributes: ServiceDefinitionDataAttributes, ServiceDefinitionGetResponse: ServiceDefinitionGetResponse, - ServiceDefinitionListResponse: ServiceDefinitionListResponse, ServiceDefinitionMeta: ServiceDefinitionMeta, ServiceDefinitionV1: ServiceDefinitionV1, ServiceDefinitionV1Contact: ServiceDefinitionV1Contact, @@ -1181,7 +1181,7 @@ const typeMap: { [index: string]: any } = { ServiceDefinitionV2Opsgenie: ServiceDefinitionV2Opsgenie, ServiceDefinitionV2Repo: ServiceDefinitionV2Repo, ServiceDefinitionV2Slack: ServiceDefinitionV2Slack, - ServiceDefinitionsCreateResponse: ServiceDefinitionsCreateResponse, + ServiceDefinitionsListResponse: ServiceDefinitionsListResponse, UsageApplicationSecurityMonitoringResponse: UsageApplicationSecurityMonitoringResponse, UsageAttributesObject: UsageAttributesObject, diff --git a/packages/datadog-api-client-v2/models/ServiceDefinitionListResponse.ts b/packages/datadog-api-client-v2/models/ServiceDefinitionCreateResponse.ts similarity index 79% rename from packages/datadog-api-client-v2/models/ServiceDefinitionListResponse.ts rename to packages/datadog-api-client-v2/models/ServiceDefinitionCreateResponse.ts index 6d6b2f5270cf..aa91b93642ef 100644 --- a/packages/datadog-api-client-v2/models/ServiceDefinitionListResponse.ts +++ b/packages/datadog-api-client-v2/models/ServiceDefinitionCreateResponse.ts @@ -8,11 +8,11 @@ import { ServiceDefinitionData } from "./ServiceDefinitionData"; import { AttributeTypeMap } from "../../datadog-api-client-common/util"; /** - * Get service definitions response. + * Create service definitions response. */ -export class ServiceDefinitionListResponse { +export class ServiceDefinitionCreateResponse { /** - * Get service definitions response payload. + * Create service definitions response payload. */ "data"?: Array; @@ -35,7 +35,7 @@ export class ServiceDefinitionListResponse { * @ignore */ static getAttributeTypeMap(): AttributeTypeMap { - return ServiceDefinitionListResponse.attributeTypeMap; + return ServiceDefinitionCreateResponse.attributeTypeMap; } public constructor() {} diff --git a/packages/datadog-api-client-v2/models/ServiceDefinitionV1Version.ts b/packages/datadog-api-client-v2/models/ServiceDefinitionV1Version.ts index f376e1dcbdb8..712557246c80 100644 --- a/packages/datadog-api-client-v2/models/ServiceDefinitionV1Version.ts +++ b/packages/datadog-api-client-v2/models/ServiceDefinitionV1Version.ts @@ -4,5 +4,5 @@ * Copyright 2020-Present Datadog, Inc. */ -export type ServiceDefinitionV1Version = typeof v1; -export const v1 = "v1"; +export type ServiceDefinitionV1Version = typeof V1; +export const V1 = "v1"; diff --git a/packages/datadog-api-client-v2/models/ServiceDefinitionsCreateResponse.ts b/packages/datadog-api-client-v2/models/ServiceDefinitionsListResponse.ts similarity index 88% rename from packages/datadog-api-client-v2/models/ServiceDefinitionsCreateResponse.ts rename to packages/datadog-api-client-v2/models/ServiceDefinitionsListResponse.ts index 92b4cc3eb6e2..53983a1ad67e 100644 --- a/packages/datadog-api-client-v2/models/ServiceDefinitionsCreateResponse.ts +++ b/packages/datadog-api-client-v2/models/ServiceDefinitionsListResponse.ts @@ -10,7 +10,7 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util"; /** * Create service definitions response. */ -export class ServiceDefinitionsCreateResponse { +export class ServiceDefinitionsListResponse { /** * Data representing service definitions. */ @@ -35,7 +35,7 @@ export class ServiceDefinitionsCreateResponse { * @ignore */ static getAttributeTypeMap(): AttributeTypeMap { - return ServiceDefinitionsCreateResponse.attributeTypeMap; + return ServiceDefinitionsListResponse.attributeTypeMap; } public constructor() {}