Skip to content

Commit 44a4742

Browse files
chore(php): support new surface LROs (#7354)
PiperOrigin-RevId: 638666995 Source-Link: googleapis/googleapis@94da39f Source-Link: googleapis/googleapis-gen@8a9dd85 Copy-Tag: eyJwIjoiQXBwSHViLy5Pd2xCb3QueWFtbCIsImgiOiI4YTlkZDg1YmE1NmJhZTM3ZjQ3OGI0YWQ2NGM0YjEyYmVmMGU4NzdmIn0= Copy-Tag: eyJwIjoiQXBwc0V2ZW50c1N1YnNjcmlwdGlvbnMvLk93bEJvdC55YW1sIiwiaCI6IjhhOWRkODViYTU2YmFlMzdmNDc4YjRhZDY0YzRiMTJiZWYwZTg3N2YifQ== Copy-Tag: eyJwIjoiQXJ0aWZhY3RSZWdpc3RyeS8uT3dsQm90LnlhbWwiLCJoIjoiOGE5ZGQ4NWJhNTZiYWUzN2Y0NzhiNGFkNjRjNGIxMmJlZjBlODc3ZiJ9 Copy-Tag: eyJwIjoiQXNzdXJlZFdvcmtsb2Fkcy8uT3dsQm90LnlhbWwiLCJoIjoiOGE5ZGQ4NWJhNTZiYWUzN2Y0NzhiNGFkNjRjNGIxMmJlZjBlODc3ZiJ9 Copy-Tag: eyJwIjoiQ29tbWVyY2VDb25zdW1lclByb2N1cmVtZW50Ly5Pd2xCb3QueWFtbCIsImgiOiI4YTlkZDg1YmE1NmJhZTM3ZjQ3OGI0YWQ2NGM0YjEyYmVmMGU4NzdmIn0= Copy-Tag: eyJwIjoiQ29tcHV0ZS8uT3dsQm90LnlhbWwiLCJoIjoiOGE5ZGQ4NWJhNTZiYWUzN2Y0NzhiNGFkNjRjNGIxMmJlZjBlODc3ZiJ9 Copy-Tag: eyJwIjoiQ29uZmlnLy5Pd2xCb3QueWFtbCIsImgiOiI4YTlkZDg1YmE1NmJhZTM3ZjQ3OGI0YWQ2NGM0YjEyYmVmMGU4NzdmIn0= Copy-Tag: eyJwIjoiRGV2ZWxvcGVyQ29ubmVjdC8uT3dsQm90LnlhbWwiLCJoIjoiOGE5ZGQ4NWJhN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E5ZGQ4NWJhNTZiYWUzN2Y0NzhiNGFkNjRjNGIxMmJlZjBlODc3ZiJ9 Copy-Tag: eyJwIjoiUG9saWN5U2ltdWxhdG9yLy5Pd2xCb3QueWFtbCIsImgiOiI4YTlkZDg1YmE1NmJhZTM3ZjQ3OGI0YWQ2NGM0YjEyYmVmMGU4NzdmIn0= Copy-Tag: eyJwIjoiUmFwaWRNaWdyYXRpb25Bc3Nlc3NtZW50Ly5Pd2xCb3QueWFtbCIsImgiOiI4YTlkZDg1YmE1NmJhZTM3ZjQ3OGI0YWQ2NGM0YjEyYmVmMGU4NzdmIn0= Copy-Tag: eyJwIjoiUmVkaXNDbHVzdGVyLy5Pd2xCb3QueWFtbCIsImgiOiI4YTlkZDg1YmE1NmJhZTM3ZjQ3OGI0YWQ2NGM0YjEyYmVmMGU4NzdmIn0= Co-authored-by: Brent Shaffer <betterbrent@google.com>
1 parent f86b038 commit 44a4742

297 files changed

Lines changed: 2247 additions & 54 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AppHub/src/V1/Client/AppHubClient.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;
@@ -80,6 +79,7 @@
8079
use Google\Cloud\Location\GetLocationRequest;
8180
use Google\Cloud\Location\ListLocationsRequest;
8281
use Google\Cloud\Location\Location;
82+
use Google\LongRunning\Client\OperationsClient;
8383
use Google\LongRunning\Operation;
8484
use GuzzleHttp\Promise\PromiseInterface;
8585

@@ -206,6 +206,25 @@ public function resumeOperation($operationName, $methodName = null)
206206
return $operation;
207207
}
208208

