Skip to content

Commit 207b3f5

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 2591899 of spec repo
1 parent 8cffc73 commit 207b3f5

File tree

41 files changed

+4573
-16
lines changed

Some content is hidden

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

41 files changed

+4573
-16
lines changed

.generator/schemas/v2/openapi.yaml

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

LICENSE-3rdparty.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ serde_json,https://github.com/serde-rs/json,MIT OR Apache-2.0,"Erick Tryzelaar <
129129
serde_urlencoded,https://github.com/nox/serde_urlencoded,MIT OR Apache-2.0,Anthony Ramine <[email protected]>
130130
serde_with,https://github.com/jonasbb/serde_with,MIT OR Apache-2.0,"Jonas Bushart, Marcin Kaźmierczak"
131131
serde_with_macros,https://github.com/jonasbb/serde_with,MIT OR Apache-2.0,Jonas Bushart
132+
simd-adler32,https://github.com/mcountryman/simd-adler32,MIT,Marvin Countryman <[email protected]>
132133
slab,https://github.com/tokio-rs/slab,MIT,Carl Lerche <[email protected]>
133134
smallvec,https://github.com/servo/rust-smallvec,MIT OR Apache-2.0,The Servo Project Developers
134135
socket2,https://github.com/rust-lang/socket2,MIT OR Apache-2.0,"Alex Crichton <[email protected]>, Thomas de Zeeuw <[email protected]>"

