pub struct DataClient<'a> {
pub access_token: Cow<'a, str>,
pub client: Client<HttpsConnector<HttpConnector>>,
}Fields§
§access_token: Cow<'a, str>Represents the API access token used to authenticate requests to the Wistia API.
client: Client<HttpsConnector<HttpConnector>>The HTTPS client to use for sending requests.
Implementations§
Source§impl<'a> DataClient<'a>
impl<'a> DataClient<'a>
Sourcepub fn from_env() -> Result<Self>
pub fn from_env() -> Result<Self>
Initialize a new Wistia DataClient object from an API access token,
assuming this is currently set in the environment.
Sourcepub async fn download_asset(
&'a self,
req: DownloadAssetRequest<'a>,
) -> Result<Cursor<Bytes>>
pub async fn download_asset( &'a self, req: DownloadAssetRequest<'a>, ) -> Result<Cursor<Bytes>>
Sourcepub async fn get_media(&self, video_id: &'a str) -> Result<Media>
pub async fn get_media(&self, video_id: &'a str) -> Result<Media>
Retrieve info on a media on Wistia (typically a video)
§Docs
Sourcepub async fn update_media(&self, video: UpdateMediaRequest) -> Result<MediaInfo>
pub async fn update_media(&self, video: UpdateMediaRequest) -> Result<MediaInfo>
Update attributes on a media in Wistia (typically a video)
§Docs
https://wistia.com/support/developers/data-api#medias-update
Sourcepub async fn get<R: DeserializeOwned>(&'a self, url: &'a str) -> Result<R>
pub async fn get<R: DeserializeOwned>(&'a self, url: &'a str) -> Result<R>
Make a GET request to the Wistia Data API
Sourcepub async fn put<B: Serialize, R: DeserializeOwned>(
&'a self,
url: &'a str,
body: B,
) -> Result<R>
pub async fn put<B: Serialize, R: DeserializeOwned>( &'a self, url: &'a str, body: B, ) -> Result<R>
Make a PUT request to the Wistia Data API, with included query parameters
Sourcepub async fn put_with_body<B: Serialize, R: DeserializeOwned>(
&'a self,
url: &'a str,
body: B,
) -> Result<R>
pub async fn put_with_body<B: Serialize, R: DeserializeOwned>( &'a self, url: &'a str, body: B, ) -> Result<R>
Make a PUT request to the Wistia Data API
Trait Implementations§
Source§impl<'a> Clone for DataClient<'a>
impl<'a> Clone for DataClient<'a>
Source§fn clone(&self) -> DataClient<'a>
fn clone(&self) -> DataClient<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> From<&'a str> for DataClient<'a>
impl<'a> From<&'a str> for DataClient<'a>
Auto Trait Implementations§
impl<'a> Freeze for DataClient<'a>
impl<'a> !RefUnwindSafe for DataClient<'a>
impl<'a> Send for DataClient<'a>
impl<'a> Sync for DataClient<'a>
impl<'a> Unpin for DataClient<'a>
impl<'a> !UnwindSafe for DataClient<'a>
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