Skip to main content

SmugMugClient

Struct SmugMugClient 

Source
pub struct SmugMugClient { /* private fields */ }

Implementations§

Source§

impl SmugMugClient

Source

pub async fn list_albums(&self) -> Result<Vec<Album>>

Source

pub async fn create_album( &self, name: &str, parent_node_uri: Option<&str>, privacy: &str, ) -> Result<Album>

Source

pub async fn find_album_in_folder( &self, parent_node_uri: &str, album_name: &str, ) -> Result<Option<Album>>

Source

pub async fn find_or_create_folder_path( &self, folder_path: &str, privacy: Option<&str>, ) -> Result<String>

Find or create each folder along folder_path (e.g. “2024/Travel”) and return the last one’s node URI. privacy (Public, Unlisted or Private) is set on any folder that has to be created; None leaves SmugMug’s default. Existing folders are left as they are.

Source

pub async fn find_folder_path( &self, folder_path: &str, ) -> Result<Option<String>>

Node URI of the folder at folder_path, or None if any folder along it doesn’t exist. Creates nothing.

Source

pub async fn get_album(&self, album_key: &str) -> Result<Album>

Source

pub async fn delete_album(&self, album_key: &str) -> Result<()>

Source

pub async fn get_node_tree(&self) -> Result<NodeTree>

Source

pub async fn update_album_settings( &self, album_key: &str, settings: AlbumSettingsUpdate, ) -> Result<()>

Source

pub async fn request_album_download( &self, album_key: &str, ) -> Result<AlbumDownloadInfo>

Request album download ZIP generation

Source

pub async fn check_album_download_status( &self, download_uri: &str, ) -> Result<AlbumDownloadInfo>

Check the status of an album download

Get album download link with polling (max 10 attempts, 3s intervals)

Source§

impl SmugMugClient

Source

pub async fn list_image_comments(&self, image_key: &str) -> Result<Vec<Comment>>

List all comments for an image

Source

pub async fn create_image_comment( &self, image_key: &str, request: CreateCommentRequest, ) -> Result<Comment>

Create a new comment on an image

Source§

impl SmugMugClient

Source

pub async fn list_album_images( &self, album_key: &str, ) -> Result<Vec<AlbumImage>>

Every image in the album, across all pages of the listing.

Source

pub async fn get_image_details(&self, image_key: &str) -> Result<ImageDetails>

Source

pub async fn delete_image(&self, image_key: &str) -> Result<()>

Source

pub async fn update_image_metadata( &self, image_key: &str, metadata: ImageMetadataUpdate, ) -> Result<()>

Source

pub async fn move_image( &self, image_key: &str, target_album_key: &str, ) -> Result<()>

Source§

impl SmugMugClient

Source

pub fn new( api_key: String, api_secret: String, access_token: String, access_token_secret: String, ) -> Self

Source

pub fn build_oauth_header(&self, method: &str, url: &str) -> String

Source

pub fn build_oauth_header_with_query<T: Request>( &self, method: &str, url: &str, query: &T, ) -> String

Same as build_oauth_header, but for a request that carries query parameters (e.g. pagination’s start/count). OAuth1 signing requires those parameters to be passed in separately rather than embedded in url — a url containing a ?query part panics inside the oauth1-request crate. Callers must send the request with the same query value (e.g. reqwest’s .query(query)) so the signed parameters match what is actually sent.

Source

pub async fn get_auth_user(&self) -> Result<Value>

Source

pub async fn get_user_features(&self, user_uri: &str) -> Result<Value>

Source

pub async fn request_raw( &self, method: &str, path_or_url: &str, ) -> Result<(u16, String)>

Authenticated request with any HTTP method to an arbitrary API path (e.g. /api/v2!authuser?_verbosity=1) or absolute URL, returning the HTTP status and raw body without interpreting either. Query parameters are signed separately, as OAuth1 requires. Used for exploring endpoints that aren’t publicly documented; OPTIONS makes SmugMug describe an endpoint’s methods and parameters.

Source

pub async fn get_all_pages<T: DeserializeOwned>( &self, first_url: &str, locator: &str, ) -> Result<Vec<T>>

GET a SmugMug list endpoint (e.g. .../album/KEY!images) and every following page, returning all items of the locator array (e.g. “AlbumImage”, “Album”, “Comment”, “Node”) from each page’s Response. SmugMug returns one page per request (often 100 items, sometimes fewer) and links the next one as Response.Pages.NextPage; a missing locator array (empty list) yields no items. Later pages are fetched from the same host as first_url, with their query parameters signed separately as OAuth1 requires.

Source

pub async fn get_with_auth(&self, url: &str) -> Result<Response>

Source

pub async fn post_with_auth(&self, url: &str, body: Value) -> Result<Response>

Source

pub async fn delete_with_auth(&self, url: &str) -> Result<Response>

Source

pub async fn patch_with_auth(&self, url: &str, body: Value) -> Result<Response>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more