tesla-0.1.0.0: Tesla API client.

Safe HaskellNone
LanguageHaskell2010

Tesla

Description

Tesla is intended to provide access to all known Tesla APIs as documented at https://tesla-api.timdorr.com/

Synopsis

Documentation

authenticate :: AuthInfo -> IO AuthResponse Source #

Authenticate to the Tesla service.

refreshAuth :: AuthInfo -> AuthResponse -> IO AuthResponse Source #

Refresh authentication credentials using a refresh token.

data AuthResponse Source #

An Authentication response.

Instances
Show AuthResponse Source # 
Instance details

Defined in Tesla

Generic AuthResponse Source # 
Instance details

Defined in Tesla

Associated Types

type Rep AuthResponse :: Type -> Type #

FromJSON AuthResponse Source # 
Instance details

Defined in Tesla

type Rep AuthResponse Source # 
Instance details

Defined in Tesla

type Rep AuthResponse = D1 (MetaData "AuthResponse" "Tesla" "tesla-0.1.0.0-JB5wsXtyQxgGsyRjC0YcSi" False) (C1 (MetaCons "AuthResponse" PrefixI True) (S1 (MetaSel (Just "_access_token") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String) :*: (S1 (MetaSel (Just "_expires_in") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int) :*: S1 (MetaSel (Just "_refresh_token") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String))))

data AuthInfo Source #

An Authentication request.

Instances
Show AuthInfo Source # 
Instance details

Defined in Tesla

vehicles :: MonadIO m => AuthInfo -> m (Map Text Text) Source #

Get a mapping of vehicle name to vehicle ID.

fromToken :: String -> AuthInfo Source #

Get an AuthInfo instance from a bearer token.

authOpts :: AuthInfo -> Options Source #

Get a set of wreq options from an AuthInfo.