pub struct Client { /* private fields */ }Expand description
A client for communicating with the Media Manager API
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(key: &str, secret: &str) -> MMCResult<Client>
pub fn new(key: &str, secret: &str) -> MMCResult<Client>
Generates a new client for the production Media Manager API
Sourcepub fn staging(key: &str, secret: &str) -> MMCResult<Client>
pub fn staging(key: &str, secret: &str) -> MMCResult<Client>
Generates a new client for the staging Media Manager API
Sourcepub fn get(
&self,
endpoint: Endpoints,
id: &str,
params: Option<Vec<(&'_ str, &'_ str)>>,
) -> MMCResult<String>
pub fn get( &self, endpoint: Endpoints, id: &str, params: Option<Vec<(&'_ str, &'_ str)>>, ) -> MMCResult<String>
Attempts to fetch a single object with the requested id from the requested Media Manager API endpoint
Sourcepub fn list(
&self,
endpoint: Endpoints,
params: Vec<(&'_ str, &'_ str)>,
) -> MMCResult<String>
pub fn list( &self, endpoint: Endpoints, params: Vec<(&'_ str, &'_ str)>, ) -> MMCResult<String>
Attempts to fetch a list of objects from the requested Media Manager API endpoint augmented by the requested parameters
Sourcepub fn child_list(
&self,
endpoint: Endpoints,
parent_id: &str,
parent_endpoint: Endpoints,
params: Option<Vec<(&'_ str, &'_ str)>>,
) -> MMCResult<String>
pub fn child_list( &self, endpoint: Endpoints, parent_id: &str, parent_endpoint: Endpoints, params: Option<Vec<(&'_ str, &'_ str)>>, ) -> MMCResult<String>
Attempts to fetch a list of child objects of the requested Media Manager API type belonging to the requested parent object augmeted by the requested parameters
Sourcepub fn create<T: Serialize>(
&self,
parent: Endpoints,
id: &str,
endpoint: Endpoints,
body: &T,
) -> MMCResult<String>
pub fn create<T: Serialize>( &self, parent: Endpoints, id: &str, endpoint: Endpoints, body: &T, ) -> MMCResult<String>
Sourcepub fn edit(&self, endpoint: Endpoints, id: &str) -> MMCResult<String>
pub fn edit(&self, endpoint: Endpoints, id: &str) -> MMCResult<String>
Attempts to fetch the edit object specified by the Endpoints and id
Sourcepub fn update<T: Serialize>(
&self,
endpoint: Endpoints,
id: &str,
body: &T,
) -> MMCResult<String>
pub fn update<T: Serialize>( &self, endpoint: Endpoints, id: &str, body: &T, ) -> MMCResult<String>
Attempts to update the object specified by the Endpoints and id
Sourcepub fn delete(&self, endpoint: Endpoints, id: &str) -> MMCResult<String>
pub fn delete(&self, endpoint: Endpoints, id: &str) -> MMCResult<String>
Attempts to delete the object specified by the Endpoints and id
Sourcepub fn change_parent(
&self,
parent_endpoint: Endpoints,
parent_id: &str,
child_endpoint: Endpoints,
child_id: &str,
) -> MMCResult<String>
pub fn change_parent( &self, parent_endpoint: Endpoints, parent_id: &str, child_endpoint: Endpoints, child_id: &str, ) -> MMCResult<String>
Attempts to change the parent of an object
Sourcepub fn url(&self, url: &str) -> MMCResult<String>
pub fn url(&self, url: &str) -> MMCResult<String>
Allows for calling any arbitrary url from the Media Manager API
Sourcepub fn asset(
&self,
id: &str,
params: Option<Vec<(&'_ str, &'_ str)>>,
) -> MMCResult<String>
pub fn asset( &self, id: &str, params: Option<Vec<(&'_ str, &'_ str)>>, ) -> MMCResult<String>
Shorthand for accessing a single asset
Sourcepub fn assets(
&self,
parent_id: &str,
parent_endpoint: Endpoints,
params: Option<Vec<(&'_ str, &'_ str)>>,
) -> MMCResult<String>
pub fn assets( &self, parent_id: &str, parent_endpoint: Endpoints, params: Option<Vec<(&'_ str, &'_ str)>>, ) -> MMCResult<String>
Shorthand for accessing a list of assets
Sourcepub fn changelog(&self, params: Vec<(&'_ str, &'_ str)>) -> MMCResult<String>
pub fn changelog(&self, params: Vec<(&'_ str, &'_ str)>) -> MMCResult<String>
Shorthand for accessing a list of changes
Sourcepub fn collection(
&self,
id: &str,
params: Option<Vec<(&'_ str, &'_ str)>>,
) -> MMCResult<String>
pub fn collection( &self, id: &str, params: Option<Vec<(&'_ str, &'_ str)>>, ) -> MMCResult<String>
Shorthand for accessing a single collection
Sourcepub fn collections(&self, params: Vec<(&'_ str, &'_ str)>) -> MMCResult<String>
pub fn collections(&self, params: Vec<(&'_ str, &'_ str)>) -> MMCResult<String>
Shorthand for accessing a list of collections
Sourcepub fn episode(
&self,
id: &str,
params: Option<Vec<(&'_ str, &'_ str)>>,
) -> MMCResult<String>
pub fn episode( &self, id: &str, params: Option<Vec<(&'_ str, &'_ str)>>, ) -> MMCResult<String>
Shorthand for accessing a single episode
Sourcepub fn episodes(
&self,
season_id: &str,
params: Option<Vec<(&'_ str, &'_ str)>>,
) -> MMCResult<String>
pub fn episodes( &self, season_id: &str, params: Option<Vec<(&'_ str, &'_ str)>>, ) -> MMCResult<String>
Shorthand for accessing a list of episodes
Sourcepub fn franchise(
&self,
id: &str,
params: Option<Vec<(&'_ str, &'_ str)>>,
) -> MMCResult<String>
pub fn franchise( &self, id: &str, params: Option<Vec<(&'_ str, &'_ str)>>, ) -> MMCResult<String>
Shorthand for accessing a single franchise
Sourcepub fn franchises(&self, params: Vec<(&'_ str, &'_ str)>) -> MMCResult<String>
pub fn franchises(&self, params: Vec<(&'_ str, &'_ str)>) -> MMCResult<String>
Shorthand for accessing a list of franchises
Sourcepub fn season(
&self,
id: &str,
params: Option<Vec<(&'_ str, &'_ str)>>,
) -> MMCResult<String>
pub fn season( &self, id: &str, params: Option<Vec<(&'_ str, &'_ str)>>, ) -> MMCResult<String>
Shorthand for accessing a single season
Sourcepub fn seasons(
&self,
show_id: &str,
params: Option<Vec<(&'_ str, &'_ str)>>,
) -> MMCResult<String>
pub fn seasons( &self, show_id: &str, params: Option<Vec<(&'_ str, &'_ str)>>, ) -> MMCResult<String>
Shorthand for accessing a list of seasons
Sourcepub fn special(
&self,
id: &str,
params: Option<Vec<(&'_ str, &'_ str)>>,
) -> MMCResult<String>
pub fn special( &self, id: &str, params: Option<Vec<(&'_ str, &'_ str)>>, ) -> MMCResult<String>
Shorthand for accessing a single special
Sourcepub fn specials(
&self,
show_id: &str,
params: Option<Vec<(&'_ str, &'_ str)>>,
) -> MMCResult<String>
pub fn specials( &self, show_id: &str, params: Option<Vec<(&'_ str, &'_ str)>>, ) -> MMCResult<String>
Shorthand for accessing a list of specials