Skip to content

Commit 3bb93bc

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 740eb90 of spec repo
1 parent aed347f commit 3bb93bc

26 files changed

Lines changed: 3518 additions & 18 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 534 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Approve a flag suggestion returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_feature_flags::FeatureFlagsAPI;
4+
use datadog_api_client::datadogV2::model::FlagSuggestionEventDataType;
5+
use datadog_api_client::datadogV2::model::ReviewFlagSuggestionAttributes;
6+
use datadog_api_client::datadogV2::model::ReviewFlagSuggestionData;
7+
use datadog_api_client::datadogV2::model::ReviewFlagSuggestionRequest;
8+
use uuid::Uuid;
9+
10+
#[tokio::main]
11+
async fn main() {
12+
let body = ReviewFlagSuggestionRequest::new(
13+
ReviewFlagSuggestionData::new(FlagSuggestionEventDataType::FLAG_SUGGESTION_EVENTS)
14+
.attributes(
15+
ReviewFlagSuggestionAttributes::new().comment("Looks good, approved!".to_string()),
16+
),
17+
);
18+
let configuration = datadog::Configuration::new();
19+
let api = FeatureFlagsAPI::with_config(configuration);
20+
let resp = api
21+
.approve_flag_suggestion(
22+
Uuid::parse_str("550e8400-e29b-41d4-a716-446655440020").expect("invalid UUID"),
23+
body,
24+
)
25+
.await;
26+
if let Ok(value) = resp {
27+
println!("{:#?}", value);
28+
} else {
29+
println!("{:#?}", resp.unwrap_err());
30+
}
31+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Create a flag suggestion returns "Created" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_feature_flags::FeatureFlagsAPI;
4+
use datadog_api_client::datadogV2::model::CreateFlagSuggestionAttributes;
5+
use datadog_api_client::datadogV2::model::CreateFlagSuggestionData;
6+
use datadog_api_client::datadogV2::model::CreateFlagSuggestionRequest;
7+
use datadog_api_client::datadogV2::model::FlagSuggestionAction;
8+
use datadog_api_client::datadogV2::model::FlagSuggestionDataType;
9+
use datadog_api_client::datadogV2::model::FlagSuggestionProperty;
10+
use datadog_api_client::datadogV2::model::SuggestionMetadata;
11+
use uuid::Uuid;
12+
13+
#[tokio::main]
14+
async fn main() {
15+
let body = CreateFlagSuggestionRequest::new(CreateFlagSuggestionData::new(
16+
CreateFlagSuggestionAttributes::new(
17+
FlagSuggestionAction::ARCHIVED,
18+
vec!["user@example.com".to_string()],
19+
FlagSuggestionProperty::FLAG,
20+
)
21+
.comment("Archive this deprecated flag".to_string())
22+
.environment_id(
23+
Uuid::parse_str("550e8400-e29b-41d4-a716-446655440001").expect("invalid UUID"),
24+
)
25+
.suggestion("ENABLED".to_string())
26+
.suggestion_metadata(
27+
SuggestionMetadata::new()
28+
.variant_id("550e8400-e29b-41d4-a716-446655440005".to_string()),
29+
),
30+
FlagSuggestionDataType::FLAG_SUGGESTIONS,
31+
));
32+
let configuration = datadog::Configuration::new();
33+
let api = FeatureFlagsAPI::with_config(configuration);
34+
let resp = api
35+
.create_flag_suggestion(
36+
Uuid::parse_str("550e8400-e29b-41d4-a716-446655440000").expect("invalid UUID"),
37+
body,
38+
)
39+
.await;
40+
if let Ok(value) = resp {
41+
println!("{:#?}", value);
42+
} else {
43+
println!("{:#?}", resp.unwrap_err());
44+
}
45+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Delete a flag suggestion returns "No Content" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_feature_flags::FeatureFlagsAPI;
4+
use uuid::Uuid;
5+
6+
#[tokio::main]
7+
async fn main() {
8+
let configuration = datadog::Configuration::new();
9+
let api = FeatureFlagsAPI::with_config(configuration);
10+
let resp = api
11+
.delete_flag_suggestion(
12+
Uuid::parse_str("550e8400-e29b-41d4-a716-446655440020").expect("invalid UUID"),
13+
)
14+
.await;
15+
if let Ok(value) = resp {
16+
println!("{:#?}", value);
17+
} else {
18+
println!("{:#?}", resp.unwrap_err());
19+
}
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Get a flag suggestion returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_feature_flags::FeatureFlagsAPI;
4+
use uuid::Uuid;
5+
6+
#[tokio::main]
7+
async fn main() {
8+
let configuration = datadog::Configuration::new();
9+
let api = FeatureFlagsAPI::with_config(configuration);
10+
let resp = api
11+
.get_flag_suggestion(
12+
Uuid::parse_str("550e8400-e29b-41d4-a716-446655440020").expect("invalid UUID"),
13+
)
14+
.await;
15+
if let Ok(value) = resp {
16+
println!("{:#?}", value);
17+
} else {
18+
println!("{:#?}", resp.unwrap_err());
19+
}
20+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Reject a flag suggestion returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_feature_flags::FeatureFlagsAPI;
4+
use datadog_api_client::datadogV2::model::FlagSuggestionEventDataType;
5+
use datadog_api_client::datadogV2::model::ReviewFlagSuggestionAttributes;
6+
use datadog_api_client::datadogV2::model::ReviewFlagSuggestionData;
7+
use datadog_api_client::datadogV2::model::ReviewFlagSuggestionRequest;
8+
use uuid::Uuid;
9+
10+
#[tokio::main]
11+
async fn main() {
12+
let body = ReviewFlagSuggestionRequest::new(
13+
ReviewFlagSuggestionData::new(FlagSuggestionEventDataType::FLAG_SUGGESTION_EVENTS)
14+
.attributes(
15+
ReviewFlagSuggestionAttributes::new().comment("Looks good, approved!".to_string()),
16+
),
17+
);
18+
let configuration = datadog::Configuration::new();
19+
let api = FeatureFlagsAPI::with_config(configuration);
20+
let resp = api
21+
.reject_flag_suggestion(
22+
Uuid::parse_str("550e8400-e29b-41d4-a716-446655440020").expect("invalid UUID"),
23+
body,
24+
)
25+
.await;
26+
if let Ok(value) = resp {
27+
println!("{:#?}", value);
28+
} else {
29+
println!("{:#?}", resp.unwrap_err());
30+
}
31+
}

0 commit comments

Comments
 (0)