examples/v1_logs-pipelines_CreateLogsPipeline.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,13 @@ async fn main() {
1616
LogsGrokParser::new(
1717
LogsGrokParserRules::new(
1818
r#"rule_name_1 foo
19-
rule_name_2 bar
20-
"#
21-
.to_string(),
19+
rule_name_2 bar"#
20+
.to_string(),
2221
)
2322
.support_rules(
2423
r#"rule_name_1 foo
25-
rule_name_2 bar
26-
"#
27-
.to_string(),
24+
rule_name_2 bar"#
25+
.to_string(),
2826
),
2927
"message".to_string(),
3028
LogsGrokParserType::GROK_PARSER,

examples/v1_logs-pipelines_UpdateLogsPipeline.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,13 @@ async fn main() {
1616
LogsGrokParser::new(
1717
LogsGrokParserRules::new(
1818
r#"rule_name_1 foo
19-
rule_name_2 bar
20-
"#
21-
.to_string(),
19+
rule_name_2 bar"#
20+
.to_string(),
2221
)
2322
.support_rules(
2423
r#"rule_name_1 foo
25-
rule_name_2 bar
26-
"#
27-
.to_string(),
24+
rule_name_2 bar"#
25+
.to_string(),
2826
),
2927
"message".to_string(),
3028
LogsGrokParserType::GROK_PARSER,
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// POST request to resolve vulnerable symbols returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_static_analysis::StaticAnalysisAPI;
4+
use datadog_api_client::datadogV2::model::ResolveVulnerableSymbolsRequest;
5+
use datadog_api_client::datadogV2::model::ResolveVulnerableSymbolsRequestData;
6+
use datadog_api_client::datadogV2::model::ResolveVulnerableSymbolsRequestDataAttributes;
7+
use datadog_api_client::datadogV2::model::ResolveVulnerableSymbolsRequestDataType;
8+
9+
#[tokio::main]
10+
async fn main() {
11+
let body = ResolveVulnerableSymbolsRequest::new().data(
12+
ResolveVulnerableSymbolsRequestData::new(
13+
ResolveVulnerableSymbolsRequestDataType::RESOLVE_VULNERABLE_SYMBOLS_REQUEST,
14+
)
15+
.attributes(ResolveVulnerableSymbolsRequestDataAttributes::new().purls(vec![])),
16+
);
17+
let mut configuration = datadog::Configuration::new();
18+
configuration.set_unstable_operation_enabled("v2.CreateSCAResolveVulnerableSymbols", true);
19+
let api = StaticAnalysisAPI::with_config(configuration);
20+
let resp = api.create_sca_resolve_vulnerable_symbols(body).await;
21+
if let Ok(value) = resp {
22+
println!("{:#?}", value);
23+
} else {
24+
println!("{:#?}", resp.unwrap_err());
25+
}
26+
}
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
// Post dependencies for analysis returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_static_analysis::StaticAnalysisAPI;
4+
use datadog_api_client::datadogV2::model::ScaRequest;
5+
use datadog_api_client::datadogV2::model::ScaRequestData;
6+
use datadog_api_client::datadogV2::model::ScaRequestDataAttributes;
7+
use datadog_api_client::datadogV2::model::ScaRequestDataAttributesCommit;
8+
use datadog_api_client::datadogV2::model::ScaRequestDataAttributesDependenciesItems;
9+
use datadog_api_client::datadogV2::model::ScaRequestDataAttributesDependenciesItemsLocationsItems;
10+
use datadog_api_client::datadogV2::model::ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition;
11+
use datadog_api_client::datadogV2::model::ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition;
12+
use datadog_api_client::datadogV2::model::ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems;
13+
use datadog_api_client::datadogV2::model::ScaRequestDataAttributesFilesItems;
14+
use datadog_api_client::datadogV2::model::ScaRequestDataAttributesRelationsItems;
15+
use datadog_api_client::datadogV2::model::ScaRequestDataAttributesRepository;
16+
use datadog_api_client::datadogV2::model::ScaRequestDataAttributesVulnerabilitiesItems;
17+
use datadog_api_client::datadogV2::model::ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems;
18+
use datadog_api_client::datadogV2::model::ScaRequestDataType;
19+
20+
#[tokio::main]
21+
async fn main() {
22+
let body =
23+
ScaRequest
24+
::new().data(
25+
ScaRequestData::new(
26+
ScaRequestDataType::SCAREQUESTS,
27+
).attributes(
28+
ScaRequestDataAttributes::new()
29+
.commit(ScaRequestDataAttributesCommit::new())
30+
.dependencies(
31+
vec![
32+
ScaRequestDataAttributesDependenciesItems::new()
33+
.exclusions(vec![])
34+
.locations(
35+
vec![
36+
ScaRequestDataAttributesDependenciesItemsLocationsItems::new()
37+
.block(
38+
ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition
39+
::new()
40+
.end(
41+
ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition
42+
::new(),
43+
)
44+
.start(
45+
ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition
46+
::new(),
47+
),
48+
)
49+
.name(
50+
ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition
51+
::new()
52+
.end(
53+
ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition
54+
::new(),
55+
)
56+
.start(
57+
ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition
58+
::new(),
59+
),
60+
)
61+
.namespace(
62+
ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition
63+
::new()
64+
.end(
65+
ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition
66+
::new(),
67+
)
68+
.start(
69+
ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition
70+
::new(),
71+
),
72+
)
73+
.version(
74+
ScaRequestDataAttributesDependenciesItemsLocationsItemsFilePosition
75+
::new()
76+
.end(
77+
ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition
78+
::new(),
79+
)
80+
.start(
81+
ScaRequestDataAttributesDependenciesItemsLocationsItemsPosition
82+
::new(),
83+
),
84+
)
85+
],
86+
)
87+
.reachable_symbol_properties(
88+
vec![
89+
ScaRequestDataAttributesDependenciesItemsReachableSymbolPropertiesItems::new()
90+
],
91+
)
92+
],
93+
)
94+
.files(vec![ScaRequestDataAttributesFilesItems::new()])
95+
.relations(vec![ScaRequestDataAttributesRelationsItems::new().depends_on(vec![])])
96+
.repository(ScaRequestDataAttributesRepository::new())
97+
.vulnerabilities(
98+
vec![
99+
ScaRequestDataAttributesVulnerabilitiesItems
100+
::new().affects(vec![ScaRequestDataAttributesVulnerabilitiesItemsAffectsItems::new()])
101+
],
102+
),
103+
),
104+
);
105+
let mut configuration = datadog::Configuration::new();
106+
configuration.set_unstable_operation_enabled("v2.CreateSCAResult", true);
107+
let api = StaticAnalysisAPI::with_config(configuration);
108+
let resp = api.create_sca_result(body).await;
109+
if let Ok(value) = resp {
110+
println!("{:#?}", value);
111+
} else {
112+
println!("{:#?}", resp.unwrap_err());
113+
}
114+
}

src/datadog/configuration.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,8 @@ impl Default for Configuration {
228228
("v2.get_slo_report".to_owned(), false),
229229
("v2.get_slo_report_job_status".to_owned(), false),
230230
("v2.get_spa_recommendations".to_owned(), false),
231+
("v2.create_sca_resolve_vulnerable_symbols".to_owned(), false),
232+
("v2.create_sca_result".to_owned(), false),
231233
("v2.add_member_team".to_owned(), false),
232234
("v2.list_member_teams".to_owned(), false),
233235
("v2.remove_member_team".to_owned(), false),

0 commit comments

Comments
 (0)