[−][src]Struct letterboxd::Client
Letterboxd asynchronous client.
Client is created from given api key pair either
- by authenticating using a username/password,
- with a token (all API calls will be authenticated),
- without a token (no API calls will be authenticated; calls that require authentication will fail).
Note: Not all APIs are implemented. Feel free to contribute implementation for missing endpoints. The implementation is usually very straight forward.
Methods
impl Client
[src]
pub fn new(api_key_pair: ApiKeyPair) -> Self
[src]
Creates a new client without authentication.
pub fn with_token(api_key_pair: ApiKeyPair, token: AccessToken) -> Self
[src]
Crates a new client from a given token.
It is not checked that the token is valid.
pub async fn authenticate<'_, '_>(
api_key_pair: ApiKeyPair,
username: &'_ str,
password: &'_ str
) -> Result<Self>
[src]
api_key_pair: ApiKeyPair,
username: &'_ str,
password: &'_ str
) -> Result<Self>
Authenticates and creates a new client from given username/password.
pub fn is_authenticated(&self) -> bool
[src]
Returns if the client has a token.
This method does not check that the token is valid.
pub fn token(&self) -> Option<&AccessToken>
[src]
Returns the token used for authentication.
pub fn set_token(&mut self, token: Option<AccessToken>)
[src]
Sets a new token which will be used for authentication.
Setting None
disables authentication.
pub async fn films<'_, '_>(
&'_ self,
request: &'_ FilmsRequest
) -> Result<FilmsResponse>
[src]
&'_ self,
request: &'_ FilmsRequest
) -> Result<FilmsResponse>
A cursored window over the list of films.
Use the ‘next’ cursor to move through the list. The response will include the film relationships for the signed-in member and the member indicated by the member LID if specified.
pub async fn film_services<'_>(&'_ self) -> Result<FilmServicesResponse>
[src]
Get a list of services supported by the /films endpoint.
Services are returned in alphabetical order. Some services are only available to paying members, so results will vary based on the authenticated member’s status.
pub async fn film_genres<'_>(&'_ self) -> Result<GenresResponse>
[src]
Get a list of genres supported by the films
function.
Genres are returned in alphabetical order.
pub async fn film<'_, '_>(&'_ self, id: &'_ str) -> Result<Film>
[src]
Get details about a film by ID.
pub async fn film_availability<'_, '_>(
&'_ self,
id: &'_ str
) -> Result<FilmAvailabilityResponse>
[src]
&'_ self,
id: &'_ str
) -> Result<FilmAvailabilityResponse>
Get availability data about a film by ID.
pub async fn film_relationship<'_, '_>(
&'_ self,
id: &'_ str
) -> Result<FilmAvailabilityResponse>
[src]
&'_ self,
id: &'_ str
) -> Result<FilmAvailabilityResponse>
Get details of the authenticated member’s relationship with a film by ID.
pub async fn update_film_relationship<'_, '_, '_>(
&'_ self,
id: &'_ str,
request: &'_ FilmRelationshipUpdateRequest
) -> Result<FilmRelationshipUpdateResponse>
[src]
&'_ self,
id: &'_ str,
request: &'_ FilmRelationshipUpdateRequest
) -> Result<FilmRelationshipUpdateResponse>
Update the authenticated member’s relationship with a film by ID.
pub async fn film_relationship_members<'_, '_, '_>(
&'_ self,
id: &'_ str,
request: &'_ MemberFilmRelationshipsRequest
) -> Result<MemberFilmRelationshipsResponse>
[src]
&'_ self,
id: &'_ str,
request: &'_ MemberFilmRelationshipsRequest
) -> Result<MemberFilmRelationshipsResponse>
Get details of the authenticated member’s relationship with a film by ID.
pub async fn film_statistics<'_, '_>(
&'_ self,
id: &'_ str
) -> Result<FilmStatistics>
[src]
&'_ self,
id: &'_ str
) -> Result<FilmStatistics>
Get statistical data about a film by ID.
pub async fn lists<'_, '_>(
&'_ self,
request: &'_ ListsRequest
) -> Result<ListsResponse>
[src]
&'_ self,
request: &'_ ListsRequest
) -> Result<ListsResponse>
A cursored window over a list of lists.
Use the ‘next’ cursor to move through the list.
pub async fn create_list<'_, '_>(
&'_ self,
request: &'_ ListCreationRequest
) -> Result<ListCreateResponse>
[src]
&'_ self,
request: &'_ ListCreationRequest
) -> Result<ListCreateResponse>
Create a list.
pub async fn list<'_, '_>(&'_ self, id: &'_ str) -> Result<List>
[src]
Get details of a list by ID.
pub async fn update_list<'_, '_, '_>(
&'_ self,
id: &'_ str,
request: &'_ ListUpdateRequest
) -> Result<ListUpdateResponse>
[src]
&'_ self,
id: &'_ str,
request: &'_ ListUpdateRequest
) -> Result<ListUpdateResponse>
Update a list by ID.
pub async fn delete_list<'_, '_>(&'_ self, id: &'_ str) -> Result<()>
[src]
Delete a list by ID.
pub async fn list_entries<'_, '_, '_>(
&'_ self,
id: &'_ str,
request: &'_ ListEntriesRequest
) -> Result<ListEntriesResponse>
[src]
&'_ self,
id: &'_ str,
request: &'_ ListEntriesRequest
) -> Result<ListEntriesResponse>
Get entries for a list by ID.
pub async fn search<'_, '_>(
&'_ self,
request: &'_ SearchRequest
) -> Result<SearchResponse>
[src]
&'_ self,
request: &'_ SearchRequest
) -> Result<SearchResponse>
Search for any data.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,