• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2020 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 package com.google.cloud.talent.v4beta1;
17 
18 import static io.grpc.MethodDescriptor.generateFullMethodName;
19 
20 /**
21  *
22  *
23  * <pre>
24  * A service handles auto completion.
25  * </pre>
26  */
27 @javax.annotation.Generated(
28     value = "by gRPC proto compiler",
29     comments = "Source: google/cloud/talent/v4beta1/completion_service.proto")
30 @io.grpc.stub.annotations.GrpcGenerated
31 public final class CompletionGrpc {
32 
CompletionGrpc()33   private CompletionGrpc() {}
34 
35   public static final String SERVICE_NAME = "google.cloud.talent.v4beta1.Completion";
36 
37   // Static method descriptors that strictly reflect the proto.
38   private static volatile io.grpc.MethodDescriptor<
39           com.google.cloud.talent.v4beta1.CompleteQueryRequest,
40           com.google.cloud.talent.v4beta1.CompleteQueryResponse>
41       getCompleteQueryMethod;
42 
43   @io.grpc.stub.annotations.RpcMethod(
44       fullMethodName = SERVICE_NAME + '/' + "CompleteQuery",
45       requestType = com.google.cloud.talent.v4beta1.CompleteQueryRequest.class,
46       responseType = com.google.cloud.talent.v4beta1.CompleteQueryResponse.class,
47       methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
48   public static io.grpc.MethodDescriptor<
49           com.google.cloud.talent.v4beta1.CompleteQueryRequest,
50           com.google.cloud.talent.v4beta1.CompleteQueryResponse>
getCompleteQueryMethod()51       getCompleteQueryMethod() {
52     io.grpc.MethodDescriptor<
53             com.google.cloud.talent.v4beta1.CompleteQueryRequest,
54             com.google.cloud.talent.v4beta1.CompleteQueryResponse>
55         getCompleteQueryMethod;
56     if ((getCompleteQueryMethod = CompletionGrpc.getCompleteQueryMethod) == null) {
57       synchronized (CompletionGrpc.class) {
58         if ((getCompleteQueryMethod = CompletionGrpc.getCompleteQueryMethod) == null) {
59           CompletionGrpc.getCompleteQueryMethod =
60               getCompleteQueryMethod =
61                   io.grpc.MethodDescriptor
62                       .<com.google.cloud.talent.v4beta1.CompleteQueryRequest,
63                           com.google.cloud.talent.v4beta1.CompleteQueryResponse>
64                           newBuilder()
65                       .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
66                       .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CompleteQuery"))
67                       .setSampledToLocalTracing(true)
68                       .setRequestMarshaller(
69                           io.grpc.protobuf.ProtoUtils.marshaller(
70                               com.google.cloud.talent.v4beta1.CompleteQueryRequest
71                                   .getDefaultInstance()))
72                       .setResponseMarshaller(
73                           io.grpc.protobuf.ProtoUtils.marshaller(
74                               com.google.cloud.talent.v4beta1.CompleteQueryResponse
75                                   .getDefaultInstance()))
76                       .setSchemaDescriptor(new CompletionMethodDescriptorSupplier("CompleteQuery"))
77                       .build();
78         }
79       }
80     }
81     return getCompleteQueryMethod;
82   }
83 
84   /** Creates a new async stub that supports all call types for the service */
newStub(io.grpc.Channel channel)85   public static CompletionStub newStub(io.grpc.Channel channel) {
86     io.grpc.stub.AbstractStub.StubFactory<CompletionStub> factory =
87         new io.grpc.stub.AbstractStub.StubFactory<CompletionStub>() {
88           @java.lang.Override
89           public CompletionStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
90             return new CompletionStub(channel, callOptions);
91           }
92         };
93     return CompletionStub.newStub(factory, channel);
94   }
95 
96   /**
97    * Creates a new blocking-style stub that supports unary and streaming output calls on the service
98    */
newBlockingStub(io.grpc.Channel channel)99   public static CompletionBlockingStub newBlockingStub(io.grpc.Channel channel) {
100     io.grpc.stub.AbstractStub.StubFactory<CompletionBlockingStub> factory =
101         new io.grpc.stub.AbstractStub.StubFactory<CompletionBlockingStub>() {
102           @java.lang.Override
103           public CompletionBlockingStub newStub(
104               io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
105             return new CompletionBlockingStub(channel, callOptions);
106           }
107         };
108     return CompletionBlockingStub.newStub(factory, channel);
109   }
110 
111   /** Creates a new ListenableFuture-style stub that supports unary calls on the service */
newFutureStub(io.grpc.Channel channel)112   public static CompletionFutureStub newFutureStub(io.grpc.Channel channel) {
113     io.grpc.stub.AbstractStub.StubFactory<CompletionFutureStub> factory =
114         new io.grpc.stub.AbstractStub.StubFactory<CompletionFutureStub>() {
115           @java.lang.Override
116           public CompletionFutureStub newStub(
117               io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
118             return new CompletionFutureStub(channel, callOptions);
119           }
120         };
121     return CompletionFutureStub.newStub(factory, channel);
122   }
123 
124   /**
125    *
126    *
127    * <pre>
128    * A service handles auto completion.
129    * </pre>
130    */
131   public interface AsyncService {
132 
133     /**
134      *
135      *
136      * <pre>
137      * Completes the specified prefix with keyword suggestions.
138      * Intended for use by a job search auto-complete search box.
139      * </pre>
140      */
completeQuery( com.google.cloud.talent.v4beta1.CompleteQueryRequest request, io.grpc.stub.StreamObserver<com.google.cloud.talent.v4beta1.CompleteQueryResponse> responseObserver)141     default void completeQuery(
142         com.google.cloud.talent.v4beta1.CompleteQueryRequest request,
143         io.grpc.stub.StreamObserver<com.google.cloud.talent.v4beta1.CompleteQueryResponse>
144             responseObserver) {
145       io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
146           getCompleteQueryMethod(), responseObserver);
147     }
148   }
149 
150   /**
151    * Base class for the server implementation of the service Completion.
152    *
153    * <pre>
154    * A service handles auto completion.
155    * </pre>
156    */
157   public abstract static class CompletionImplBase implements io.grpc.BindableService, AsyncService {
158 
159     @java.lang.Override
bindService()160     public final io.grpc.ServerServiceDefinition bindService() {
161       return CompletionGrpc.bindService(this);
162     }
163   }
164 
165   /**
166    * A stub to allow clients to do asynchronous rpc calls to service Completion.
167    *
168    * <pre>
169    * A service handles auto completion.
170    * </pre>
171    */
172   public static final class CompletionStub extends io.grpc.stub.AbstractAsyncStub<CompletionStub> {
CompletionStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)173     private CompletionStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
174       super(channel, callOptions);
175     }
176 
177     @java.lang.Override
build(io.grpc.Channel channel, io.grpc.CallOptions callOptions)178     protected CompletionStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
179       return new CompletionStub(channel, callOptions);
180     }
181 
182     /**
183      *
184      *
185      * <pre>
186      * Completes the specified prefix with keyword suggestions.
187      * Intended for use by a job search auto-complete search box.
188      * </pre>
189      */
completeQuery( com.google.cloud.talent.v4beta1.CompleteQueryRequest request, io.grpc.stub.StreamObserver<com.google.cloud.talent.v4beta1.CompleteQueryResponse> responseObserver)190     public void completeQuery(
191         com.google.cloud.talent.v4beta1.CompleteQueryRequest request,
192         io.grpc.stub.StreamObserver<com.google.cloud.talent.v4beta1.CompleteQueryResponse>
193             responseObserver) {
194       io.grpc.stub.ClientCalls.asyncUnaryCall(
195           getChannel().newCall(getCompleteQueryMethod(), getCallOptions()),
196           request,
197           responseObserver);
198     }
199   }
200 
201   /**
202    * A stub to allow clients to do synchronous rpc calls to service Completion.
203    *
204    * <pre>
205    * A service handles auto completion.
206    * </pre>
207    */
208   public static final class CompletionBlockingStub
209       extends io.grpc.stub.AbstractBlockingStub<CompletionBlockingStub> {
CompletionBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)210     private CompletionBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
211       super(channel, callOptions);
212     }
213 
214     @java.lang.Override
build( io.grpc.Channel channel, io.grpc.CallOptions callOptions)215     protected CompletionBlockingStub build(
216         io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
217       return new CompletionBlockingStub(channel, callOptions);
218     }
219 
220     /**
221      *
222      *
223      * <pre>
224      * Completes the specified prefix with keyword suggestions.
225      * Intended for use by a job search auto-complete search box.
226      * </pre>
227      */
completeQuery( com.google.cloud.talent.v4beta1.CompleteQueryRequest request)228     public com.google.cloud.talent.v4beta1.CompleteQueryResponse completeQuery(
229         com.google.cloud.talent.v4beta1.CompleteQueryRequest request) {
230       return io.grpc.stub.ClientCalls.blockingUnaryCall(
231           getChannel(), getCompleteQueryMethod(), getCallOptions(), request);
232     }
233   }
234 
235   /**
236    * A stub to allow clients to do ListenableFuture-style rpc calls to service Completion.
237    *
238    * <pre>
239    * A service handles auto completion.
240    * </pre>
241    */
242   public static final class CompletionFutureStub
243       extends io.grpc.stub.AbstractFutureStub<CompletionFutureStub> {
CompletionFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)244     private CompletionFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
245       super(channel, callOptions);
246     }
247 
248     @java.lang.Override
build(io.grpc.Channel channel, io.grpc.CallOptions callOptions)249     protected CompletionFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
250       return new CompletionFutureStub(channel, callOptions);
251     }
252 
253     /**
254      *
255      *
256      * <pre>
257      * Completes the specified prefix with keyword suggestions.
258      * Intended for use by a job search auto-complete search box.
259      * </pre>
260      */
261     public com.google.common.util.concurrent.ListenableFuture<
262             com.google.cloud.talent.v4beta1.CompleteQueryResponse>
completeQuery(com.google.cloud.talent.v4beta1.CompleteQueryRequest request)263         completeQuery(com.google.cloud.talent.v4beta1.CompleteQueryRequest request) {
264       return io.grpc.stub.ClientCalls.futureUnaryCall(
265           getChannel().newCall(getCompleteQueryMethod(), getCallOptions()), request);
266     }
267   }
268 
269   private static final int METHODID_COMPLETE_QUERY = 0;
270 
271   private static final class MethodHandlers<Req, Resp>
272       implements io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
273           io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
274           io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
275           io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
276     private final AsyncService serviceImpl;
277     private final int methodId;
278 
MethodHandlers(AsyncService serviceImpl, int methodId)279     MethodHandlers(AsyncService serviceImpl, int methodId) {
280       this.serviceImpl = serviceImpl;
281       this.methodId = methodId;
282     }
283 
284     @java.lang.Override
285     @java.lang.SuppressWarnings("unchecked")
invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver)286     public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
287       switch (methodId) {
288         case METHODID_COMPLETE_QUERY:
289           serviceImpl.completeQuery(
290               (com.google.cloud.talent.v4beta1.CompleteQueryRequest) request,
291               (io.grpc.stub.StreamObserver<com.google.cloud.talent.v4beta1.CompleteQueryResponse>)
292                   responseObserver);
293           break;
294         default:
295           throw new AssertionError();
296       }
297     }
298 
299     @java.lang.Override
300     @java.lang.SuppressWarnings("unchecked")
invoke( io.grpc.stub.StreamObserver<Resp> responseObserver)301     public io.grpc.stub.StreamObserver<Req> invoke(
302         io.grpc.stub.StreamObserver<Resp> responseObserver) {
303       switch (methodId) {
304         default:
305           throw new AssertionError();
306       }
307     }
308   }
309 
bindService(AsyncService service)310   public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) {
311     return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
312         .addMethod(
313             getCompleteQueryMethod(),
314             io.grpc.stub.ServerCalls.asyncUnaryCall(
315                 new MethodHandlers<
316                     com.google.cloud.talent.v4beta1.CompleteQueryRequest,
317                     com.google.cloud.talent.v4beta1.CompleteQueryResponse>(
318                     service, METHODID_COMPLETE_QUERY)))
319         .build();
320   }
321 
322   private abstract static class CompletionBaseDescriptorSupplier
323       implements io.grpc.protobuf.ProtoFileDescriptorSupplier,
324           io.grpc.protobuf.ProtoServiceDescriptorSupplier {
CompletionBaseDescriptorSupplier()325     CompletionBaseDescriptorSupplier() {}
326 
327     @java.lang.Override
getFileDescriptor()328     public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
329       return com.google.cloud.talent.v4beta1.CompletionServiceProto.getDescriptor();
330     }
331 
332     @java.lang.Override
getServiceDescriptor()333     public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
334       return getFileDescriptor().findServiceByName("Completion");
335     }
336   }
337 
338   private static final class CompletionFileDescriptorSupplier
339       extends CompletionBaseDescriptorSupplier {
CompletionFileDescriptorSupplier()340     CompletionFileDescriptorSupplier() {}
341   }
342 
343   private static final class CompletionMethodDescriptorSupplier
344       extends CompletionBaseDescriptorSupplier
345       implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
346     private final String methodName;
347 
CompletionMethodDescriptorSupplier(String methodName)348     CompletionMethodDescriptorSupplier(String methodName) {
349       this.methodName = methodName;
350     }
351 
352     @java.lang.Override
getMethodDescriptor()353     public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
354       return getServiceDescriptor().findMethodByName(methodName);
355     }
356   }
357 
358   private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
359 
getServiceDescriptor()360   public static io.grpc.ServiceDescriptor getServiceDescriptor() {
361     io.grpc.ServiceDescriptor result = serviceDescriptor;
362     if (result == null) {
363       synchronized (CompletionGrpc.class) {
364         result = serviceDescriptor;
365         if (result == null) {
366           serviceDescriptor =
367               result =
368                   io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
369                       .setSchemaDescriptor(new CompletionFileDescriptorSupplier())
370                       .addMethod(getCompleteQueryMethod())
371                       .build();
372         }
373       }
374     }
375     return result;
376   }
377 }
378