Skip to content
36 changes: 21 additions & 15 deletions Billing/src/V1/Client/CloudBillingClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use Google\ApiCore\ApiException;
use Google\ApiCore\CredentialsWrapper;
use Google\ApiCore\GapicClientTrait;
use Google\ApiCore\Options\ClientOptions;
use Google\ApiCore\PagedListResponse;
use Google\ApiCore\ResourceHelperTrait;
use Google\ApiCore\RetrySettings;
Expand Down Expand Up @@ -233,25 +234,28 @@ public static function parseName(string $formattedName, ?string $template = null
/**
* Constructor.
*
* @param array $options {
* @param array|ClientOptions $options {
* Optional. Options for configuring the service API wrapper.
*
* @type string $apiEndpoint
* The address of the API remote host. May optionally include the port, formatted
* as "<uri>:<port>". Default 'cloudbilling.googleapis.com:443'.
* @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials
* The credentials to be used by the client to authorize API calls. This option
* accepts either a path to a credentials file, or a decoded credentials file as a
* PHP array.
* *Advanced usage*: In addition, this option can also accept a pre-constructed
* {@see \Google\Auth\FetchAuthTokenInterface} object or
* {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these
* objects are provided, any settings in $credentialsConfig will be ignored.
* *Important*: If you accept a credential configuration (credential
* JSON/File/Stream) from an external source for authentication to Google Cloud
* Platform, you must validate it before providing it to any Google API or library.
* Providing an unvalidated credential configuration to Google APIs can compromise
* the security of your systems and data. For more information {@see
* @type FetchAuthTokenInterface|CredentialsWrapper $credentials
* This option should only be used with a pre-constructed
* {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that
* when one of these objects are provided, any settings in $credentialsConfig will
* be ignored.
* **Important**: If you are providing a path to a credentials file, or a decoded
* credentials file as a PHP array, this usage is now DEPRECATED. Providing an
* unvalidated credential configuration to Google APIs can compromise the security
* of your systems and data. It is recommended to create the credentials explicitly
* ```
* use Google\Auth\Credentials\ServiceAccountCredentials;
* use Google\Cloud\Billing\V1\CloudBillingClient;
* $creds = new ServiceAccountCredentials($scopes, $json);
* $options = new CloudBillingClient(['credentials' => $creds]);
* ```
* {@see
* https://cloud.google.com/docs/authentication/external/externally-sourced-credentials}
* @type array $credentialsConfig
* Options used to configure credentials, including auth token caching, for the
Expand Down Expand Up @@ -289,11 +293,13 @@ public static function parseName(string $formattedName, ?string $template = null
* @type false|LoggerInterface $logger
* A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the
* 'GOOGLE_SDK_PHP_LOGGING' environment flag
* @type string $universeDomain
* The service domain for the client. Defaults to 'googleapis.com'.
* }
*
* @throws ValidationException
*/
public function __construct(array $options = [])
public function __construct(array|ClientOptions $options = [])
{
$clientOptions = $this->buildClientOptions($options);
$this->setClientOptions($clientOptions);
Expand Down
36 changes: 21 additions & 15 deletions Billing/src/V1/Client/CloudCatalogClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use Google\ApiCore\ApiException;
use Google\ApiCore\CredentialsWrapper;
use Google\ApiCore\GapicClientTrait;
use Google\ApiCore\Options\ClientOptions;
use Google\ApiCore\PagedListResponse;
use Google\ApiCore\ResourceHelperTrait;
use Google\ApiCore\RetrySettings;
Expand Down Expand Up @@ -146,25 +147,28 @@ public static function parseName(string $formattedName, ?string $template = null
/**
* Constructor.
*
* @param array $options {
* @param array|ClientOptions $options {
* Optional. Options for configuring the service API wrapper.
*
* @type string $apiEndpoint
* The address of the API remote host. May optionally include the port, formatted
* as "<uri>:<port>". Default 'cloudbilling.googleapis.com:443'.
* @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials
* The credentials to be used by the client to authorize API calls. This option
* accepts either a path to a credentials file, or a decoded credentials file as a
* PHP array.
* *Advanced usage*: In addition, this option can also accept a pre-constructed
* {@see \Google\Auth\FetchAuthTokenInterface} object or
* {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these
* objects are provided, any settings in $credentialsConfig will be ignored.
* *Important*: If you accept a credential configuration (credential
* JSON/File/Stream) from an external source for authentication to Google Cloud
* Platform, you must validate it before providing it to any Google API or library.
* Providing an unvalidated credential configuration to Google APIs can compromise
* the security of your systems and data. For more information {@see
* @type FetchAuthTokenInterface|CredentialsWrapper $credentials
* This option should only be used with a pre-constructed
* {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that
* when one of these objects are provided, any settings in $credentialsConfig will
* be ignored.
* **Important**: If you are providing a path to a credentials file, or a decoded
* credentials file as a PHP array, this usage is now DEPRECATED. Providing an
* unvalidated credential configuration to Google APIs can compromise the security
* of your systems and data. It is recommended to create the credentials explicitly
* ```
* use Google\Auth\Credentials\ServiceAccountCredentials;
* use Google\Cloud\Billing\V1\CloudCatalogClient;
* $creds = new ServiceAccountCredentials($scopes, $json);
* $options = new CloudCatalogClient(['credentials' => $creds]);
* ```
* {@see
* https://cloud.google.com/docs/authentication/external/externally-sourced-credentials}
* @type array $credentialsConfig
* Options used to configure credentials, including auth token caching, for the
Expand Down Expand Up @@ -202,11 +206,13 @@ public static function parseName(string $formattedName, ?string $template = null
* @type false|LoggerInterface $logger
* A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the
* 'GOOGLE_SDK_PHP_LOGGING' environment flag
* @type string $universeDomain
* The service domain for the client. Defaults to 'googleapis.com'.
* }
*
* @throws ValidationException
*/
public function __construct(array $options = [])
public function __construct(array|ClientOptions $options = [])
{
$clientOptions = $this->buildClientOptions($options);
$this->setClientOptions($clientOptions);
Expand Down
36 changes: 21 additions & 15 deletions BillingBudgets/src/V1/Client/BudgetServiceClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use Google\ApiCore\ApiException;
use Google\ApiCore\CredentialsWrapper;
use Google\ApiCore\GapicClientTrait;
use Google\ApiCore\Options\ClientOptions;
use Google\ApiCore\PagedListResponse;
use Google\ApiCore\ResourceHelperTrait;
use Google\ApiCore\RetrySettings;
Expand Down Expand Up @@ -169,25 +170,28 @@ public static function parseName(string $formattedName, ?string $template = null
/**
* Constructor.
*
* @param array $options {
* @param array|ClientOptions $options {
* Optional. Options for configuring the service API wrapper.
*
* @type string $apiEndpoint
* The address of the API remote host. May optionally include the port, formatted
* as "<uri>:<port>". Default 'billingbudgets.googleapis.com:443'.
* @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials
* The credentials to be used by the client to authorize API calls. This option
* accepts either a path to a credentials file, or a decoded credentials file as a
* PHP array.
* *Advanced usage*: In addition, this option can also accept a pre-constructed
* {@see \Google\Auth\FetchAuthTokenInterface} object or
* {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these
* objects are provided, any settings in $credentialsConfig will be ignored.
* *Important*: If you accept a credential configuration (credential
* JSON/File/Stream) from an external source for authentication to Google Cloud
* Platform, you must validate it before providing it to any Google API or library.
* Providing an unvalidated credential configuration to Google APIs can compromise
* the security of your systems and data. For more information {@see
* @type FetchAuthTokenInterface|CredentialsWrapper $credentials
* This option should only be used with a pre-constructed
* {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that
* when one of these objects are provided, any settings in $credentialsConfig will
* be ignored.
* **Important**: If you are providing a path to a credentials file, or a decoded
* credentials file as a PHP array, this usage is now DEPRECATED. Providing an
* unvalidated credential configuration to Google APIs can compromise the security
* of your systems and data. It is recommended to create the credentials explicitly
* ```
* use Google\Auth\Credentials\ServiceAccountCredentials;
* use Google\Cloud\Billing\Budgets\V1\BudgetServiceClient;
* $creds = new ServiceAccountCredentials($scopes, $json);
* $options = new BudgetServiceClient(['credentials' => $creds]);
* ```
* {@see
* https://cloud.google.com/docs/authentication/external/externally-sourced-credentials}
* @type array $credentialsConfig
* Options used to configure credentials, including auth token caching, for the
Expand Down Expand Up @@ -225,11 +229,13 @@ public static function parseName(string $formattedName, ?string $template = null
* @type false|LoggerInterface $logger
* A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the
* 'GOOGLE_SDK_PHP_LOGGING' environment flag
* @type string $universeDomain
* The service domain for the client. Defaults to 'googleapis.com'.
* }
*
* @throws ValidationException
*/
public function __construct(array $options = [])
public function __construct(array|ClientOptions $options = [])
{
$clientOptions = $this->buildClientOptions($options);
$this->setClientOptions($clientOptions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use Google\ApiCore\ApiException;
use Google\ApiCore\CredentialsWrapper;
use Google\ApiCore\GapicClientTrait;
use Google\ApiCore\Options\ClientOptions;
use Google\ApiCore\PagedListResponse;
use Google\ApiCore\ResourceHelperTrait;
use Google\ApiCore\RetrySettings;
Expand Down Expand Up @@ -225,25 +226,28 @@ public static function parseName(string $formattedName, ?string $template = null
/**
* Constructor.
*
* @param array $options {
* @param array|ClientOptions $options {
* Optional. Options for configuring the service API wrapper.
*
* @type string $apiEndpoint
* The address of the API remote host. May optionally include the port, formatted
* as "<uri>:<port>". Default 'binaryauthorization.googleapis.com:443'.
* @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials
* The credentials to be used by the client to authorize API calls. This option
* accepts either a path to a credentials file, or a decoded credentials file as a
* PHP array.
* *Advanced usage*: In addition, this option can also accept a pre-constructed
* {@see \Google\Auth\FetchAuthTokenInterface} object or
* {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these
* objects are provided, any settings in $credentialsConfig will be ignored.
* *Important*: If you accept a credential configuration (credential
* JSON/File/Stream) from an external source for authentication to Google Cloud
* Platform, you must validate it before providing it to any Google API or library.
* Providing an unvalidated credential configuration to Google APIs can compromise
* the security of your systems and data. For more information {@see
* @type FetchAuthTokenInterface|CredentialsWrapper $credentials
* This option should only be used with a pre-constructed
* {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that
* when one of these objects are provided, any settings in $credentialsConfig will
* be ignored.
* **Important**: If you are providing a path to a credentials file, or a decoded
* credentials file as a PHP array, this usage is now DEPRECATED. Providing an
* unvalidated credential configuration to Google APIs can compromise the security
* of your systems and data. It is recommended to create the credentials explicitly
* ```
* use Google\Auth\Credentials\ServiceAccountCredentials;
* use Google\Cloud\BinaryAuthorization\V1\BinauthzManagementServiceV1Client;
* $creds = new ServiceAccountCredentials($scopes, $json);
* $options = new BinauthzManagementServiceV1Client(['credentials' => $creds]);
* ```
* {@see
* https://cloud.google.com/docs/authentication/external/externally-sourced-credentials}
* @type array $credentialsConfig
* Options used to configure credentials, including auth token caching, for the
Expand Down Expand Up @@ -281,11 +285,13 @@ public static function parseName(string $formattedName, ?string $template = null
* @type false|LoggerInterface $logger
* A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the
* 'GOOGLE_SDK_PHP_LOGGING' environment flag
* @type string $universeDomain
* The service domain for the client. Defaults to 'googleapis.com'.
* }
*
* @throws ValidationException
*/
public function __construct(array $options = [])
public function __construct(array|ClientOptions $options = [])
{
$clientOptions = $this->buildClientOptions($options);
$this->setClientOptions($clientOptions);
Expand Down
36 changes: 21 additions & 15 deletions BinaryAuthorization/src/V1/Client/SystemPolicyV1Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use Google\ApiCore\ApiException;
use Google\ApiCore\CredentialsWrapper;
use Google\ApiCore\GapicClientTrait;
use Google\ApiCore\Options\ClientOptions;
use Google\ApiCore\ResourceHelperTrait;
use Google\ApiCore\RetrySettings;
use Google\ApiCore\Transport\TransportInterface;
Expand Down Expand Up @@ -170,25 +171,28 @@ public static function parseName(string $formattedName, ?string $template = null
/**
* Constructor.
*
* @param array $options {
* @param array|ClientOptions $options {
* Optional. Options for configuring the service API wrapper.
*
* @type string $apiEndpoint
* The address of the API remote host. May optionally include the port, formatted
* as "<uri>:<port>". Default 'binaryauthorization.googleapis.com:443'.
* @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials
* The credentials to be used by the client to authorize API calls. This option
* accepts either a path to a credentials file, or a decoded credentials file as a
* PHP array.
* *Advanced usage*: In addition, this option can also accept a pre-constructed
* {@see \Google\Auth\FetchAuthTokenInterface} object or
* {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these
* objects are provided, any settings in $credentialsConfig will be ignored.
* *Important*: If you accept a credential configuration (credential
* JSON/File/Stream) from an external source for authentication to Google Cloud
* Platform, you must validate it before providing it to any Google API or library.
* Providing an unvalidated credential configuration to Google APIs can compromise
* the security of your systems and data. For more information {@see
* @type FetchAuthTokenInterface|CredentialsWrapper $credentials
* This option should only be used with a pre-constructed
* {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that
* when one of these objects are provided, any settings in $credentialsConfig will
* be ignored.
* **Important**: If you are providing a path to a credentials file, or a decoded
* credentials file as a PHP array, this usage is now DEPRECATED. Providing an
* unvalidated credential configuration to Google APIs can compromise the security
* of your systems and data. It is recommended to create the credentials explicitly
* ```
* use Google\Auth\Credentials\ServiceAccountCredentials;
* use Google\Cloud\BinaryAuthorization\V1\SystemPolicyV1Client;
* $creds = new ServiceAccountCredentials($scopes, $json);
* $options = new SystemPolicyV1Client(['credentials' => $creds]);
* ```
* {@see
* https://cloud.google.com/docs/authentication/external/externally-sourced-credentials}
* @type array $credentialsConfig
* Options used to configure credentials, including auth token caching, for the
Expand Down Expand Up @@ -226,11 +230,13 @@ public static function parseName(string $formattedName, ?string $template = null
* @type false|LoggerInterface $logger
* A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the
* 'GOOGLE_SDK_PHP_LOGGING' environment flag
* @type string $universeDomain
* The service domain for the client. Defaults to 'googleapis.com'.
* }
*
* @throws ValidationException
*/
public function __construct(array $options = [])
public function __construct(array|ClientOptions $options = [])
{
$clientOptions = $this->buildClientOptions($options);
$this->setClientOptions($clientOptions);
Expand Down
Loading
Loading