Skip to content

Commit 2d0a27a

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit ba2015c of spec repo
1 parent fd9e312 commit 2d0a27a

File tree

114 files changed

+15374
-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.

114 files changed

+15374
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 1394 additions & 0 deletions
Large diffs are not rendered by default.

examples/v2_cohort_GetRumCohort.rs

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// Get rum cohort returns "Successful response with cohort analysis data" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_cohort::CohortAPI;
4+
use datadog_api_client::datadogV2::model::GetCohortRequest;
5+
use datadog_api_client::datadogV2::model::GetCohortRequestData;
6+
use datadog_api_client::datadogV2::model::GetCohortRequestDataAttributes;
7+
use datadog_api_client::datadogV2::model::GetCohortRequestDataAttributesDefinition;
8+
use datadog_api_client::datadogV2::model::GetCohortRequestDataAttributesDefinitionAudienceFilters;
9+
use datadog_api_client::datadogV2::model::GetCohortRequestDataAttributesDefinitionAudienceFiltersAccountsItems;
10+
use datadog_api_client::datadogV2::model::GetCohortRequestDataAttributesDefinitionAudienceFiltersSegmentsItems;
11+
use datadog_api_client::datadogV2::model::GetCohortRequestDataAttributesDefinitionAudienceFiltersUsersItems;
12+
use datadog_api_client::datadogV2::model::GetCohortRequestDataAttributesTime;
13+
use datadog_api_client::datadogV2::model::GetCohortRequestDataType;
14+
15+
#[tokio::main]
16+
async fn main() {
17+
let body =
18+
GetCohortRequest
19+
::new().data(
20+
GetCohortRequestData::new(
21+
GetCohortRequestDataType::COHORT_REQUEST,
22+
).attributes(
23+
GetCohortRequestDataAttributes::new()
24+
.definition(
25+
GetCohortRequestDataAttributesDefinition
26+
::new().audience_filters(
27+
GetCohortRequestDataAttributesDefinitionAudienceFilters::new()
28+
.accounts(
29+
vec![
30+
GetCohortRequestDataAttributesDefinitionAudienceFiltersAccountsItems::new(
31+
"".to_string(),
32+
)
33+
],
34+
)
35+
.segments(
36+
vec![
37+
GetCohortRequestDataAttributesDefinitionAudienceFiltersSegmentsItems::new(
38+
"".to_string(),
39+
"".to_string(),
40+
)
41+
],
42+
)
43+
.users(
44+
vec![
45+
GetCohortRequestDataAttributesDefinitionAudienceFiltersUsersItems::new(
46+
"".to_string(),
47+
)
48+
],
49+
),
50+
),
51+
)
52+
.time(GetCohortRequestDataAttributesTime::new()),
53+
),
54+
);
55+
let mut configuration = datadog::Configuration::new();
56+
configuration.set_unstable_operation_enabled("v2.GetRumCohort", true);
57+
let api = CohortAPI::with_config(configuration);
58+
let resp = api.get_rum_cohort(body).await;
59+
if let Ok(value) = resp {
60+
println!("{:#?}", value);
61+
} else {
62+
println!("{:#?}", resp.unwrap_err());
63+
}
64+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// Get rum cohort users returns "Successful response with cohort users" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_cohort::CohortAPI;
4+
use datadog_api_client::datadogV2::model::GetCohortUsersRequest;
5+
use datadog_api_client::datadogV2::model::GetCohortUsersRequestData;
6+
use datadog_api_client::datadogV2::model::GetCohortUsersRequestDataAttributes;
7+
use datadog_api_client::datadogV2::model::GetCohortUsersRequestDataAttributesDefinition;
8+
use datadog_api_client::datadogV2::model::GetCohortUsersRequestDataAttributesDefinitionAudienceFilters;
9+
use datadog_api_client::datadogV2::model::GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersAccountsItems;
10+
use datadog_api_client::datadogV2::model::GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersSegmentsItems;
11+
use datadog_api_client::datadogV2::model::GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersUsersItems;
12+
use datadog_api_client::datadogV2::model::GetCohortUsersRequestDataAttributesTime;
13+
use datadog_api_client::datadogV2::model::GetCohortUsersRequestDataType;
14+
15+
#[tokio::main]
16+
async fn main() {
17+
let body =
18+
GetCohortUsersRequest
19+
::new().data(
20+
GetCohortUsersRequestData::new(
21+
GetCohortUsersRequestDataType::COHORT_USERS_REQUEST,
22+
).attributes(
23+
GetCohortUsersRequestDataAttributes::new()
24+
.definition(
25+
GetCohortUsersRequestDataAttributesDefinition
26+
::new().audience_filters(
27+
GetCohortUsersRequestDataAttributesDefinitionAudienceFilters::new()
28+
.accounts(
29+
vec![
30+
GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersAccountsItems::new(
31+
"".to_string(),
32+
)
33+
],
34+
)
35+
.segments(
36+
vec![
37+
GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersSegmentsItems::new(
38+
"".to_string(),
39+
"".to_string(),
40+
)
41+
],
42+
)
43+
.users(
44+
vec![
45+
GetCohortUsersRequestDataAttributesDefinitionAudienceFiltersUsersItems::new(
46+
"".to_string(),
47+
)
48+
],
49+
),
50+
),
51+
)
52+
.time(GetCohortUsersRequestDataAttributesTime::new()),
53+
),
54+
);
55+
let mut configuration = datadog::Configuration::new();
56+
configuration.set_unstable_operation_enabled("v2.GetRumCohortUsers", true);
57+
let api = CohortAPI::with_config(configuration);
58+
let resp = api.get_rum_cohort_users(body).await;
59+
if let Ok(value) = resp {
60+
println!("{:#?}", value);
61+
} else {
62+
println!("{:#?}", resp.unwrap_err());
63+
}
64+
}

examples/v2_funnel_GetRumFunnel.rs

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// Get rum funnel returns "Successful response with funnel analysis data" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_funnel::FunnelAPI;
4+
use datadog_api_client::datadogV2::model::FunnelRequest;
5+
use datadog_api_client::datadogV2::model::FunnelRequestData;
6+
use datadog_api_client::datadogV2::model::FunnelRequestDataAttributes;
7+
use datadog_api_client::datadogV2::model::FunnelRequestDataAttributesSearch;
8+
use datadog_api_client::datadogV2::model::FunnelRequestDataAttributesSearchStepsItems;
9+
use datadog_api_client::datadogV2::model::FunnelRequestDataAttributesTime;
10+
use datadog_api_client::datadogV2::model::FunnelRequestDataType;
11+
12+
#[tokio::main]
13+
async fn main() {
14+
let body = FunnelRequest::new().data(
15+
FunnelRequestData::new(FunnelRequestDataType::FUNNEL_REQUEST)
16+
.attributes(
17+
FunnelRequestDataAttributes::new()
18+
.data_source("rum".to_string())
19+
.enforced_execution_type("".to_string())
20+
.request_id("".to_string())
21+
.search(
22+
FunnelRequestDataAttributesSearch::new()
23+
.cross_session_filter("".to_string())
24+
.query_string("@type:view".to_string())
25+
.steps(vec![
26+
FunnelRequestDataAttributesSearchStepsItems::new()
27+
.facet("@view.name".to_string())
28+
.step_filter("".to_string())
29+
.value("/apm/home".to_string()),
30+
FunnelRequestDataAttributesSearchStepsItems::new()
31+
.facet("@view.name".to_string())
32+
.step_filter("".to_string())
33+
.value("/apm/traces".to_string()),
34+
])
35+
.subquery_id("".to_string()),
36+
)
37+
.time(
38+
FunnelRequestDataAttributesTime::new()
39+
.from(1756425600000)
40+
.to(1756857600000),
41+
),
42+
)
43+
.id("funnel_request".to_string()),
44+
);
45+
let mut configuration = datadog::Configuration::new();
46+
configuration.set_unstable_operation_enabled("v2.GetRumFunnel", true);
47+
let api = FunnelAPI::with_config(configuration);
48+
let resp = api.get_rum_funnel(body).await;
49+
if let Ok(value) = resp {
50+
println!("{:#?}", value);
51+
} else {
52+
println!("{:#?}", resp.unwrap_err());
53+
}
54+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// Get rum funnel step suggestions returns "Successful response with funnel step
2+
// suggestions" response
3+
use datadog_api_client::datadog;
4+
use datadog_api_client::datadogV2::api_funnel::FunnelAPI;
5+
use datadog_api_client::datadogV2::model::FunnelSuggestionRequest;
6+
use datadog_api_client::datadogV2::model::FunnelSuggestionRequestData;
7+
use datadog_api_client::datadogV2::model::FunnelSuggestionRequestDataAttributes;
8+
use datadog_api_client::datadogV2::model::FunnelSuggestionRequestDataAttributesSearch;
9+
use datadog_api_client::datadogV2::model::FunnelSuggestionRequestDataAttributesSearchStepsItems;
10+
use datadog_api_client::datadogV2::model::FunnelSuggestionRequestDataAttributesTermSearch;
11+
use datadog_api_client::datadogV2::model::FunnelSuggestionRequestDataAttributesTime;
12+
use datadog_api_client::datadogV2::model::FunnelSuggestionRequestDataType;
13+
14+
#[tokio::main]
15+
async fn main() {
16+
let body = FunnelSuggestionRequest::new().data(
17+
FunnelSuggestionRequestData::new(
18+
FunnelSuggestionRequestDataType::FUNNEL_SUGGESTION_REQUEST,
19+
)
20+
.attributes(
21+
FunnelSuggestionRequestDataAttributes::new()
22+
.data_source("".to_string())
23+
.search(
24+
FunnelSuggestionRequestDataAttributesSearch::new()
25+
.cross_session_filter("".to_string())
26+
.query_string("@type:view".to_string())
27+
.steps(vec![
28+
FunnelSuggestionRequestDataAttributesSearchStepsItems::new()
29+
.facet("@view.name".to_string())
30+
.step_filter("".to_string())
31+
.value("/apm/home".to_string()),
32+
])
33+
.subquery_id("".to_string()),
34+
)
35+
.term_search(
36+
FunnelSuggestionRequestDataAttributesTermSearch::new().query("apm".to_string()),
37+
)
38+
.time(
39+
FunnelSuggestionRequestDataAttributesTime::new()
40+
.from(1756425600000)
41+
.to(1756857600000),
42+
),
43+
)
44+
.id("funnel_suggestion_request".to_string()),
45+
);
46+
let mut configuration = datadog::Configuration::new();
47+
configuration.set_unstable_operation_enabled("v2.GetRumFunnelStepSuggestions", true);
48+
let api = FunnelAPI::with_config(configuration);
49+
let resp = api.get_rum_funnel_step_suggestions(body).await;
50+
if let Ok(value) = resp {
51+
println!("{:#?}", value);
52+
} else {
53+
println!("{:#?}", resp.unwrap_err());
54+
}
55+
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
// Create rum segment returns "Segment created successfully" response
2+
use chrono::{DateTime, Utc};
3+
use datadog_api_client::datadog;
4+
use datadog_api_client::datadogV2::api_segments::SegmentsAPI;
5+
use datadog_api_client::datadogV2::model::Segment;
6+
use datadog_api_client::datadogV2::model::SegmentData;
7+
use datadog_api_client::datadogV2::model::SegmentDataAttributes;
8+
use datadog_api_client::datadogV2::model::SegmentDataAttributesDataQuery;
9+
use datadog_api_client::datadogV2::model::SegmentDataAttributesDataQueryEventPlatformItems;
10+
use datadog_api_client::datadogV2::model::SegmentDataSource;
11+
use datadog_api_client::datadogV2::model::SegmentDataType;
12+
13+
#[tokio::main]
14+
async fn main() {
15+
let body = Segment::new().data(
16+
SegmentData::new(SegmentDataType::SEGMENT)
17+
.attributes(
18+
SegmentDataAttributes::new(
19+
SegmentDataAttributesDataQuery::new().event_platform(vec![
20+
SegmentDataAttributesDataQueryEventPlatformItems::new(
21+
"@usr.id".to_string(),
22+
)
23+
.from("2025-08-01".to_string())
24+
.name("high_value_users".to_string())
25+
.query(
26+
"@type:view @view.name:/logs @usr.session_duration:>300000".to_string(),
27+
)
28+
.to("2025-09-01".to_string()),
29+
]),
30+
"High-Value Users".to_string(),
31+
)
32+
.created_at(
33+
DateTime::parse_from_rfc3339("0001-01-01T00:00:00+00:00")
34+
.expect("Failed to parse datetime")
35+
.with_timezone(&Utc),
36+
)
37+
.created_by(SegmentDataSource::new(
38+
"".to_string(),
39+
"".to_string(),
40+
"".to_string(),
41+
))
42+
.description(
43+
"Users who frequently visit logs and have high session duration".to_string(),
44+
)
45+
.modified_at(
46+
DateTime::parse_from_rfc3339("0001-01-01T00:00:00+00:00")
47+
.expect("Failed to parse datetime")
48+
.with_timezone(&Utc),
49+
)
50+
.modified_by(SegmentDataSource::new(
51+
"".to_string(),
52+
"".to_string(),
53+
"".to_string(),
54+
))
55+
.org_id(123456)
56+
.source(0)
57+
.tags(vec![
58+
"high-value".to_string(),
59+
"logs".to_string(),
60+
"active".to_string(),
61+
])
62+
.version(1),
63+
)
64+
.id("segment-12345".to_string()),
65+
);
66+
let mut configuration = datadog::Configuration::new();
67+
configuration.set_unstable_operation_enabled("v2.CreateRumSegment", true);
68+
let api = SegmentsAPI::with_config(configuration);
69+
let resp = api.create_rum_segment(body).await;
70+
if let Ok(value) = resp {
71+
println!("{:#?}", value);
72+
} else {
73+
println!("{:#?}", resp.unwrap_err());
74+
}
75+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Initialize rum segments returns "Default segments created successfully" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_segments::SegmentsAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
let mut configuration = datadog::Configuration::new();
8+
configuration.set_unstable_operation_enabled("v2.InitializeRumSegments", true);
9+
let api = SegmentsAPI::with_config(configuration);
10+
let resp = api.initialize_rum_segments().await;
11+
if let Ok(value) = resp {
12+
println!("{:#?}", value);
13+
} else {
14+
println!("{:#?}", resp.unwrap_err());
15+
}
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// List rum segments returns "Successful response with list of segments" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_segments::SegmentsAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
let mut configuration = datadog::Configuration::new();
8+
configuration.set_unstable_operation_enabled("v2.ListRumSegments", true);
9+
let api = SegmentsAPI::with_config(configuration);
10+
let resp = api.list_rum_segments().await;
11+
if let Ok(value) = resp {
12+
println!("{:#?}", value);
13+
} else {
14+
println!("{:#?}", resp.unwrap_err());
15+
}
16+
}

0 commit comments

Comments
 (0)