FreshBooksClientConfig
in package
Configuration object for FreshBooks API Client
Table of Contents
Constants
- API_BASE_URL = "https://api.freshbooks.com"
- AUTH_BASE_URL = "https://auth.freshbooks.com"
- DEFAULT_TIMEOUT = 30
Properties
- $accessToken : string|null
- $apiBaseUrl : string
- $authBaseUrl : string
- $autoRetry : bool
- $clientId : string|null
- $clientSecret : string|null
- $redirectUri : string|null
- $refreshToken : string|null
- $retries : int
- $timeout : int
- $tokenExpiresAt : DateTimeImmutable|null
- $userAgent : string|null
- $version : string
Methods
- __construct() : void
- __construct
- getUserAgent() : string
- Get the userAgent for requests. If this is not set, the default will be set and returned.
- getVersion() : string
- Get the library version.
Constants
API_BASE_URL
private
mixed
API_BASE_URL
= "https://api.freshbooks.com"
AUTH_BASE_URL
private
mixed
AUTH_BASE_URL
= "https://auth.freshbooks.com"
DEFAULT_TIMEOUT
private
mixed
DEFAULT_TIMEOUT
= 30
Properties
$accessToken
public
string|null
$accessToken
$apiBaseUrl
public
string
$apiBaseUrl
$authBaseUrl
public
string
$authBaseUrl
$autoRetry
public
bool
$autoRetry
$clientId
public
string|null
$clientId
$clientSecret
public
string|null
$clientSecret
$redirectUri
public
string|null
$redirectUri
$refreshToken
public
string|null
$refreshToken
$retries
public
int
$retries
$timeout
public
int
$timeout
$tokenExpiresAt
public
DateTimeImmutable|null
$tokenExpiresAt
$userAgent
public
string|null
$userAgent
$version
public
string
$version
Methods
__construct()
__construct
public
__construct([string|null $clientSecret = null ][, string|null $redirectUri = null ][, string|null $accessToken = null ][, string|null $refreshToken = null ][, string|null $userAgent = null ][, bool $autoRetry = true ][, int $retries = 3 ][, int $timeout = self::DEFAULT_TIMEOUT ]) : void
Parameters
- $clientSecret : string|null = null
- $redirectUri : string|null = null
- $accessToken : string|null = null
- $refreshToken : string|null = null
- $userAgent : string|null = null
- $autoRetry : bool = true
- $retries : int = 3
- $timeout : int = self::DEFAULT_TIMEOUT
getUserAgent()
Get the userAgent for requests. If this is not set, the default will be set and returned.
public
getUserAgent() : string
Return values
stringgetVersion()
Get the library version.
private
getVersion() : string