pub struct BundleHandler { /* private fields */ }
Expand description
Handler for bundle operations
Implementations§
Source§impl BundleHandler
impl BundleHandler
Sourcepub fn new(client: FilesClient) -> Self
pub fn new(client: FilesClient) -> Self
Create a new bundle handler
Sourcepub async fn list(
&self,
user_id: Option<i64>,
cursor: Option<&str>,
per_page: Option<i64>,
) -> Result<(Vec<BundleEntity>, PaginationInfo)>
pub async fn list( &self, user_id: Option<i64>, cursor: Option<&str>, per_page: Option<i64>, ) -> Result<(Vec<BundleEntity>, PaginationInfo)>
List bundles
§Arguments
user_id
- Filter by user ID (0 for current user)cursor
- Pagination cursorper_page
- Results per page
§Returns
Tuple of (bundles, pagination_info)
§Example
use files_sdk::{FilesClient, BundleHandler};
let client = FilesClient::builder().api_key("key").build()?;
let handler = BundleHandler::new(client);
let (bundles, pagination) = handler.list(None, None, None).await?;
Sourcepub async fn get(&self, id: i64) -> Result<BundleEntity>
pub async fn get(&self, id: i64) -> Result<BundleEntity>
Sourcepub async fn create(
&self,
paths: Vec<String>,
password: Option<&str>,
expires_at: Option<&str>,
max_uses: Option<i64>,
description: Option<&str>,
note: Option<&str>,
code: Option<&str>,
require_registration: Option<bool>,
permissions: Option<&str>,
) -> Result<BundleEntity>
pub async fn create( &self, paths: Vec<String>, password: Option<&str>, expires_at: Option<&str>, max_uses: Option<i64>, description: Option<&str>, note: Option<&str>, code: Option<&str>, require_registration: Option<bool>, permissions: Option<&str>, ) -> Result<BundleEntity>
Create a new bundle
§Arguments
paths
- List of paths to include in bundle (required)password
- Password protectionexpires_at
- Expiration date/timemax_uses
- Maximum number of accessesdescription
- Public descriptionnote
- Internal notecode
- Custom bundle code for URLrequire_registration
- Require user registrationpermissions
- Permission level (read, write, read_write, full, preview_only)
§Returns
The created bundle
Auto Trait Implementations§
impl Freeze for BundleHandler
impl !RefUnwindSafe for BundleHandler
impl Send for BundleHandler
impl Sync for BundleHandler
impl Unpin for BundleHandler
impl !UnwindSafe for BundleHandler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more