209+
/**
210+
* Create the default operation client for the service.
211+
*
212+
* @param array $options ClientOptions for the client.
213+
*
214+
* @return OperationsClient
215+
*/
216+
private function createOperationsClient(array $options)
217+
{
218+
// Unset client-specific configuration options
219+
unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']);
220+
221+
if (isset($options['operationsClient'])) {
222+
return $options['operationsClient'];
223+
}
224+
225+
return new OperationsClient($options);
226+
}
227+
209228
/**
210229
* Formats a string containing the fully-qualified path to represent a application
211230
* resource.

AppHub/tests/Unit/V1/Client/AppHubClientTest.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\AppHub\V1\Application;
@@ -82,6 +81,7 @@
8281
use Google\Cloud\Location\ListLocationsRequest;
8382
use Google\Cloud\Location\ListLocationsResponse;
8483
use Google\Cloud\Location\Location;
84+
use Google\LongRunning\Client\OperationsClient;
8585
use Google\LongRunning\GetOperationRequest;
8686
use Google\LongRunning\Operation;
8787
use Google\Protobuf\Any;

AppsEventsSubscriptions/src/V1/Client/SubscriptionsServiceClient.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;
@@ -42,6 +41,7 @@
4241
use Google\Apps\Events\Subscriptions\V1\Subscription;
4342
use Google\Apps\Events\Subscriptions\V1\UpdateSubscriptionRequest;
4443
use Google\Auth\FetchAuthTokenInterface;
44+
use Google\LongRunning\Client\OperationsClient;
4545
use Google\LongRunning\Operation;
4646
use GuzzleHttp\Promise\PromiseInterface;
4747

@@ -154,6 +154,25 @@ public function resumeOperation($operationName, $methodName = null)
154154
return $operation;
155155
}
156156

157+
/**
158+
* Create the default operation client for the service.
159+
*
160+
* @param array $options ClientOptions for the client.
161+
*
162+
* @return OperationsClient
163+
*/
164+
private function createOperationsClient(array $options)
165+
{
166+
// Unset client-specific configuration options
167+
unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']);
168+
169+
if (isset($options['operationsClient'])) {
170+
return $options['operationsClient'];
171+
}
172+
173+
return new OperationsClient($options);
174+
}
175+
157176
/**
158177
* Formats a string containing the fully-qualified path to represent a subscription
159178
* resource.

AppsEventsSubscriptions/tests/Unit/V1/Client/SubscriptionsServiceClientTest.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\Apps\Events\Subscriptions\V1\Client\SubscriptionsServiceClient;
@@ -37,6 +36,7 @@
3736
use Google\Apps\Events\Subscriptions\V1\ReactivateSubscriptionRequest;
3837
use Google\Apps\Events\Subscriptions\V1\Subscription;
3938
use Google\Apps\Events\Subscriptions\V1\UpdateSubscriptionRequest;
39+
use Google\LongRunning\Client\OperationsClient;
4040
use Google\LongRunning\GetOperationRequest;
4141
use Google\LongRunning\Operation;
4242
use Google\Protobuf\Any;

ArtifactRegistry/src/V1/Client/ArtifactRegistryClient.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;
@@ -87,6 +86,7 @@
8786
use Google\Cloud\Location\GetLocationRequest;
8887
use Google\Cloud\Location\ListLocationsRequest;
8988
use Google\Cloud\Location\Location;
89+
use Google\LongRunning\Client\OperationsClient;
9090
use Google\LongRunning\Operation;
9191
use GuzzleHttp\Promise\PromiseInterface;
9292

@@ -232,6 +232,25 @@ public function resumeOperation($operationName, $methodName = null)
232232
return $operation;
233233
}
234234

235+
/**
236+
* Create the default operation client for the service.
237+
*
238+
* @param array $options ClientOptions for the client.
239+
*
240+
* @return OperationsClient
241+
*/
242+
private function createOperationsClient(array $options)
243+
{
244+
// Unset client-specific configuration options
245+
unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']);
246+
247+
if (isset($options['operationsClient'])) {
248+
return $options['operationsClient'];
249+
}
250+
251+
return new OperationsClient($options);
252+
}
253+
235254
/**
236255
* Formats a string containing the fully-qualified path to represent a docker_image
237256
* resource.

ArtifactRegistry/tests/Unit/V1/Client/ArtifactRegistryClientTest.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\ArtifactRegistry\V1\BatchDeleteVersionsRequest;
@@ -92,6 +91,7 @@
9291
use Google\Cloud\Location\ListLocationsRequest;
9392
use Google\Cloud\Location\ListLocationsResponse;
9493
use Google\Cloud\Location\Location;
94+
use Google\LongRunning\Client\OperationsClient;
9595
use Google\LongRunning\GetOperationRequest;
9696
use Google\LongRunning\Operation;
9797
use Google\Protobuf\Any;

AssuredWorkloads/src/V1/Client/AssuredWorkloadsServiceClient.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;
@@ -48,6 +47,7 @@
4847
use Google\Cloud\AssuredWorkloads\V1\UpdateWorkloadRequest;
4948
use Google\Cloud\AssuredWorkloads\V1\Violation;
5049
use Google\Cloud\AssuredWorkloads\V1\Workload;
50+
use Google\LongRunning\Client\OperationsClient;
5151
use Google\LongRunning\Operation;
5252
use GuzzleHttp\Promise\PromiseInterface;
5353

@@ -151,6 +151,25 @@ public function resumeOperation($operationName, $methodName = null)
151151
return $operation;
152152
}
153153

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

AssuredWorkloads/tests/Unit/V1/Client/AssuredWorkloadsServiceClientTest.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\AssuredWorkloads\V1\AcknowledgeViolationRequest;
@@ -45,6 +44,7 @@
4544
use Google\Cloud\AssuredWorkloads\V1\Violation;
4645
use Google\Cloud\AssuredWorkloads\V1\Workload;
4746
use Google\Cloud\AssuredWorkloads\V1\Workload\ComplianceRegime;
47+
use Google\LongRunning\Client\OperationsClient;
4848
use Google\LongRunning\GetOperationRequest;
4949
use Google\LongRunning\Operation;
5050
use Google\Protobuf\Any;

CommerceConsumerProcurement/src/V1/Client/ConsumerProcurementServiceClient.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;
@@ -39,6 +38,7 @@
3938
use Google\Cloud\Commerce\Consumer\Procurement\V1\ListOrdersRequest;
4039
use Google\Cloud\Commerce\Consumer\Procurement\V1\Order;
4140
use Google\Cloud\Commerce\Consumer\Procurement\V1\PlaceOrderRequest;
41+
use Google\LongRunning\Client\OperationsClient;
4242
use Google\LongRunning\Operation;
4343
use GuzzleHttp\Promise\PromiseInterface;
4444

@@ -146,6 +146,25 @@ public function resumeOperation($operationName, $methodName = null)
146146
return $operation;
147147
}
148148

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

CommerceConsumerProcurement/tests/Unit/V1/Client/ConsumerProcurementServiceClientTest.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\Commerce\Consumer\Procurement\V1\Client\ConsumerProcurementServiceClient;
@@ -33,6 +32,7 @@
3332
use Google\Cloud\Commerce\Consumer\Procurement\V1\ListOrdersResponse;
3433
use Google\Cloud\Commerce\Consumer\Procurement\V1\Order;
3534
use Google\Cloud\Commerce\Consumer\Procurement\V1\PlaceOrderRequest;
35+
use Google\LongRunning\Client\OperationsClient;
3636
use Google\LongRunning\GetOperationRequest;
3737
use Google\LongRunning\Operation;
3838
use Google\Protobuf\Any;

0 commit comments

Comments
 (0)