Skip to content

Commit 2008476

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Fix WidgetNewFixedSpan - timestamps are milliseconds not seconds (#3513)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 1bbdac6 commit 2008476

File tree

17 files changed

+635
-6
lines changed

17 files changed

+635
-6
lines changed

.generator/schemas/v1/openapi.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25943,17 +25943,17 @@ components:
2594325943
description: Used for fixed span times, such as 'March 1 to March 7'.
2594425944
properties:
2594525945
from:
25946-
description: Start time in seconds since epoch.
25947-
example: 1712080128
25946+
description: Start time in milliseconds since epoch.
25947+
example: 1712080128000
2594825948
format: int64
2594925949
minimum: 0
2595025950
type: integer
2595125951
hide_incomplete_cost_data:
2595225952
description: Whether to hide incomplete cost data in the widget.
2595325953
type: boolean
2595425954
to:
25955-
description: End time in seconds since epoch.
25956-
example: 1712083128
25955+
description: End time in milliseconds since epoch.
25956+
example: 1712083128000
2595725957
format: int64
2595825958
minimum: 0
2595925959
type: integer

.generator/schemas/v2/openapi.yaml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32179,6 +32179,53 @@ components:
3217932179
type: string
3218032180
type: array
3218132181
type: object
32182+
Integration:
32183+
description: Integration resource object.
32184+
properties:
32185+
attributes:
32186+
$ref: '#/components/schemas/IntegrationAttributes'
32187+
id:
32188+
description: The unique identifier of the integration.
32189+
example: calico
32190+
type: string
32191+
links:
32192+
$ref: '#/components/schemas/IntegrationLinks'
32193+
type:
32194+
$ref: '#/components/schemas/IntegrationType'
32195+
required:
32196+
- type
32197+
- id
32198+
- attributes
32199+
type: object
32200+
IntegrationAttributes:
32201+
description: Attributes for an integration.
32202+
properties:
32203+
categories:
32204+
description: List of categories associated with the integration.
32205+
example:
32206+
- Category::Kubernetes
32207+
- Category::Log Collection
32208+
items:
32209+
type: string
32210+
type: array
32211+
description:
32212+
description: A description of the integration.
32213+
example: Calico is a networking and network security solution for containers.
32214+
type: string
32215+
installed:
32216+
description: Whether the integration is installed.
32217+
example: true
32218+
type: boolean
32219+
title:
32220+
description: The name of the integration.
32221+
example: calico
32222+
type: string
32223+
required:
32224+
- title
32225+
- description
32226+
- categories
32227+
- installed
32228+
type: object
3218232229
IntegrationIncident:
3218332230
description: Incident integration settings
3218432231
properties:
@@ -32284,6 +32331,14 @@ components:
3228432331
value:
3228532332
$ref: '#/components/schemas/AnyValue'
3228632333
type: object
32334+
IntegrationLinks:
32335+
description: Links for the integration resource.
32336+
properties:
32337+
self:
32338+
description: Link to the integration resource.
32339+
example: /integrations?integrationId=calico
32340+
type: string
32341+
type: object
3228732342
IntegrationMonitor:
3228832343
description: Monitor integration settings
3228932344
properties:
@@ -32385,6 +32440,15 @@ components:
3238532440
type: string
3238632441
type: object
3238732442
type: object
32443+
IntegrationType:
32444+
default: integration
32445+
description: Integration resource type.
32446+
enum:
32447+
- integration
32448+
example: integration
32449+
type: string
32450+
x-enum-varnames:
32451+
- INTEGRATION
3238832452
InterfaceAttributes:
3238932453
description: The interface attributes
3239032454
properties:
@@ -34776,6 +34840,17 @@ components:
3477634840
- data
3477734841
- meta
3477834842
type: object
34843+
ListIntegrationsResponse:
34844+
description: Response containing information about multiple integrations.
34845+
properties:
34846+
data:
34847+
description: Array of integration objects.
34848+
items:
34849+
$ref: '#/components/schemas/Integration'
34850+
type: array
34851+
required:
34852+
- data
34853+
type: object
3477934854
ListInterfaceTagsResponse:
3478034855
description: Response for listing interface tags.
3478134856
properties:
@@ -84205,6 +84280,24 @@ paths:
8420584280
x-unstable: '**Note**: This endpoint is in public beta and is subject to change.
8420684281

8420784282
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
84283+
/api/v2/integrations:
84284+
get:
84285+
operationId: ListIntegrations
84286+
responses:
84287+
'200':
84288+
content:
84289+
application/json:
84290+
schema:
84291+
$ref: '#/components/schemas/ListIntegrationsResponse'
84292+
description: Successful Response.
84293+
'429':
84294+
$ref: '#/components/responses/TooManyRequestsResponse'
84295+
security:
84296+
- apiKeyAuth: []
84297+
appKeyAuth: []
84298+
summary: List Integrations
84299+
tags:
84300+
- Integrations
8420884301
/api/v2/integrations/cloudflare/accounts:
8420984302
get:
8421084303
description: List Cloudflare accounts.
@@ -106291,6 +106384,10 @@ tags:
106291106384
and todos. See the [Incident Management page](https://docs.datadoghq.com/service_management/incident_management/)
106292106385
for more information.
106293106386
name: Incidents
106387+
- description: 'The Integrations API is used to list available integrations
106388+
106389+
and retrieve information about their installation status.'
106390+
name: Integrations
106294106391
- description: Manage your Jira Integration. Atlassian Jira is a project management
106295106392
and issue tracking tool for teams to coordinate work and handle tasks efficiently.
106296106393
name: Jira Integration
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2026-02-18T20:11:26.764Z"

cassettes/v2/Integrations_3892031482/List-Integrations-returns-Successful-Response-response_1582902457/recording.har

Lines changed: 57 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* List Integrations returns "Successful Response." response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.IntegrationsApi(configuration);
9+
10+
apiInstance
11+
.listIntegrations()
12+
.then((data: v2.ListIntegrationsResponse) => {
13+
console.log(
14+
"API called successfully. Returned data: " + JSON.stringify(data)
15+
);
16+
})
17+
.catch((error: any) => console.error(error));

features/support/scenarios_model_mapping.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7015,6 +7015,9 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
70157015
},
70167016
"operationResponseType": "ServiceNowUsersResponse",
70177017
},
7018+
"v2.ListIntegrations": {
7019+
"operationResponseType": "ListIntegrationsResponse",
7020+
},
70187021
"v2.ListCloudflareAccounts": {
70197022
"operationResponseType": "CloudflareAccountsResponse",
70207023
},

