[][src]Struct letterboxd::Client

pub struct Client { /* fields omitted */ }

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.

Implementations

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]

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]

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]

Get availability data about a film by ID.

pub async fn film_relationship(
    &self,
    id: &str
) -> Result<FilmAvailabilityResponse>
[src]

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]

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]

Get details of the authenticated member’s relationship with a film by ID.

pub async fn film_statistics(&self, id: &str) -> Result<FilmStatistics>[src]

Get statistical data about a film by ID.

pub async fn lists(&self, request: &ListsRequest) -> Result<ListsResponse>[src]

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]

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]

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]

Get entries for a list by ID.

pub async fn search(&self, request: &SearchRequest) -> Result<SearchResponse>[src]

Search for any data.

Trait Implementations

impl Debug for Client[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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