Skip to content

Commit

Permalink
chore(php): support new surface LROs (#7355)
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 638666995
Source-Link: googleapis/googleapis@94da39f
Source-Link: googleapis/googleapis-gen@8a9dd85
Copy-Tag: eyJwIjoiU2VjdXJlU291cmNlTWFuYWdlci8uT3dsQm90LnlhbWwiLCJoIjoiOGE5ZGQ4NWJhNTZiYWUzN2Y0NzhiNGFkNjRjNGIxMmJlZjBlODc3ZiJ9
Copy-Tag: eyJwIjoiU2VjdXJpdHlDZW50ZXIvLk93bEJvdC55YW1sIiwiaCI6IjhhOWRkODViYTU2YmFlMzdmNDc4YjRhZDY0YzRiMTJiZWYwZTg3N2YifQ==
Copy-Tag: eyJwIjoiU3RvcmFnZUNvbnRyb2wvLk93bEJvdC55YW1sIiwiaCI6IjhhOWRkODViYTU2YmFlMzdmNDc4YjRhZDY0YzRiMTJiZWYwZTg3N2YifQ==
Copy-Tag: eyJwIjoiVGVsY29BdXRvbWF0aW9uLy5Pd2xCb3QueWFtbCIsImgiOiI4YTlkZDg1YmE1NmJhZTM3ZjQ3OGI0YWQ2NGM0YjEyYmVmMGU4NzdmIn0=
Copy-Tag: eyJwIjoiVHB1Ly5Pd2xCb3QueWFtbCIsImgiOiI4YTlkZDg1YmE1NmJhZTM3ZjQ3OGI0YWQ2NGM0YjEyYmVmMGU4NzdmIn0=
Copy-Tag: eyJwIjoiV29ya2Zsb3dzLy5Pd2xCb3QueWFtbCIsImgiOiI4YTlkZDg1YmE1NmJhZTM3ZjQ3OGI0YWQ2NGM0YjEyYmVmMGU4NzdmIn0=
Co-authored-by: Brent Shaffer <[email protected]>
  • Loading branch information
gcf-owl-bot[bot] and bshaffer authored May 30, 2024
1 parent 67fc636 commit 2825041
Show file tree
Hide file tree
Showing 12 changed files with 126 additions and 12 deletions.
21 changes: 20 additions & 1 deletion SecureSourceManager/src/V1/Client/SecureSourceManagerClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
use Google\ApiCore\ApiException;
use Google\ApiCore\CredentialsWrapper;
use Google\ApiCore\GapicClientTrait;
use Google\ApiCore\LongRunning\OperationsClient;
use Google\ApiCore\OperationResponse;
use Google\ApiCore\PagedListResponse;
use Google\ApiCore\ResourceHelperTrait;
Expand All @@ -53,6 +52,7 @@
use Google\Cloud\SecureSourceManager\V1\ListInstancesRequest;
use Google\Cloud\SecureSourceManager\V1\ListRepositoriesRequest;
use Google\Cloud\SecureSourceManager\V1\Repository;
use Google\LongRunning\Client\OperationsClient;
use Google\LongRunning\Operation;
use GuzzleHttp\Promise\PromiseInterface;

Expand Down Expand Up @@ -182,6 +182,25 @@ public function resumeOperation($operationName, $methodName = null)
return $operation;
}

/**
* Create the default operation client for the service.
*
* @param array $options ClientOptions for the client.
*
* @return OperationsClient
*/
private function createOperationsClient(array $options)
{
// Unset client-specific configuration options
unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']);

if (isset($options['operationsClient'])) {
return $options['operationsClient'];
}

return new OperationsClient($options);
}

