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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
187,682 changes: 99,668 additions & 88,014 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions examples/v2/experiments/ArchiveExposureSQLModel.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* Archive exposure SQL model returns "The exposure SQL model was archived. Archiving an already-archived model succeeds
* and leaves the original archive time in place." response
*/

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

const configuration = client.createConfiguration({
authMethods: {
AuthZ: {
accessToken: process.env.DD_BEARER_TOKEN as string,
},
},
});
const apiInstance = new v2.ExperimentsApi(configuration);

const params: v2.ExperimentsApiArchiveExposureSQLModelRequest = {
exposureSqlModelId: "550e8400-e29b-41d4-a716-446655440000",
};

apiInstance
.archiveExposureSQLModel(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
38 changes: 38 additions & 0 deletions examples/v2/experiments/CancelExperiment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/**
* Cancel experiment returns "The experiment was canceled and unlinked from its feature flag allocations." response
*/

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

const configuration = client.createConfiguration({
authMethods: {
AuthZ: {
accessToken: process.env.DD_BEARER_TOKEN as string,
},
},
});
const apiInstance = new v2.ExperimentsApi(configuration);

// there is a valid "experiment" in the system
const EXPERIMENT_DATA_ID = process.env.EXPERIMENT_DATA_ID as string;

const params: v2.ExperimentsApiCancelExperimentRequest = {
body: {
data: {
type: "cancel-experiment-request",
attributes: {
reason: "Cancel the test experiment",
},
},
},
experimentId: EXPERIMENT_DATA_ID,
};

apiInstance
.cancelExperiment(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
36 changes: 36 additions & 0 deletions examples/v2/experiments/ConcludeExperiment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* Conclude experiment returns "The experiment was concluded and the winning variant was rolled out to its linked feature
* flag allocation." response
*/

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

const configuration = client.createConfiguration({
authMethods: {
AuthZ: {
accessToken: process.env.DD_BEARER_TOKEN as string,
},
},
});
const apiInstance = new v2.ExperimentsApi(configuration);

const params: v2.ExperimentsApiConcludeExperimentRequest = {
body: {
data: {
attributes: {
decisionVariantKey: "treatment",
},
type: "conclude-experiment-request",
},
},
experimentId: "550e8400-e29b-41d4-a716-446655440000",
};

apiInstance
.concludeExperiment(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
34 changes: 34 additions & 0 deletions examples/v2/experiments/CreateExperiment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* Create experiment returns "Created" response
*/

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

const configuration = client.createConfiguration({
authMethods: {
AuthZ: {
accessToken: process.env.DD_BEARER_TOKEN as string,
},
},
});
const apiInstance = new v2.ExperimentsApi(configuration);

const params: v2.ExperimentsApiCreateExperimentRequest = {
body: {
data: {
type: "experiments",
attributes: {
name: "ex-14bb9543f523edde",
},
},
},
};

apiInstance
.createExperiment(params)
.then((data: v2.ExperimentsExperimentV2DTO) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
47 changes: 47 additions & 0 deletions examples/v2/experiments/CreateExperimentMetricGroup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* Create experiment metric group returns "Created" response
*/

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

const configuration = client.createConfiguration({
authMethods: {
AuthZ: {
accessToken: process.env.DD_BEARER_TOKEN as string,
},
},
});
const apiInstance = new v2.ExperimentsApi(configuration);

// there is a valid "experiment" in the system
const EXPERIMENT_DATA_ID = process.env.EXPERIMENT_DATA_ID as string;

// there is a valid "experiment_metric" in the system
const EXPERIMENT_METRIC_DATA_ID = process.env
.EXPERIMENT_METRIC_DATA_ID as string;

const params: v2.ExperimentsApiCreateExperimentMetricGroupRequest = {
body: {
data: {
type: "experiment-metric-groups",
attributes: {
name: "ex-14bb9543f523edde",
metrics: [
{
metricId: EXPERIMENT_METRIC_DATA_ID,
},
],
},
},
},
experimentId: EXPERIMENT_DATA_ID,
};

apiInstance
.createExperimentMetricGroup(params)
.then((data: v2.ExperimentsExperimentMetricGroupMutationV2) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* Create experiment metric group from collection returns "Created" response
*/

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

const configuration = client.createConfiguration({
authMethods: {
AuthZ: {
accessToken: process.env.DD_BEARER_TOKEN as string,
},
},
});
const apiInstance = new v2.ExperimentsApi(configuration);

// there is a valid "experiment" in the system
const EXPERIMENT_DATA_ID = process.env.EXPERIMENT_DATA_ID as string;

// there is a valid "experiment_metric_collection_with_metric" in the system
const EXPERIMENT_METRIC_COLLECTION_WITH_METRIC_DATA_ID = process.env
.EXPERIMENT_METRIC_COLLECTION_WITH_METRIC_DATA_ID as string;

const params: v2.ExperimentsApiCreateExperimentMetricGroupFromCollectionRequest =
{
experimentId: EXPERIMENT_DATA_ID,
metricCollectionId: EXPERIMENT_METRIC_COLLECTION_WITH_METRIC_DATA_ID,
};

apiInstance
.createExperimentMetricGroupFromCollection(params)
.then((data: v2.ExperimentsExperimentMetricGroupMutationV2) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
53 changes: 53 additions & 0 deletions examples/v2/experiments/CreateExposureSQLModel.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/**
* Create exposure SQL model returns "Created" response
*/

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

const configuration = client.createConfiguration({
authMethods: {
AuthZ: {
accessToken: process.env.DD_BEARER_TOKEN as string,
},
},
});
const apiInstance = new v2.ExperimentsApi(configuration);

const params: v2.ExperimentsApiCreateExposureSQLModelRequest = {
body: {
data: {
attributes: {
datePartitionColumn: undefined,
experimentColumn: "experiment_id",
name: "Exposure events",
properties: [
{
columnName: "country",
columnType: "STRING",
description: undefined,
name: "country",
},
],
sql: "SELECT user_id, experiment_id, variant, exposed_at, country FROM analytics.exposures",
subjectTypes: [
{
columnName: "user_id",
subjectTypeId: "550e8400-e29b-41d4-a716-446655440010",
},
],
timestampColumn: "exposed_at",
variantColumn: "variant",
},
type: "exposure-sql-models",
},
},
};

apiInstance
.createExposureSQLModel(params)
.then((data: v2.ExperimentsExposureSQLModelV2DTO) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
46 changes: 46 additions & 0 deletions examples/v2/experiments/CreateMetric.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* Create metric returns "Created" response
*/

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

const configuration = client.createConfiguration({
authMethods: {
AuthZ: {
accessToken: process.env.DD_BEARER_TOKEN as string,
},
},
});
const apiInstance = new v2.ExperimentsApi(configuration);

const params: v2.ExperimentsApiCreateMetricRequest = {
body: {
data: {
type: "metrics",
attributes: {
name: "ex-14bb9543f523edde",
dataSourceType: "DATADOG",
desiredChange: "METRIC_INCREASES",
numeratorAggregation: {
operation: "sum",
datadogMetricMeasure: {
name: "ex-14bb9543f523edde view duration",
sourceType: "PRODUCT_ANALYTICS",
sourceSubtype: "RUM_VIEWS",
columnType: "double",
columnName: "@view.time_spent",
},
},
},
},
},
};

apiInstance
.createMetric(params)
.then((data: v2.ExperimentsMetricV2DTO) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
34 changes: 34 additions & 0 deletions examples/v2/experiments/CreateMetricCollection.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* Create metric collection returns "Created" response
*/

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

const configuration = client.createConfiguration({
authMethods: {
AuthZ: {
accessToken: process.env.DD_BEARER_TOKEN as string,
},
},
});
const apiInstance = new v2.ExperimentsApi(configuration);

const params: v2.ExperimentsApiCreateMetricCollectionRequest = {
body: {
data: {
type: "metric-collections",
attributes: {
name: "ex-14bb9543f523edde",
},
},
},
};

apiInstance
.createMetricCollection(params)
.then((data: v2.ExperimentsMetricCollectionV2DTO) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Loading
Loading