MindeeApi
in package
Data class containing settings for endpoints.
Table of Contents
Properties
- $accountName : string
- $apiKey : string|null
- $baseUrl : string
- $endpointName : string
- $requestTimeout : int
- $urlRoot : string
- $version : string
Methods
- __construct() : mixed
- setApiKey() : void
- Sets the API key.
- setBaseUrl() : void
- Sets the base url.
- setFromEnv() : void
- Sets values from environment if needed.
- setTimeout() : void
- Sets the default timeout.
Properties
$accountName
public
string
$accountName
Name of the owner of an endpoint. Is equals to 'mindee' for off-the-shelf APIs.
$apiKey
public
string|null
$apiKey
API key.
$baseUrl
public
string
$baseUrl
Base for the root url. Used for testing purposes.
$endpointName
public
string
$endpointName
Name of the endpoint.
$requestTimeout
public
int
$requestTimeout
Timeout for the request, in ms.
$urlRoot
public
string
$urlRoot
Root of the URL to use for API calls.
$version
public
string
$version
Version of the endpoint.
Methods
__construct()
public
__construct(string|null $apiKey, string $endpointName[, string|null $accountName = Client::DEFAULT_OWNER ][, string|null $version = "1" ]) : mixed
Parameters
- $apiKey : string|null
-
API key.
- $endpointName : string
-
Name of the endpoint.
- $accountName : string|null = Client::DEFAULT_OWNER
-
Name of the endpoint's owner.
- $version : string|null = "1"
-
Version of the endpoint.
Tags
setApiKey()
Sets the API key.
private
setApiKey([string|null $apiKey = null ]) : void
Parameters
- $apiKey : string|null = null
-
Optional API key.
setBaseUrl()
Sets the base url.
private
setBaseUrl(string $value) : void
Parameters
- $value : string
-
Value for the base Url.
setFromEnv()
Sets values from environment if needed.
private
setFromEnv() : void
setTimeout()
Sets the default timeout.
private
setTimeout(string $value) : void
Parameters
- $value : string
-
Value for the CURL timeout.