/**
* Formats a string containing the fully-qualified path to represent a crypto_key
* resource.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

use Google\ApiCore\ApiException;
use Google\ApiCore\CredentialsWrapper;
use Google\ApiCore\LongRunning\OperationsClient;
use Google\ApiCore\Testing\GeneratedTest;
use Google\ApiCore\Testing\MockTransport;
use Google\Cloud\Iam\V1\GetIamPolicyRequest;
Expand All @@ -49,6 +48,7 @@
use Google\Cloud\SecureSourceManager\V1\ListRepositoriesRequest;
use Google\Cloud\SecureSourceManager\V1\ListRepositoriesResponse;
use Google\Cloud\SecureSourceManager\V1\Repository;
use Google\LongRunning\Client\OperationsClient;
use Google\LongRunning\GetOperationRequest;
use Google\LongRunning\Operation;
use Google\Protobuf\Any;
Expand Down
21 changes: 20 additions & 1 deletion SecurityCenter/src/V2/Client/SecurityCenterClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
use Google\ApiCore\ApiException;
use Google\ApiCore\CredentialsWrapper;
use Google\ApiCore\GapicClientTrait;
use Google\ApiCore\LongRunning\OperationsClient;
use Google\ApiCore\OperationResponse;
use Google\ApiCore\PagedListResponse;
use Google\ApiCore\ResourceHelperTrait;
Expand Down Expand Up @@ -88,6 +87,7 @@
use Google\Cloud\SecurityCenter\V2\UpdateSecurityMarksRequest;
use Google\Cloud\SecurityCenter\V2\UpdateSourceRequest;
use Google\Cloud\SecurityCenter\V2\ValuedResource;
use Google\LongRunning\Client\OperationsClient;
use Google\LongRunning\Operation;
use GuzzleHttp\Promise\PromiseInterface;

Expand Down Expand Up @@ -222,6 +222,25 @@ public function resumeOperation($operationName, $methodName = null)
return $operation;
}

/**
* Create the default operation client for the service.
*
* @param array $options ClientOptions for the client.
*
* @return OperationsClient
*/
private function createOperationsClient(array $options)
{
// Unset client-specific configuration options
unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']);

if (isset($options['operationsClient'])) {
return $options['operationsClient'];
}

return new OperationsClient($options);
}

/**
* Formats a string containing the fully-qualified path to represent a
* big_query_export resource.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

use Google\ApiCore\ApiException;
use Google\ApiCore\CredentialsWrapper;
use Google\ApiCore\LongRunning\OperationsClient;
use Google\ApiCore\Testing\GeneratedTest;
use Google\ApiCore\Testing\MockTransport;
use Google\Cloud\Iam\V1\GetIamPolicyRequest;
Expand Down Expand Up @@ -97,6 +96,7 @@
use Google\Cloud\SecurityCenter\V2\UpdateSecurityMarksRequest;
use Google\Cloud\SecurityCenter\V2\UpdateSourceRequest;
use Google\Cloud\SecurityCenter\V2\ValuedResource;
use Google\LongRunning\Client\OperationsClient;
use Google\LongRunning\GetOperationRequest;
use Google\LongRunning\Operation;
use Google\Protobuf\Any;
Expand Down
21 changes: 20 additions & 1 deletion StorageControl/src/V2/Client/StorageControlClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
use Google\ApiCore\ApiException;
use Google\ApiCore\CredentialsWrapper;
use Google\ApiCore\GapicClientTrait;
use Google\ApiCore\LongRunning\OperationsClient;
use Google\ApiCore\OperationResponse;
use Google\ApiCore\PagedListResponse;
use Google\ApiCore\ResourceHelperTrait;
Expand All @@ -48,6 +47,7 @@
use Google\Cloud\Storage\Control\V2\ManagedFolder;
use Google\Cloud\Storage\Control\V2\RenameFolderRequest;
use Google\Cloud\Storage\Control\V2\StorageLayout;
use Google\LongRunning\Client\OperationsClient;
use Google\LongRunning\Operation;
use GuzzleHttp\Promise\PromiseInterface;

Expand Down Expand Up @@ -159,6 +159,25 @@ public function resumeOperation($operationName, $methodName = null)
return $operation;
}

/**
* Create the default operation client for the service.
*
* @param array $options ClientOptions for the client.
*
* @return OperationsClient
*/
private function createOperationsClient(array $options)
{
// Unset client-specific configuration options
unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']);

if (isset($options['operationsClient'])) {
return $options['operationsClient'];
}

return new OperationsClient($options);
}

