pub struct SmugMugClient { /* private fields */ }Implementations§
Source§impl SmugMugClient
impl SmugMugClient
pub async fn list_albums(&self) -> Result<Vec<Album>>
pub async fn create_album( &self, name: &str, parent_node_uri: Option<&str>, privacy: &str, ) -> Result<Album>
pub async fn find_album_in_folder( &self, parent_node_uri: &str, album_name: &str, ) -> Result<Option<Album>>
Sourcepub async fn find_or_create_folder_path(
&self,
folder_path: &str,
privacy: Option<&str>,
) -> Result<String>
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.
Sourcepub async fn find_folder_path(
&self,
folder_path: &str,
) -> Result<Option<String>>
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.
pub async fn get_album(&self, album_key: &str) -> Result<Album>
pub async fn delete_album(&self, album_key: &str) -> Result<()>
pub async fn get_node_tree(&self) -> Result<NodeTree>
pub async fn update_album_settings( &self, album_key: &str, settings: AlbumSettingsUpdate, ) -> Result<()>
Sourcepub async fn request_album_download(
&self,
album_key: &str,
) -> Result<AlbumDownloadInfo>
pub async fn request_album_download( &self, album_key: &str, ) -> Result<AlbumDownloadInfo>
Request album download ZIP generation
Sourcepub async fn check_album_download_status(
&self,
download_uri: &str,
) -> Result<AlbumDownloadInfo>
pub async fn check_album_download_status( &self, download_uri: &str, ) -> Result<AlbumDownloadInfo>
Check the status of an album download
Sourcepub async fn get_album_download_link(&self, album_key: &str) -> Result<String>
pub async fn get_album_download_link(&self, album_key: &str) -> Result<String>
Get album download link with polling (max 10 attempts, 3s intervals)
Source§impl SmugMugClient
impl SmugMugClient
Sourcepub async fn list_image_comments(&self, image_key: &str) -> Result<Vec<Comment>>
pub async fn list_image_comments(&self, image_key: &str) -> Result<Vec<Comment>>
List all comments for an image
Sourcepub async fn create_image_comment(
&self,
image_key: &str,
request: CreateCommentRequest,
) -> Result<Comment>
pub async fn create_image_comment( &self, image_key: &str, request: CreateCommentRequest, ) -> Result<Comment>
Create a new comment on an image
Source§impl SmugMugClient
impl SmugMugClient
Sourcepub async fn list_album_images(
&self,
album_key: &str,
) -> Result<Vec<AlbumImage>>
pub async fn list_album_images( &self, album_key: &str, ) -> Result<Vec<AlbumImage>>
Every image in the album, across all pages of the listing.
pub async fn get_image_details(&self, image_key: &str) -> Result<ImageDetails>
pub async fn delete_image(&self, image_key: &str) -> Result<()>
pub async fn update_image_metadata( &self, image_key: &str, metadata: ImageMetadataUpdate, ) -> Result<()>
pub async fn move_image( &self, image_key: &str, target_album_key: &str, ) -> Result<()>
Source§impl SmugMugClient
impl SmugMugClient
pub fn new( api_key: String, api_secret: String, access_token: String, access_token_secret: String, ) -> Self
pub fn build_oauth_header(&self, method: &str, url: &str) -> String
Sourcepub fn build_oauth_header_with_query<T: Request>(
&self,
method: &str,
url: &str,
query: &T,
) -> String
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.
pub async fn get_auth_user(&self) -> Result<Value>
pub async fn get_user_features(&self, user_uri: &str) -> Result<Value>
Sourcepub async fn request_raw(
&self,
method: &str,
path_or_url: &str,
) -> Result<(u16, String)>
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.
Sourcepub async fn get_all_pages<T: DeserializeOwned>(
&self,
first_url: &str,
locator: &str,
) -> Result<Vec<T>>
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.
pub async fn get_with_auth(&self, url: &str) -> Result<Response>
pub async fn post_with_auth(&self, url: &str, body: Value) -> Result<Response>
pub async fn delete_with_auth(&self, url: &str) -> Result<Response>
pub async fn patch_with_auth(&self, url: &str, body: Value) -> Result<Response>
Auto Trait Implementations§
impl !RefUnwindSafe for SmugMugClient
impl !UnwindSafe for SmugMugClient
impl Freeze for SmugMugClient
impl Send for SmugMugClient
impl Sync for SmugMugClient
impl Unpin for SmugMugClient
impl UnsafeUnpin for SmugMugClient
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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