Skip to content

Commit 36ca6d0

Browse files
feat: [StorageControl]Update BUILD configs to support rest transportation for all client (#8398)
* feat:Update BUILD configs to support rest transportation for all client PiperOrigin-RevId: 774863055 Source-Link: googleapis/googleapis@aab2776 Source-Link: googleapis/googleapis-gen@0c3d8d9 Copy-Tag: eyJwIjoiU3RvcmFnZUNvbnRyb2wvLk93bEJvdC55YW1sIiwiaCI6IjBjM2Q4ZDk1MWE5NzY4Y2JlYjM1M2JhYzU1YzkyODY4M2E4OTA1M2QifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 398aefa commit 36ca6d0

2 files changed

Lines changed: 120 additions & 9 deletions

File tree

StorageControl/src/V2/Client/StorageControlClient.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,14 @@ private static function getClientDefaults()
148148
'credentialsConfig' => [
149149
'defaultScopes' => self::$serviceScopes,
150150
],
151+
'transportConfig' => [
152+
'rest' => [
153+
'restClientConfigPath' => __DIR__ . '/../resources/storage_control_rest_client_config.php',
154+
],
155+
],
151156
];
152157
}
153158

154-
/** Implements ClientOptionsTrait::supportedTransports. */
155-
private static function supportedTransports()
156-
{
157-
return ['grpc', 'grpc-fallback'];
158-
}
159-
160159
/**
161160
* Return an OperationsClient object with the same endpoint as $this.
162161
*
@@ -434,8 +433,9 @@ public static function parseName(string $formattedName, ?string $template = null
434433
* default this settings points to the default client config file, which is
435434
* provided in the resources folder.
436435
* @type string|TransportInterface $transport
437-
* The transport used for executing network requests. At the moment, supports only
438-
* `grpc`. *Advanced usage*: Additionally, it is possible to pass in an already
436+
* The transport used for executing network requests. May be either the string
437+
* `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system.
438+
* *Advanced usage*: Additionally, it is possible to pass in an already
439439
* instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note
440440
* that when this object is provided, any settings in $transportConfig, and any
441441
* $apiEndpoint setting, will be ignored.
@@ -445,8 +445,10 @@ public static function parseName(string $formattedName, ?string $template = null
445445
* example:
446446
* $transportConfig = [
447447
* 'grpc' => [...],
448+
* 'rest' => [...],
448449
* ];
449-
* See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} method for the
450+
* See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and
451+
* {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the
450452
* supported options.
451453
* @type callable $clientCertSource
452454
* A callable which returns the client cert as a string. This can be used to
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
<?php
2+
/*
3+
* Copyright 2025 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/*
19+
* GENERATED CODE WARNING
20+
* This file was automatically generated - do not edit!
21+
*/
22+
23+
return [
24+
'interfaces' => [
25+
'google.storage.control.v2.StorageControl' => [
26+
'GetFolderIntelligenceConfig' => [
27+
'method' => 'get',
28+
'uriTemplate' => '/v2/{name=folders/*/locations/*/intelligenceConfig}',
29+
'placeholders' => [
30+
'name' => [
31+
'getters' => [
32+
'getName',
33+
],
34+
],
35+
],
36+
],
37+
'GetOrganizationIntelligenceConfig' => [
38+
'method' => 'get',
39+
'uriTemplate' => '/v2/{name=organizations/*/locations/*/intelligenceConfig}',
40+
'placeholders' => [
41+
'name' => [
42+
'getters' => [
43+
'getName',
44+
],
45+
],
46+
],
47+
],
48+
'GetProjectIntelligenceConfig' => [
49+
'method' => 'get',
50+
'uriTemplate' => '/v2/{name=projects/*/locations/*/intelligenceConfig}',
51+
'placeholders' => [
52+
'name' => [
53+
'getters' => [
54+
'getName',
55+
],
56+
],
57+
],
58+
],
59+
'UpdateFolderIntelligenceConfig' => [
60+
'method' => 'patch',
61+
'uriTemplate' => '/v2/{intelligence_config.name=folders/*/locations/*/intelligenceConfig}',
62+
'body' => 'intelligence_config',
63+
'placeholders' => [
64+
'intelligence_config.name' => [
65+
'getters' => [
66+
'getIntelligenceConfig',
67+
'getName',
68+
],
69+
],
70+
],
71+
'queryParams' => [
72+
'update_mask',
73+
],
74+
],
75+
'UpdateOrganizationIntelligenceConfig' => [
76+
'method' => 'patch',
77+
'uriTemplate' => '/v2/{intelligence_config.name=organizations/*/locations/*/intelligenceConfig}',
78+
'body' => 'intelligence_config',
79+
'placeholders' => [
80+
'intelligence_config.name' => [
81+
'getters' => [
82+
'getIntelligenceConfig',
83+
'getName',
84+
],
85+
],
86+
],
87+
'queryParams' => [
88+
'update_mask',
89+
],
90+
],
91+
'UpdateProjectIntelligenceConfig' => [
92+
'method' => 'patch',
93+
'uriTemplate' => '/v2/{intelligence_config.name=projects/*/locations/*/intelligenceConfig}',
94+
'body' => 'intelligence_config',
95+
'placeholders' => [
96+
'intelligence_config.name' => [
97+
'getters' => [
98+
'getIntelligenceConfig',
99+
'getName',
100+
],
101+
],
102+
],
103+
'queryParams' => [
104+
'update_mask',
105+
],
106+
],
107+
],
108+
],
109+
];

0 commit comments

Comments
 (0)