diff --git a/.apigentools-info b/.apigentools-info index 66db1fd5dbb..65fb7296cd8 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:56:49.073582", + "spec_repo_commit": "9f80a9c5" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2022-10-11 16:21:59.066264", - "spec_repo_commit": "c90265b2" + "regenerated": "2022-10-12 15:56:49.085696", + "spec_repo_commit": "9f80a9c5" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 2f96dba665f..da02a9204bd 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: @@ -8490,7 +8490,7 @@ components: format: email type: string slack: - description: "Service owner\u2019s slack channel." + description: "Service owner\u2019s Slack channel." example: https://yourcompany.slack.com/archives/channel123 type: string ServiceDefinitionV1Info: @@ -8526,7 +8526,7 @@ components: description: Org related information about the service. properties: application: - description: App feature for which this service supports. + description: App feature this service supports. example: E-Commerce type: string team: @@ -8535,7 +8535,7 @@ components: type: string type: object ServiceDefinitionV1Pagerduty: - description: PagerDuty service url for the service. + description: PagerDuty service URL for the service. example: https://my-org.pagerduty.com/service-directory/PMyService type: string ServiceDefinitionV1Resource: @@ -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: @@ -8794,7 +8794,7 @@ components: - url type: object ServiceDefinitionV2Slack: - description: Service owner's slack channel. + description: Service owner's Slack channel. properties: contact: description: Slack Channel. @@ -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 882780270d7..5d0bec53979 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 a14436b9e1e..4bcaaa819ff 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 d8ad80ef3e3..824abe467b1 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 7a77d3722c5..4c54ca050af 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 7970be5cb9d..c546ee2bb52 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 6d6b2f5270c..aa91b93642e 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/ServiceDefinitionV1Contact.ts b/packages/datadog-api-client-v2/models/ServiceDefinitionV1Contact.ts index e389b6b016f..277729452cd 100644 --- a/packages/datadog-api-client-v2/models/ServiceDefinitionV1Contact.ts +++ b/packages/datadog-api-client-v2/models/ServiceDefinitionV1Contact.ts @@ -15,7 +15,7 @@ export class ServiceDefinitionV1Contact { */ "email"?: string; /** - * Service owner’s slack channel. + * Service owner’s Slack channel. */ "slack"?: string; diff --git a/packages/datadog-api-client-v2/models/ServiceDefinitionV1Integrations.ts b/packages/datadog-api-client-v2/models/ServiceDefinitionV1Integrations.ts index 162145475d9..d2f5e1d09a9 100644 --- a/packages/datadog-api-client-v2/models/ServiceDefinitionV1Integrations.ts +++ b/packages/datadog-api-client-v2/models/ServiceDefinitionV1Integrations.ts @@ -11,7 +11,7 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util"; */ export class ServiceDefinitionV1Integrations { /** - * PagerDuty service url for the service. + * PagerDuty service URL for the service. */ "pagerduty"?: string; diff --git a/packages/datadog-api-client-v2/models/ServiceDefinitionV1Org.ts b/packages/datadog-api-client-v2/models/ServiceDefinitionV1Org.ts index 0ffa917f8b2..2ac81800de9 100644 --- a/packages/datadog-api-client-v2/models/ServiceDefinitionV1Org.ts +++ b/packages/datadog-api-client-v2/models/ServiceDefinitionV1Org.ts @@ -11,7 +11,7 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util"; */ export class ServiceDefinitionV1Org { /** - * App feature for which this service supports. + * App feature this service supports. */ "application"?: string; /** diff --git a/packages/datadog-api-client-v2/models/ServiceDefinitionV1Version.ts b/packages/datadog-api-client-v2/models/ServiceDefinitionV1Version.ts index f376e1dcbdb..712557246c8 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/ServiceDefinitionV2Slack.ts b/packages/datadog-api-client-v2/models/ServiceDefinitionV2Slack.ts index dee22c1a1cf..39c196c0210 100644 --- a/packages/datadog-api-client-v2/models/ServiceDefinitionV2Slack.ts +++ b/packages/datadog-api-client-v2/models/ServiceDefinitionV2Slack.ts @@ -8,7 +8,7 @@ import { ServiceDefinitionV2SlackType } from "./ServiceDefinitionV2SlackType"; import { AttributeTypeMap } from "../../datadog-api-client-common/util"; /** - * Service owner's slack channel. + * Service owner's Slack channel. */ export class ServiceDefinitionV2Slack { /** 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 92b4cc3eb6e..53983a1ad67 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() {}