Skip to content

Commit 9676315

Browse files
chore(php): promote ApiKeys as stable (#7470)
chore(php): promote AdvisoryNotifications as stable chore(php): promote BareMetalSolutions as stable chore(php): promote BigQueryAnalyticsHub as stable chore(php): promote BigQueryMigration as stable PiperOrigin-RevId: 646217655 Source-Link: googleapis/googleapis@51de26c Source-Link: googleapis/googleapis-gen@6b37947 Copy-Tag: eyJwIjoiQWR2aXNvcnlOb3RpZmljYXRpb25zLy5Pd2xCb3QueWFtbCIsImgiOiI2YjM3OTQ3MGZjZTVlMGE3ZTdlYWY3YTUyZjZiZGNiOTQ2YjQyYzlkIn0= Copy-Tag: eyJwIjoiQXBpS2V5cy8uT3dsQm90LnlhbWwiLCJoIjoiNmIzNzk0NzBmY2U1ZTBhN2U3ZWFmN2E1MmY2YmRjYjk0NmI0MmM5ZCJ9 Copy-Tag: eyJwIjoiQmFyZU1ldGFsU29sdXRpb24vLk93bEJvdC55YW1sIiwiaCI6IjZiMzc5NDcwZmNlNWUwYTdlN2VhZjdhNTJmNmJkY2I5NDZiNDJjOWQifQ== Copy-Tag: eyJwIjoiQmlnUXVlcnlBbmFseXRpY3NIdWIvLk93bEJvdC55YW1sIiwiaCI6IjZiMzc5NDcwZmNlNWUwYTdlN2VhZjdhNTJmNmJkY2I5NDZiNDJjOWQifQ== Copy-Tag: eyJwIjoiQmlnUXVlcnlNaWdyYXRpb24vLk93bEJvdC55YW1sIiwiaCI6IjZiMzc5NDcwZmNlNWUwYTdlN2VhZjdhNTJmNmJkY2I5NDZiNDJjOWQifQ==
1 parent 9c213e8 commit 9676315

6 files changed

Lines changed: 63 additions & 6 deletions

File tree

ApiKeys/src/V2/Client/ApiKeysClient.php

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
use Google\ApiCore\ApiException;
2828
use Google\ApiCore\CredentialsWrapper;
2929
use Google\ApiCore\GapicClientTrait;
30-
use Google\ApiCore\LongRunning\OperationsClient;
3130
use Google\ApiCore\OperationResponse;
3231
use Google\ApiCore\PagedListResponse;
3332
use Google\ApiCore\ResourceHelperTrait;
@@ -46,6 +45,7 @@
4645
use Google\Cloud\ApiKeys\V2\LookupKeyResponse;
4746
use Google\Cloud\ApiKeys\V2\UndeleteKeyRequest;
4847
use Google\Cloud\ApiKeys\V2\UpdateKeyRequest;
48+
use Google\LongRunning\Client\OperationsClient;
4949
use Google\LongRunning\Operation;
5050
use GuzzleHttp\Promise\PromiseInterface;
5151

@@ -149,6 +149,25 @@ public function resumeOperation($operationName, $methodName = null)
149149
return $operation;
150150
}
151151

