Skip to content

Commit ccb5145

Browse files
feat(spanner): add proto descriptors for proto and enum types in create/update/get database ddl requests
PiperOrigin-RevId: 601013501 Source-Link: googleapis/googleapis@81b24a5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/46f0446037906f0d905365835f02a652241f3de3 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDZmMDQ0NjAzNzkwNmYwZDkwNTM2NTgzNWYwMmE2NTIyNDFmM2RlMyJ9 fix(deps): Update the Java code generator (gapic-generator-java) to 2.32.0 PiperOrigin-RevId: 599914188 Source-Link: googleapis/googleapis@17e6661 Source-Link: https://github.com/googleapis/googleapis-gen/commit/d86ba5be537e489435105ca85566cc4103301aba Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDg2YmE1YmU1MzdlNDg5NDM1MTA1Y2E4NTU2NmNjNDEwMzMwMWFiYSJ9 feat: add max_commit_delay API PiperOrigin-RevId: 599315735 Source-Link: googleapis/googleapis@465a103 Source-Link: https://github.com/googleapis/googleapis-gen/commit/930e2318acbd10fb54d8668d2f2cf19fe413d5a9 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTMwZTIzMThhY2JkMTBmYjU0ZDg2NjhkMmYyY2YxOWZlNDEzZDVhOSJ9 feat(spanner): add proto and enum types PiperOrigin-RevId: 599046867 Source-Link: googleapis/googleapis@64a5bfe Source-Link: https://github.com/googleapis/googleapis-gen/commit/6e96ab8bb1ec4536c5a0c4d095f53ce0578cb8a4 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNmU5NmFiOGJiMWVjNDUzNmM1YTBjNGQwOTVmNTNjZTA1NzhjYjhhNCJ9 fix(deps): Update the Java code generator (gapic-generator-java) to 2.31.0 PiperOrigin-RevId: 596645164 Source-Link: googleapis/googleapis@4a0e62e Source-Link: https://github.com/googleapis/googleapis-gen/commit/a10ed6a77676c37e60799098d48d0afb16008613 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYTEwZWQ2YTc3Njc2YzM3ZTYwNzk5MDk4ZDQ4ZDBhZmIxNjAwODYxMyJ9
1 parent f689f74 commit ccb5145

File tree

477 files changed

+80089
-91774
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

477 files changed

