Skip to content

Commit

Permalink
feat: mark new surface GA and previous surface deprecated (#674)
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer authored Dec 6, 2023
1 parent a015824 commit e45bf0e
Show file tree
Hide file tree
Showing 53 changed files with 90 additions and 63 deletions.
13 changes: 6 additions & 7 deletions src/Generation/GapicClientGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,13 @@ private function generateClass(): PhpClass
'a parseName method to extract the individual identifiers contained within formatted names ' .
'that are returned by the API.'
),
// If this service contains both client surfaces, link to the new surface.
in_array($this->serviceDetails->migrationMode, [MigrationMode::MIGRATING, MigrationMode::MIGRATION_MODE_UNSPECIFIED])
? PhpDoc::text(
'This service has a new (beta) implementation. See {@see ' .
$this->serviceDetails->gapicClientV2Type->getFullname() . '} to use the new surface.'
) : null,
$this->serviceDetails->isGa() ? null : PhpDoc::experimental(),
!$this->serviceDetails->isDeprecated ? null : PhpDoc::deprecated(ServiceDetails::DEPRECATED_MSG)
PhpDoc::deprecated(
// If this service contains both client surfaces, link to the new surface.
in_array($this->serviceDetails->migrationMode, [MigrationMode::MIGRATING, MigrationMode::MIGRATION_MODE_UNSPECIFIED])
? 'Please use the new service client {@see ' . $this->serviceDetails->gapicClientV2Type->getFullname() . '}.'
: ServiceDetails::DEPRECATED_MSG
)
))
->withTrait($this->ctx->type(Type::fromName(\Google\ApiCore\GapicClientTrait::class)))
->withMember($this->serviceName())
Expand Down
14 changes: 1 addition & 13 deletions src/Generation/GapicClientV2Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,19 +127,7 @@ private function generateClass(): PhpClass
'a parseName method to extract the individual identifiers contained within formatted names ' .
'that are returned by the API.'
),
// TODO(#594): Uncomment this and remove the following two lines when stable.
// $this->serviceDetails->isGa() ? null : PhpDoc::experimental(),
PhpDoc::text(
'This class is currently experimental and may be subject to changes.' .
// If this service is GA and contains both client surfaces, link to the stable surface.
($this->serviceDetails->isGa() && in_array(
$this->serviceDetails->migrationMode,
[MigrationMode::MIGRATING, MigrationMode::MIGRATION_MODE_UNSPECIFIED]
)
? ' See {@see ' . $this->serviceDetails->emptyClientType->getFullname() . '} for the stable implementation'
: '')
),
PhpDoc::experimental(),
$this->serviceDetails->isGa() ? null : PhpDoc::experimental(),
!$this->serviceDetails->isDeprecated ? null : PhpDoc::deprecated(ServiceDetails::DEPRECATED_MSG),
$this->serviceDetails->streamingOnly ? null : $this->magicAsyncDocs(),
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@
* assist with these names, this class includes a format method for each type of
* name, and additionally a parseName method to extract the individual identifiers
* contained within formatted names that are returned by the API.
*
* @deprecated This class will be removed in the next major version update.
*/
class AssetServiceGapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@
* $addressesClient->close();
* }
* ```
*
* @deprecated This class will be removed in the next major version update.
*/
class AddressesGapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
* $regionOperationsClient->close();
* }
* ```
*
* @deprecated This class will be removed in the next major version update.
*/
class RegionOperationsGapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@
* $clusterManagerClient->close();
* }
* ```
*
* @deprecated This class will be removed in the next major version update.
*/
class ClusterManagerGapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
* assist with these names, this class includes a format method for each type of
* name, and additionally a parseName method to extract the individual identifiers
* contained within formatted names that are returned by the API.
*
* @deprecated This class will be removed in the next major version update.
*/
class AutoscalingPolicyServiceGapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@
* assist with these names, this class includes a format method for each type of
* name, and additionally a parseName method to extract the individual identifiers
* contained within formatted names that are returned by the API.
*
* @deprecated This class will be removed in the next major version update.
*/
class ClusterControllerGapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
* $jobControllerClient->close();
* }
* ```
*
* @deprecated This class will be removed in the next major version update.
*/
class JobControllerGapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
* assist with these names, this class includes a format method for each type of
* name, and additionally a parseName method to extract the individual identifiers
* contained within formatted names that are returned by the API.
*
* @deprecated This class will be removed in the next major version update.
*/
class WorkflowTemplateServiceGapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@
* name, and additionally a parseName method to extract the individual identifiers
* contained within formatted names that are returned by the API.
*
* This class is currently experimental and may be subject to changes.
*
* @experimental
*
* @method PromiseInterface callFunctionAsync(CallFunctionRequest $request, array $optionalArgs = [])
* @method PromiseInterface createFunctionAsync(CreateFunctionRequest $request, array $optionalArgs = [])
* @method PromiseInterface deleteFunctionAsync(DeleteFunctionRequest $request, array $optionalArgs = [])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@
* $iAMPolicyClient->close();
* }
* ```
*
* @deprecated This class will be removed in the next major version update.
*/
class IAMPolicyGapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@
* assist with these names, this class includes a format method for each type of
* name, and additionally a parseName method to extract the individual identifiers
* contained within formatted names that are returned by the API.
*
* @deprecated This class will be removed in the next major version update.
*/
class KeyManagementServiceGapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@
* assist with these names, this class includes a format method for each type of
* name, and additionally a parseName method to extract the individual identifiers
* contained within formatted names that are returned by the API.
*
* @deprecated This class will be removed in the next major version update.
*/
class ConfigServiceV2GapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
* assist with these names, this class includes a format method for each type of
* name, and additionally a parseName method to extract the individual identifiers
* contained within formatted names that are returned by the API.
*
* @deprecated This class will be removed in the next major version update.
*/
class LoggingServiceV2GapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
* assist with these names, this class includes a format method for each type of
* name, and additionally a parseName method to extract the individual identifiers
* contained within formatted names that are returned by the API.
*
* @deprecated This class will be removed in the next major version update.
*/
class MetricsServiceV2GapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@
* name, and additionally a parseName method to extract the individual identifiers
* contained within formatted names that are returned by the API.
*
* This class is currently experimental and may be subject to changes. See {@see
* \Google\Cloud\Redis\V1\CloudRedisClient} for the stable implementation
*
* @experimental
*
* @method PromiseInterface createInstanceAsync(CreateInstanceRequest $request, array $optionalArgs = [])
* @method PromiseInterface deleteInstanceAsync(DeleteInstanceRequest $request, array $optionalArgs = [])
* @method PromiseInterface exportInstanceAsync(ExportInstanceRequest $request, array $optionalArgs = [])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@
* name, and additionally a parseName method to extract the individual identifiers
* contained within formatted names that are returned by the API.
*
* This service has a new (beta) implementation. See {@see
* \Google\Cloud\Redis\V1\Client\CloudRedisClient} to use the new surface.
* @deprecated Please use the new service client {@see \Google\Cloud\Redis\V1\Client\CloudRedisClient}.
*/
class CloudRedisGapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
* contained within formatted names that are returned by the API.
*
* @experimental
*
* @deprecated This class will be removed in the next major version update.
*/
class CatalogServiceGapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
* contained within formatted names that are returned by the API.
*
* @experimental
*
* @deprecated This class will be removed in the next major version update.
*/
class CompletionServiceGapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
* contained within formatted names that are returned by the API.
*
* @experimental
*
* @deprecated This class will be removed in the next major version update.
*/
class PredictionServiceGapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@
* contained within formatted names that are returned by the API.
*
* @experimental
*
* @deprecated This class will be removed in the next major version update.
*/
class ProductServiceGapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@
* contained within formatted names that are returned by the API.
*
* @experimental
*
* @deprecated This class will be removed in the next major version update.
*/
class SearchServiceGapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@
* contained within formatted names that are returned by the API.
*
* @experimental
*
* @deprecated This class will be removed in the next major version update.
*/
class UserEventServiceGapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,6 @@
* name, and additionally a parseName method to extract the individual identifiers
* contained within formatted names that are returned by the API.
*
* This class is currently experimental and may be subject to changes. See {@see
* \Google\Cloud\SecurityCenter\V1\SecurityCenterClient} for the stable
* implementation
*
* @experimental
*
* @method PromiseInterface createFindingAsync(CreateFindingRequest $request, array $optionalArgs = [])
* @method PromiseInterface createNotificationConfigAsync(CreateNotificationConfigRequest $request, array $optionalArgs = [])
* @method PromiseInterface createSourceAsync(CreateSourceRequest $request, array $optionalArgs = [])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,7 @@
* name, and additionally a parseName method to extract the individual identifiers
* contained within formatted names that are returned by the API.
*
* This service has a new (beta) implementation. See {@see
* \Google\Cloud\SecurityCenter\V1\Client\SecurityCenterClient} to use the new
* surface.
* @deprecated Please use the new service client {@see \Google\Cloud\SecurityCenter\V1\Client\SecurityCenterClient}.
*/
class SecurityCenterGapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@
* $speechClient->close();
* }
* ```
*
* @deprecated This class will be removed in the next major version update.
*/
class SpeechGapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
* contained within formatted names that are returned by the API.
*
* @experimental
*
* @deprecated This class will be removed in the next major version update.
*/
class ApplicationServiceGapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
* contained within formatted names that are returned by the API.
*
* @experimental
*
* @deprecated This class will be removed in the next major version update.
*/
class CompanyServiceGapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
* contained within formatted names that are returned by the API.
*
* @experimental
*
* @deprecated This class will be removed in the next major version update.
*/
class CompletionGapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
* contained within formatted names that are returned by the API.
*
* @experimental
*
* @deprecated This class will be removed in the next major version update.
*/
class EventServiceGapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@
* contained within formatted names that are returned by the API.
*
* @experimental
*
* @deprecated This class will be removed in the next major version update.
*/
class JobServiceGapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
* contained within formatted names that are returned by the API.
*
* @experimental
*
* @deprecated This class will be removed in the next major version update.
*/
class ProfileServiceGapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
* contained within formatted names that are returned by the API.
*
* @experimental
*
* @deprecated This class will be removed in the next major version update.
*/
class TenantServiceGapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@
* $videoIntelligenceServiceClient->close();
* }
* ```
*
* @deprecated This class will be removed in the next major version update.
*/
class VideoIntelligenceServiceGapicClient
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Tools/ConfigLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

namespace Google\Generator\Tests\Tools;

trait ConfigLoader
class ConfigLoader
{
/**
* Load a config file from the specified path, which must be relative to the `tests/Unit` directory.
Expand Down
4 changes: 0 additions & 4 deletions tests/Unit/ProtoTests/Basic/out/src/Client/BasicClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@
* This class provides the ability to make remote calls to the backing service through method
* calls that map to API methods.
*
* This class is currently experimental and may be subject to changes.
*
* @experimental
*
* @method PromiseInterface aMethodAsync(Request $request, array $optionalArgs = [])
* @method PromiseInterface methodWithArgsAsync(RequestWithArgs $request, array $optionalArgs = [])
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@
* $basicBidiStreamingClient->close();
* }
* ```
*
* @deprecated This class will be removed in the next major version update.
*/
class BasicBidiStreamingGapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
* $basicClientStreamingClient->close();
* }
* ```
*
* @deprecated This class will be removed in the next major version update.
*/
class BasicClientStreamingGapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@
* assist with these names, this class includes a format method for each type of
* name, and additionally a parseName method to extract the individual identifiers
* contained within formatted names that are returned by the API.
*
* @deprecated This class will be removed in the next major version update.
*/
class LibraryGapicClient
{
Expand Down
Loading

0 comments on commit e45bf0e

Please sign in to comment.