Skip to content

Commit aa4559f

Browse files
feat: [Many APIs] usage deprecation of credentials client option (#8602)
* feat: support ClientOptions in client constructor docs: document universeDomain client option docs: add "generic" phpdocs for OperationResponse and ServerStream fix: Update pagination rules for compute clients deps: Update dependency google/protobuf to v4 PiperOrigin-RevId: 807444648 Source-Link: googleapis/googleapis@6288882 Source-Link: googleapis/googleapis-gen@577eee9 Copy-Tag: eyJwIjoiTmV0d29ya01hbmFnZW1lbnQvLk93bEJvdC55YW1sIiwiaCI6IjU3N2VlZTkzMWI3M2U5MTBmZmFlMWIxNzBmNmY5ZjhiZDc5NzVhMzYifQ== Copy-Tag: eyJwIjoiTmV0d29ya1NlY3VyaXR5Ly5Pd2xCb3QueWFtbCIsImgiOiI1NzdlZWU5MzFiNzNlOTEwZmZhZTFiMTcwZjZmOWY4YmQ3OTc1YTM2In0= Copy-Tag: eyJwIjoiTmV0d29ya1NlcnZpY2VzLy5Pd2xCb3QueWFtbCIsImgiOiI1NzdlZWU5MzFiNzNlOTEwZmZhZTFiMTcwZjZmOWY4YmQ3OTc1YTM2In0= Copy-Tag: eyJwIjoiTm90ZWJvb2tzLy5Pd2xCb3QueWFtbCIsImgiOiI1NzdlZWU5MzFiNzNlOTEwZmZhZTFiMTcwZjZmOWY4YmQ3OTc1YTM2In0= Copy-Tag: eyJwIjoiT3B0aW1pemF0aW9uLy5Pd2xCb3QueWFtbCIsImgiOiI1NzdlZWU5MzFiNzNlOTEwZmZhZTFiMTcwZjZmOWY4YmQ3OTc1YTM2In0= Copy-Tag: eyJwIjoiT3JhY2xlRGF0YWJhc2UvLk93bEJvdC55YW1sIiwiaCI6IjU3N2VlZTkzMWI3M2U5MTBmZmFlMWIxNzBmNmY5ZjhiZDc5NzVhMzYifQ== Copy-Tag: eyJwIjoiT3JjaGVzdHJhdGlvbkFpcmZsb3cvLk93bEJvdC55YW1sIiwiaCI6IjU3N2VlZTkzMWI3M2U5MTBmZmFlMWIxNzBmNmY5ZjhiZDc5NzVhMzYifQ== Copy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NzBmNmY5ZjhiZDc5NzVhMzYifQ== Copy-Tag: eyJwIjoiUHJpdmlsZWdlZEFjY2Vzc01hbmFnZXIvLk93bEJvdC55YW1sIiwiaCI6IjU3N2VlZTkzMWI3M2U5MTBmZmFlMWIxNzBmNmY5ZjhiZDc5NzVhMzYifQ== Copy-Tag: eyJwIjoiUHJvZmlsZXIvLk93bEJvdC55YW1sIiwiaCI6IjU3N2VlZTkzMWI3M2U5MTBmZmFlMWIxNzBmNmY5ZjhiZDc5NzVhMzYifQ== Copy-Tag: eyJwIjoiUHViU3ViLy5Pd2xCb3QueWFtbCIsImgiOiI1NzdlZWU5MzFiNzNlOTEwZmZhZTFiMTcwZjZmOWY4YmQ3OTc1YTM2In0= Copy-Tag: eyJwIjoiUXVvdGFzLy5Pd2xCb3QueWFtbCIsImgiOiI1NzdlZWU5MzFiNzNlOTEwZmZhZTFiMTcwZjZmOWY4YmQ3OTc1YTM2In0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * docs: usage deprecation of credentials client option PiperOrigin-RevId: 809097824 Source-Link: googleapis/googleapis@e8ed6b4 Source-Link: googleapis/googleapis-gen@96cfee1 Copy-Tag: eyJwIjoiTmV0d29ya01hbmFnZW1lbnQvLk93bEJvdC55YW1sIiwiaCI6Ijk2Y2ZlZTE2MzkzNjhlMzRhOGQxZjc2NWNlZGRlY2Y5ZGNhMTE5ZGMifQ== Copy-Tag: eyJwIjoiTmV0d29ya1NlY3VyaXR5Ly5Pd2xCb3QueWFtbCIsImgiOiI5NmNmZWUxNjM5MzY4ZTM0YThkMWY3NjVjZWRkZWNmOWRjYTExOWRjIn0= Copy-Tag: eyJwIjoiTmV0d29ya1NlcnZpY2VzLy5Pd2xCb3QueWFtbCIsImgiOiI5NmNmZWUxNjM5MzY4ZTM0YThkMWY3NjVjZWRkZWNmOWRjYTExOWRjIn0= Copy-Tag: eyJwIjoiTm90ZWJvb2tzLy5Pd2xCb3QueWFt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UG9saWN5U2ltdWxhdG9yLy5Pd2xCb3QueWFtbCIsImgiOiI5NmNmZWUxNjM5MzY4ZTM0YThkMWY3NjVjZWRkZWNmOWRjYTExOWRjIn0= Copy-Tag: eyJwIjoiUG9saWN5VHJvdWJsZXNob290ZXIvLk93bEJvdC55YW1sIiwiaCI6Ijk2Y2ZlZTE2MzkzNjhlMzRhOGQxZjc2NWNlZGRlY2Y5ZGNhMTE5ZGMifQ== Copy-Tag: eyJwIjoiUG9saWN5VHJvdWJsZXNob290ZXJJYW0vLk93bEJvdC55YW1sIiwiaCI6Ijk2Y2ZlZTE2MzkzNjhlMzRhOGQxZjc2NWNlZGRlY2Y5ZGNhMTE5ZGMifQ== Copy-Tag: eyJwIjoiUHJpdmF0ZUNhdGFsb2cvLk93bEJvdC55YW1sIiwiaCI6Ijk2Y2ZlZTE2MzkzNjhlMzRhOGQxZjc2NWNlZGRlY2Y5ZGNhMTE5ZGMifQ== Copy-Tag: eyJwIjoiUHJpdmlsZWdlZEFjY2Vzc01hbmFnZXIvLk93bEJvdC55YW1sIiwiaCI6Ijk2Y2ZlZTE2MzkzNjhlMzRhOGQxZjc2NWNlZGRlY2Y5ZGNhMTE5ZGMifQ== Copy-Tag: eyJwIjoiUHJvZmlsZXIvLk93bEJvdC55YW1sIiwiaCI6Ijk2Y2ZlZTE2MzkzNjhlMzRhOGQxZjc2NWNlZGRlY2Y5ZGNhMTE5ZGMifQ== Copy-Tag: eyJwIjoiUHViU3ViLy5Pd2xCb3QueWFtbCIsImgiOiI5NmNmZWUxNjM5MzY4ZTM0YThkMWY3NjVjZWRkZWNmOWRjYTExOWRjIn0= Copy-Tag: eyJwIjoiUXVvdGFzLy5Pd2xCb3QueWFtbCIsImgiOiI5NmNmZWUxNjM5MzY4ZTM0YThkMWY3NjVjZWRkZWNmOWRjYTExOWRjIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 1322d64 commit aa4559f

35 files changed

Lines changed: 1373 additions & 1559 deletions

File tree

NetworkManagement/src/V1/Client/ReachabilityServiceClient.php

Lines changed: 41 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
use Google\ApiCore\CredentialsWrapper;
2929
use Google\ApiCore\GapicClientTrait;
3030
use Google\ApiCore\OperationResponse;
31+
use Google\ApiCore\Options\ClientOptions;
3132
use Google\ApiCore\PagedListResponse;
3233
use Google\ApiCore\ResourceHelperTrait;
3334
use Google\ApiCore\RetrySettings;
@@ -109,7 +110,9 @@ final class ReachabilityServiceClient
109110
private const CODEGEN_NAME = 'gapic';
110111

111112
/** The default scopes required by the service. */
112-
public static $serviceScopes = ['https://www.googleapis.com/auth/cloud-platform'];
113+
public static $serviceScopes = [
114+
'https://www.googleapis.com/auth/cloud-platform',
115+
];
113116

114117
private $operationsClient;
115118

@@ -155,9 +158,7 @@ public function getOperationsClient()
155158
*/
156159
public function resumeOperation($operationName, $methodName = null)
157160
{
158-
$options = isset($this->descriptors[$methodName]['longRunning'])
159-
? $this->descriptors[$methodName]['longRunning']
160-
: [];
161+
$options = $this->descriptors[$methodName]['longRunning'] ?? [];
161162
$operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);
162163
$operation->reload();
163164
return $operation;
@@ -242,25 +243,28 @@ public static function parseName(string $formattedName, ?string $template = null
242243
/**
243244
* Constructor.
244245
*
245-
* @param array $options {
246+
* @param array|ClientOptions $options {
246247
* Optional. Options for configuring the service API wrapper.
247248
*
248249
* @type string $apiEndpoint
249250
* The address of the API remote host. May optionally include the port, formatted
250251
* as "<uri>:<port>". Default 'networkmanagement.googleapis.com:443'.
251-
* @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials
252-
* The credentials to be used by the client to authorize API calls. This option
253-
* accepts either a path to a credentials file, or a decoded credentials file as a
254-
* PHP array.
255-
* *Advanced usage*: In addition, this option can also accept a pre-constructed
256-
* {@see \Google\Auth\FetchAuthTokenInterface} object or
257-
* {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these
258-
* objects are provided, any settings in $credentialsConfig will be ignored.
259-
* *Important*: If you accept a credential configuration (credential
260-
* JSON/File/Stream) from an external source for authentication to Google Cloud
261-
* Platform, you must validate it before providing it to any Google API or library.
262-
* Providing an unvalidated credential configuration to Google APIs can compromise
263-
* the security of your systems and data. For more information {@see
252+
* @type FetchAuthTokenInterface|CredentialsWrapper $credentials
253+
* This option should only be used with a pre-constructed
254+
* {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that
255+
* when one of these objects are provided, any settings in $credentialsConfig will
256+
* be ignored.
257+
* **Important**: If you are providing a path to a credentials file, or a decoded
258+
* credentials file as a PHP array, this usage is now DEPRECATED. Providing an
259+
* unvalidated credential configuration to Google APIs can compromise the security
260+
* of your systems and data. It is recommended to create the credentials explicitly
261+
* ```
262+
* use Google\Auth\Credentials\ServiceAccountCredentials;
263+
* use Google\Cloud\NetworkManagement\V1\ReachabilityServiceClient;
264+
* $creds = new ServiceAccountCredentials($scopes, $json);
265+
* $options = new ReachabilityServiceClient(['credentials' => $creds]);
266+
* ```
267+
* {@see
264268
* https://cloud.google.com/docs/authentication/external/externally-sourced-credentials}
265269
* @type array $credentialsConfig
266270
* Options used to configure credentials, including auth token caching, for the
@@ -298,11 +302,13 @@ public static function parseName(string $formattedName, ?string $template = null
298302
* @type false|LoggerInterface $logger
299303
* A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the
300304
* 'GOOGLE_SDK_PHP_LOGGING' environment flag
305+
* @type string $universeDomain
306+
* The service domain for the client. Defaults to 'googleapis.com'.
301307
* }
302308
*
303309
* @throws ValidationException
304310
*/
305-
public function __construct(array $options = [])
311+
public function __construct(array|ClientOptions $options = [])
306312
{
307313
$clientOptions = $this->buildClientOptions($options);
308314
$this->setClientOptions($clientOptions);
@@ -350,14 +356,12 @@ public function __call($method, $args)
350356
* {@see RetrySettings} for example usage.
351357
* }
352358
*
353-
* @return OperationResponse
359+
* @return OperationResponse<ConnectivityTest>
354360
*
355361
* @throws ApiException Thrown if the API call fails.
356362
*/
357-
public function createConnectivityTest(
358-
CreateConnectivityTestRequest $request,
359-
array $callOptions = []
360-
): OperationResponse {
363+
public function createConnectivityTest(CreateConnectivityTestRequest $request, array $callOptions = []): OperationResponse
364+
{
361365
return $this->startApiCall('CreateConnectivityTest', $request, $callOptions)->wait();
362366
}
363367

@@ -379,14 +383,12 @@ public function createConnectivityTest(
379383
* {@see RetrySettings} for example usage.
380384
* }
381385
*
382-
* @return OperationResponse
386+
* @return OperationResponse<null>
383387
*
384388
* @throws ApiException Thrown if the API call fails.
385389
*/
386-
public function deleteConnectivityTest(
387-
DeleteConnectivityTestRequest $request,
388-
array $callOptions = []
389-
): OperationResponse {
390+
public function deleteConnectivityTest(DeleteConnectivityTestRequest $request, array $callOptions = []): OperationResponse
391+
{
390392
return $this->startApiCall('DeleteConnectivityTest', $request, $callOptions)->wait();
391393
}
392394

@@ -439,10 +441,8 @@ public function getConnectivityTest(GetConnectivityTestRequest $request, array $
439441
*
440442
* @throws ApiException Thrown if the API call fails.
441443
*/
442-
public function listConnectivityTests(
443-
ListConnectivityTestsRequest $request,
444-
array $callOptions = []
445-
): PagedListResponse {
444+
public function listConnectivityTests(ListConnectivityTestsRequest $request, array $callOptions = []): PagedListResponse
445+
{
446446
return $this->startApiCall('ListConnectivityTests', $request, $callOptions);
447447
}
448448

@@ -475,14 +475,12 @@ public function listConnectivityTests(
475475
* {@see RetrySettings} for example usage.
476476
* }
477477
*
478-
* @return OperationResponse
478+
* @return OperationResponse<ConnectivityTest>
479479
*
480480
* @throws ApiException Thrown if the API call fails.
481481
*/
482-
public function rerunConnectivityTest(
483-
RerunConnectivityTestRequest $request,
484-
array $callOptions = []
485-
): OperationResponse {
482+
public function rerunConnectivityTest(RerunConnectivityTestRequest $request, array $callOptions = []): OperationResponse
483+
{
486484
return $this->startApiCall('RerunConnectivityTest', $request, $callOptions)->wait();
487485
}
488486

@@ -517,14 +515,12 @@ public function rerunConnectivityTest(
517515
* {@see RetrySettings} for example usage.
518516
* }
519517
*
520-
* @return OperationResponse
518+
* @return OperationResponse<ConnectivityTest>
521519
*
522520
* @throws ApiException Thrown if the API call fails.
523521
*/
524-
public function updateConnectivityTest(
525-
UpdateConnectivityTestRequest $request,
526-
array $callOptions = []
527-
): OperationResponse {
522+
public function updateConnectivityTest(UpdateConnectivityTestRequest $request, array $callOptions = []): OperationResponse
523+
{
528524
return $this->startApiCall('UpdateConnectivityTest', $request, $callOptions)->wait();
529525
}
530526

@@ -665,10 +661,8 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions =
665661
*
666662
* @throws ApiException Thrown if the API call fails.
667663
*/
668-
public function testIamPermissions(
669-
TestIamPermissionsRequest $request,
670-
array $callOptions = []
671-
): TestIamPermissionsResponse {
664+
public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse
665+
{
672666
return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait();
673667
}
674668
}

NetworkManagement/src/V1/Client/VpcFlowLogsServiceClient.php

Lines changed: 40 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
use Google\ApiCore\CredentialsWrapper;
2929
use Google\ApiCore\GapicClientTrait;
3030
use Google\ApiCore\OperationResponse;
31+
use Google\ApiCore\Options\ClientOptions;
3132
use Google\ApiCore\PagedListResponse;
3233
use Google\ApiCore\ResourceHelperTrait;
3334
use Google\ApiCore\RetrySettings;
@@ -102,7 +103,9 @@ final class VpcFlowLogsServiceClient
102103
private const CODEGEN_NAME = 'gapic';
103104

104105
/** The default scopes required by the service. */
105-
public static $serviceScopes = ['https://www.googleapis.com/auth/cloud-platform'];
106+
public static $serviceScopes = [
107+
'https://www.googleapis.com/auth/cloud-platform',
108+
];
106109

107110
private $operationsClient;
108111

@@ -148,9 +151,7 @@ public function getOperationsClient()
148151
*/
149152
public function resumeOperation($operationName, $methodName = null)
150153
{
151-
$options = isset($this->descriptors[$methodName]['longRunning'])
152-
? $this->descriptors[$methodName]['longRunning']
153-
: [];
154+
$options = $this->descriptors[$methodName]['longRunning'] ?? [];
154155
$operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);
155156
$operation->reload();
156157
return $operation;
@@ -239,25 +240,28 @@ public static function parseName(string $formattedName, ?string $template = null
239240
/**
240241
* Constructor.
241242
*
242-
* @param array $options {
243+
* @param array|ClientOptions $options {
243244
* Optional. Options for configuring the service API wrapper.
244245
*
245246
* @type string $apiEndpoint
246247
* The address of the API remote host. May optionally include the port, formatted
247248
* as "<uri>:<port>". Default 'networkmanagement.googleapis.com:443'.
248-
* @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials
249-
* The credentials to be used by the client to authorize API calls. This option
250-
* accepts either a path to a credentials file, or a decoded credentials file as a
251-
* PHP array.
252-
* *Advanced usage*: In addition, this option can also accept a pre-constructed
253-
* {@see \Google\Auth\FetchAuthTokenInterface} object or
254-
* {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these
255-
* objects are provided, any settings in $credentialsConfig will be ignored.
256-
* *Important*: If you accept a credential configuration (credential
257-
* JSON/File/Stream) from an external source for authentication to Google Cloud
258-
* Platform, you must validate it before providing it to any Google API or library.
259-
* Providing an unvalidated credential configuration to Google APIs can compromise
260-
* the security of your systems and data. For more information {@see
249+
* @type FetchAuthTokenInterface|CredentialsWrapper $credentials
250+
* This option should only be used with a pre-constructed
251+
* {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that
252+
* when one of these objects are provided, any settings in $credentialsConfig will
253+
* be ignored.
254+
* **Important**: If you are providing a path to a credentials file, or a decoded
255+
* credentials file as a PHP array, this usage is now DEPRECATED. Providing an
256+
* unvalidated credential configuration to Google APIs can compromise the security
257+
* of your systems and data. It is recommended to create the credentials explicitly
258+
* ```
259+
* use Google\Auth\Credentials\ServiceAccountCredentials;
260+
* use Google\Cloud\NetworkManagement\V1\VpcFlowLogsServiceClient;
261+
* $creds = new ServiceAccountCredentials($scopes, $json);
262+
* $options = new VpcFlowLogsServiceClient(['credentials' => $creds]);
263+
* ```
264+
* {@see
261265
* https://cloud.google.com/docs/authentication/external/externally-sourced-credentials}
262266
* @type array $credentialsConfig
263267
* Options used to configure credentials, including auth token caching, for the
@@ -295,11 +299,13 @@ public static function parseName(string $formattedName, ?string $template = null
295299
* @type false|LoggerInterface $logger
296300
* A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the
297301
* 'GOOGLE_SDK_PHP_LOGGING' environment flag
302+
* @type string $universeDomain
303+
* The service domain for the client. Defaults to 'googleapis.com'.
298304
* }
299305
*
300306
* @throws ValidationException
301307
*/
302-
public function __construct(array $options = [])
308+
public function __construct(array|ClientOptions $options = [])
303309
{
304310
$clientOptions = $this->buildClientOptions($options);
305311
$this->setClientOptions($clientOptions);
@@ -349,14 +355,12 @@ public function __call($method, $args)
349355
* {@see RetrySettings} for example usage.
350356
* }
351357
*
352-
* @return OperationResponse
358+
* @return OperationResponse<VpcFlowLogsConfig>
353359
*
354360
* @throws ApiException Thrown if the API call fails.
355361
*/
356-
public function createVpcFlowLogsConfig(
357-
CreateVpcFlowLogsConfigRequest $request,
358-
array $callOptions = []
359-
): OperationResponse {
362+
public function createVpcFlowLogsConfig(CreateVpcFlowLogsConfigRequest $request, array $callOptions = []): OperationResponse
363+
{
360364
return $this->startApiCall('CreateVpcFlowLogsConfig', $request, $callOptions)->wait();
361365
}
362366

@@ -378,14 +382,12 @@ public function createVpcFlowLogsConfig(
378382
* {@see RetrySettings} for example usage.
379383
* }
380384
*
381-
* @return OperationResponse
385+
* @return OperationResponse<null>
382386
*
383387
* @throws ApiException Thrown if the API call fails.
384388
*/
385-
public function deleteVpcFlowLogsConfig(
386-
DeleteVpcFlowLogsConfigRequest $request,
387-
array $callOptions = []
388-
): OperationResponse {
389+
public function deleteVpcFlowLogsConfig(DeleteVpcFlowLogsConfigRequest $request, array $callOptions = []): OperationResponse
390+
{
389391
return $this->startApiCall('DeleteVpcFlowLogsConfig', $request, $callOptions)->wait();
390392
}
391393

@@ -411,10 +413,8 @@ public function deleteVpcFlowLogsConfig(
411413
*
412414
* @throws ApiException Thrown if the API call fails.
413415
*/
414-
public function getVpcFlowLogsConfig(
415-
GetVpcFlowLogsConfigRequest $request,
416-
array $callOptions = []
417-
): VpcFlowLogsConfig {
416+
public function getVpcFlowLogsConfig(GetVpcFlowLogsConfigRequest $request, array $callOptions = []): VpcFlowLogsConfig
417+
{
418418
return $this->startApiCall('GetVpcFlowLogsConfig', $request, $callOptions)->wait();
419419
}
420420

@@ -440,10 +440,8 @@ public function getVpcFlowLogsConfig(
440440
*
441441
* @throws ApiException Thrown if the API call fails.
442442
*/
443-
public function listVpcFlowLogsConfigs(
444-
ListVpcFlowLogsConfigsRequest $request,
445-
array $callOptions = []
446-
): PagedListResponse {
443+
public function listVpcFlowLogsConfigs(ListVpcFlowLogsConfigsRequest $request, array $callOptions = []): PagedListResponse
444+
{
447445
return $this->startApiCall('ListVpcFlowLogsConfigs', $request, $callOptions);
448446
}
449447

@@ -479,14 +477,12 @@ public function listVpcFlowLogsConfigs(
479477
* {@see RetrySettings} for example usage.
480478
* }
481479
*
482-
* @return OperationResponse
480+
* @return OperationResponse<VpcFlowLogsConfig>
483481
*
484482
* @throws ApiException Thrown if the API call fails.
485483
*/
486-
public function updateVpcFlowLogsConfig(
487-
UpdateVpcFlowLogsConfigRequest $request,
488-
array $callOptions = []
489-
): OperationResponse {
484+
public function updateVpcFlowLogsConfig(UpdateVpcFlowLogsConfigRequest $request, array $callOptions = []): OperationResponse
485+
{
490486
return $this->startApiCall('UpdateVpcFlowLogsConfig', $request, $callOptions)->wait();
491487
}
492488

@@ -627,10 +623,8 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions =
627623
*
628624
* @throws ApiException Thrown if the API call fails.
629625
*/
630-
public function testIamPermissions(
631-
TestIamPermissionsRequest $request,
632-
array $callOptions = []
633-
): TestIamPermissionsResponse {
626+
public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse
627+
{
634628
return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait();
635629
}
636630
}

0 commit comments

Comments
 (0)