/**
* Formats a string containing the fully-qualified path to represent a bucket
* resource.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

use Google\ApiCore\ApiException;
use Google\ApiCore\CredentialsWrapper;
use Google\ApiCore\LongRunning\OperationsClient;
use Google\ApiCore\Testing\GeneratedTest;
use Google\ApiCore\Testing\MockTransport;
use Google\Cloud\Storage\Control\V2\Client\StorageControlClient;
Expand All @@ -43,6 +42,7 @@
use Google\Cloud\Storage\Control\V2\ManagedFolder;
use Google\Cloud\Storage\Control\V2\RenameFolderRequest;
use Google\Cloud\Storage\Control\V2\StorageLayout;
use Google\LongRunning\Client\OperationsClient;
use Google\LongRunning\GetOperationRequest;
use Google\LongRunning\Operation;
use Google\Protobuf\Any;
Expand Down
21 changes: 20 additions & 1 deletion TelcoAutomation/src/V1/Client/TelcoAutomationClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
use Google\ApiCore\ApiException;
use Google\ApiCore\CredentialsWrapper;
use Google\ApiCore\GapicClientTrait;
use Google\ApiCore\LongRunning\OperationsClient;
use Google\ApiCore\OperationResponse;
use Google\ApiCore\PagedListResponse;
use Google\ApiCore\ResourceHelperTrait;
Expand Down Expand Up @@ -83,6 +82,7 @@
use Google\Cloud\TelcoAutomation\V1\UpdateBlueprintRequest;
use Google\Cloud\TelcoAutomation\V1\UpdateDeploymentRequest;
use Google\Cloud\TelcoAutomation\V1\UpdateHydratedDeploymentRequest;
use Google\LongRunning\Client\OperationsClient;
use Google\LongRunning\Operation;
use GuzzleHttp\Promise\PromiseInterface;

Expand Down Expand Up @@ -219,6 +219,25 @@ public function resumeOperation($operationName, $methodName = null)
return $operation;
}

/**
* Create the default operation client for the service.
*
* @param array $options ClientOptions for the client.
*
* @return OperationsClient
*/
private function createOperationsClient(array $options)
{
// Unset client-specific configuration options
unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']);

if (isset($options['operationsClient'])) {
return $options['operationsClient'];
}

return new OperationsClient($options);
}

/**
* Formats a string containing the fully-qualified path to represent a blueprint
* resource.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

use Google\ApiCore\ApiException;
use Google\ApiCore\CredentialsWrapper;
use Google\ApiCore\LongRunning\OperationsClient;
use Google\ApiCore\Testing\GeneratedTest;
use Google\ApiCore\Testing\MockTransport;
use Google\Cloud\Location\GetLocationRequest;
Expand Down Expand Up @@ -87,6 +86,7 @@
use Google\Cloud\TelcoAutomation\V1\UpdateBlueprintRequest;
use Google\Cloud\TelcoAutomation\V1\UpdateDeploymentRequest;
use Google\Cloud\TelcoAutomation\V1\UpdateHydratedDeploymentRequest;
use Google\LongRunning\Client\OperationsClient;
use Google\LongRunning\GetOperationRequest;
use Google\LongRunning\Operation;
use Google\Protobuf\Any;
Expand Down
21 changes: 20 additions & 1 deletion Tpu/src/V2/Client/TpuClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
use Google\ApiCore\ApiException;
use Google\ApiCore\CredentialsWrapper;
use Google\ApiCore\GapicClientTrait;
use Google\ApiCore\LongRunning\OperationsClient;
use Google\ApiCore\OperationResponse;
use Google\ApiCore\PagedListResponse;
use Google\ApiCore\ResourceHelperTrait;
Expand Down Expand Up @@ -56,6 +55,7 @@
use Google\Cloud\Tpu\V2\StartNodeRequest;
use Google\Cloud\Tpu\V2\StopNodeRequest;
use Google\Cloud\Tpu\V2\UpdateNodeRequest;
use Google\LongRunning\Client\OperationsClient;
use Google\LongRunning\Operation;
use GuzzleHttp\Promise\PromiseInterface;

Expand Down Expand Up @@ -167,6 +167,25 @@ public function resumeOperation($operationName, $methodName = null)
return $operation;
}

/**
* Create the default operation client for the service.
*
* @param array $options ClientOptions for the client.
*
* @return OperationsClient
*/
private function createOperationsClient(array $options)
{
// Unset client-specific configuration options
unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']);

if (isset($options['operationsClient'])) {
return $options['operationsClient'];
}

return new OperationsClient($options);
}

