Skip to content
42 changes: 23 additions & 19 deletions Dataflow/src/V1beta3/Client/FlexTemplatesServiceClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
use Google\ApiCore\ApiException;
use Google\ApiCore\CredentialsWrapper;
use Google\ApiCore\GapicClientTrait;
use Google\ApiCore\Options\ClientOptions;
use Google\ApiCore\RetrySettings;
use Google\ApiCore\Transport\TransportInterface;
use Google\ApiCore\ValidationException;
Expand Down Expand Up @@ -99,25 +100,28 @@ private static function getClientDefaults()
/**
* 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 'dataflow.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\Dataflow\V1beta3\FlexTemplatesServiceClient;
* $creds = new ServiceAccountCredentials($scopes, $json);
* $options = new FlexTemplatesServiceClient(['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 @@ -155,13 +159,15 @@ private static function getClientDefaults()
* @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
*
* @experimental
*/
public function __construct(array $options = [])
public function __construct(array|ClientOptions $options = [])
{
$clientOptions = $this->buildClientOptions($options);
$this->setClientOptions($clientOptions);
Expand Down Expand Up @@ -202,10 +208,8 @@ public function __call($method, $args)
*
* @experimental
*/
public function launchFlexTemplate(
LaunchFlexTemplateRequest $request,
array $callOptions = []
): LaunchFlexTemplateResponse {
public function launchFlexTemplate(LaunchFlexTemplateRequest $request, array $callOptions = []): LaunchFlexTemplateResponse
{
return $this->startApiCall('LaunchFlexTemplate', $request, $callOptions)->wait();
}
}
36 changes: 21 additions & 15 deletions Dataflow/src/V1beta3/Client/JobsV1Beta3Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,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\RetrySettings;
use Google\ApiCore\Transport\TransportInterface;
Expand Down Expand Up @@ -114,25 +115,28 @@ private static function getClientDefaults()
/**
* 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 'dataflow.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\Dataflow\V1beta3\JobsV1Beta3Client;
* $creds = new ServiceAccountCredentials($scopes, $json);
* $options = new JobsV1Beta3Client(['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 @@ -170,13 +174,15 @@ private static function getClientDefaults()
* @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
*
* @experimental
*/
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 Dataflow/src/V1beta3/Client/MessagesV1Beta3Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,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\RetrySettings;
use Google\ApiCore\Transport\TransportInterface;
Expand Down Expand Up @@ -100,25 +101,28 @@ private static function getClientDefaults()
/**
* 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 'dataflow.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\Dataflow\V1beta3\MessagesV1Beta3Client;
* $creds = new ServiceAccountCredentials($scopes, $json);
* $options = new MessagesV1Beta3Client(['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 @@ -156,13 +160,15 @@ private static function getClientDefaults()
* @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
*
* @experimental
*/
public function __construct(array $options = [])
public function __construct(array|ClientOptions $options = [])
{
$clientOptions = $this->buildClientOptions($options);
$this->setClientOptions($clientOptions);
Expand Down
48 changes: 25 additions & 23 deletions Dataflow/src/V1beta3/Client/MetricsV1Beta3Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,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\RetrySettings;
use Google\ApiCore\Transport\TransportInterface;
Expand Down Expand Up @@ -105,25 +106,28 @@ private static function getClientDefaults()
/**
* 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 'dataflow.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\Dataflow\V1beta3\MetricsV1Beta3Client;
* $creds = new ServiceAccountCredentials($scopes, $json);
* $options = new MetricsV1Beta3Client(['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 @@ -161,13 +165,15 @@ private static function getClientDefaults()
* @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
*
* @experimental
*/
public function __construct(array $options = [])
public function __construct(array|ClientOptions $options = [])
{
$clientOptions = $this->buildClientOptions($options);
$this->setClientOptions($clientOptions);
Expand Down Expand Up @@ -210,10 +216,8 @@ public function __call($method, $args)
*
* @experimental
*/
public function getJobExecutionDetails(
GetJobExecutionDetailsRequest $request,
array $callOptions = []
): PagedListResponse {
public function getJobExecutionDetails(GetJobExecutionDetailsRequest $request, array $callOptions = []): PagedListResponse
{
return $this->startApiCall('GetJobExecutionDetails', $request, $callOptions);
}

Expand Down Expand Up @@ -278,10 +282,8 @@ public function getJobMetrics(GetJobMetricsRequest $request, array $callOptions
*
* @experimental
*/
public function getStageExecutionDetails(
GetStageExecutionDetailsRequest $request,
array $callOptions = []
): PagedListResponse {
public function getStageExecutionDetails(GetStageExecutionDetailsRequest $request, array $callOptions = []): PagedListResponse
{
return $this->startApiCall('GetStageExecutionDetails', $request, $callOptions);
}
}
Loading
Loading