Skip to content

Commit

Permalink
chore: add migration information to service class descriptions (#638)
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer committed Jun 9, 2023
1 parent 500e006 commit 2e1f6d3
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 5 deletions.
7 changes: 7 additions & 0 deletions src/Generation/GapicClientGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
use Google\Generator\Collections\Map;
use Google\Generator\Collections\Vector;
use Google\Generator\Utils\Helpers;
use Google\Generator\Utils\MigrationMode;
use Google\Generator\Utils\ResolvedType;
use Google\Generator\Utils\Transport;
use Google\Generator\Utils\Type;
Expand Down Expand Up @@ -119,6 +120,12 @@ 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->emptyClientV2Type->getFullname() . '} to use the new surface.'
) : null,
$this->serviceDetails->isGa() ? null : PhpDoc::experimental(),
!$this->serviceDetails->isDeprecated ? null : PhpDoc::deprecated(ServiceDetails::DEPRECATED_MSG)
))
Expand Down
11 changes: 10 additions & 1 deletion src/Generation/GapicClientV2Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,16 @@ private function generateClass(): PhpClass
),
// 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.'),
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(),
PhpDoc::internal(),
!$this->serviceDetails->isDeprecated ? null : PhpDoc::deprecated(ServiceDetails::DEPRECATED_MSG),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
* 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.
* This class is currently experimental and may be subject to changes. See {@see
* \Google\Cloud\Redis\V1\CloudRedisClient} for the stable implementation
*
* @experimental
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@
* 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.
*
* This service has a new (beta) implementation. See {@see
* \Google\Cloud\Redis\V1\Client\CloudRedisClient} to use the new surface.
*/
class CloudRedisGapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@
* 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.
* This class is currently experimental and may be subject to changes. See {@see
* \Google\Cloud\SecurityCenter\V1\SecurityCenterClient} for the stable
* implementation
*
* @experimental
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@
* 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.
*
* This service has a new (beta) implementation. See {@see
* \Google\Cloud\SecurityCenter\V1\Client\SecurityCenterClient} to use the new
* surface.
*/
class SecurityCenterGapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
* 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.
* This class is currently experimental and may be subject to changes. See {@see
* \Testing\ResourceNames\ResourceNamesClient} for the stable implementation
*
* @experimental
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@
* 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.
*
* This service has a new (beta) implementation. See {@see
* \Testing\ResourceNames\Client\ResourceNamesClient} to use the new surface.
*/
class ResourceNamesGapicClient
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
* 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.
* This class is currently experimental and may be subject to changes. See {@see
* \Testing\RoutingHeaders\RoutingHeadersClient} for the stable implementation
*
* @experimental
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
* $routingHeadersClient->close();
* }
* ```
*
* This service has a new (beta) implementation. See {@see
* \Testing\RoutingHeaders\Client\RoutingHeadersClient} to use the new surface.
*/
class RoutingHeadersGapicClient
{
Expand Down

0 comments on commit 2e1f6d3

Please sign in to comment.