Skip to content

Commit

Permalink
chore!: promote GkeConnectGateway to v2
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer committed Dec 17, 2024
1 parent 70dd30d commit 59737b8
Show file tree
Hide file tree
Showing 28 changed files with 79 additions and 2,407 deletions.
4 changes: 2 additions & 2 deletions .repo-metadata-full.json
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@
"GkeConnectGateway": {
"language": "php",
"distribution_name": "google/cloud-gke-connect-gateway",
"release_level": "preview",
"release_level": "stable",
"client_documentation": "https://cloud.google.com/php/docs/reference/cloud-gke-connect-gateway/latest",
"library_type": "GAPIC_AUTO",
"api_shortname": "connectgateway"
Expand Down Expand Up @@ -1599,4 +1599,4 @@
"library_type": "GAPIC_AUTO",
"api_shortname": "workflows"
}
}
}
2 changes: 1 addition & 1 deletion GkeConnectGateway/.OwlBot.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
deep-copy-regex:
- source: /google/cloud/gkeconnect/gateway/(v1beta1|v1)/.*-php/(.*)
- source: /google/cloud/gkeconnect/gateway/(v1|v1beta1)/.*-php/(.*)
dest: /owl-bot-staging/GkeConnectGateway/$1/$2
api-name: GkeConnectGateway
5 changes: 2 additions & 3 deletions GkeConnectGateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ for more information about the debugging tools.

### Version

This component is considered beta. As such, it should be expected to be mostly
stable and we're working towards a release candidate. We will address issues
and requests with a higher priority.
This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in
any minor or patch releases. We will address issues and requests with the highest priority.

### Next Steps

Expand Down
36 changes: 0 additions & 36 deletions GkeConnectGateway/metadata/V1Beta1/Gateway.php

This file was deleted.

43 changes: 10 additions & 33 deletions GkeConnectGateway/owlbot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 Google LLC
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,37 +32,14 @@

php.owlbot_main(src=src, dest=dest)

# Change the wording for the deprecation warning.
# remove class_alias code
s.replace(
'src/*/*_*.php',
r'will be removed in the next major release',
'will be removed in a future release')

### [START] protoc backwards compatibility fixes

# roll back to private properties.
s.replace(
"src/**/V*/**/*.php",
r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$",
r"""Generated from protobuf field \1
*/
private $""")

# Replace "Unwrapped" with "Value" for method names.
s.replace(
"src/**/V*/**/*.php",
r"public function ([s|g]\w{3,})Unwrapped",
r"public function \1Value"
)

### [END] protoc backwards compatibility fixes

# fix relative cloud.google.com links
s.replace(
"src/**/V*/**/*.php",
r"(.{0,})\]\((/.{0,})\)",
r"\1](https://cloud.google.com\2)"
)
"src/V*/**/*.php",
r"^// Adding a class alias for backwards compatibility with the previous class name.$"
+ "\n"
+ r"^class_alias\(.*\);$"
+ "\n",
'')

# format generated clients
subprocess.run([
Expand All @@ -72,8 +49,8 @@
'--package=@prettier/plugin-php@^0.16',
'--',
'prettier',
'**/Gapic/*',
'**/Client/*',
'--write',
'--parser=php',
'--single-quote',
'--print-width=80'])
'--print-width=120'])
18 changes: 6 additions & 12 deletions GkeConnectGateway/src/V1/Client/GatewayControlClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
use Google\Cloud\GkeConnect\Gateway\V1\GenerateCredentialsRequest;
use Google\Cloud\GkeConnect\Gateway\V1\GenerateCredentialsResponse;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Log\LoggerInterface;

/**
* Service Description: GatewayControl is the control plane API for Connect Gateway.
Expand Down Expand Up @@ -68,9 +67,7 @@ final class GatewayControlClient
private const CODEGEN_NAME = 'gapic';

/** The default scopes required by the service. */
public static $serviceScopes = [
'https://www.googleapis.com/auth/cloud-platform',
];
public static $serviceScopes = ['https://www.googleapis.com/auth/cloud-platform'];

private static function getClientDefaults()
{
Expand Down Expand Up @@ -100,9 +97,7 @@ private static function defaultTransport()
/** Implements ClientOptionsTrait::supportedTransports. */
private static function supportedTransports()
{
return [
'rest',
];
return ['rest'];
}

/**
Expand Down Expand Up @@ -152,9 +147,6 @@ private static function supportedTransports()
* @type callable $clientCertSource
* A callable which returns the client cert as a string. This can be used to
* provide a certificate and private key to the transport layer for mTLS.
* @type false|LoggerInterface $logger
* A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the
* 'GOOGLE_SDK_PHP_LOGGING' environment flag
* }
*
* @throws ValidationException
Expand Down Expand Up @@ -198,8 +190,10 @@ public function __call($method, $args)
*
* @throws ApiException Thrown if the API call fails.
*/
public function generateCredentials(GenerateCredentialsRequest $request, array $callOptions = []): GenerateCredentialsResponse
{
public function generateCredentials(
GenerateCredentialsRequest $request,
array $callOptions = []
): GenerateCredentialsResponse {
return $this->startApiCall('GenerateCredentials', $request, $callOptions)->wait();
}
}
10 changes: 5 additions & 5 deletions GkeConnectGateway/src/V1/GenerateCredentialsRequest.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions GkeConnectGateway/src/V1/GenerateCredentialsResponse.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 6 additions & 12 deletions GkeConnectGateway/src/V1beta1/Client/GatewayControlClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
use Google\Cloud\GkeConnect\Gateway\V1beta1\GenerateCredentialsRequest;
use Google\Cloud\GkeConnect\Gateway\V1beta1\GenerateCredentialsResponse;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Log\LoggerInterface;

/**
* Service Description: GatewayControl is the control plane API for Connect Gateway.
Expand Down Expand Up @@ -72,9 +71,7 @@ final class GatewayControlClient
private const CODEGEN_NAME = 'gapic';

/** The default scopes required by the service. */
public static $serviceScopes = [
'https://www.googleapis.com/auth/cloud-platform',
];
public static $serviceScopes = ['https://www.googleapis.com/auth/cloud-platform'];

private static function getClientDefaults()
{
Expand Down Expand Up @@ -104,9 +101,7 @@ private static function defaultTransport()
/** Implements ClientOptionsTrait::supportedTransports. */
private static function supportedTransports()
{
return [
'rest',
];
return ['rest'];
}

/**
Expand Down Expand Up @@ -156,9 +151,6 @@ private static function supportedTransports()
* @type callable $clientCertSource
* A callable which returns the client cert as a string. This can be used to
* provide a certificate and private key to the transport layer for mTLS.
* @type false|LoggerInterface $logger
* A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the
* 'GOOGLE_SDK_PHP_LOGGING' environment flag
* }
*
* @throws ValidationException
Expand Down Expand Up @@ -206,8 +198,10 @@ public function __call($method, $args)
*
* @experimental
*/
public function generateCredentials(GenerateCredentialsRequest $request, array $callOptions = []): GenerateCredentialsResponse
{
public function generateCredentials(
GenerateCredentialsRequest $request,
array $callOptions = []
): GenerateCredentialsResponse {
return $this->startApiCall('GenerateCredentials', $request, $callOptions)->wait();
}
}
Loading

0 comments on commit 59737b8

Please sign in to comment.