Skip to content

Commit

Permalink
feat: Update default transport type for Connect Gateway v1 client to …
Browse files Browse the repository at this point in the history
…"rest" (#7824)

* feat!: Update default transport type for Connect Gateway v1beta1 client to "rest"

BREAKING CHANGE: gRPC support is being removed in favor of HTTP support, as gRPC is not currently supported by Connect Gateway.
PiperOrigin-RevId: 695487411
Source-Link: googleapis/googleapis@5257378
Source-Link: googleapis/googleapis-gen@5dbaade
Copy-Tag: eyJwIjoiR2tlQ29ubmVjdEdhdGV3YXkvLk93bEJvdC55YW1sIiwiaCI6IjVkYmFhZGU2ZGMyZjE0NWFhMWVhZjMzZDBkOGEwNTIxNTZhNDkwODgifQ==

* feat!: Update default transport type for Connect Gateway v1 client to "rest"

BREAKING CHANGE: gRPC support is being removed in favor of HTTP support, as gRPC is not currently supported by Connect Gateway.
PiperOrigin-RevId: 695803161
Source-Link: googleapis/googleapis@de97a5f
Source-Link: googleapis/googleapis-gen@aebeaed
Copy-Tag: eyJwIjoiR2tlQ29ubmVjdEdhdGV3YXkvLk93bEJvdC55YW1sIiwiaCI6ImFlYmVhZWRlZGU1NDU0NWVlMTZlOWMxMmFmNjVjZGJhNDM3MTAzMGQifQ==
  • Loading branch information
gcf-owl-bot[bot] authored Nov 13, 2024
1 parent 285585e commit 6a01b6d
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 22 deletions.
25 changes: 18 additions & 7 deletions GkeConnectGateway/src/V1/Client/GatewayControlClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ private static function getClientDefaults()
'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT,
'clientConfig' => __DIR__ . '/../resources/gateway_control_client_config.json',
'descriptorsConfigPath' => __DIR__ . '/../resources/gateway_control_descriptor_config.php',
'gcpApiConfigPath' => __DIR__ . '/../resources/gateway_control_grpc_config.json',
'credentialsConfig' => [
'defaultScopes' => self::$serviceScopes,
'useJwtAccessWithScope' => false,
],
'transportConfig' => [
'rest' => [
Expand All @@ -90,6 +90,20 @@ private static function getClientDefaults()
];
}

/** Implements GapicClientTrait::defaultTransport. */
private static function defaultTransport()
{
return 'rest';
}

/** Implements ClientOptionsTrait::supportedTransports. */
private static function supportedTransports()
{
return [
'rest',
];
}

/**
* Constructor.
*
Expand Down Expand Up @@ -120,9 +134,8 @@ private static function getClientDefaults()
* default this settings points to the default client config file, which is
* provided in the resources folder.
* @type string|TransportInterface $transport
* The transport used for executing network requests. May be either the string
* `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system.
* *Advanced usage*: Additionally, it is possible to pass in an already
* The transport used for executing network requests. At the moment, supports only
* `rest`. *Advanced usage*: Additionally, it is possible to pass in an already
* instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note
* that when this object is provided, any settings in $transportConfig, and any
* $apiEndpoint setting, will be ignored.
Expand All @@ -131,11 +144,9 @@ private static function getClientDefaults()
* each supported transport type should be passed in a key for that transport. For
* example:
* $transportConfig = [
* 'grpc' => [...],
* 'rest' => [...],
* ];
* See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and
* {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the
* See the {@see \Google\ApiCore\Transport\RestTransport::build()} method for the
* supported options.
* @type callable $clientCertSource
* A callable which returns the client cert as a string. This can be used to
Expand Down
25 changes: 18 additions & 7 deletions GkeConnectGateway/src/V1beta1/Client/GatewayControlClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ private static function getClientDefaults()
'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT,
'clientConfig' => __DIR__ . '/../resources/gateway_control_client_config.json',
'descriptorsConfigPath' => __DIR__ . '/../resources/gateway_control_descriptor_config.php',
'gcpApiConfigPath' => __DIR__ . '/../resources/gateway_control_grpc_config.json',
'credentialsConfig' => [
'defaultScopes' => self::$serviceScopes,
'useJwtAccessWithScope' => false,
],
'transportConfig' => [
'rest' => [
Expand All @@ -94,6 +94,20 @@ private static function getClientDefaults()
];
}

/** Implements GapicClientTrait::defaultTransport. */
private static function defaultTransport()
{
return 'rest';
}

/** Implements ClientOptionsTrait::supportedTransports. */
private static function supportedTransports()
{
return [
'rest',
];
}

/**
* Constructor.
*
Expand Down Expand Up @@ -124,9 +138,8 @@ private static function getClientDefaults()
* default this settings points to the default client config file, which is
* provided in the resources folder.
* @type string|TransportInterface $transport
* The transport used for executing network requests. May be either the string
* `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system.
* *Advanced usage*: Additionally, it is possible to pass in an already
* The transport used for executing network requests. At the moment, supports only
* `rest`. *Advanced usage*: Additionally, it is possible to pass in an already
* instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note
* that when this object is provided, any settings in $transportConfig, and any
* $apiEndpoint setting, will be ignored.
Expand All @@ -135,11 +148,9 @@ private static function getClientDefaults()
* each supported transport type should be passed in a key for that transport. For
* example:
* $transportConfig = [
* 'grpc' => [...],
* 'rest' => [...],
* ];
* See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and
* {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the
* See the {@see \Google\ApiCore\Transport\RestTransport::build()} method for the
* supported options.
* @type callable $clientCertSource
* A callable which returns the client cert as a string. This can be used to
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
/*
* 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.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
* GENERATED CODE WARNING
* Generated by gapic-generator-php from the file
* https://github.com/googleapis/googleapis/blob/master/google/cloud/gkeconnect/gateway/v1beta1/control.proto
* Updates to the above are reflected here through a refresh process.
*/

namespace Google\Cloud\GkeConnect\Gateway\V1beta1\Enums\GenerateCredentialsRequest;

/**
* OperatingSystem contains string constants that represent the names of each value
* in the
* google.cloud.gkeconnect.gateway.v1beta1.GenerateCredentialsRequest.OperatingSystem
* descriptor.
*/
class OperatingSystem
{
const OPERATING_SYSTEM_UNSPECIFIED = 'OPERATING_SYSTEM_UNSPECIFIED';

const OPERATING_SYSTEM_WINDOWS = 'OPERATING_SYSTEM_WINDOWS';
}
24 changes: 16 additions & 8 deletions GkeConnectGateway/src/V1beta1/Gapic/GatewayControlGapicClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,9 @@ private static function getClientDefaults()
__DIR__ . '/../resources/gateway_control_client_config.json',
'descriptorsConfigPath' =>
__DIR__ . '/../resources/gateway_control_descriptor_config.php',
'gcpApiConfigPath' =>
__DIR__ . '/../resources/gateway_control_grpc_config.json',
'credentialsConfig' => [
'defaultScopes' => self::$serviceScopes,
'useJwtAccessWithScope' => false,
],
'transportConfig' => [
'rest' => [
Expand All @@ -110,6 +109,18 @@ private static function getClientDefaults()
];
}

/** Implements GapicClientTrait::defaultTransport. */
private static function defaultTransport()
{
return 'rest';
}

/** Implements GapicClientTrait::supportedTransports. */
private static function supportedTransports()
{
return ['rest'];
}

/**
* Constructor.
*
Expand Down Expand Up @@ -140,9 +151,8 @@ private static function getClientDefaults()
* default this settings points to the default client config file, which is
* provided in the resources folder.
* @type string|TransportInterface $transport
* The transport used for executing network requests. May be either the string
* `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system.
* *Advanced usage*: Additionally, it is possible to pass in an already
* The transport used for executing network requests. At the moment, supports only
* `rest`. *Advanced usage*: Additionally, it is possible to pass in an already
* instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note
* that when this object is provided, any settings in $transportConfig, and any
* $apiEndpoint setting, will be ignored.
Expand All @@ -151,11 +161,9 @@ private static function getClientDefaults()
* each supported transport type should be passed in a key for that transport. For
* example:
* $transportConfig = [
* 'grpc' => [...],
* 'rest' => [...],
* ];
* See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and
* {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the
* See the {@see \Google\ApiCore\Transport\RestTransport::build()} method for the
* supported options.
* @type callable $clientCertSource
* A callable which returns the client cert as a string. This can be used to
Expand Down

0 comments on commit 6a01b6d

Please sign in to comment.