Skip to content

Commit db4aee9

Browse files
feat: [Many APIs] usage deprecation of credentials client option (#8601)
* docs: usage deprecation of credentials client option PiperOrigin-RevId: 809097824 Source-Link: googleapis/googleapis@e8ed6b4 Source-Link: googleapis/googleapis-gen@96cfee1 Copy-Tag: eyJwIjoiTGljZW5zZU1hbmFnZXIvLk93bEJvdC55YW1sIiwiaCI6Ijk2Y2ZlZTE2MzkzNjhlMzRhOGQxZjc2NWNlZGRlY2Y5ZGNhMTE5ZGMifQ== Copy-Tag: eyJwIjoiTGlmZVNjaWVuY2VzLy5Pd2xCb3QueWFtbCIsImgiOiI5NmNmZWUxNjM5MzY4ZTM0YThkMWY3NjVjZWRkZWNmOWRjYTExOWRjIn0= Copy-Tag: eyJwIjoiTG9nZ2luZy8uT3dsQm90LnlhbWwiLCJoIjoiOTZjZmVlMTYzOTM2OGUzNGE4ZDFmNzY1Y2VkZGVjZjlkY2ExMTlkYyJ9 Copy-Tag: eyJwIjoiTG9uZ1J1bm5pbmcvLk93bEJvdC55YW1sIiwiaCI6Ijk2Y2ZlZTE2MzkzNjhlMzRhOGQxZjc2NWNlZGRlY2Y5ZGNhMTE5ZGMifQ== Copy-Tag: eyJwIjoiTHVzdHJlLy5Pd2xCb3QueWFtbCIsImgiOiI5NmNmZWUxNjM5MzY4ZTM0YThkMWY3NjVjZWRkZWNmOWRjYTExOWRjIn0= Copy-Tag: eyJwIjoiTWFpbnRlbmFuY2UvLk93bEJvdC55YW1sIiwiaCI6Ijk2Y2ZlZTE2MzkzNjhlMzRhOGQxZjc2NWNlZGRlY2Y5ZGNhMTE5ZGMifQ== Copy-Tag: eyJwIjoiTWFuYWdlZElkZW50aXRpZXMvLk93bEJvdC55YW1sIiwiaCI6Ijk2Y2ZlZTE2MzkzNjhlMzRhOGQxZjc2NWNlZGRlY2Y5ZGNhMTE5ZGMifQ== Copy-Tag: eyJwIjoiTWFuYWdlZEthZmthLy5Pd2xCb3QueWFtbCIsImgiOiI5NmNmZWUxNjM5MzY4ZTM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Copy-Tag: eyJwIjoiTW9kZWxBcm1vci8uT3dsQm90LnlhbWwiLCJoIjoiOTZjZmVlMTYzOTM2OGUzNGE4ZDFmNzY1Y2VkZGVjZjlkY2ExMTlkYyJ9 Copy-Tag: eyJwIjoiTW9uaXRvcmluZy8uT3dsQm90LnlhbWwiLCJoIjoiOTZjZmVlMTYzOTM2OGUzNGE4ZDFmNzY1Y2VkZGVjZjlkY2ExMTlkYyJ9 Copy-Tag: eyJwIjoiTmV0QXBwLy5Pd2xCb3QueWFtbCIsImgiOiI5NmNmZWUxNjM5MzY4ZTM0YThkMWY3NjVjZWRkZWNmOWRjYTExOWRjIn0= Copy-Tag: eyJwIjoiTmV0d29ya0Nvbm5lY3Rpdml0eS8uT3dsQm90LnlhbWwiLCJoIjoiOTZjZmVlMTYzOTM2OGUzNGE4ZDFmNzY1Y2VkZGVjZjlkY2ExMTlkYyJ9 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: eyJwIjoiTGljZW5zZU1hbmFnZXIvLk93bEJvdC55YW1sIiwiaCI6IjU3N2VlZTkzMWI3M2U5MTBmZmFlMWIxNzBmNmY5ZjhiZDc5NzVhMzYifQ== Copy-Tag: eyJwIjoiTGlmZVNjaWVuY2VzLy5Pd2xCb3QueWFtbCIsImgiOiI1NzdlZWU5MzFiNzNlOTEwZmZhZTFiMTcwZjZmOWY4YmQ3OTc1YTM2In0= Copy-Tag: eyJwIjoiTG9nZ2luZy8uT3dsQm90LnlhbWwiLCJoIjoiNTc3ZWVlOTMxYjczZTkxMGZmYWUxYjE3MGY2ZjlmOGJkNzk3NWEzNiJ9 Copy-Tag: eyJwIjoiTG9uZ1J1bm5pbmcvLk93bEJvdC55YW1sIiwiaCI6IjU3N2VlZTkzMWI3M2U5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UcmFuc2xhdGlvbi8uT3dsQm90LnlhbWwiLCJoIjoiNTc3ZWVlOTMxYjczZTkxMGZmYWUxYjE3MGY2ZjlmOGJkNzk3NWEzNiJ9 Copy-Tag: eyJwIjoiTWVtY2FjaGUvLk93bEJvdC55YW1sIiwiaCI6IjU3N2VlZTkzMWI3M2U5MTBmZmFlMWIxNzBmNmY5ZjhiZDc5NzVhMzYifQ== Copy-Tag: eyJwIjoiTWVtb3J5c3RvcmUvLk93bEJvdC55YW1sIiwiaCI6IjU3N2VlZTkzMWI3M2U5MTBmZmFlMWIxNzBmNmY5ZjhiZDc5NzVhMzYifQ== Copy-Tag: eyJwIjoiTWlncmF0aW9uQ2VudGVyLy5Pd2xCb3QueWFtbCIsImgiOiI1NzdlZWU5MzFiNzNlOTEwZmZhZTFiMTcwZjZmOWY4YmQ3OTc1YTM2In0= Copy-Tag: eyJwIjoiTW9kZWxBcm1vci8uT3dsQm90LnlhbWwiLCJoIjoiNTc3ZWVlOTMxYjczZTkxMGZmYWUxYjE3MGY2ZjlmOGJkNzk3NWEzNiJ9 Copy-Tag: eyJwIjoiTW9uaXRvcmluZy8uT3dsQm90LnlhbWwiLCJoIjoiNTc3ZWVlOTMxYjczZTkxMGZmYWUxYjE3MGY2ZjlmOGJkNzk3NWEzNiJ9 Copy-Tag: eyJwIjoiTmV0QXBwLy5Pd2xCb3QueWFtbCIsImgiOiI1NzdlZWU5MzFiNzNlOTEwZmZhZTFiMTcwZjZmOWY4YmQ3OTc1YTM2In0= Copy-Tag: eyJwIjoiTmV0d29ya0Nvbm5lY3Rpdml0eS8uT3dsQm90LnlhbWwiLCJoIjoiNTc3ZWVlOTMxYjczZTkxMGZmYWUxYjE3MGY2ZjlmOGJkNzk3NWEzNiJ9 * 🦉 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 7bb75d4 commit db4aee9

40 files changed

Lines changed: 927 additions & 727 deletions

File tree

LicenseManager/src/V1/Client/LicenseManagerClient.php

Lines changed: 27 additions & 23 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;
@@ -157,9 +158,7 @@ public function getOperationsClient()
157158
*/
158159
public function resumeOperation($operationName, $methodName = null)
159160
{
160-
$options = isset($this->descriptors[$methodName]['longRunning'])
161-
? $this->descriptors[$methodName]['longRunning']
162-
: [];
161+
$options = $this->descriptors[$methodName]['longRunning'] ?? [];
163162
$operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);
164163
$operation->reload();
165164
return $operation;
@@ -288,25 +287,28 @@ public static function parseName(string $formattedName, ?string $template = null
288287
/**
289288
* Constructor.
290289
*
291-
* @param array $options {
290+
* @param array|ClientOptions $options {
292291
* Optional. Options for configuring the service API wrapper.
293292
*
294293
* @type string $apiEndpoint
295294
* The address of the API remote host. May optionally include the port, formatted
296295
* as "<uri>:<port>". Default 'licensemanager.googleapis.com:443'.
297-
* @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials
298-
* The credentials to be used by the client to authorize API calls. This option
299-
* accepts either a path to a credentials file, or a decoded credentials file as a
300-
* PHP array.
301-
* *Advanced usage*: In addition, this option can also accept a pre-constructed
302-
* {@see \Google\Auth\FetchAuthTokenInterface} object or
303-
* {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these
304-
* objects are provided, any settings in $credentialsConfig will be ignored.
305-
* *Important*: If you accept a credential configuration (credential
306-
* JSON/File/Stream) from an external source for authentication to Google Cloud
307-
* Platform, you must validate it before providing it to any Google API or library.
308-
* Providing an unvalidated credential configuration to Google APIs can compromise
309-
* the security of your systems and data. For more information {@see
296+
* @type FetchAuthTokenInterface|CredentialsWrapper $credentials
297+
* This option should only be used with a pre-constructed
298+
* {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that
299+
* when one of these objects are provided, any settings in $credentialsConfig will
300+
* be ignored.
301+
* **Important**: If you are providing a path to a credentials file, or a decoded
302+
* credentials file as a PHP array, this usage is now DEPRECATED. Providing an
303+
* unvalidated credential configuration to Google APIs can compromise the security
304+
* of your systems and data. It is recommended to create the credentials explicitly
305+
* ```
306+
* use Google\Auth\Credentials\ServiceAccountCredentials;
307+
* use Google\Cloud\LicenseManager\V1\LicenseManagerClient;
308+
* $creds = new ServiceAccountCredentials($scopes, $json);
309+
* $options = new LicenseManagerClient(['credentials' => $creds]);
310+
* ```
311+
* {@see
310312
* https://cloud.google.com/docs/authentication/external/externally-sourced-credentials}
311313
* @type array $credentialsConfig
312314
* Options used to configure credentials, including auth token caching, for the
@@ -344,11 +346,13 @@ public static function parseName(string $formattedName, ?string $template = null
344346
* @type false|LoggerInterface $logger
345347
* A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the
346348
* 'GOOGLE_SDK_PHP_LOGGING' environment flag
349+
* @type string $universeDomain
350+
* The service domain for the client. Defaults to 'googleapis.com'.
347351
* }
348352
*
349353
* @throws ValidationException
350354
*/
351-
public function __construct(array $options = [])
355+
public function __construct(array|ClientOptions $options = [])
352356
{
353357
$clientOptions = $this->buildClientOptions($options);
354358
$this->setClientOptions($clientOptions);
@@ -409,7 +413,7 @@ public function aggregateUsage(AggregateUsageRequest $request, array $callOption
409413
* {@see RetrySettings} for example usage.
410414
* }
411415
*
412-
* @return OperationResponse
416+
* @return OperationResponse<Configuration>
413417
*
414418
* @throws ApiException Thrown if the API call fails.
415419
*/
@@ -436,7 +440,7 @@ public function createConfiguration(CreateConfigurationRequest $request, array $
436440
* {@see RetrySettings} for example usage.
437441
* }
438442
*
439-
* @return OperationResponse
443+
* @return OperationResponse<Configuration>
440444
*
441445
* @throws ApiException Thrown if the API call fails.
442446
*/
@@ -464,7 +468,7 @@ public function deactivateConfiguration(
464468
* {@see RetrySettings} for example usage.
465469
* }
466470
*
467-
* @return OperationResponse
471+
* @return OperationResponse<null>
468472
*
469473
* @throws ApiException Thrown if the API call fails.
470474
*/
@@ -676,7 +680,7 @@ public function queryConfigurationLicenseUsage(
676680
* {@see RetrySettings} for example usage.
677681
* }
678682
*
679-
* @return OperationResponse
683+
* @return OperationResponse<Configuration>
680684
*
681685
* @throws ApiException Thrown if the API call fails.
682686
*/
@@ -704,7 +708,7 @@ public function reactivateConfiguration(
704708
* {@see RetrySettings} for example usage.
705709
* }
706710
*
707-
* @return OperationResponse
711+
* @return OperationResponse<Configuration>
708712
*
709713
* @throws ApiException Thrown if the API call fails.
710714
*/

LifeSciences/src/V2beta/Client/WorkflowsServiceV2BetaClient.php

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
use Google\ApiCore\CredentialsWrapper;
3131
use Google\ApiCore\GapicClientTrait;
3232
use Google\ApiCore\OperationResponse;
33+
use Google\ApiCore\Options\ClientOptions;
3334
use Google\ApiCore\PagedListResponse;
3435
use Google\ApiCore\RetrySettings;
3536
use Google\ApiCore\Transport\TransportInterface;
@@ -134,9 +135,7 @@ public function getOperationsClient()
134135
*/
135136
public function resumeOperation($operationName, $methodName = null)
136137
{
137-
$options = isset($this->descriptors[$methodName]['longRunning'])
138-
? $this->descriptors[$methodName]['longRunning']
139-
: [];
138+
$options = $this->descriptors[$methodName]['longRunning'] ?? [];
140139
$operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);
141140
$operation->reload();
142141
return $operation;
@@ -164,25 +163,28 @@ private function createOperationsClient(array $options)
164163
/**
165164
* Constructor.
166165
*
167-
* @param array $options {
166+
* @param array|ClientOptions $options {
168167
* Optional. Options for configuring the service API wrapper.
169168
*
170169
* @type string $apiEndpoint
171170
* The address of the API remote host. May optionally include the port, formatted
172171
* as "<uri>:<port>". Default 'lifesciences.googleapis.com:443'.
173-
* @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials
174-
* The credentials to be used by the client to authorize API calls. This option
175-
* accepts either a path to a credentials file, or a decoded credentials file as a
176-
* PHP array.
177-
* *Advanced usage*: In addition, this option can also accept a pre-constructed
178-
* {@see \Google\Auth\FetchAuthTokenInterface} object or
179-
* {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these
180-
* objects are provided, any settings in $credentialsConfig will be ignored.
181-
* *Important*: If you accept a credential configuration (credential
182-
* JSON/File/Stream) from an external source for authentication to Google Cloud
183-
* Platform, you must validate it before providing it to any Google API or library.
184-
* Providing an unvalidated credential configuration to Google APIs can compromise
185-
* the security of your systems and data. For more information {@see
172+
* @type FetchAuthTokenInterface|CredentialsWrapper $credentials
173+
* This option should only be used with a pre-constructed
174+
* {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that
175+
* when one of these objects are provided, any settings in $credentialsConfig will
176+
* be ignored.
177+
* **Important**: If you are providing a path to a credentials file, or a decoded
178+
* credentials file as a PHP array, this usage is now DEPRECATED. Providing an
179+
* unvalidated credential configuration to Google APIs can compromise the security
180+
* of your systems and data. It is recommended to create the credentials explicitly
181+
* ```
182+
* use Google\Auth\Credentials\ServiceAccountCredentials;
183+
* use Google\Cloud\LifeSciences\V2beta\WorkflowsServiceV2BetaClient;
184+
* $creds = new ServiceAccountCredentials($scopes, $json);
185+
* $options = new WorkflowsServiceV2BetaClient(['credentials' => $creds]);
186+
* ```
187+
* {@see
186188
* https://cloud.google.com/docs/authentication/external/externally-sourced-credentials}
187189
* @type array $credentialsConfig
188190
* Options used to configure credentials, including auth token caching, for the
@@ -220,13 +222,15 @@ private function createOperationsClient(array $options)
220222
* @type false|LoggerInterface $logger
221223
* A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the
222224
* 'GOOGLE_SDK_PHP_LOGGING' environment flag
225+
* @type string $universeDomain
226+
* The service domain for the client. Defaults to 'googleapis.com'.
223227
* }
224228
*
225229
* @throws ValidationException
226230
*
227231
* @experimental
228232
*/
229-
public function __construct(array $options = [])
233+
public function __construct(array|ClientOptions $options = [])
230234
{
231235
$clientOptions = $this->buildClientOptions($options);
232236
$this->setClientOptions($clientOptions);
@@ -277,7 +281,7 @@ public function __call($method, $args)
277281
* {@see RetrySettings} for example usage.
278282
* }
279283
*
280-
* @return OperationResponse
284+
* @return OperationResponse<RunPipelineResponse>
281285
*
282286
* @throws ApiException Thrown if the API call fails.
283287
*

Logging/src/V2/Client/ConfigServiceV2Client.php

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
use Google\ApiCore\GapicClientTrait;
3030
use Google\ApiCore\LongRunning\OperationsClient;
3131
use Google\ApiCore\OperationResponse;
32+
use Google\ApiCore\Options\ClientOptions;
3233
use Google\ApiCore\PagedListResponse;
3334
use Google\ApiCore\ResourceHelperTrait;
3435
use Google\ApiCore\RetrySettings;
@@ -37,6 +38,7 @@
3738
use Google\Auth\FetchAuthTokenInterface;
3839
use Google\Cloud\Logging\V2\CmekSettings;
3940
use Google\Cloud\Logging\V2\CopyLogEntriesRequest;
41+
use Google\Cloud\Logging\V2\CopyLogEntriesResponse;
4042
use Google\Cloud\Logging\V2\CreateBucketRequest;
4143
use Google\Cloud\Logging\V2\CreateExclusionRequest;
4244
use Google\Cloud\Logging\V2\CreateLinkRequest;
@@ -196,7 +198,7 @@ public function getOperationsClient()
196198
*/
197199
public function resumeOperation($operationName, $methodName = null)
198200
{
199-
$options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : [];
201+
$options = $this->descriptors[$methodName]['longRunning'] ?? [];
200202
$operation = new OperationResponse($operationName, $this->getOperationsClient(), $options);
201203
$operation->reload();
202204
return $operation;
@@ -1024,25 +1026,28 @@ public static function parseName(string $formattedName, ?string $template = null
10241026
/**
10251027
* Constructor.
10261028
*
1027-
* @param array $options {
1029+
* @param array|ClientOptions $options {
10281030
* Optional. Options for configuring the service API wrapper.
10291031
*
10301032
* @type string $apiEndpoint
10311033
* The address of the API remote host. May optionally include the port, formatted
10321034
* as "<uri>:<port>". Default 'logging.googleapis.com:443'.
1033-
* @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials
1034-
* The credentials to be used by the client to authorize API calls. This option
1035-
* accepts either a path to a credentials file, or a decoded credentials file as a
1036-
* PHP array.
1037-
* *Advanced usage*: In addition, this option can also accept a pre-constructed
1038-
* {@see \Google\Auth\FetchAuthTokenInterface} object or
1039-
* {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these
1040-
* objects are provided, any settings in $credentialsConfig will be ignored.
1041-
* *Important*: If you accept a credential configuration (credential
1042-
* JSON/File/Stream) from an external source for authentication to Google Cloud
1043-
* Platform, you must validate it before providing it to any Google API or library.
1044-
* Providing an unvalidated credential configuration to Google APIs can compromise
1045-
* the security of your systems and data. For more information {@see
1035+
* @type FetchAuthTokenInterface|CredentialsWrapper $credentials
1036+
* This option should only be used with a pre-constructed
1037+
* {@see FetchAuthTokenInterface} or {@see CredentialsWrapper} object. Note that
1038+
* when one of these objects are provided, any settings in $credentialsConfig will
1039+
* be ignored.
1040+
* **Important**: If you are providing a path to a credentials file, or a decoded
1041+
* credentials file as a PHP array, this usage is now DEPRECATED. Providing an
1042+
* unvalidated credential configuration to Google APIs can compromise the security
1043+
* of your systems and data. It is recommended to create the credentials explicitly
1044+
* ```
1045+
* use Google\Auth\Credentials\ServiceAccountCredentials;
1046+
* use Google\Cloud\Logging\V2\ConfigServiceV2Client;
1047+
* $creds = new ServiceAccountCredentials($scopes, $json);
1048+
* $options = new ConfigServiceV2Client(['credentials' => $creds]);
1049+
* ```
1050+
* {@see
10461051
* https://cloud.google.com/docs/authentication/external/externally-sourced-credentials}
10471052
* @type array $credentialsConfig
10481053
* Options used to configure credentials, including auth token caching, for the
@@ -1080,11 +1085,13 @@ public static function parseName(string $formattedName, ?string $template = null
10801085
* @type false|LoggerInterface $logger
10811086
* A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the
10821087
* 'GOOGLE_SDK_PHP_LOGGING' environment flag
1088+
* @type string $universeDomain
1089+
* The service domain for the client. Defaults to 'googleapis.com'.
10831090
* }
10841091
*
10851092
* @throws ValidationException
10861093
*/
1087-
public function __construct(array $options = [])
1094+
public function __construct(array|ClientOptions $options = [])
10881095
{
10891096
$clientOptions = $this->buildClientOptions($options);
10901097
$this->setClientOptions($clientOptions);
@@ -1119,7 +1126,7 @@ public function __call($method, $args)
11191126
* {@see RetrySettings} for example usage.
11201127
* }
11211128
*
1122-
* @return OperationResponse
1129+
* @return OperationResponse<CopyLogEntriesResponse>
11231130
*
11241131
* @throws ApiException Thrown if the API call fails.
11251132
*/
@@ -1174,7 +1181,7 @@ public function createBucket(CreateBucketRequest $request, array $callOptions =
11741181
* {@see RetrySettings} for example usage.
11751182
* }
11761183
*
1177-
* @return OperationResponse
1184+
* @return OperationResponse<LogBucket>
11781185
*
11791186
* @throws ApiException Thrown if the API call fails.
11801187
*/
@@ -1230,7 +1237,7 @@ public function createExclusion(CreateExclusionRequest $request, array $callOpti
12301237
* {@see RetrySettings} for example usage.
12311238
* }
12321239
*
1233-
* @return OperationResponse
1240+
* @return OperationResponse<Link>
12341241
*
12351242
* @throws ApiException Thrown if the API call fails.
12361243
*/
@@ -1365,7 +1372,7 @@ public function deleteExclusion(DeleteExclusionRequest $request, array $callOpti
13651372
* {@see RetrySettings} for example usage.
13661373
* }
13671374
*
1368-
* @return OperationResponse
1375+
* @return OperationResponse<null>
13691376
*
13701377
* @throws ApiException Thrown if the API call fails.
13711378
*/
@@ -1834,7 +1841,7 @@ public function updateBucket(UpdateBucketRequest $request, array $callOptions =
18341841
* {@see RetrySettings} for example usage.
18351842
* }
18361843
*
1837-
* @return OperationResponse
1844+
* @return OperationResponse<LogBucket>
18381845
*
18391846
* @throws ApiException Thrown if the API call fails.
18401847
*/

0 commit comments

Comments
 (0)