#![allow(missing_docs, unreachable_pub, clippy::all, clippy::pedantic)]
use crate::client::Client;
use crate::error::Error;
use crate::generated::routes;
use crate::generated::types::*;
use crate::pagination::Page;
#[derive(Debug, Clone, Default, PartialEq)]
pub struct GetFolderParams {
pub page: Option<String>,
}
pub struct Folders<'a> {
client: &'a Client,
}
impl<'a> Folders<'a> {
pub(crate) fn new(client: &'a Client) -> Self {
Self { client }
}
pub fn client(&self) -> &'a Client {
self.client
}
pub async fn get(
&self,
folder_id: i64,
params: &GetFolderParams,
) -> Result<Page<GetFolderResponseContent>, Error> {
let mut operation = self.client.operation(&routes::GET_FOLDER, &[&folder_id]);
operation.resource_id(folder_id);
operation.query_optional("page", params.page.as_ref());
self.client.send_page(operation).await
}
}