datadog_api/apis/logs.rs
1use crate::{
2 client::DatadogClient,
3 models::{LogsSearchRequest, LogsSearchResponse},
4 Result,
5};
6
7/// API client for Datadog logs endpoints.
8pub struct LogsApi {
9 client: DatadogClient,
10}
11
12impl LogsApi {
13 /// Creates a new API client.
14 #[must_use]
15 pub const fn new(client: DatadogClient) -> Self {
16 Self { client }
17 }
18
19 pub async fn search_logs(&self, request: &LogsSearchRequest) -> Result<LogsSearchResponse> {
20 self.client
21 .post("/api/v2/logs/events/search", request)
22 .await
23 }
24}