Skip to main content

hey_sdk/generated/services/
clips.rs

1// Generated by hey-sdk-generator from openapi.json and behavior-model.json. DO NOT EDIT.
2
3#![allow(missing_docs, unreachable_pub, clippy::all, clippy::pedantic)]
4
5use crate::client::Client;
6use crate::error::Error;
7use crate::generated::routes;
8use crate::generated::types::*;
9use crate::pagination::Page;
10
11/// Optional query parameters for `ListClips`.
12#[derive(Debug, Clone, Default, PartialEq)]
13pub struct ListClipsParams {
14    pub page: Option<String>,
15}
16
17pub struct Clips<'a> {
18    client: &'a Client,
19}
20
21impl<'a> Clips<'a> {
22    pub(crate) fn new(client: &'a Client) -> Self {
23        Self { client }
24    }
25
26    /// The client this service sends through.
27    pub fn client(&self) -> &'a Client {
28        self.client
29    }
30
31    /// List clips, newest first
32    pub async fn list(
33        &self,
34        params: &ListClipsParams,
35    ) -> Result<Page<ListClipsResponseContent>, Error> {
36        let mut operation = self.client.operation(&routes::LIST_CLIPS, &[]);
37        operation.query_optional("page", params.page.as_ref());
38        self.client.send_page(operation).await
39    }
40}