hey-sdk 0.30.0

Rust client for the HEY API, generated from a Smithy model of the API
Documentation
// Generated by hey-sdk-generator from openapi.json and behavior-model.json. DO NOT EDIT.

#![allow(clippy::too_many_arguments)]

use crate::client::Client;
use crate::error::Error;
use crate::generated::routes;
use crate::generated::types::*;
use crate::pagination::Page;

/// Optional query parameters for `ListClips`.
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ListClipsParams {
    pub page: Option<String>,
}

pub struct Clips<'a> {
    client: &'a Client,
}

impl<'a> Clips<'a> {
    pub(crate) fn new(client: &'a Client) -> Self {
        Self { client }
    }

    /// The client this service sends through.
    pub fn client(&self) -> &'a Client {
        self.client
    }

    /// List clips, newest first
    pub async fn list(
        &self,
        params: &ListClipsParams,
    ) -> Result<Page<ListClipsResponseContent>, Error> {
        let mut operation = self.client.operation(&routes::LIST_CLIPS, &[]);
        operation.query_optional("page", params.page.as_ref());
        self.client.send_page(operation).await
    }
}