features/v2/integrations.feature

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@endpoint(integrations) @endpoint(integrations-v2)
2+
Feature: Integrations
3+
The Integrations API is used to list available integrations and retrieve
4+
information about their installation status.
5+
6+
@skip-validation @team:DataDog/integrations-experience
7+
Scenario: List Integrations returns "Successful Response." response
8+
Given a valid "apiKeyAuth" key in the system
9+
And a valid "appKeyAuth" key in the system
10+
And an instance of "Integrations" API
11+
And new "ListIntegrations" request
12+
When the request is sent
13+
Then the response status is 200 Successful Response.

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2527,6 +2527,12 @@
25272527
"type": "safe"
25282528
}
25292529
},
2530+
"ListIntegrations": {
2531+
"tag": "Integrations",
2532+
"undo": {
2533+
"type": "safe"
2534+
}
2535+
},
25302536
"ListCloudflareAccounts": {
25312537
"tag": "Cloudflare Integration",
25322538
"undo": {

packages/datadog-api-client-v1/models/WidgetNewFixedSpan.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util";
1212
*/
1313
export class WidgetNewFixedSpan {
1414
/**
15-
* Start time in seconds since epoch.
15+
* Start time in milliseconds since epoch.
1616
*/
1717
"from": number;
1818
/**
1919
* Whether to hide incomplete cost data in the widget.
2020
*/
2121
"hideIncompleteCostData"?: boolean;
2222
/**
23-
* End time in seconds since epoch.
23+
* End time in milliseconds since epoch.
2424
*/
2525
"to": number;
2626
/**
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
import { BaseAPIRequestFactory } from "../../datadog-api-client-common/baseapi";
2+
import {
3+
Configuration,
4+
applySecurityAuthentication,
5+
} from "../../datadog-api-client-common/configuration";
6+
import {
7+
RequestContext,
8+
HttpMethod,
9+
ResponseContext,
10+
} from "../../datadog-api-client-common/http/http";
11+
12+
import { logger } from "../../../logger";
13+
import { ObjectSerializer } from "../models/ObjectSerializer";
14+
import { ApiException } from "../../datadog-api-client-common/exception";
15+
16+
import { APIErrorResponse } from "../models/APIErrorResponse";
17+
import { ListIntegrationsResponse } from "../models/ListIntegrationsResponse";
18+
19+
export class IntegrationsApiRequestFactory extends BaseAPIRequestFactory {
20+
public async listIntegrations(
21+
_options?: Configuration
22+
): Promise<RequestContext> {
23+
const _config = _options || this.configuration;
24+
25+
// Path Params
26+
const localVarPath = "/api/v2/integrations";
27+
28+
// Make Request Context
29+
const requestContext = _config
30+
.getServer("v2.IntegrationsApi.listIntegrations")
31+
.makeRequestContext(localVarPath, HttpMethod.GET);
32+
requestContext.setHeaderParam("Accept", "application/json");
33+
requestContext.setHttpConfig(_config.httpConfig);
34+
35+
// Apply auth methods
36+
applySecurityAuthentication(_config, requestContext, [
37+
"apiKeyAuth",
38+
"appKeyAuth",
39+
]);
40+
41+
return requestContext;
42+
}
43+
}
44+
45+
export class IntegrationsApiResponseProcessor {
46+
/**
47+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
48+
* to the expected objects
49+
*
50+
* @params response Response returned by the server for a request to listIntegrations
51+
* @throws ApiException if the response code was not in [200, 299]
52+
*/
53+
public async listIntegrations(
54+
response: ResponseContext
55+
): Promise<ListIntegrationsResponse> {
56+
const contentType = ObjectSerializer.normalizeMediaType(
57+
response.headers["content-type"]
58+
);
59+
if (response.httpStatusCode === 200) {
60+
const body: ListIntegrationsResponse = ObjectSerializer.deserialize(
61+
ObjectSerializer.parse(await response.body.text(), contentType),
62+
"ListIntegrationsResponse"
63+
) as ListIntegrationsResponse;
64+
return body;
65+
}
66+
if (response.httpStatusCode === 429) {
67+
const bodyText = ObjectSerializer.parse(
68+
await response.body.text(),
69+
contentType
70+
);
71+
let body: APIErrorResponse;
72+
try {
73+
body = ObjectSerializer.deserialize(
74+
bodyText,
75+
"APIErrorResponse"
76+
) as APIErrorResponse;
77+
} catch (error) {
78+
logger.debug(`Got error deserializing error: ${error}`);
79+
throw new ApiException<APIErrorResponse>(
80+
response.httpStatusCode,
81+
bodyText
82+
);
83+
}
84+
throw new ApiException<APIErrorResponse>(response.httpStatusCode, body);
85+
}
86+
87+
// Work around for missing responses in specification, e.g. for petstore.yaml
88+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
89+
const body: ListIntegrationsResponse = ObjectSerializer.deserialize(
90+
ObjectSerializer.parse(await response.body.text(), contentType),
91+
"ListIntegrationsResponse",
92+
""
93+
) as ListIntegrationsResponse;
94+
return body;
95+
}
96+
97+
const body = (await response.body.text()) || "";
98+
throw new ApiException<string>(
99+
response.httpStatusCode,
100+
'Unknown API Status Code!\nBody: "' + body + '"'
101+
);
102+
}
103+
}
104+
105+
export class IntegrationsApi {
106+
private requestFactory: IntegrationsApiRequestFactory;
107+
private responseProcessor: IntegrationsApiResponseProcessor;
108+
private configuration: Configuration;
109+
110+
public constructor(
111+
configuration: Configuration,
112+
requestFactory?: IntegrationsApiRequestFactory,
113+
responseProcessor?: IntegrationsApiResponseProcessor
114+
) {
115+
this.configuration = configuration;
116+
this.requestFactory =
117+
requestFactory || new IntegrationsApiRequestFactory(configuration);
118+
this.responseProcessor =
119+
responseProcessor || new IntegrationsApiResponseProcessor();
120+
}
121+
122+
/**
123+
* @param param The request object
124+
*/
125+
public listIntegrations(
126+
options?: Configuration
127+
): Promise<ListIntegrationsResponse> {
128+
const requestContextPromise = this.requestFactory.listIntegrations(options);
129+
return requestContextPromise.then((requestContext) => {
130+
return this.configuration.httpApi
131+
.send(requestContext)
132+
.then((responseContext) => {
133+
return this.responseProcessor.listIntegrations(responseContext);
134+
});
135+
});
136+
}
137+
}

0 commit comments

Comments
 (0)