Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70064,6 +70064,13 @@ paths:
get:
description: Get the list of all suppression rules.
operationId: ListSecurityMonitoringSuppressions
parameters:
- description: Query string.
in: query
name: query
required: false
schema:
type: string
responses:
'200':
content:
Expand Down
4 changes: 2 additions & 2 deletions LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ winapi,https://github.com/retep998/winapi-rs,MIT OR Apache-2.0,Peter Atashian <r
winapi-i686-pc-windows-gnu,https://github.com/retep998/winapi-rs,MIT OR Apache-2.0,Peter Atashian <retep998@gmail.com>
winapi-x86_64-pc-windows-gnu,https://github.com/retep998/winapi-rs,MIT OR Apache-2.0,Peter Atashian <retep998@gmail.com>
windows-core,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,The windows-core Authors
windows-implement,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft
windows-interface,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft
windows-implement,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,The windows-implement Authors
windows-interface,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,The windows-interface Authors
windows-link,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,The windows-link Authors
windows-result,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,The windows-result Authors
windows-strings,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,The windows-strings Authors
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
// Get all suppression rules returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_security_monitoring::ListSecurityMonitoringSuppressionsOptionalParams;
use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI;

#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = SecurityMonitoringAPI::with_config(configuration);
let resp = api.list_security_monitoring_suppressions().await;
let resp = api
.list_security_monitoring_suppressions(
ListSecurityMonitoringSuppressionsOptionalParams::default(),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
Expand Down
28 changes: 27 additions & 1 deletion src/datadogV2/api/api_security_monitoring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,22 @@ impl ListSecurityMonitoringSignalsOptionalParams {
}
}

/// ListSecurityMonitoringSuppressionsOptionalParams is a struct for passing parameters to the method [`SecurityMonitoringAPI::list_security_monitoring_suppressions`]
#[non_exhaustive]
#[derive(Clone, Default, Debug)]
pub struct ListSecurityMonitoringSuppressionsOptionalParams {
/// Query string.
pub query: Option<String>,
}

impl ListSecurityMonitoringSuppressionsOptionalParams {
/// Query string.
pub fn query(mut self, value: String) -> Self {
self.query = Some(value);
self
}
}

/// ListVulnerabilitiesOptionalParams is a struct for passing parameters to the method [`SecurityMonitoringAPI::list_vulnerabilities`]
#[non_exhaustive]
#[derive(Clone, Default, Debug)]
Expand Down Expand Up @@ -7579,12 +7595,13 @@ impl SecurityMonitoringAPI {
/// Get the list of all suppression rules.
pub async fn list_security_monitoring_suppressions(
&self,
params: ListSecurityMonitoringSuppressionsOptionalParams,
) -> Result<
crate::datadogV2::model::SecurityMonitoringSuppressionsResponse,
datadog::Error<ListSecurityMonitoringSuppressionsError>,
> {
match self
.list_security_monitoring_suppressions_with_http_info()
.list_security_monitoring_suppressions_with_http_info(params)
.await
{
Ok(response_content) => {
Expand All @@ -7603,13 +7620,17 @@ impl SecurityMonitoringAPI {
/// Get the list of all suppression rules.
pub async fn list_security_monitoring_suppressions_with_http_info(
&self,
params: ListSecurityMonitoringSuppressionsOptionalParams,
) -> Result<
datadog::ResponseContent<crate::datadogV2::model::SecurityMonitoringSuppressionsResponse>,
datadog::Error<ListSecurityMonitoringSuppressionsError>,
> {
let local_configuration = &self.config;
let operation_id = "v2.list_security_monitoring_suppressions";

// unbox and build optional parameters
let query = params.query;

let local_client = &self.client;

let local_uri_str = format!(
Expand All @@ -7619,6 +7640,11 @@ impl SecurityMonitoringAPI {
let mut local_req_builder =
local_client.request(reqwest::Method::GET, local_uri_str.as_str());

if let Some(ref local_query_param) = query {
local_req_builder =
local_req_builder.query(&[("query", &local_query_param.to_string())]);
};

// build headers
let mut headers = HeaderMap::new();
headers.insert("Accept", HeaderValue::from_static("application/json"));
Expand Down
8 changes: 7 additions & 1 deletion tests/scenarios/function_mappings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16080,7 +16080,13 @@ fn test_v2_list_security_monitoring_suppressions(
.v2_api_security_monitoring
.as_ref()
.expect("api instance not found");
let response = match block_on(api.list_security_monitoring_suppressions_with_http_info()) {
let query = _parameters
.get("query")
.and_then(|param| Some(serde_json::from_value(param.clone()).unwrap()));
let mut params = datadogV2::api_security_monitoring::ListSecurityMonitoringSuppressionsOptionalParams::default();
params.query = query;
let response = match block_on(api.list_security_monitoring_suppressions_with_http_info(params))
{
Ok(response) => response,
Err(error) => {
return match error {
Expand Down