pub struct StaticAnalysisAPI { /* private fields */ }Expand description
API for static analysis
Implementations§
Source§impl StaticAnalysisAPI
impl StaticAnalysisAPI
pub fn new() -> Self
Sourcepub fn with_config(config: Configuration) -> Self
pub fn with_config(config: Configuration) -> Self
Examples found in repository?
examples/v2_static-analysis_CreateSCAResolveVulnerableSymbols.rs (line 19)
10async 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}More examples
examples/v2_static-analysis_CreateSCAResult.rs (line 107)
21async 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}pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self
Sourcepub async fn create_sca_resolve_vulnerable_symbols(
&self,
body: ResolveVulnerableSymbolsRequest,
) -> Result<ResolveVulnerableSymbolsResponse, Error<CreateSCAResolveVulnerableSymbolsError>>
pub async fn create_sca_resolve_vulnerable_symbols( &self, body: ResolveVulnerableSymbolsRequest, ) -> Result<ResolveVulnerableSymbolsResponse, Error<CreateSCAResolveVulnerableSymbolsError>>
Examples found in repository?
examples/v2_static-analysis_CreateSCAResolveVulnerableSymbols.rs (line 20)
10async 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}pub async fn create_sca_resolve_vulnerable_symbols_with_http_info( &self, body: ResolveVulnerableSymbolsRequest, ) -> Result<ResponseContent<ResolveVulnerableSymbolsResponse>, Error<CreateSCAResolveVulnerableSymbolsError>>
Sourcepub async fn create_sca_result(
&self,
body: ScaRequest,
) -> Result<(), Error<CreateSCAResultError>>
pub async fn create_sca_result( &self, body: ScaRequest, ) -> Result<(), Error<CreateSCAResultError>>
Examples found in repository?
examples/v2_static-analysis_CreateSCAResult.rs (line 108)
21async 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}pub async fn create_sca_result_with_http_info( &self, body: ScaRequest, ) -> Result<ResponseContent<()>, Error<CreateSCAResultError>>
Trait Implementations§
Source§impl Clone for StaticAnalysisAPI
impl Clone for StaticAnalysisAPI
Source§fn clone(&self) -> StaticAnalysisAPI
fn clone(&self) -> StaticAnalysisAPI
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StaticAnalysisAPI
impl Debug for StaticAnalysisAPI
Auto Trait Implementations§
impl Freeze for StaticAnalysisAPI
impl !RefUnwindSafe for StaticAnalysisAPI
impl Send for StaticAnalysisAPI
impl Sync for StaticAnalysisAPI
impl Unpin for StaticAnalysisAPI
impl !UnwindSafe for StaticAnalysisAPI
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more