Skip to content

Commit d653323

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit f3368f1 of spec repo
1 parent 8d37a8b commit d653323

File tree

8 files changed

+115
-5
lines changed

8 files changed

+115
-5
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5847,7 +5847,7 @@ components:
58475847
description: Request object.
58485848
properties:
58495849
data:
5850-
$ref: '#/components/schemas/CIAppCreatePipelineEventRequestData'
5850+
$ref: '#/components/schemas/CIAppCreatePipelineEventRequestDataSingleOrArray'
58515851
type: object
58525852
CIAppCreatePipelineEventRequestAttributes:
58535853
description: Attributes of the pipeline event to create.
@@ -5883,6 +5883,16 @@ components:
58835883
type:
58845884
$ref: '#/components/schemas/CIAppCreatePipelineEventRequestDataType'
58855885
type: object
5886+
CIAppCreatePipelineEventRequestDataArray:
5887+
description: Array of pipeline events to create in batch.
5888+
items:
5889+
$ref: '#/components/schemas/CIAppCreatePipelineEventRequestData'
5890+
type: array
5891+
CIAppCreatePipelineEventRequestDataSingleOrArray:
5892+
description: Data of the pipeline events to create.
5893+
oneOf:
5894+
- $ref: '#/components/schemas/CIAppCreatePipelineEventRequestData'
5895+
- $ref: '#/components/schemas/CIAppCreatePipelineEventRequestDataArray'
58865896
CIAppCreatePipelineEventRequestDataType:
58875897
default: cipipeline_resource_request
58885898
description: Type of the event.
@@ -49695,6 +49705,9 @@ paths:
4969549705
we support, see [Pipeline Data Model And Execution Types](https://docs.datadoghq.com/continuous_integration/guides/pipeline_data_model/).
4969649706

4969749707

49708+
Multiple events can be sent in an array (up to 1000).
49709+
49710+
4969849711
Pipeline events can be submitted with a timestamp that is up to 18 hours in
4969949712
the past.'
4970049713
operationId: CreateCIAppPipelineEvent
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/**
2+
* Send several pipeline events returns "Request accepted for processing" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.CIVisibilityPipelinesApi(configuration);
9+
10+
const params: v2.CIVisibilityPipelinesApiCreateCIAppPipelineEventRequest = {
11+
body: {
12+
data: [
13+
{
14+
attributes: {
15+
providerName: "example-provider",
16+
resource: {
17+
level: "pipeline",
18+
uniqueId: "3eacb6f3-ff04-4e10-8a9c-46e6d054024a",
19+
name: "Deploy to AWS",
20+
url: "https://my-ci-provider.example/pipelines/my-pipeline/run/1",
21+
start: new Date(new Date().getTime() + -120 * 1000),
22+
end: new Date(new Date().getTime() + -30 * 1000),
23+
status: "success",
24+
partialRetry: false,
25+
git: {
26+
repositoryUrl: "https://github.com/DataDog/datadog-agent",
27+
sha: "7f263865994b76066c4612fd1965215e7dcb4cd2",
28+
authorEmail: "[email protected]",
29+
},
30+
},
31+
},
32+
type: "cipipeline_resource_request",
33+
},
34+
{
35+
attributes: {
36+
providerName: "example-provider",
37+
resource: {
38+
level: "pipeline",
39+
uniqueId: "7b2c8f9e-aa15-4d22-9c7d-83f4e065138b",
40+
name: "Deploy to Production",
41+
url: "https://my-ci-provider.example/pipelines/prod-pipeline/run/2",
42+
start: new Date(new Date().getTime() + -180 * 1000),
43+
end: new Date(new Date().getTime() + -45 * 1000),
44+
status: "success",
45+
partialRetry: false,
46+
git: {
47+
repositoryUrl: "https://github.com/DataDog/datadog-agent",
48+
sha: "9a4f7c28b3e5d12f8e6c9b2a5d8f3e1c7b4a6d9e",
49+
authorEmail: "[email protected]",
50+
},
51+
},
52+
},
53+
type: "cipipeline_resource_request",
54+
},
55+
],
56+
},
57+
};
58+
59+
apiInstance
60+
.createCIAppPipelineEvent(params)
61+
.then((data: any) => {
62+
console.log(
63+
"API called successfully. Returned data: " + JSON.stringify(data)
64+
);
65+
})
66+
.catch((error: any) => console.error(error));

features/v2/ci_visibility_pipelines.feature

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,10 @@ Feature: CI Visibility Pipelines
128128
And body with value {"data": {"attributes": {"resource": {"level": "pipeline","unique_id": "3eacb6f3-ff04-4e10-8a9c-46e6d054024a","name": "Deploy to AWS","url": "https://my-ci-provider.example/pipelines/my-pipeline/run/1","start": "{{ timeISO('now - 120s') }}","status": "running","partial_retry": false,"git": {"repository_url": "https://github.com/DataDog/datadog-agent","sha": "7f263865994b76066c4612fd1965215e7dcb4cd2","author_email": "[email protected]"}}},"type": "cipipeline_resource_request"}}
129129
When the request is sent
130130
Then the response status is 202 Request accepted for processing
131+
132+
@team:DataDog/ci-app-backend
133+
Scenario: Send several pipeline events returns "Request accepted for processing" response
134+
Given new "CreateCIAppPipelineEvent" request
135+
And body with value {"data": [{"attributes": {"provider_name": "example-provider", "resource": {"level": "pipeline","unique_id": "3eacb6f3-ff04-4e10-8a9c-46e6d054024a","name": "Deploy to AWS","url": "https://my-ci-provider.example/pipelines/my-pipeline/run/1","start": "{{ timeISO('now - 120s') }}","end": "{{ timeISO('now - 30s') }}","status": "success","partial_retry": false,"git": {"repository_url": "https://github.com/DataDog/datadog-agent","sha": "7f263865994b76066c4612fd1965215e7dcb4cd2","author_email": "[email protected]"}}},"type": "cipipeline_resource_request"},{"attributes": {"provider_name": "example-provider", "resource": {"level": "pipeline","unique_id": "7b2c8f9e-aa15-4d22-9c7d-83f4e065138b","name": "Deploy to Production","url": "https://my-ci-provider.example/pipelines/prod-pipeline/run/2","start": "{{ timeISO('now - 180s') }}","end": "{{ timeISO('now - 45s') }}","status": "success","partial_retry": false,"git": {"repository_url": "https://github.com/DataDog/datadog-agent","sha": "9a4f7c28b3e5d12f8e6c9b2a5d8f3e1c7b4a6d9e","author_email": "[email protected]"}}},"type": "cipipeline_resource_request"}]}
136+
When the request is sent
137+
Then the response status is 202 Request accepted for processing

packages/datadog-api-client-v2/apis/CIVisibilityPipelinesApi.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,8 @@ export class CIVisibilityPipelinesApi {
574574
/**
575575
* Send your pipeline event to your Datadog platform over HTTP. For details about how pipeline executions are modeled and what execution types we support, see [Pipeline Data Model And Execution Types](https://docs.datadoghq.com/continuous_integration/guides/pipeline_data_model/).
576576
*
577+
* Multiple events can be sent in an array (up to 1000).
578+
*
577579
* Pipeline events can be submitted with a timestamp that is up to 18 hours in the past.
578580
* @param param The request object
579581
*/

packages/datadog-api-client-v2/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,6 +1155,7 @@ export { CIAppCreatePipelineEventRequest } from "./models/CIAppCreatePipelineEve
11551155
export { CIAppCreatePipelineEventRequestAttributes } from "./models/CIAppCreatePipelineEventRequestAttributes";
11561156
export { CIAppCreatePipelineEventRequestAttributesResource } from "./models/CIAppCreatePipelineEventRequestAttributesResource";
11571157
export { CIAppCreatePipelineEventRequestData } from "./models/CIAppCreatePipelineEventRequestData";
1158+
export { CIAppCreatePipelineEventRequestDataSingleOrArray } from "./models/CIAppCreatePipelineEventRequestDataSingleOrArray";
11581159
export { CIAppCreatePipelineEventRequestDataType } from "./models/CIAppCreatePipelineEventRequestDataType";
11591160
export { CIAppEventAttributes } from "./models/CIAppEventAttributes";
11601161
export { CIAppGitInfo } from "./models/CIAppGitInfo";

packages/datadog-api-client-v2/models/CIAppCreatePipelineEventRequest.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* This product includes software developed at Datadog (https://www.datadoghq.com/).
44
* Copyright 2020-Present Datadog, Inc.
55
*/
6-
import { CIAppCreatePipelineEventRequestData } from "./CIAppCreatePipelineEventRequestData";
6+
import { CIAppCreatePipelineEventRequestDataSingleOrArray } from "./CIAppCreatePipelineEventRequestDataSingleOrArray";
77

88
import { AttributeTypeMap } from "../../datadog-api-client-common/util";
99

@@ -12,9 +12,9 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util";
1212
*/
1313
export class CIAppCreatePipelineEventRequest {
1414
/**
15-
* Data of the pipeline event to create.
15+
* Data of the pipeline events to create.
1616
*/
17-
"data"?: CIAppCreatePipelineEventRequestData;
17+
"data"?: CIAppCreatePipelineEventRequestDataSingleOrArray;
1818

1919
/**
2020
* A container for additional, undeclared properties.
@@ -34,7 +34,7 @@ export class CIAppCreatePipelineEventRequest {
3434
static readonly attributeTypeMap: AttributeTypeMap = {
3535
data: {
3636
baseName: "data",
37-
type: "CIAppCreatePipelineEventRequestData",
37+
type: "CIAppCreatePipelineEventRequestDataSingleOrArray",
3838
},
3939
additionalProperties: {
4040
baseName: "additionalProperties",
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
3+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
* Copyright 2020-Present Datadog, Inc.
5+
*/
6+
import { CIAppCreatePipelineEventRequestData } from "./CIAppCreatePipelineEventRequestData";
7+
8+
import { UnparsedObject } from "../../datadog-api-client-common/util";
9+
10+
/**
11+
* Data of the pipeline events to create.
12+
*/
13+
14+
export type CIAppCreatePipelineEventRequestDataSingleOrArray =
15+
| CIAppCreatePipelineEventRequestData
16+
| Array<CIAppCreatePipelineEventRequestData>
17+
| UnparsedObject;

packages/datadog-api-client-v2/models/ObjectSerializer.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6234,6 +6234,10 @@ const oneOfMap: { [index: string]: string[] } = {
62346234
"CIAppPipelineEventJob",
62356235
"CIAppPipelineEventStep",
62366236
],
6237+
CIAppCreatePipelineEventRequestDataSingleOrArray: [
6238+
"CIAppCreatePipelineEventRequestData",
6239+
"Array<CIAppCreatePipelineEventRequestData>",
6240+
],
62376241
CIAppGroupByMissing: ["string", "number"],
62386242
CIAppGroupByTotal: ["boolean", "string", "number"],
62396243
CIAppPipelineEventPipeline: [

0 commit comments

Comments
 (0)