+80089
-91774
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,242 @@
1+
/*
2+
* Copyright 2023 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.cloud.spanner.executor.v1;
18+
19+
import com.google.api.gax.core.BackgroundResource;
20+
import com.google.api.gax.rpc.BidiStreamingCallable;
21+
import com.google.cloud.spanner.executor.v1.stub.SpannerExecutorProxyStub;
22+
import com.google.cloud.spanner.executor.v1.stub.SpannerExecutorProxyStubSettings;
23+
import com.google.spanner.executor.v1.SpannerAsyncActionRequest;
24+
import com.google.spanner.executor.v1.SpannerAsyncActionResponse;
25+
import java.io.IOException;
26+
import java.util.concurrent.TimeUnit;
27+
import javax.annotation.Generated;
28+
29+
// AUTO-GENERATED DOCUMENTATION AND CLASS.
30+
/**
31+
* Service Description: Service that executes SpannerActions asynchronously.
32+
*
33+
* <p>This class provides the ability to make remote calls to the backing service through method
34+
* calls that map to API methods. Sample code to get started:
35+
*
36+
* <pre>{@code
37+
* // This snippet has been automatically generated and should be regarded as a code template only.
38+
* // It will require modifications to work:
39+
* // - It may require correct/in-range values for request initialization.
40+
* // - It may require specifying regional endpoints when creating the service client as shown in
41+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
42+
* try (SpannerExecutorProxyClient spannerExecutorProxyClient =
43+
* SpannerExecutorProxyClient.create()) {
44+
* BidiStream<SpannerAsyncActionRequest, SpannerAsyncActionResponse> bidiStream =
45+
* spannerExecutorProxyClient.executeActionAsyncCallable().call();
46+
* SpannerAsyncActionRequest request =
47+
* SpannerAsyncActionRequest.newBuilder()
48+
* .setActionId(198295492)
49+
* .setAction(SpannerAction.newBuilder().build())
50+
* .build();
51+
* bidiStream.send(request);
52+
* for (SpannerAsyncActionResponse response : bidiStream) {
53+
* // Do something when a response is received.
54+
* }
55+
* }
56+
* }</pre>
57+
*
58+
* <p>Note: close() needs to be called on the SpannerExecutorProxyClient object to clean up
59+
* resources such as threads. In the example above, try-with-resources is used, which automatically
60+
* calls close().
61+
*
62+
* <table>
63+
* <caption>Methods</caption>
64+
* <tr>
65+
* <th>Method</th>
66+
* <th>Description</th>
67+
* <th>Method Variants</th>
68+
* </tr>
69+
* <tr>
70+
* <td><p> ExecuteActionAsync</td>
71+
* <td><p> ExecuteActionAsync is a streaming call that starts executing a new Spanner action.
72+
* <p> For each request, the server will reply with one or more responses, but only the last response will contain status in the outcome.
73+
* <p> Responses can be matched to requests by action_id. It is allowed to have multiple actions in flight--in that case, actions are be executed in parallel.</td>
74+
* <td>
75+
* <p>Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.</p>
76+
* <ul>
77+
* <li><p> executeActionAsyncCallable()
78+
* </ul>
79+
* </td>
80+
* </tr>
81+
* </table>
82+
*
83+
* <p>See the individual methods for example code.
84+
*
85+
* <p>Many parameters require resource names to be formatted in a particular way. To assist with
86+
* these names, this class includes a format method for each type of name, and additionally a parse
87+
* method to extract the individual identifiers contained within names that are returned.
88+
*
89+
* <p>This class can be customized by passing in a custom instance of SpannerExecutorProxySettings
90+
* to create(). For example:
91+
*
92+
* <p>To customize credentials:
93+
*
94+
* <pre>{@code
95+
* // This snippet has been automatically generated and should be regarded as a code template only.
96+
* // It will require modifications to work:
97+
* // - It may require correct/in-range values for request initialization.
98+
* // - It may require specifying regional endpoints when creating the service client as shown in
99+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
100+
* SpannerExecutorProxySettings spannerExecutorProxySettings =
101+
* SpannerExecutorProxySettings.newBuilder()
102+
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
103+
* .build();
104+
* SpannerExecutorProxyClient spannerExecutorProxyClient =
105+
* SpannerExecutorProxyClient.create(spannerExecutorProxySettings);
106+
* }</pre>
107+
*
108+
* <p>To customize the endpoint:
109+
*
110+
* <pre>{@code
111+
* // This snippet has been automatically generated and should be regarded as a code template only.
112+
* // It will require modifications to work:
113+
* // - It may require correct/in-range values for request initialization.
114+
* // - It may require specifying regional endpoints when creating the service client as shown in
115+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
116+
* SpannerExecutorProxySettings spannerExecutorProxySettings =
117+
* SpannerExecutorProxySettings.newBuilder().setEndpoint(myEndpoint).build();
118+
* SpannerExecutorProxyClient spannerExecutorProxyClient =
119+
* SpannerExecutorProxyClient.create(spannerExecutorProxySettings);
120+
* }</pre>
121+
*
122+
* <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
123+
*/
124+
@Generated("by gapic-generator-java")
125+
public class SpannerExecutorProxyClient implements BackgroundResource {
126+
private final SpannerExecutorProxySettings settings;
127+
private final SpannerExecutorProxyStub stub;
128+
129+
/** Constructs an instance of SpannerExecutorProxyClient with default settings. */
130+
public static final SpannerExecutorProxyClient create() throws IOException {
131+
return create(SpannerExecutorProxySettings.newBuilder().build());
132+
}
133+
134+
/**
135+
* Constructs an instance of SpannerExecutorProxyClient, using the given settings. The channels
136+
* are created based on the settings passed in, or defaults for any settings that are not set.
137+
*/
138+
public static final SpannerExecutorProxyClient create(SpannerExecutorProxySettings settings)
139+
throws IOException {
140+
return new SpannerExecutorProxyClient(settings);
141+
}
142+
143+
/**
144+
* Constructs an instance of SpannerExecutorProxyClient, using the given stub for making calls.
145+
* This is for advanced usage - prefer using create(SpannerExecutorProxySettings).
146+
*/
147+
public static final SpannerExecutorProxyClient create(SpannerExecutorProxyStub stub) {
148+
return new SpannerExecutorProxyClient(stub);
149+
}
150+
151+
/**
152+
* Constructs an instance of SpannerExecutorProxyClient, using the given settings. This is
153+
* protected so that it is easy to make a subclass, but otherwise, the static factory methods
154+
* should be preferred.
155+
*/
156+
protected SpannerExecutorProxyClient(SpannerExecutorProxySettings settings) throws IOException {
157+
this.settings = settings;
158+
this.stub = ((SpannerExecutorProxyStubSettings) settings.getStubSettings()).createStub();
159+
}
160+
161+
protected SpannerExecutorProxyClient(SpannerExecutorProxyStub stub) {
162+
this.settings = null;
163+
this.stub = stub;
164+
}
165+
166+
public final SpannerExecutorProxySettings getSettings() {
167+
return settings;
168+
}
169+
170+
public SpannerExecutorProxyStub getStub() {
171+
return stub;
172+
}
173+
174+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
175+
/**
176+
* ExecuteActionAsync is a streaming call that starts executing a new Spanner action.
177+
*
178+
* <p>For each request, the server will reply with one or more responses, but only the last
179+
* response will contain status in the outcome.
180+
*
181+
* <p>Responses can be matched to requests by action_id. It is allowed to have multiple actions in
182+
* flight--in that case, actions are be executed in parallel.
183+
*
184+
* <p>Sample code:
185+
*
186+
* <pre>{@code
187+
* // This snippet has been automatically generated and should be regarded as a code template only.
188+
* // It will require modifications to work:
189+
* // - It may require correct/in-range values for request initialization.
190+
* // - It may require specifying regional endpoints when creating the service client as shown in
191+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
192+
* try (SpannerExecutorProxyClient spannerExecutorProxyClient =
193+
* SpannerExecutorProxyClient.create()) {
194+
* BidiStream<SpannerAsyncActionRequest, SpannerAsyncActionResponse> bidiStream =
195+
* spannerExecutorProxyClient.executeActionAsyncCallable().call();
196+
* SpannerAsyncActionRequest request =
197+
* SpannerAsyncActionRequest.newBuilder()
198+
* .setActionId(198295492)
199+
* .setAction(SpannerAction.newBuilder().build())
200+
* .build();
201+
* bidiStream.send(request);
202+
* for (SpannerAsyncActionResponse response : bidiStream) {
203+
* // Do something when a response is received.
204+
* }
205+
* }
206+
* }</pre>
207+
*/
208+
public final BidiStreamingCallable<SpannerAsyncActionRequest, SpannerAsyncActionResponse>
209+
executeActionAsyncCallable() {
210+
return stub.executeActionAsyncCallable();
211+
}
212+
213+
@Override
214+
public final void close() {
215+
stub.close();
216+
}
217+
218+
@Override
219+
public void shutdown() {
220+
stub.shutdown();
221+
}
222+
223+
@Override
224+
public boolean isShutdown() {
225+
return stub.isShutdown();
226+
}
227+
228+
@Override
229+
public boolean isTerminated() {
230+
return stub.isTerminated();
231+
}
232+
233+
@Override
234+
public void shutdownNow() {
235+
stub.shutdownNow();
236+
}
237+
238+
@Override
239+
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
240+
return stub.awaitTermination(duration, unit);
241+
}
242+
}

0 commit comments

Comments
 (0)