Skip to content

Commit 59aac73

Browse files
authored
add vision/v1p3beta1 and automl clients (#3484)
1 parent e875a47 commit 59aac73

File tree

336 files changed

+170933
-30
lines changed

Some content is hidden

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

336 files changed

+170933
-30
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ This library supports the following Google Cloud Platform services with clients
2626
This library supports the following Google Cloud Platform services with clients at a [Beta](#versioning) quality level:
2727

2828
- [BigQuery Data Transfer](google-cloud-clients/google-cloud-bigquerydatatransfer) (Beta)
29+
- [Cloud AutoML](google-cloud-clients/google-cloud-automl) (Beta)
2930
- [Cloud Data Loss Prevention](google-cloud-clients/google-cloud-dlp) (Beta)
3031
- [Cloud Firestore](google-cloud-clients/google-cloud-firestore) (Beta)
3132
- [Cloud IoT Core](google-cloud-clients/google-cloud-iot) (Beta)
@@ -74,7 +75,7 @@ libraryDependencies += "com.google.cloud" % "google-cloud-storage" % "1.36.0"
7475
```
7576
[//]: # ({x-version-update-end})
7677

77-
If you're using IntelliJ or Eclipse, you can add client libraries to your project using these IDE plugins:
78+
If you're using IntelliJ or Eclipse, you can add client libraries to your project using these IDE plugins:
7879
* [Cloud Tools for IntelliJ](https://cloud.google.com/tools/intellij/docs/client-libraries?utm_source=github&utm_medium=google-cloud-java&utm_campaign=ToolsforIntelliJ)
7980
* [Cloud Tools for Eclipse](https://cloud.google.com/eclipse/docs/libraries?utm_source=github&utm_medium=google-cloud-java&utm_campaign=ToolsforEclipse)
8081

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<artifactId>grpc-google-cloud-automl-v1beta1</artifactId>
6+
<version>0.19.1-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-automl-v1beta1:current} -->
7+
<name>grpc-google-cloud-automl-v1beta1</name>
8+
<description>GRPC library for grpc-google-cloud-automl-v1beta1</description>
9+
<parent>
10+
<groupId>com.google.api.grpc</groupId>
11+
<artifactId>google-api-grpc</artifactId>
12+
<version>0.19.1-SNAPSHOT</version><!-- {x-version-update:google-api-grpc:current} -->
13+
</parent>
14+
<dependencies>
15+
<dependency>
16+
<groupId>io.grpc</groupId>
17+
<artifactId>grpc-stub</artifactId>
18+
<scope>compile</scope>
19+
</dependency>
20+
<dependency>
21+
<groupId>io.grpc</groupId>
22+
<artifactId>grpc-protobuf</artifactId>
23+
<scope>compile</scope>
24+
</dependency>
25+
<dependency>
26+
<groupId>com.google.api.grpc</groupId>
27+
<artifactId>proto-google-cloud-automl-v1beta1</artifactId>
28+
<scope>compile</scope>
29+
</dependency>
30+
</dependencies>
31+
</project>

google-api-grpc/grpc-google-cloud-automl-v1beta1/src/main/java/com/google/cloud/automl/v1beta1/AutoMlGrpc.java

Lines changed: 1631 additions & 0 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,313 @@
1+
package com.google.cloud.automl.v1beta1;
2+
3+
import static io.grpc.MethodDescriptor.generateFullMethodName;
4+
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
5+
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
6+
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
7+
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
8+
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
9+
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
10+
import static io.grpc.stub.ClientCalls.futureUnaryCall;
11+
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
12+
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
13+
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
14+
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
15+
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
16+
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
17+
18+
/**
19+
* <pre>
20+
* AutoML Prediction API.
21+
* </pre>
22+
*/
23+
@javax.annotation.Generated(
24+
value = "by gRPC proto compiler (version 1.10.0)",
25+
comments = "Source: google/cloud/automl/v1beta1/prediction_service.proto")
26+
public final class PredictionServiceGrpc {
27+
28+
private PredictionServiceGrpc() {}
29+
30+
public static final String SERVICE_NAME = "google.cloud.automl.v1beta1.PredictionService";
31+
32+
// Static method descriptors that strictly reflect the proto.
33+
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
34+
@java.lang.Deprecated // Use {@link #getPredictMethod()} instead.
35+
public static final io.grpc.MethodDescriptor<com.google.cloud.automl.v1beta1.PredictRequest,
36+
com.google.cloud.automl.v1beta1.PredictResponse> METHOD_PREDICT = getPredictMethodHelper();
37+
38+
private static volatile io.grpc.MethodDescriptor<com.google.cloud.automl.v1beta1.PredictRequest,
39+
com.google.cloud.automl.v1beta1.PredictResponse> getPredictMethod;
40+
41+
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
42+
public static io.grpc.MethodDescriptor<com.google.cloud.automl.v1beta1.PredictRequest,
43+
com.google.cloud.automl.v1beta1.PredictResponse> getPredictMethod() {
44+
return getPredictMethodHelper();
45+
}
46+
47+
private static io.grpc.MethodDescriptor<com.google.cloud.automl.v1beta1.PredictRequest,
48+
com.google.cloud.automl.v1beta1.PredictResponse> getPredictMethodHelper() {
49+
io.grpc.MethodDescriptor<com.google.cloud.automl.v1beta1.PredictRequest, com.google.cloud.automl.v1beta1.PredictResponse> getPredictMethod;
50+
if ((getPredictMethod = PredictionServiceGrpc.getPredictMethod) == null) {
51+
synchronized (PredictionServiceGrpc.class) {
52+
if ((getPredictMethod = PredictionServiceGrpc.getPredictMethod) == null) {
53+
PredictionServiceGrpc.getPredictMethod = getPredictMethod =
54+
io.grpc.MethodDescriptor.<com.google.cloud.automl.v1beta1.PredictRequest, com.google.cloud.automl.v1beta1.PredictResponse>newBuilder()
55+
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
56+
.setFullMethodName(generateFullMethodName(
57+
"google.cloud.automl.v1beta1.PredictionService", "Predict"))
58+
.setSampledToLocalTracing(true)
59+
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
60+
com.google.cloud.automl.v1beta1.PredictRequest.getDefaultInstance()))
61+
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
62+
com.google.cloud.automl.v1beta1.PredictResponse.getDefaultInstance()))
63+
.setSchemaDescriptor(new PredictionServiceMethodDescriptorSupplier("Predict"))
64+
.build();
65+
}
66+
}
67+
}
68+
return getPredictMethod;
69+
}
70+
71+
/**
72+
* Creates a new async stub that supports all call types for the service
73+
*/
74+
public static PredictionServiceStub newStub(io.grpc.Channel channel) {
75+
return new PredictionServiceStub(channel);
76+
}
77+
78+
/**
79+
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
80+
*/
81+
public static PredictionServiceBlockingStub newBlockingStub(
82+
io.grpc.Channel channel) {
83+
return new PredictionServiceBlockingStub(channel);
84+
}
85+
86+
/**
87+
* Creates a new ListenableFuture-style stub that supports unary calls on the service
88+
*/
89+
public static PredictionServiceFutureStub newFutureStub(
90+
io.grpc.Channel channel) {
91+
return new PredictionServiceFutureStub(channel);
92+
}
93+
94+
/**
95+
* <pre>
96+
* AutoML Prediction API.
97+
* </pre>
98+
*/
99+
public static abstract class PredictionServiceImplBase implements io.grpc.BindableService {
100+
101+
/**
102+
* <pre>
103+
* Perform a prediction.
104+
* </pre>
105+
*/
106+
public void predict(com.google.cloud.automl.v1beta1.PredictRequest request,
107+
io.grpc.stub.StreamObserver<com.google.cloud.automl.v1beta1.PredictResponse> responseObserver) {
108+
asyncUnimplementedUnaryCall(getPredictMethodHelper(), responseObserver);
109+
}
110+
111+
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
112+
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
113+
.addMethod(
114+
getPredictMethodHelper(),
115+
asyncUnaryCall(
116+
new MethodHandlers<
117+
com.google.cloud.automl.v1beta1.PredictRequest,
118+
com.google.cloud.automl.v1beta1.PredictResponse>(
119+
this, METHODID_PREDICT)))
120+
.build();
121+
}
122+
}
123+
124+
/**
125+
* <pre>
126+
* AutoML Prediction API.
127+
* </pre>
128+
*/
129+
public static final class PredictionServiceStub extends io.grpc.stub.AbstractStub<PredictionServiceStub> {
130+
private PredictionServiceStub(io.grpc.Channel channel) {
131+
super(channel);
132+
}
133+
134+
private PredictionServiceStub(io.grpc.Channel channel,
135+
io.grpc.CallOptions callOptions) {
136+
super(channel, callOptions);
137+
}
138+
139+
@java.lang.Override
140+
protected PredictionServiceStub build(io.grpc.Channel channel,
141+
io.grpc.CallOptions callOptions) {
142+
return new PredictionServiceStub(channel, callOptions);
143+
}
144+
145+
/**
146+
* <pre>
147+
* Perform a prediction.
148+
* </pre>
149+
*/
150+
public void predict(com.google.cloud.automl.v1beta1.PredictRequest request,
151+
io.grpc.stub.StreamObserver<com.google.cloud.automl.v1beta1.PredictResponse> responseObserver) {
152+
asyncUnaryCall(
153+
getChannel().newCall(getPredictMethodHelper(), getCallOptions()), request, responseObserver);
154+
}
155+
}
156+
157+
/**
158+
* <pre>
159+
* AutoML Prediction API.
160+
* </pre>
161+
*/
162+
public static final class PredictionServiceBlockingStub extends io.grpc.stub.AbstractStub<PredictionServiceBlockingStub> {
163+
private PredictionServiceBlockingStub(io.grpc.Channel channel) {
164+
super(channel);
165+
}
166+
167+
private PredictionServiceBlockingStub(io.grpc.Channel channel,
168+
io.grpc.CallOptions callOptions) {
169+
super(channel, callOptions);
170+
}
171+
172+
@java.lang.Override
173+
protected PredictionServiceBlockingStub build(io.grpc.Channel channel,
174+
io.grpc.CallOptions callOptions) {
175+
return new PredictionServiceBlockingStub(channel, callOptions);
176+
}
177+
178+
/**
179+
* <pre>
180+
* Perform a prediction.
181+
* </pre>
182+
*/
183+
public com.google.cloud.automl.v1beta1.PredictResponse predict(com.google.cloud.automl.v1beta1.PredictRequest request) {
184+
return blockingUnaryCall(
185+
getChannel(), getPredictMethodHelper(), getCallOptions(), request);
186+
}
187+
}
188+
189+
/**
190+
* <pre>
191+
* AutoML Prediction API.
192+
* </pre>
193+
*/
194+
public static final class PredictionServiceFutureStub extends io.grpc.stub.AbstractStub<PredictionServiceFutureStub> {
195+
private PredictionServiceFutureStub(io.grpc.Channel channel) {
196+
super(channel);
197+
}
198+
199+
private PredictionServiceFutureStub(io.grpc.Channel channel,
200+
io.grpc.CallOptions callOptions) {
201+
super(channel, callOptions);
202+
}
203+
204+
@java.lang.Override
205+
protected PredictionServiceFutureStub build(io.grpc.Channel channel,
206+
io.grpc.CallOptions callOptions) {
207+
return new PredictionServiceFutureStub(channel, callOptions);
208+
}
209+
210+
/**
211+
* <pre>
212+
* Perform a prediction.
213+
* </pre>
214+
*/
215+
public com.google.common.util.concurrent.ListenableFuture<com.google.cloud.automl.v1beta1.PredictResponse> predict(
216+
com.google.cloud.automl.v1beta1.PredictRequest request) {
217+
return futureUnaryCall(
218+
getChannel().newCall(getPredictMethodHelper(), getCallOptions()), request);
219+
}
220+
}
221+
222+
private static final int METHODID_PREDICT = 0;
223+
224+
private static final class MethodHandlers<Req, Resp> implements
225+
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
226+
io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
227+
io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
228+
io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
229+
private final PredictionServiceImplBase serviceImpl;
230+
private final int methodId;
231+
232+
MethodHandlers(PredictionServiceImplBase serviceImpl, int methodId) {
233+
this.serviceImpl = serviceImpl;
234+
this.methodId = methodId;
235+
}
236+
237+
@java.lang.Override
238+
@java.lang.SuppressWarnings("unchecked")
239+
public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
240+
switch (methodId) {
241+
case METHODID_PREDICT:
242+
serviceImpl.predict((com.google.cloud.automl.v1beta1.PredictRequest) request,
243+
(io.grpc.stub.StreamObserver<com.google.cloud.automl.v1beta1.PredictResponse>) responseObserver);
244+
break;
245+
default:
246+
throw new AssertionError();
247+
}
248+
}
249+
250+
@java.lang.Override
251+
@java.lang.SuppressWarnings("unchecked")
252+
public io.grpc.stub.StreamObserver<Req> invoke(
253+
io.grpc.stub.StreamObserver<Resp> responseObserver) {
254+
switch (methodId) {
255+
default:
256+
throw new AssertionError();
257+
}
258+
}
259+
}
260+
261+
private static abstract class PredictionServiceBaseDescriptorSupplier
262+
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
263+
PredictionServiceBaseDescriptorSupplier() {}
264+
265+
@java.lang.Override
266+
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
267+
return com.google.cloud.automl.v1beta1.PredictionServiceProto.getDescriptor();
268+
}
269+
270+
@java.lang.Override
271+
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
272+
return getFileDescriptor().findServiceByName("PredictionService");
273+
}
274+
}
275+
276+
private static final class PredictionServiceFileDescriptorSupplier
277+
extends PredictionServiceBaseDescriptorSupplier {
278+
PredictionServiceFileDescriptorSupplier() {}
279+
}
280+
281+
private static final class PredictionServiceMethodDescriptorSupplier
282+
extends PredictionServiceBaseDescriptorSupplier
283+
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
284+
private final String methodName;
285+
286+
PredictionServiceMethodDescriptorSupplier(String methodName) {
287+
this.methodName = methodName;
288+
}
289+
290+
@java.lang.Override
291+
public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
292+
return getServiceDescriptor().findMethodByName(methodName);
293+
}
294+
}
295+
296+
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
297+
298+
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
299+
io.grpc.ServiceDescriptor result = serviceDescriptor;
300+
if (result == null) {
301+
synchronized (PredictionServiceGrpc.class) {
302+
result = serviceDescriptor;
303+
if (result == null) {
304+
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
305+
.setSchemaDescriptor(new PredictionServiceFileDescriptorSupplier())
306+
.addMethod(getPredictMethodHelper())
307+
.build();
308+
}
309+
}
310+
}
311+
return result;
312+
}
313+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<artifactId>grpc-google-cloud-vision-v1p3beta1</artifactId>
6+
<version>0.19.1-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-vision-v1p3beta1:current} -->
7+
<name>grpc-google-cloud-vision-v1p3beta1</name>
8+
<description>GRPC library for grpc-google-cloud-vision-v1p3beta1</description>
9+
<parent>
10+
<groupId>com.google.api.grpc</groupId>
11+
<artifactId>google-api-grpc</artifactId>
12+
<version>0.19.1-SNAPSHOT</version><!-- {x-version-update:google-api-grpc:current} -->
13+
</parent>
14+
<dependencies>
15+
<dependency>
16+
<groupId>io.grpc</groupId>
17+
<artifactId>grpc-stub</artifactId>
18+
<scope>compile</scope>
19+
</dependency>
20+
<dependency>
21+
<groupId>io.grpc</groupId>
22+
<artifactId>grpc-protobuf</artifactId>
23+
<scope>compile</scope>
24+
</dependency>
25+
<dependency>
26+
<groupId>com.google.api.grpc</groupId>
27+
<artifactId>proto-google-cloud-vision-v1p3beta1</artifactId>
28+
<scope>compile</scope>
29+
</dependency>
30+
</dependencies>
31+
</project>

0 commit comments

Comments
 (0)