[−][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.
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]
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]
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]
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]
&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]
Search for any data.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Client
[src]
impl Send for Client
[src]
impl Sync for Client
[src]
impl Unpin for Client
[src]
impl !UnwindSafe for Client
[src]
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[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.
pub 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.
pub 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>,