Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
901 changes: 901 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions examples/v2/change-management/CreateChangeRequest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* Create a change request returns "Created" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.createChangeRequest"] = true;
const apiInstance = new v2.ChangeManagementApi(configuration);

const params: v2.ChangeManagementApiCreateChangeRequestRequest = {
body: {
data: {
attributes: {
changeRequestLinkedIncidentUuid: "00000000-0000-0000-0000-000000000000",
changeRequestMaintenanceWindowQuery: "",
changeRequestPlan:
"1. Deploy to staging 2. Run tests 3. Deploy to production",
changeRequestRisk: "LOW",
changeRequestType: "NORMAL",
description: "Deploying new payment service v2.1",
endDate: new Date(2024, 1, 2, 15, 0, 0, 0),
projectId: "d4bbe1af-f36e-42f1-87c1-493ca35c320e",
requestedTeams: ["team-handle-1"],
startDate: new Date(2024, 1, 1, 3, 0, 0, 0),
title: "Deploy new payment service",
},
type: "change_request",
},
},
};

apiInstance
.createChangeRequest(params)
.then((data: v2.ChangeRequestResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
31 changes: 31 additions & 0 deletions examples/v2/change-management/CreateChangeRequestBranch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* Create a change request branch returns "OK" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.createChangeRequestBranch"] = true;
const apiInstance = new v2.ChangeManagementApi(configuration);

const params: v2.ChangeManagementApiCreateChangeRequestBranchRequest = {
body: {
data: {
attributes: {
branchName: "chm/CHM-1234",
repoId: "DataDog/dd-source",
},
type: "change_request_branch",
},
},
changeRequestId: "change_request_id",
};

apiInstance
.createChangeRequestBranch(params)
.then((data: v2.ChangeRequestResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
23 changes: 23 additions & 0 deletions examples/v2/change-management/DeleteChangeRequestDecision.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* Delete a change request decision returns "OK" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.deleteChangeRequestDecision"] = true;
const apiInstance = new v2.ChangeManagementApi(configuration);

const params: v2.ChangeManagementApiDeleteChangeRequestDecisionRequest = {
changeRequestId: "change_request_id",
decisionId: "decision_id",
};

apiInstance
.deleteChangeRequestDecision(params)
.then((data: v2.ChangeRequestResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
22 changes: 22 additions & 0 deletions examples/v2/change-management/GetChangeRequest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Get a change request returns "OK" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.getChangeRequest"] = true;
const apiInstance = new v2.ChangeManagementApi(configuration);

const params: v2.ChangeManagementApiGetChangeRequestRequest = {
changeRequestId: "change_request_id",
};

apiInstance
.getChangeRequest(params)
.then((data: v2.ChangeRequestResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
63 changes: 63 additions & 0 deletions examples/v2/change-management/UpdateChangeRequest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/**
* Update a change request returns "OK" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.updateChangeRequest"] = true;
const apiInstance = new v2.ChangeManagementApi(configuration);

const params: v2.ChangeManagementApiUpdateChangeRequestRequest = {
body: {
data: {
attributes: {
changeRequestPlan: "Updated deployment plan",
changeRequestRisk: "LOW",
changeRequestType: "NORMAL",
endDate: new Date(2024, 1, 2, 15, 0, 0, 0),
id: "CHM-1234",
startDate: new Date(2024, 1, 1, 3, 0, 0, 0),
},
relationships: {
changeRequestDecisions: {
data: [
{
id: "decision-id-0",
type: "change_request_decision",
},
],
},
},
type: "change_request",
},
included: [
{
attributes: {
changeRequestStatus: "REQUESTED",
requestReason: "Please review and approve this change",
},
id: "decision-id-0",
relationships: {
requestedUser: {
data: {
id: "00000000-0000-0000-0000-000000000000",
type: "user",
},
},
},
type: "change_request_decision",
},
],
},
changeRequestId: "change_request_id",
};

apiInstance
.updateChangeRequest(params)
.then((data: v2.ChangeRequestResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
59 changes: 59 additions & 0 deletions examples/v2/change-management/UpdateChangeRequestDecision.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/**
* Update a change request decision returns "OK" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.updateChangeRequestDecision"] = true;
const apiInstance = new v2.ChangeManagementApi(configuration);

const params: v2.ChangeManagementApiUpdateChangeRequestDecisionRequest = {
body: {
data: {
attributes: {
id: "CHM-1234",
},
relationships: {
changeRequestDecisions: {
data: [
{
id: "decision-id-0",
type: "change_request_decision",
},
],
},
},
type: "change_request",
},
included: [
{
attributes: {
changeRequestStatus: "REQUESTED",
requestReason: "Please review and approve this change",
},
id: "decision-id-0",
relationships: {
requestedUser: {
data: {
id: "00000000-0000-0000-0000-000000000000",
type: "user",
},
},
},
type: "change_request_decision",
},
],
},
changeRequestId: "change_request_id",
decisionId: "decision_id",
};

apiInstance
.updateChangeRequestDecision(params)
.then((data: v2.ChangeRequestResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
62 changes: 62 additions & 0 deletions features/support/scenarios_model_mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3805,6 +3805,68 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
},
"operationResponseType": "ListRelationCatalogResponse",
},
"v2.CreateChangeRequest": {
"body": {
"type": "ChangeRequestCreateRequest",
"format": "",
},
"operationResponseType": "ChangeRequestResponse",
},
"v2.GetChangeRequest": {
"changeRequestId": {
"type": "string",
"format": "",
},
"operationResponseType": "ChangeRequestResponse",
},
"v2.UpdateChangeRequest": {
"changeRequestId": {
"type": "string",
"format": "",
},
"body": {
"type": "ChangeRequestUpdateRequest",
"format": "",
},
"operationResponseType": "ChangeRequestResponse",
},
"v2.CreateChangeRequestBranch": {
"changeRequestId": {
"type": "string",
"format": "",
},
"body": {
"type": "ChangeRequestBranchCreateRequest",
"format": "",
},
"operationResponseType": "ChangeRequestResponse",
},
"v2.DeleteChangeRequestDecision": {
"changeRequestId": {
"type": "string",
"format": "",
},
"decisionId": {
"type": "string",
"format": "",
},
"operationResponseType": "ChangeRequestResponse",
},
"v2.UpdateChangeRequestDecision": {
"changeRequestId": {
"type": "string",
"format": "",
},
"decisionId": {
"type": "string",
"format": "",
},
"body": {
"type": "ChangeRequestDecisionUpdateRequest",
"format": "",
},
"operationResponseType": "ChangeRequestResponse",
},
"v2.CreateCIAppPipelineEvent": {
"body": {
"type": "CIAppCreatePipelineEventRequest",
Expand Down
Loading