/**
* Formats a string containing the fully-qualified path to represent a
* accelerator_type resource.
Expand Down
2 changes: 1 addition & 1 deletion Tpu/tests/Unit/V2/Client/TpuClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

use Google\ApiCore\ApiException;
use Google\ApiCore\CredentialsWrapper;
use Google\ApiCore\LongRunning\OperationsClient;
use Google\ApiCore\Testing\GeneratedTest;
use Google\ApiCore\Testing\MockTransport;
use Google\Cloud\Location\GetLocationRequest;
Expand Down Expand Up @@ -53,6 +52,7 @@
use Google\Cloud\Tpu\V2\StartNodeRequest;
use Google\Cloud\Tpu\V2\StopNodeRequest;
use Google\Cloud\Tpu\V2\UpdateNodeRequest;
use Google\LongRunning\Client\OperationsClient;
use Google\LongRunning\GetOperationRequest;
use Google\LongRunning\Operation;
use Google\Protobuf\Any;
Expand Down
21 changes: 20 additions & 1 deletion Workflows/src/V1/Client/WorkflowsClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
use Google\ApiCore\ApiException;
use Google\ApiCore\CredentialsWrapper;
use Google\ApiCore\GapicClientTrait;
use Google\ApiCore\LongRunning\OperationsClient;
use Google\ApiCore\OperationResponse;
use Google\ApiCore\PagedListResponse;
use Google\ApiCore\ResourceHelperTrait;
Expand All @@ -44,6 +43,7 @@
use Google\Cloud\Workflows\V1\ListWorkflowsRequest;
use Google\Cloud\Workflows\V1\UpdateWorkflowRequest;
use Google\Cloud\Workflows\V1\Workflow;
use Google\LongRunning\Client\OperationsClient;
use Google\LongRunning\Operation;
use GuzzleHttp\Promise\PromiseInterface;

Expand Down Expand Up @@ -147,6 +147,25 @@ public function resumeOperation($operationName, $methodName = null)
return $operation;
}

/**
* Create the default operation client for the service.
*
* @param array $options ClientOptions for the client.
*
* @return OperationsClient
*/
private function createOperationsClient(array $options)
{
// Unset client-specific configuration options
unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']);

if (isset($options['operationsClient'])) {
return $options['operationsClient'];
}

return new OperationsClient($options);
}

/**
* Formats a string containing the fully-qualified path to represent a crypto_key
* resource.
Expand Down
2 changes: 1 addition & 1 deletion Workflows/tests/Unit/V1/Client/WorkflowsClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

use Google\ApiCore\ApiException;
use Google\ApiCore\CredentialsWrapper;
use Google\ApiCore\LongRunning\OperationsClient;
use Google\ApiCore\Testing\GeneratedTest;
use Google\ApiCore\Testing\MockTransport;
use Google\Cloud\Location\GetLocationRequest;
Expand All @@ -39,6 +38,7 @@
use Google\Cloud\Workflows\V1\ListWorkflowsResponse;
use Google\Cloud\Workflows\V1\UpdateWorkflowRequest;
use Google\Cloud\Workflows\V1\Workflow;
use Google\LongRunning\Client\OperationsClient;
use Google\LongRunning\GetOperationRequest;
use Google\LongRunning\Operation;
use Google\Protobuf\Any;
Expand Down

0 comments on commit 2825041

Please sign in to comment.