View Source Squeeze.Fitbit.ClientBehaviour behaviour (OpenPace v0.0.1)
Behaviour module defining callbacks for Fitbit API client operations.
Link to this section Summary
Callbacks
Creates a subscription for a user's activities
Gets list of activities with optional parameters
Gets TCX data for a specific activity
Gets daily activity summary for a specific date
Gets the logged in user's profile information
Creates a new Tesla client from a Credential struct
Creates a new Tesla client from an access token and options
Sets the authorization header with a new access token
Link to this section Types
@type access_token() :: String.t()
@type activity_data() :: map()
@type client() :: Tesla.Client.t()
@type date() :: String.t()
@type log_id() :: String.t()
@type opts() :: keyword()
@type subscription_result() :: {:ok, :created} | {:ok, :exists} | {:error, :unauthorized | :unknown | any()}
@type user_data() :: map()
@type user_id() :: String.t()
Link to this section Callbacks
@callback create_subscription(client(), user_id()) :: subscription_result()
Creates a subscription for a user's activities
@callback get_activities(client(), opts()) :: {:ok, Tesla.Env.t()} | {:error, any()}
Gets list of activities with optional parameters
@callback get_activity_tcx(client(), log_id()) :: {:ok, Tesla.Env.t()} | {:error, any()}
Gets TCX data for a specific activity
@callback get_daily_activity_summary(client(), date()) :: {:ok, Tesla.Env.t()} | {:error, any()}
Gets daily activity summary for a specific date
Gets the logged in user's profile information
@callback new(Squeeze.Accounts.Credential.t()) :: client()
Creates a new Tesla client from a Credential struct
@callback new(access_token(), opts()) :: client()
Creates a new Tesla client from an access token and options
@callback set_authorization_header(Tesla.Env.t(), access_token()) :: Tesla.Env.t()
Sets the authorization header with a new access token