152+
/**
153+
* Create the default operation client for the service.
154+
*
155+
* @param array $options ClientOptions for the client.
156+
*
157+
* @return OperationsClient
158+
*/
159+
private function createOperationsClient(array $options)
160+
{
161+
// Unset client-specific configuration options
162+
unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']);
163+
164+
if (isset($options['operationsClient'])) {
165+
return $options['operationsClient'];
166+
}
167+
168+
return new OperationsClient($options);
169+
}
170+
152171
/**
153172
* Formats a string containing the fully-qualified path to represent a key
154173
* resource.

ApiKeys/tests/Unit/V2/Client/ApiKeysClientTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
use Google\ApiCore\ApiException;
2626
use Google\ApiCore\CredentialsWrapper;
27-
use Google\ApiCore\LongRunning\OperationsClient;
2827
use Google\ApiCore\Testing\GeneratedTest;
2928
use Google\ApiCore\Testing\MockTransport;
3029
use Google\Cloud\ApiKeys\V2\Client\ApiKeysClient;
@@ -40,6 +39,7 @@
4039
use Google\Cloud\ApiKeys\V2\LookupKeyResponse;
4140
use Google\Cloud\ApiKeys\V2\UndeleteKeyRequest;
4241
use Google\Cloud\ApiKeys\V2\UpdateKeyRequest;
42+
use Google\LongRunning\Client\OperationsClient;
4343
use Google\LongRunning\GetOperationRequest;
4444
use Google\LongRunning\Operation;
4545
use Google\Protobuf\Any;

BareMetalSolution/src/V2/Client/BareMetalSolutionClient.php

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
use Google\ApiCore\ApiException;
2828
use Google\ApiCore\CredentialsWrapper;
2929
use Google\ApiCore\GapicClientTrait;
30-
use Google\ApiCore\LongRunning\OperationsClient;
3130
use Google\ApiCore\OperationResponse;
3231
use Google\ApiCore\PagedListResponse;
3332
use Google\ApiCore\ResourceHelperTrait;
@@ -92,6 +91,7 @@
9291
use Google\Cloud\Location\GetLocationRequest;
9392
use Google\Cloud\Location\ListLocationsRequest;
9493
use Google\Cloud\Location\Location;
94+
use Google\LongRunning\Client\OperationsClient;
9595
use Google\LongRunning\Operation;
9696
use GuzzleHttp\Promise\PromiseInterface;
9797

@@ -239,6 +239,25 @@ public function resumeOperation($operationName, $methodName = null)
239239
return $operation;
240240
}
241241

242+
/**
243+
* Create the default operation client for the service.
244+
*
245+
* @param array $options ClientOptions for the client.
246+
*
247+
* @return OperationsClient
248+
*/
249+
private function createOperationsClient(array $options)
250+
{
251+
// Unset client-specific configuration options
252+
unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']);
253+
254+
if (isset($options['operationsClient'])) {
255+
return $options['operationsClient'];
256+
}
257+
258+
return new OperationsClient($options);
259+
}
260+
242261
/**
243262
* Formats a string containing the fully-qualified path to represent a instance
244263
* resource.

BareMetalSolution/tests/Unit/V2/Client/BareMetalSolutionClientTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
use Google\ApiCore\ApiException;
2626
use Google\ApiCore\CredentialsWrapper;
27-
use Google\ApiCore\LongRunning\OperationsClient;
2827
use Google\ApiCore\Testing\GeneratedTest;
2928
use Google\ApiCore\Testing\MockTransport;
3029
use Google\Cloud\BareMetalSolution\V2\Client\BareMetalSolutionClient;
@@ -102,6 +101,7 @@
102101
use Google\Cloud\Location\ListLocationsRequest;
103102
use Google\Cloud\Location\ListLocationsResponse;
104103
use Google\Cloud\Location\Location;
104+
use Google\LongRunning\Client\OperationsClient;
105105
use Google\LongRunning\GetOperationRequest;
106106
use Google\LongRunning\Operation;
107107
use Google\Protobuf\Any;

BigQueryAnalyticsHub/src/V1/Client/AnalyticsHubServiceClient.php

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
use Google\ApiCore\ApiException;
2828
use Google\ApiCore\CredentialsWrapper;
2929
use Google\ApiCore\GapicClientTrait;
30-
use Google\ApiCore\LongRunning\OperationsClient;
3130
use Google\ApiCore\OperationResponse;
3231
use Google\ApiCore\PagedListResponse;
3332
use Google\ApiCore\ResourceHelperTrait;
@@ -64,6 +63,7 @@
6463
use Google\Cloud\Iam\V1\SetIamPolicyRequest;
6564
use Google\Cloud\Iam\V1\TestIamPermissionsRequest;
6665
use Google\Cloud\Iam\V1\TestIamPermissionsResponse;
66+
use Google\LongRunning\Client\OperationsClient;
6767
use Google\LongRunning\Operation;
6868
use GuzzleHttp\Promise\PromiseInterface;
6969

@@ -186,6 +186,25 @@ public function resumeOperation($operationName, $methodName = null)
186186
return $operation;
187187
}
188188

189+
/**
190+
* Create the default operation client for the service.
191+
*
192+
* @param array $options ClientOptions for the client.
193+
*
194+
* @return OperationsClient
195+
*/
196+
private function createOperationsClient(array $options)
197+
{
198+
// Unset client-specific configuration options
199+
unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']);
200+
201+
if (isset($options['operationsClient'])) {
202+
return $options['operationsClient'];
203+
}
204+
205+
return new OperationsClient($options);
206+
}
207+
189208
/**
190209
* Formats a string containing the fully-qualified path to represent a
191210
* data_exchange resource.

BigQueryAnalyticsHub/tests/Unit/V1/Client/AnalyticsHubServiceClientTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
use Google\ApiCore\ApiException;
2626
use Google\ApiCore\CredentialsWrapper;
27-
use Google\ApiCore\LongRunning\OperationsClient;
2827
use Google\ApiCore\Testing\GeneratedTest;
2928
use Google\ApiCore\Testing\MockTransport;
3029
use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
@@ -65,6 +64,7 @@
6564
use Google\Cloud\Iam\V1\SetIamPolicyRequest;
6665
use Google\Cloud\Iam\V1\TestIamPermissionsRequest;
6766
use Google\Cloud\Iam\V1\TestIamPermissionsResponse;
67+
use Google\LongRunning\Client\OperationsClient;
6868
use Google\LongRunning\GetOperationRequest;
6969
use Google\LongRunning\Operation;
7070
use Google\Protobuf\Any;

0 commit comments

Comments
 (0)