class Configuration

Configuration Class Doc Comment PHP version 7.4

Constants

BOOLEAN_FORMAT_INT

BOOLEAN_FORMAT_STRING

Properties

protected string[] $apiKeys

Associate array to store API key(s)

protected string[] $apiKeyPrefixes

Associate array to store API prefix (e.g. Bearer)

protected string $accessToken

Access token for OAuth/Bearer authentication

protected string $booleanFormatForQueryString

Boolean format for query string

protected string $username

Username for HTTP basic authentication

protected string $password

Password for HTTP basic authentication

protected string $host

The host

protected string $userAgent

User agent of the HTTP request, set to "OpenAPI-Generator/{version}/PHP" by default

protected bool $debug

Debug switch (default set to false)

protected string $debugFile

Debug file location (log to STDOUT by default)

protected string $tempFolderPath

Debug file location (log to STDOUT by default)

Methods

__construct()

Constructor

$this
setApiKey(string $apiKeyIdentifier, string $key)

Sets API key

null|string
getApiKey(string $apiKeyIdentifier)

Gets API key

$this
setApiKeyPrefix(string $apiKeyIdentifier, string $prefix)

Sets the prefix for API key (e.g. Bearer)

null|string
getApiKeyPrefix(string $apiKeyIdentifier)

Gets API key prefix

$this
setAccessToken(string $accessToken)

Sets the access token for OAuth

string
getAccessToken()

Gets the access token for OAuth

$this
setBooleanFormatForQueryString(string $booleanFormat)

Sets boolean format for query string.

string
getBooleanFormatForQueryString()

Gets boolean format for query string.

$this
setUsername(string $username)

Sets the username for HTTP basic authentication

string
getUsername()

Gets the username for HTTP basic authentication

$this
setPassword(string $password)

Sets the password for HTTP basic authentication

string
getPassword()

Gets the password for HTTP basic authentication

$this
setHost(string $host)

Sets the host

string
getHost()

Gets the host

$this
setUserAgent(string $userAgent)

Sets the user agent of the api client

string
getUserAgent()

Gets the user agent of the api client

$this
setDebug(bool $debug)

Sets debug flag

bool
getDebug()

Gets the debug flag

$this
setDebugFile(string $debugFile)

Sets the debug file

string
getDebugFile()

Gets the debug file

$this
setTempFolderPath(string $tempFolderPath)

Sets the temp folder path

string
getTempFolderPath()

Gets the temp folder path

static Configuration
getDefaultConfiguration()

Gets the default configuration instance

static void
setDefaultConfiguration(Configuration $config)

Sets the default configuration instance

static string
toDebugReport()

Gets the essential information for debugging

null|string
getApiKeyWithPrefix(string $apiKeyIdentifier)

Get API key (with prefix if set)

array
getHostSettings()

Returns an array of host settings

static string
getHostString(array $hostsSettings, int $hostIndex, array $variables = null)

Returns URL based on host settings, index and variables

string
getHostFromSettings(int $index, array|null $variables = null)

Returns URL based on the index and variables

Details

at line 129
__construct()

Constructor

at line 142
$this setApiKey(string $apiKeyIdentifier, string $key)

Sets API key

Parameters

string $apiKeyIdentifier

API key identifier (authentication scheme)

string $key

API key or token

Return Value

$this

at line 155
null|string getApiKey(string $apiKeyIdentifier)

Gets API key

Parameters

string $apiKeyIdentifier

API key identifier (authentication scheme)

Return Value

null|string

API key or token

at line 168
$this setApiKeyPrefix(string $apiKeyIdentifier, string $prefix)

Sets the prefix for API key (e.g. Bearer)

Parameters

string $apiKeyIdentifier

API key identifier (authentication scheme)

string $prefix

API key prefix, e.g. Bearer

Return Value

$this

at line 181
null|string getApiKeyPrefix(string $apiKeyIdentifier)

Gets API key prefix

Parameters

string $apiKeyIdentifier

API key identifier (authentication scheme)

Return Value

null|string

at line 193
$this setAccessToken(string $accessToken)

Sets the access token for OAuth

Parameters

string $accessToken

Token for OAuth

Return Value

$this

at line 204
string getAccessToken()

Gets the access token for OAuth

Return Value

string

Access token for OAuth

at line 216
$this setBooleanFormatForQueryString(string $booleanFormat)

Sets boolean format for query string.

Parameters

string $booleanFormat

Return Value

$this

at line 228
string getBooleanFormatForQueryString()

Gets boolean format for query string.

Return Value

string

Boolean format for query string

at line 240
$this setUsername(string $username)

Sets the username for HTTP basic authentication

Parameters

string $username

Username for HTTP basic authentication

Return Value

$this

at line 251
string getUsername()

Gets the username for HTTP basic authentication

Return Value

string

Username for HTTP basic authentication

at line 263
$this setPassword(string $password)

Sets the password for HTTP basic authentication

Parameters

string $password

Password for HTTP basic authentication

Return Value

$this

at line 274
string getPassword()

Gets the password for HTTP basic authentication

Return Value

string

Password for HTTP basic authentication

at line 286
$this setHost(string $host)

Sets the host

Parameters

string $host Host

Return Value

$this

at line 297
string getHost()

Gets the host

Return Value

string Host

at line 310
$this setUserAgent(string $userAgent)

Sets the user agent of the api client

Parameters

string $userAgent

the user agent of the api client

Return Value

$this

Exceptions

InvalidArgumentException

at line 325
string getUserAgent()

Gets the user agent of the api client

Return Value

string

user agent

at line 337
$this setDebug(bool $debug)

Sets debug flag

Parameters

bool $debug

Debug flag

Return Value

$this

at line 348
bool getDebug()

Gets the debug flag

Return Value

bool

at line 360
$this setDebugFile(string $debugFile)

Sets the debug file

Parameters

string $debugFile

Debug file

Return Value

$this

at line 371
string getDebugFile()

Gets the debug file

Return Value

string

at line 383
$this setTempFolderPath(string $tempFolderPath)

Sets the temp folder path

Parameters

string $tempFolderPath

Temp folder path

Return Value

$this

at line 394
string getTempFolderPath()

Gets the temp folder path

Return Value

string

Temp folder path

at line 404
static Configuration getDefaultConfiguration()

Gets the default configuration instance

Return Value

Configuration

at line 420
static void setDefaultConfiguration(Configuration $config)

Sets the default configuration instance

Parameters

Configuration $config

An instance of the Configuration Object

Return Value

void

at line 430
static string toDebugReport()

Gets the essential information for debugging

Return Value

string

The report for debugging

at line 448
null|string getApiKeyWithPrefix(string $apiKeyIdentifier)

Get API key (with prefix if set)

Parameters

string $apiKeyIdentifier

name of apikey

Return Value

null|string

API key with the prefix

at line 471
array getHostSettings()

Returns an array of host settings

Return Value

array

an array of host settings

at line 489
static string getHostString(array $hostsSettings, int $hostIndex, array $variables = null)

Returns URL based on host settings, index and variables

Parameters

array $hostsSettings
int $hostIndex

index of the host settings

array $variables

hash of variable and the corresponding value (optional)

Return Value

string

URL based on host settings

at line 527
string getHostFromSettings(int $index, array|null $variables = null)

Returns URL based on the index and variables

Parameters

int $index

index of the host settings

array|null $variables

hash of variable and the corresponding value (optional)

Return Value

string

URL based on host settings