Struct datadog_api_client::datadogV2::api::api_logs::ListLogsOptionalParams
source · #[non_exhaustive]pub struct ListLogsOptionalParams {
pub body: Option<LogsListRequest>,
}Expand description
ListLogsOptionalParams is a struct for passing parameters to the method LogsAPI::list_logs
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.body: Option<LogsListRequest>Implementations§
source§impl ListLogsOptionalParams
impl ListLogsOptionalParams
sourcepub fn body(self, value: LogsListRequest) -> Self
pub fn body(self, value: LogsListRequest) -> Self
Examples found in repository?
examples/v2_logs_ListLogs.rs (line 25)
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
async fn main() {
let body = LogsListRequest::new()
.filter(
LogsQueryFilter::new()
.from("2020-09-17T11:48:36+01:00".to_string())
.indexes(vec!["main".to_string()])
.query("datadog-agent".to_string())
.to("2020-09-17T12:48:36+01:00".to_string()),
)
.page(LogsListRequestPage::new().limit(5))
.sort(LogsSort::TIMESTAMP_ASCENDING);
let configuration = datadog::Configuration::new();
let api = LogsAPI::with_config(configuration);
let resp = api
.list_logs(ListLogsOptionalParams::default().body(body))
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}More examples
examples/v2_logs_ListLogs_3138392594.rs (line 27)
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
async fn main() {
let body = LogsListRequest::new()
.filter(
LogsQueryFilter::new()
.from("now-15m".to_string())
.indexes(vec!["main".to_string()])
.to("now".to_string()),
)
.options(LogsQueryOptions::new().timezone("GMT".to_string()))
.page(LogsListRequestPage::new().limit(2))
.sort(LogsSort::TIMESTAMP_ASCENDING);
let configuration = datadog::Configuration::new();
let api = LogsAPI::with_config(configuration);
let response = api.list_logs_with_pagination(ListLogsOptionalParams::default().body(body));
pin_mut!(response);
while let Some(resp) = response.next().await {
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
}Trait Implementations§
source§impl Clone for ListLogsOptionalParams
impl Clone for ListLogsOptionalParams
source§fn clone(&self) -> ListLogsOptionalParams
fn clone(&self) -> ListLogsOptionalParams
Returns a copy 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 ListLogsOptionalParams
impl Debug for ListLogsOptionalParams
source§impl Default for ListLogsOptionalParams
impl Default for ListLogsOptionalParams
source§fn default() -> ListLogsOptionalParams
fn default() -> ListLogsOptionalParams
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ListLogsOptionalParams
impl RefUnwindSafe for ListLogsOptionalParams
impl Send for ListLogsOptionalParams
impl Sync for ListLogsOptionalParams
impl Unpin for ListLogsOptionalParams
impl UnwindSafe for ListLogsOptionalParams
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)