Skip to content

Commit 5b3d5df

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Sync 'audience_management.yaml' files with backend (#2962)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent afc61f7 commit 5b3d5df

File tree

71 files changed

+5898
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+5898
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 1065 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/**
2+
* Create connection returns "Connection created successfully" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.createConnection"] = true;
9+
const apiInstance = new v2.RumAudienceManagementApi(configuration);
10+
11+
const params: v2.RumAudienceManagementApiCreateConnectionRequest = {
12+
body: {
13+
data: {
14+
attributes: {
15+
fields: [
16+
{
17+
description: `Customer subscription tier from ` + "`" + `CRM` + "`",
18+
displayName: "Customer Tier",
19+
id: "customer_tier",
20+
sourceName: "subscription_tier",
21+
type: "string",
22+
},
23+
{
24+
description: `Customer lifetime value in ` + "`" + `USD` + "`",
25+
displayName: "Lifetime Value",
26+
id: "lifetime_value",
27+
sourceName: "ltv",
28+
type: "number",
29+
},
30+
],
31+
joinAttribute: "user_email",
32+
joinType: "email",
33+
type: "ref_table",
34+
},
35+
id: "crm-integration",
36+
type: "connection_id",
37+
},
38+
},
39+
entity: "users",
40+
};
41+
42+
apiInstance
43+
.createConnection(params)
44+
.then((data: any) => {
45+
console.log(
46+
"API called successfully. Returned data: " + JSON.stringify(data)
47+
);
48+
})
49+
.catch((error: any) => console.error(error));
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* Delete connection returns "Connection deleted successfully" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.deleteConnection"] = true;
9+
const apiInstance = new v2.RumAudienceManagementApi(configuration);
10+
11+
const params: v2.RumAudienceManagementApiDeleteConnectionRequest = {
12+
id: "connection-id-123",
13+
entity: "users",
14+
};
15+
16+
apiInstance
17+
.deleteConnection(params)
18+
.then((data: any) => {
19+
console.log(
20+
"API called successfully. Returned data: " + JSON.stringify(data)
21+
);
22+
})
23+
.catch((error: any) => console.error(error));
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
* Get account facet info returns "Successful response with facet information" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.getAccountFacetInfo"] = true;
9+
const apiInstance = new v2.RumAudienceManagementApi(configuration);
10+
11+
const params: v2.RumAudienceManagementApiGetAccountFacetInfoRequest = {
12+
body: {
13+
data: {
14+
attributes: {
15+
facetId: "first_browser_name",
16+
limit: 10,
17+
search: {
18+
query: "user_org_id:5001 AND first_country_code:US",
19+
},
20+
termSearch: {
21+
value: "Chrome",
22+
},
23+
},
24+
id: "facet_info_request",
25+
type: "users_facet_info_request",
26+
},
27+
},
28+
};
29+
30+
apiInstance
31+
.getAccountFacetInfo(params)
32+
.then((data: v2.FacetInfoResponse) => {
33+
console.log(
34+
"API called successfully. Returned data: " + JSON.stringify(data)
35+
);
36+
})
37+
.catch((error: any) => console.error(error));
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Get mapping returns "Successful response with entity mapping configuration" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.getMapping"] = true;
9+
const apiInstance = new v2.RumAudienceManagementApi(configuration);
10+
11+
const params: v2.RumAudienceManagementApiGetMappingRequest = {
12+
entity: "users",
13+
};
14+
15+
apiInstance
16+
.getMapping(params)
17+
.then((data: v2.GetMappingResponse) => {
18+
console.log(
19+
"API called successfully. Returned data: " + JSON.stringify(data)
20+
);
21+
})
22+
.catch((error: any) => console.error(error));
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
* Get user facet info returns "Successful response with facet information" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.getUserFacetInfo"] = true;
9+
const apiInstance = new v2.RumAudienceManagementApi(configuration);
10+
11+
const params: v2.RumAudienceManagementApiGetUserFacetInfoRequest = {
12+
body: {
13+
data: {
14+
attributes: {
15+
facetId: "first_browser_name",
16+
limit: 10,
17+
search: {
18+
query: "user_org_id:5001 AND first_country_code:US",
19+
},
20+
termSearch: {
21+
value: "Chrome",
22+
},
23+
},
24+
id: "facet_info_request",
25+
type: "users_facet_info_request",
26+
},
27+
},
28+
};
29+
30+
apiInstance
31+
.getUserFacetInfo(params)
32+
.then((data: v2.FacetInfoResponse) => {
33+
console.log(
34+
"API called successfully. Returned data: " + JSON.stringify(data)
35+
);
36+
})
37+
.catch((error: any) => console.error(error));
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* List connections returns "Successful response with list of connections" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.listConnections"] = true;
9+
const apiInstance = new v2.RumAudienceManagementApi(configuration);
10+
11+
const params: v2.RumAudienceManagementApiListConnectionsRequest = {
12+
entity: "users",
13+
};
14+
15+
apiInstance
16+
.listConnections(params)
17+
.then((data: v2.ListConnectionsResponse) => {
18+
console.log(
19+
"API called successfully. Returned data: " + JSON.stringify(data)
20+
);
21+
})
22+
.catch((error: any) => console.error(error));
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/**
2+
* Query accounts returns "Successful response with account data" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.queryAccounts"] = true;
9+
const apiInstance = new v2.RumAudienceManagementApi(configuration);
10+
11+
const params: v2.RumAudienceManagementApiQueryAccountsRequest = {
12+
body: {
13+
data: {
14+
attributes: {
15+
limit: 20,
16+
query:
17+
"plan_type:enterprise AND user_count:>100 AND subscription_status:active",
18+
selectColumns: [
19+
"account_id",
20+
"account_name",
21+
"user_count",
22+
"plan_type",
23+
"subscription_status",
24+
"created_at",
25+
"mrr",
26+
"industry",
27+
],
28+
sort: {
29+
field: "user_count",
30+
order: "DESC",
31+
},
32+
wildcardSearchTerm: "tech",
33+
},
34+
id: "query_account_request",
35+
type: "query_account_request",
36+
},
37+
},
38+
};
39+
40+
apiInstance
41+
.queryAccounts(params)
42+
.then((data: v2.QueryResponse) => {
43+
console.log(
44+
"API called successfully. Returned data: " + JSON.stringify(data)
45+
);
46+
})
47+
.catch((error: any) => console.error(error));
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/**
2+
* Query event filtered users returns "Successful response with filtered user data" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.queryEventFilteredUsers"] = true;
9+
const apiInstance = new v2.RumAudienceManagementApi(configuration);
10+
11+
const params: v2.RumAudienceManagementApiQueryEventFilteredUsersRequest = {
12+
body: {
13+
data: {
14+
attributes: {
15+
eventQuery: {
16+
query:
17+
"@type:view AND @view.loading_time:>3000 AND @application.name:ecommerce-platform",
18+
timeFrame: {
19+
end: 1761309676,
20+
start: 1760100076,
21+
},
22+
},
23+
includeRowCount: true,
24+
limit: 25,
25+
query:
26+
"user_org_id:5001 AND first_country_code:US AND first_browser_name:Chrome",
27+
selectColumns: [
28+
"user_id",
29+
"user_email",
30+
"first_country_code",
31+
"first_browser_name",
32+
"events_count",
33+
"session_count",
34+
"error_count",
35+
"avg_loading_time",
36+
],
37+
},
38+
id: "query_event_filtered_users_request",
39+
type: "query_event_filtered_users_request",
40+
},
41+
},
42+
};
43+
44+
apiInstance
45+
.queryEventFilteredUsers(params)
46+
.then((data: v2.QueryResponse) => {
47+
console.log(
48+
"API called successfully. Returned data: " + JSON.stringify(data)
49+
);
50+
})
51+
.catch((error: any) => console.error(error));
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/**
2+
* Query users returns "Successful response with user data" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
configuration.unstableOperations["v2.queryUsers"] = true;
9+
const apiInstance = new v2.RumAudienceManagementApi(configuration);
10+
11+
const params: v2.RumAudienceManagementApiQueryUsersRequest = {
12+
body: {
13+
data: {
14+
attributes: {
15+
limit: 25,
16+
query:
17+
"user_email:*@techcorp.com AND first_country_code:US AND first_browser_name:Chrome",
18+
selectColumns: [
19+
"user_id",
20+
"user_email",
21+
"user_name",
22+
"user_org_id",
23+
"first_country_code",
24+
"first_browser_name",
25+
"first_device_type",
26+
"last_seen",
27+
],
28+
sort: {
29+
field: "first_seen",
30+
order: "DESC",
31+
},
32+
wildcardSearchTerm: "john",
33+
},
34+
id: "query_users_request",
35+
type: "query_users_request",
36+
},
37+
},
38+
};
39+
40+
apiInstance
41+
.queryUsers(params)
42+
.then((data: v2.QueryResponse) => {
43+
console.log(
44+
"API called successfully. Returned data: " + JSON.stringify(data)
45+
);
46+
})
47+
.catch((error: any) => console.error(error));

0 commit comments

Comments
 (0)