1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Generated by basecamp-sdk-generator from openapi.json and behavior-model.json. DO NOT EDIT.
//! Events operations.
#![allow(
clippy::too_many_arguments,
clippy::wildcard_imports,
clippy::doc_markdown
)]
use crate::client::AccountClient;
use crate::error::Error;
use crate::generated::routes;
#[allow(unused_imports)]
use crate::generated::types::*;
use crate::pagination::Page;
/// Optional query parameters for `ListEvents`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ListEventsParams {
/// Page number for paginating through results. Defaults to 1. A positive value selects exactly that page, not a starting offset; see SPEC section 8.
pub page: Option<i32>,
}
/// `Events` operations, sent through one [`AccountClient`].
#[derive(Debug, Clone, Copy)]
pub struct EventsService<'a> {
client: &'a AccountClient,
}
impl<'a> EventsService<'a> {
pub(crate) fn new(client: &'a AccountClient) -> Self {
Self { client }
}
/// The client this service sends through.
pub fn client(&self) -> &'a AccountClient {
self.client
}
/// List all events for a recording
///
/// **Pagination**: Uses Link header (RFC5988). Follow the `next` rel URL
/// to fetch additional pages. X-Total-Count header provides total count.
///
/// `GET /recordings/{recordingId}/events.json` — idempotent; retries up to 3 attempt(s) on 429, 503.
pub async fn list(
&self,
recording_id: i64,
params: &ListEventsParams,
) -> Result<Page<ListEventsResponseContent>, Error> {
let mut operation = self
.client
.operation(&routes::LIST_EVENTS, &[&recording_id]);
operation.query_optional("page", params.page.as_ref());
self.client.send_page(operation).await
}
}