The ClientOptions class adds typing to the associative array of options passed into each API client constructor. To use this class directly, pass the result of {@see \Google\ApiCore\Options\ClientOptions::toArray()} to the client constructor:
use Google\ApiCore\ClientOptions;
use Google\Cloud\SecretManager\Client\SecretManagerClient;
$options = new ClientOptions([
'credentials' => '/path/to/my/credentials.json'
]);
$secretManager = new SecretManagerClient($options->toArray());
Note: It's possible to pass an associative array to the API clients as well, as ClientOptions will still be used internally for validation.
CloneableInstantiable
| Methods |
public __construct(array $options)
|
| public offsetExists( $offset) : bool |
public offsetGet( $offset)
|
public offsetSet( $offset, $value) : void
|
public offsetUnset( $offset) : void
|
public setApiEndpoint(?string $apiEndpoint) : Google
|
public setApiKey(?string $apiKey) : Google
|
public setClientCertSource(?callable $clientCertSource) : Google
|
public setClientConfig( $clientConfig) : Google
|
public setCredentials( $credentials) : Google
|
public setCredentialsConfig(array $credentialsConfig) : Google
|
public setDisableRetries(bool $disableRetries) : Google
|
public setGapicVersion(?string $gapicVersion) : Google
|
public setLibName(?string $libName) : Google
|
public setLibVersion(?string $libVersion) : Google
|
public setLogger(Psr\Log\LoggerInterface|false|?null $logger) : Google
|
public setServiceName(?string $serviceName) : Google
|
public setTransport( $transport) : Google
|
public setTransportConfig(Google
|
public setUniverseDomain(?string $universeDomain) : Google
|
public setVersionFile(?string $versionFile) : Google
|
| public toArray() : array |
| Properties |
| private ?string $apiEndpoint |
| private ?string $apiKey |
| private ?Closure $clientCertSource |
| private array $clientConfig |
private $credentials = NULL
|
| private array $credentialsConfig |
| private ?string $descriptorsConfigPath |
| private bool $disableRetries |
| private ?string $gapicVersion |
| private ?string $libName |
| private ?string $libVersion |
| private Psr\Log\LoggerInterface|false|?null $logger |
| private ?string $serviceName |
private $transport = NULL
|
| private Google |
| private ?string $universeDomain |
| private ?string $versionFile |
| Methods |
| private fromArray(array $arr) : void Sets the array of options as class properites.
|
private setDescriptorsConfigPath(?string $descriptorsConfigPath) : Google
|
private static validateFileExists(string $filePath)
|
| Methods |
private static validateFileExists(string $filePath)
|