• 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.dialogflow.v2;
17 
18 import static io.grpc.MethodDescriptor.generateFullMethodName;
19 
20 /**
21  *
22  *
23  * <pre>
24  * Service for managing [Contexts][google.cloud.dialogflow.v2.Context].
25  * </pre>
26  */
27 @javax.annotation.Generated(
28     value = "by gRPC proto compiler",
29     comments = "Source: google/cloud/dialogflow/v2/context.proto")
30 @io.grpc.stub.annotations.GrpcGenerated
31 public final class ContextsGrpc {
32 
ContextsGrpc()33   private ContextsGrpc() {}
34 
35   public static final String SERVICE_NAME = "google.cloud.dialogflow.v2.Contexts";
36 
37   // Static method descriptors that strictly reflect the proto.
38   private static volatile io.grpc.MethodDescriptor<
39           com.google.cloud.dialogflow.v2.ListContextsRequest,
40           com.google.cloud.dialogflow.v2.ListContextsResponse>
41       getListContextsMethod;
42 
43   @io.grpc.stub.annotations.RpcMethod(
44       fullMethodName = SERVICE_NAME + '/' + "ListContexts",
45       requestType = com.google.cloud.dialogflow.v2.ListContextsRequest.class,
46       responseType = com.google.cloud.dialogflow.v2.ListContextsResponse.class,
47       methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
48   public static io.grpc.MethodDescriptor<
49           com.google.cloud.dialogflow.v2.ListContextsRequest,
50           com.google.cloud.dialogflow.v2.ListContextsResponse>
getListContextsMethod()51       getListContextsMethod() {
52     io.grpc.MethodDescriptor<
53             com.google.cloud.dialogflow.v2.ListContextsRequest,
54             com.google.cloud.dialogflow.v2.ListContextsResponse>
55         getListContextsMethod;
56     if ((getListContextsMethod = ContextsGrpc.getListContextsMethod) == null) {
57       synchronized (ContextsGrpc.class) {
58         if ((getListContextsMethod = ContextsGrpc.getListContextsMethod) == null) {
59           ContextsGrpc.getListContextsMethod =
60               getListContextsMethod =
61                   io.grpc.MethodDescriptor
62                       .<com.google.cloud.dialogflow.v2.ListContextsRequest,
63                           com.google.cloud.dialogflow.v2.ListContextsResponse>
64                           newBuilder()
65                       .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
66                       .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListContexts"))
67                       .setSampledToLocalTracing(true)
68                       .setRequestMarshaller(
69                           io.grpc.protobuf.ProtoUtils.marshaller(
70                               com.google.cloud.dialogflow.v2.ListContextsRequest
71                                   .getDefaultInstance()))
72                       .setResponseMarshaller(
73                           io.grpc.protobuf.ProtoUtils.marshaller(
74                               com.google.cloud.dialogflow.v2.ListContextsResponse
75                                   .getDefaultInstance()))
76                       .setSchemaDescriptor(new ContextsMethodDescriptorSupplier("ListContexts"))
77                       .build();
78         }
79       }
80     }
81     return getListContextsMethod;
82   }
83 
84   private static volatile io.grpc.MethodDescriptor<
85           com.google.cloud.dialogflow.v2.GetContextRequest, com.google.cloud.dialogflow.v2.Context>
86       getGetContextMethod;
87 
88   @io.grpc.stub.annotations.RpcMethod(
89       fullMethodName = SERVICE_NAME + '/' + "GetContext",
90       requestType = com.google.cloud.dialogflow.v2.GetContextRequest.class,
91       responseType = com.google.cloud.dialogflow.v2.Context.class,
92       methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
93   public static io.grpc.MethodDescriptor<
94           com.google.cloud.dialogflow.v2.GetContextRequest, com.google.cloud.dialogflow.v2.Context>
getGetContextMethod()95       getGetContextMethod() {
96     io.grpc.MethodDescriptor<
97             com.google.cloud.dialogflow.v2.GetContextRequest,
98             com.google.cloud.dialogflow.v2.Context>
99         getGetContextMethod;
100     if ((getGetContextMethod = ContextsGrpc.getGetContextMethod) == null) {
101       synchronized (ContextsGrpc.class) {
102         if ((getGetContextMethod = ContextsGrpc.getGetContextMethod) == null) {
103           ContextsGrpc.getGetContextMethod =
104               getGetContextMethod =
105                   io.grpc.MethodDescriptor
106                       .<com.google.cloud.dialogflow.v2.GetContextRequest,
107                           com.google.cloud.dialogflow.v2.Context>
108                           newBuilder()
109                       .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
110                       .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetContext"))
111                       .setSampledToLocalTracing(true)
112                       .setRequestMarshaller(
113                           io.grpc.protobuf.ProtoUtils.marshaller(
114                               com.google.cloud.dialogflow.v2.GetContextRequest
115                                   .getDefaultInstance()))
116                       .setResponseMarshaller(
117                           io.grpc.protobuf.ProtoUtils.marshaller(
118                               com.google.cloud.dialogflow.v2.Context.getDefaultInstance()))
119                       .setSchemaDescriptor(new ContextsMethodDescriptorSupplier("GetContext"))
120                       .build();
121         }
122       }
123     }
124     return getGetContextMethod;
125   }
126 
127   private static volatile io.grpc.MethodDescriptor<
128           com.google.cloud.dialogflow.v2.CreateContextRequest,
129           com.google.cloud.dialogflow.v2.Context>
130       getCreateContextMethod;
131 
132   @io.grpc.stub.annotations.RpcMethod(
133       fullMethodName = SERVICE_NAME + '/' + "CreateContext",
134       requestType = com.google.cloud.dialogflow.v2.CreateContextRequest.class,
135       responseType = com.google.cloud.dialogflow.v2.Context.class,
136       methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
137   public static io.grpc.MethodDescriptor<
138           com.google.cloud.dialogflow.v2.CreateContextRequest,
139           com.google.cloud.dialogflow.v2.Context>
getCreateContextMethod()140       getCreateContextMethod() {
141     io.grpc.MethodDescriptor<
142             com.google.cloud.dialogflow.v2.CreateContextRequest,
143             com.google.cloud.dialogflow.v2.Context>
144         getCreateContextMethod;
145     if ((getCreateContextMethod = ContextsGrpc.getCreateContextMethod) == null) {
146       synchronized (ContextsGrpc.class) {
147         if ((getCreateContextMethod = ContextsGrpc.getCreateContextMethod) == null) {
148           ContextsGrpc.getCreateContextMethod =
149               getCreateContextMethod =
150                   io.grpc.MethodDescriptor
151                       .<com.google.cloud.dialogflow.v2.CreateContextRequest,
152                           com.google.cloud.dialogflow.v2.Context>
153                           newBuilder()
154                       .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
155                       .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateContext"))
156                       .setSampledToLocalTracing(true)
157                       .setRequestMarshaller(
158                           io.grpc.protobuf.ProtoUtils.marshaller(
159                               com.google.cloud.dialogflow.v2.CreateContextRequest
160                                   .getDefaultInstance()))
161                       .setResponseMarshaller(
162                           io.grpc.protobuf.ProtoUtils.marshaller(
163                               com.google.cloud.dialogflow.v2.Context.getDefaultInstance()))
164                       .setSchemaDescriptor(new ContextsMethodDescriptorSupplier("CreateContext"))
165                       .build();
166         }
167       }
168     }
169     return getCreateContextMethod;
170   }
171 
172   private static volatile io.grpc.MethodDescriptor<
173           com.google.cloud.dialogflow.v2.UpdateContextRequest,
174           com.google.cloud.dialogflow.v2.Context>
175       getUpdateContextMethod;
176 
177   @io.grpc.stub.annotations.RpcMethod(
178       fullMethodName = SERVICE_NAME + '/' + "UpdateContext",
179       requestType = com.google.cloud.dialogflow.v2.UpdateContextRequest.class,
180       responseType = com.google.cloud.dialogflow.v2.Context.class,
181       methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
182   public static io.grpc.MethodDescriptor<
183           com.google.cloud.dialogflow.v2.UpdateContextRequest,
184           com.google.cloud.dialogflow.v2.Context>
getUpdateContextMethod()185       getUpdateContextMethod() {
186     io.grpc.MethodDescriptor<
187             com.google.cloud.dialogflow.v2.UpdateContextRequest,
188             com.google.cloud.dialogflow.v2.Context>
189         getUpdateContextMethod;
190     if ((getUpdateContextMethod = ContextsGrpc.getUpdateContextMethod) == null) {
191       synchronized (ContextsGrpc.class) {
192         if ((getUpdateContextMethod = ContextsGrpc.getUpdateContextMethod) == null) {
193           ContextsGrpc.getUpdateContextMethod =
194               getUpdateContextMethod =
195                   io.grpc.MethodDescriptor
196                       .<com.google.cloud.dialogflow.v2.UpdateContextRequest,
197                           com.google.cloud.dialogflow.v2.Context>
198                           newBuilder()
199                       .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
200                       .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateContext"))
201                       .setSampledToLocalTracing(true)
202                       .setRequestMarshaller(
203                           io.grpc.protobuf.ProtoUtils.marshaller(
204                               com.google.cloud.dialogflow.v2.UpdateContextRequest
205                                   .getDefaultInstance()))
206                       .setResponseMarshaller(
207                           io.grpc.protobuf.ProtoUtils.marshaller(
208                               com.google.cloud.dialogflow.v2.Context.getDefaultInstance()))
209                       .setSchemaDescriptor(new ContextsMethodDescriptorSupplier("UpdateContext"))
210                       .build();
211         }
212       }
213     }
214     return getUpdateContextMethod;
215   }
216 
217   private static volatile io.grpc.MethodDescriptor<
218           com.google.cloud.dialogflow.v2.DeleteContextRequest, com.google.protobuf.Empty>
219       getDeleteContextMethod;
220 
221   @io.grpc.stub.annotations.RpcMethod(
222       fullMethodName = SERVICE_NAME + '/' + "DeleteContext",
223       requestType = com.google.cloud.dialogflow.v2.DeleteContextRequest.class,
224       responseType = com.google.protobuf.Empty.class,
225       methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
226   public static io.grpc.MethodDescriptor<
227           com.google.cloud.dialogflow.v2.DeleteContextRequest, com.google.protobuf.Empty>
getDeleteContextMethod()228       getDeleteContextMethod() {
229     io.grpc.MethodDescriptor<
230             com.google.cloud.dialogflow.v2.DeleteContextRequest, com.google.protobuf.Empty>
231         getDeleteContextMethod;
232     if ((getDeleteContextMethod = ContextsGrpc.getDeleteContextMethod) == null) {
233       synchronized (ContextsGrpc.class) {
234         if ((getDeleteContextMethod = ContextsGrpc.getDeleteContextMethod) == null) {
235           ContextsGrpc.getDeleteContextMethod =
236               getDeleteContextMethod =
237                   io.grpc.MethodDescriptor
238                       .<com.google.cloud.dialogflow.v2.DeleteContextRequest,
239                           com.google.protobuf.Empty>
240                           newBuilder()
241                       .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
242                       .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteContext"))
243                       .setSampledToLocalTracing(true)
244                       .setRequestMarshaller(
245                           io.grpc.protobuf.ProtoUtils.marshaller(
246                               com.google.cloud.dialogflow.v2.DeleteContextRequest
247                                   .getDefaultInstance()))
248                       .setResponseMarshaller(
249                           io.grpc.protobuf.ProtoUtils.marshaller(
250                               com.google.protobuf.Empty.getDefaultInstance()))
251                       .setSchemaDescriptor(new ContextsMethodDescriptorSupplier("DeleteContext"))
252                       .build();
253         }
254       }
255     }
256     return getDeleteContextMethod;
257   }
258 
259   private static volatile io.grpc.MethodDescriptor<
260           com.google.cloud.dialogflow.v2.DeleteAllContextsRequest, com.google.protobuf.Empty>
261       getDeleteAllContextsMethod;
262 
263   @io.grpc.stub.annotations.RpcMethod(
264       fullMethodName = SERVICE_NAME + '/' + "DeleteAllContexts",
265       requestType = com.google.cloud.dialogflow.v2.DeleteAllContextsRequest.class,
266       responseType = com.google.protobuf.Empty.class,
267       methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
268   public static io.grpc.MethodDescriptor<
269           com.google.cloud.dialogflow.v2.DeleteAllContextsRequest, com.google.protobuf.Empty>
getDeleteAllContextsMethod()270       getDeleteAllContextsMethod() {
271     io.grpc.MethodDescriptor<
272             com.google.cloud.dialogflow.v2.DeleteAllContextsRequest, com.google.protobuf.Empty>
273         getDeleteAllContextsMethod;
274     if ((getDeleteAllContextsMethod = ContextsGrpc.getDeleteAllContextsMethod) == null) {
275       synchronized (ContextsGrpc.class) {
276         if ((getDeleteAllContextsMethod = ContextsGrpc.getDeleteAllContextsMethod) == null) {
277           ContextsGrpc.getDeleteAllContextsMethod =
278               getDeleteAllContextsMethod =
279                   io.grpc.MethodDescriptor
280                       .<com.google.cloud.dialogflow.v2.DeleteAllContextsRequest,
281                           com.google.protobuf.Empty>
282                           newBuilder()
283                       .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
284                       .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteAllContexts"))
285                       .setSampledToLocalTracing(true)
286                       .setRequestMarshaller(
287                           io.grpc.protobuf.ProtoUtils.marshaller(
288                               com.google.cloud.dialogflow.v2.DeleteAllContextsRequest
289                                   .getDefaultInstance()))
290                       .setResponseMarshaller(
291                           io.grpc.protobuf.ProtoUtils.marshaller(
292                               com.google.protobuf.Empty.getDefaultInstance()))
293                       .setSchemaDescriptor(
294                           new ContextsMethodDescriptorSupplier("DeleteAllContexts"))
295                       .build();
296         }
297       }
298     }
299     return getDeleteAllContextsMethod;
300   }
301 
302   /** Creates a new async stub that supports all call types for the service */
newStub(io.grpc.Channel channel)303   public static ContextsStub newStub(io.grpc.Channel channel) {
304     io.grpc.stub.AbstractStub.StubFactory<ContextsStub> factory =
305         new io.grpc.stub.AbstractStub.StubFactory<ContextsStub>() {
306           @java.lang.Override
307           public ContextsStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
308             return new ContextsStub(channel, callOptions);
309           }
310         };
311     return ContextsStub.newStub(factory, channel);
312   }
313 
314   /**
315    * Creates a new blocking-style stub that supports unary and streaming output calls on the service
316    */
newBlockingStub(io.grpc.Channel channel)317   public static ContextsBlockingStub newBlockingStub(io.grpc.Channel channel) {
318     io.grpc.stub.AbstractStub.StubFactory<ContextsBlockingStub> factory =
319         new io.grpc.stub.AbstractStub.StubFactory<ContextsBlockingStub>() {
320           @java.lang.Override
321           public ContextsBlockingStub newStub(
322               io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
323             return new ContextsBlockingStub(channel, callOptions);
324           }
325         };
326     return ContextsBlockingStub.newStub(factory, channel);
327   }
328 
329   /** Creates a new ListenableFuture-style stub that supports unary calls on the service */
newFutureStub(io.grpc.Channel channel)330   public static ContextsFutureStub newFutureStub(io.grpc.Channel channel) {
331     io.grpc.stub.AbstractStub.StubFactory<ContextsFutureStub> factory =
332         new io.grpc.stub.AbstractStub.StubFactory<ContextsFutureStub>() {
333           @java.lang.Override
334           public ContextsFutureStub newStub(
335               io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
336             return new ContextsFutureStub(channel, callOptions);
337           }
338         };
339     return ContextsFutureStub.newStub(factory, channel);
340   }
341 
342   /**
343    *
344    *
345    * <pre>
346    * Service for managing [Contexts][google.cloud.dialogflow.v2.Context].
347    * </pre>
348    */
349   public interface AsyncService {
350 
351     /**
352      *
353      *
354      * <pre>
355      * Returns the list of all contexts in the specified session.
356      * </pre>
357      */
listContexts( com.google.cloud.dialogflow.v2.ListContextsRequest request, io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.ListContextsResponse> responseObserver)358     default void listContexts(
359         com.google.cloud.dialogflow.v2.ListContextsRequest request,
360         io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.ListContextsResponse>
361             responseObserver) {
362       io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
363           getListContextsMethod(), responseObserver);
364     }
365 
366     /**
367      *
368      *
369      * <pre>
370      * Retrieves the specified context.
371      * </pre>
372      */
getContext( com.google.cloud.dialogflow.v2.GetContextRequest request, io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Context> responseObserver)373     default void getContext(
374         com.google.cloud.dialogflow.v2.GetContextRequest request,
375         io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Context> responseObserver) {
376       io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetContextMethod(), responseObserver);
377     }
378 
379     /**
380      *
381      *
382      * <pre>
383      * Creates a context.
384      * If the specified context already exists, overrides the context.
385      * </pre>
386      */
createContext( com.google.cloud.dialogflow.v2.CreateContextRequest request, io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Context> responseObserver)387     default void createContext(
388         com.google.cloud.dialogflow.v2.CreateContextRequest request,
389         io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Context> responseObserver) {
390       io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
391           getCreateContextMethod(), responseObserver);
392     }
393 
394     /**
395      *
396      *
397      * <pre>
398      * Updates the specified context.
399      * </pre>
400      */
updateContext( com.google.cloud.dialogflow.v2.UpdateContextRequest request, io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Context> responseObserver)401     default void updateContext(
402         com.google.cloud.dialogflow.v2.UpdateContextRequest request,
403         io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Context> responseObserver) {
404       io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
405           getUpdateContextMethod(), responseObserver);
406     }
407 
408     /**
409      *
410      *
411      * <pre>
412      * Deletes the specified context.
413      * </pre>
414      */
deleteContext( com.google.cloud.dialogflow.v2.DeleteContextRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver)415     default void deleteContext(
416         com.google.cloud.dialogflow.v2.DeleteContextRequest request,
417         io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver) {
418       io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
419           getDeleteContextMethod(), responseObserver);
420     }
421 
422     /**
423      *
424      *
425      * <pre>
426      * Deletes all active contexts in the specified session.
427      * </pre>
428      */
deleteAllContexts( com.google.cloud.dialogflow.v2.DeleteAllContextsRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver)429     default void deleteAllContexts(
430         com.google.cloud.dialogflow.v2.DeleteAllContextsRequest request,
431         io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver) {
432       io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(
433           getDeleteAllContextsMethod(), responseObserver);
434     }
435   }
436 
437   /**
438    * Base class for the server implementation of the service Contexts.
439    *
440    * <pre>
441    * Service for managing [Contexts][google.cloud.dialogflow.v2.Context].
442    * </pre>
443    */
444   public abstract static class ContextsImplBase implements io.grpc.BindableService, AsyncService {
445 
446     @java.lang.Override
bindService()447     public final io.grpc.ServerServiceDefinition bindService() {
448       return ContextsGrpc.bindService(this);
449     }
450   }
451 
452   /**
453    * A stub to allow clients to do asynchronous rpc calls to service Contexts.
454    *
455    * <pre>
456    * Service for managing [Contexts][google.cloud.dialogflow.v2.Context].
457    * </pre>
458    */
459   public static final class ContextsStub extends io.grpc.stub.AbstractAsyncStub<ContextsStub> {
ContextsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)460     private ContextsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
461       super(channel, callOptions);
462     }
463 
464     @java.lang.Override
build(io.grpc.Channel channel, io.grpc.CallOptions callOptions)465     protected ContextsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
466       return new ContextsStub(channel, callOptions);
467     }
468 
469     /**
470      *
471      *
472      * <pre>
473      * Returns the list of all contexts in the specified session.
474      * </pre>
475      */
listContexts( com.google.cloud.dialogflow.v2.ListContextsRequest request, io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.ListContextsResponse> responseObserver)476     public void listContexts(
477         com.google.cloud.dialogflow.v2.ListContextsRequest request,
478         io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.ListContextsResponse>
479             responseObserver) {
480       io.grpc.stub.ClientCalls.asyncUnaryCall(
481           getChannel().newCall(getListContextsMethod(), getCallOptions()),
482           request,
483           responseObserver);
484     }
485 
486     /**
487      *
488      *
489      * <pre>
490      * Retrieves the specified context.
491      * </pre>
492      */
getContext( com.google.cloud.dialogflow.v2.GetContextRequest request, io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Context> responseObserver)493     public void getContext(
494         com.google.cloud.dialogflow.v2.GetContextRequest request,
495         io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Context> responseObserver) {
496       io.grpc.stub.ClientCalls.asyncUnaryCall(
497           getChannel().newCall(getGetContextMethod(), getCallOptions()), request, responseObserver);
498     }
499 
500     /**
501      *
502      *
503      * <pre>
504      * Creates a context.
505      * If the specified context already exists, overrides the context.
506      * </pre>
507      */
createContext( com.google.cloud.dialogflow.v2.CreateContextRequest request, io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Context> responseObserver)508     public void createContext(
509         com.google.cloud.dialogflow.v2.CreateContextRequest request,
510         io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Context> responseObserver) {
511       io.grpc.stub.ClientCalls.asyncUnaryCall(
512           getChannel().newCall(getCreateContextMethod(), getCallOptions()),
513           request,
514           responseObserver);
515     }
516 
517     /**
518      *
519      *
520      * <pre>
521      * Updates the specified context.
522      * </pre>
523      */
updateContext( com.google.cloud.dialogflow.v2.UpdateContextRequest request, io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Context> responseObserver)524     public void updateContext(
525         com.google.cloud.dialogflow.v2.UpdateContextRequest request,
526         io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Context> responseObserver) {
527       io.grpc.stub.ClientCalls.asyncUnaryCall(
528           getChannel().newCall(getUpdateContextMethod(), getCallOptions()),
529           request,
530           responseObserver);
531     }
532 
533     /**
534      *
535      *
536      * <pre>
537      * Deletes the specified context.
538      * </pre>
539      */
deleteContext( com.google.cloud.dialogflow.v2.DeleteContextRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver)540     public void deleteContext(
541         com.google.cloud.dialogflow.v2.DeleteContextRequest request,
542         io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver) {
543       io.grpc.stub.ClientCalls.asyncUnaryCall(
544           getChannel().newCall(getDeleteContextMethod(), getCallOptions()),
545           request,
546           responseObserver);
547     }
548 
549     /**
550      *
551      *
552      * <pre>
553      * Deletes all active contexts in the specified session.
554      * </pre>
555      */
deleteAllContexts( com.google.cloud.dialogflow.v2.DeleteAllContextsRequest request, io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver)556     public void deleteAllContexts(
557         com.google.cloud.dialogflow.v2.DeleteAllContextsRequest request,
558         io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver) {
559       io.grpc.stub.ClientCalls.asyncUnaryCall(
560           getChannel().newCall(getDeleteAllContextsMethod(), getCallOptions()),
561           request,
562           responseObserver);
563     }
564   }
565 
566   /**
567    * A stub to allow clients to do synchronous rpc calls to service Contexts.
568    *
569    * <pre>
570    * Service for managing [Contexts][google.cloud.dialogflow.v2.Context].
571    * </pre>
572    */
573   public static final class ContextsBlockingStub
574       extends io.grpc.stub.AbstractBlockingStub<ContextsBlockingStub> {
ContextsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)575     private ContextsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
576       super(channel, callOptions);
577     }
578 
579     @java.lang.Override
build(io.grpc.Channel channel, io.grpc.CallOptions callOptions)580     protected ContextsBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
581       return new ContextsBlockingStub(channel, callOptions);
582     }
583 
584     /**
585      *
586      *
587      * <pre>
588      * Returns the list of all contexts in the specified session.
589      * </pre>
590      */
listContexts( com.google.cloud.dialogflow.v2.ListContextsRequest request)591     public com.google.cloud.dialogflow.v2.ListContextsResponse listContexts(
592         com.google.cloud.dialogflow.v2.ListContextsRequest request) {
593       return io.grpc.stub.ClientCalls.blockingUnaryCall(
594           getChannel(), getListContextsMethod(), getCallOptions(), request);
595     }
596 
597     /**
598      *
599      *
600      * <pre>
601      * Retrieves the specified context.
602      * </pre>
603      */
getContext( com.google.cloud.dialogflow.v2.GetContextRequest request)604     public com.google.cloud.dialogflow.v2.Context getContext(
605         com.google.cloud.dialogflow.v2.GetContextRequest request) {
606       return io.grpc.stub.ClientCalls.blockingUnaryCall(
607           getChannel(), getGetContextMethod(), getCallOptions(), request);
608     }
609 
610     /**
611      *
612      *
613      * <pre>
614      * Creates a context.
615      * If the specified context already exists, overrides the context.
616      * </pre>
617      */
createContext( com.google.cloud.dialogflow.v2.CreateContextRequest request)618     public com.google.cloud.dialogflow.v2.Context createContext(
619         com.google.cloud.dialogflow.v2.CreateContextRequest request) {
620       return io.grpc.stub.ClientCalls.blockingUnaryCall(
621           getChannel(), getCreateContextMethod(), getCallOptions(), request);
622     }
623 
624     /**
625      *
626      *
627      * <pre>
628      * Updates the specified context.
629      * </pre>
630      */
updateContext( com.google.cloud.dialogflow.v2.UpdateContextRequest request)631     public com.google.cloud.dialogflow.v2.Context updateContext(
632         com.google.cloud.dialogflow.v2.UpdateContextRequest request) {
633       return io.grpc.stub.ClientCalls.blockingUnaryCall(
634           getChannel(), getUpdateContextMethod(), getCallOptions(), request);
635     }
636 
637     /**
638      *
639      *
640      * <pre>
641      * Deletes the specified context.
642      * </pre>
643      */
deleteContext( com.google.cloud.dialogflow.v2.DeleteContextRequest request)644     public com.google.protobuf.Empty deleteContext(
645         com.google.cloud.dialogflow.v2.DeleteContextRequest request) {
646       return io.grpc.stub.ClientCalls.blockingUnaryCall(
647           getChannel(), getDeleteContextMethod(), getCallOptions(), request);
648     }
649 
650     /**
651      *
652      *
653      * <pre>
654      * Deletes all active contexts in the specified session.
655      * </pre>
656      */
deleteAllContexts( com.google.cloud.dialogflow.v2.DeleteAllContextsRequest request)657     public com.google.protobuf.Empty deleteAllContexts(
658         com.google.cloud.dialogflow.v2.DeleteAllContextsRequest request) {
659       return io.grpc.stub.ClientCalls.blockingUnaryCall(
660           getChannel(), getDeleteAllContextsMethod(), getCallOptions(), request);
661     }
662   }
663 
664   /**
665    * A stub to allow clients to do ListenableFuture-style rpc calls to service Contexts.
666    *
667    * <pre>
668    * Service for managing [Contexts][google.cloud.dialogflow.v2.Context].
669    * </pre>
670    */
671   public static final class ContextsFutureStub
672       extends io.grpc.stub.AbstractFutureStub<ContextsFutureStub> {
ContextsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)673     private ContextsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
674       super(channel, callOptions);
675     }
676 
677     @java.lang.Override
build(io.grpc.Channel channel, io.grpc.CallOptions callOptions)678     protected ContextsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
679       return new ContextsFutureStub(channel, callOptions);
680     }
681 
682     /**
683      *
684      *
685      * <pre>
686      * Returns the list of all contexts in the specified session.
687      * </pre>
688      */
689     public com.google.common.util.concurrent.ListenableFuture<
690             com.google.cloud.dialogflow.v2.ListContextsResponse>
listContexts(com.google.cloud.dialogflow.v2.ListContextsRequest request)691         listContexts(com.google.cloud.dialogflow.v2.ListContextsRequest request) {
692       return io.grpc.stub.ClientCalls.futureUnaryCall(
693           getChannel().newCall(getListContextsMethod(), getCallOptions()), request);
694     }
695 
696     /**
697      *
698      *
699      * <pre>
700      * Retrieves the specified context.
701      * </pre>
702      */
703     public com.google.common.util.concurrent.ListenableFuture<
704             com.google.cloud.dialogflow.v2.Context>
getContext(com.google.cloud.dialogflow.v2.GetContextRequest request)705         getContext(com.google.cloud.dialogflow.v2.GetContextRequest request) {
706       return io.grpc.stub.ClientCalls.futureUnaryCall(
707           getChannel().newCall(getGetContextMethod(), getCallOptions()), request);
708     }
709 
710     /**
711      *
712      *
713      * <pre>
714      * Creates a context.
715      * If the specified context already exists, overrides the context.
716      * </pre>
717      */
718     public com.google.common.util.concurrent.ListenableFuture<
719             com.google.cloud.dialogflow.v2.Context>
createContext(com.google.cloud.dialogflow.v2.CreateContextRequest request)720         createContext(com.google.cloud.dialogflow.v2.CreateContextRequest request) {
721       return io.grpc.stub.ClientCalls.futureUnaryCall(
722           getChannel().newCall(getCreateContextMethod(), getCallOptions()), request);
723     }
724 
725     /**
726      *
727      *
728      * <pre>
729      * Updates the specified context.
730      * </pre>
731      */
732     public com.google.common.util.concurrent.ListenableFuture<
733             com.google.cloud.dialogflow.v2.Context>
updateContext(com.google.cloud.dialogflow.v2.UpdateContextRequest request)734         updateContext(com.google.cloud.dialogflow.v2.UpdateContextRequest request) {
735       return io.grpc.stub.ClientCalls.futureUnaryCall(
736           getChannel().newCall(getUpdateContextMethod(), getCallOptions()), request);
737     }
738 
739     /**
740      *
741      *
742      * <pre>
743      * Deletes the specified context.
744      * </pre>
745      */
746     public com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty>
deleteContext(com.google.cloud.dialogflow.v2.DeleteContextRequest request)747         deleteContext(com.google.cloud.dialogflow.v2.DeleteContextRequest request) {
748       return io.grpc.stub.ClientCalls.futureUnaryCall(
749           getChannel().newCall(getDeleteContextMethod(), getCallOptions()), request);
750     }
751 
752     /**
753      *
754      *
755      * <pre>
756      * Deletes all active contexts in the specified session.
757      * </pre>
758      */
759     public com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty>
deleteAllContexts(com.google.cloud.dialogflow.v2.DeleteAllContextsRequest request)760         deleteAllContexts(com.google.cloud.dialogflow.v2.DeleteAllContextsRequest request) {
761       return io.grpc.stub.ClientCalls.futureUnaryCall(
762           getChannel().newCall(getDeleteAllContextsMethod(), getCallOptions()), request);
763     }
764   }
765 
766   private static final int METHODID_LIST_CONTEXTS = 0;
767   private static final int METHODID_GET_CONTEXT = 1;
768   private static final int METHODID_CREATE_CONTEXT = 2;
769   private static final int METHODID_UPDATE_CONTEXT = 3;
770   private static final int METHODID_DELETE_CONTEXT = 4;
771   private static final int METHODID_DELETE_ALL_CONTEXTS = 5;
772 
773   private static final class MethodHandlers<Req, Resp>
774       implements io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
775           io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
776           io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
777           io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
778     private final AsyncService serviceImpl;
779     private final int methodId;
780 
MethodHandlers(AsyncService serviceImpl, int methodId)781     MethodHandlers(AsyncService serviceImpl, int methodId) {
782       this.serviceImpl = serviceImpl;
783       this.methodId = methodId;
784     }
785 
786     @java.lang.Override
787     @java.lang.SuppressWarnings("unchecked")
invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver)788     public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
789       switch (methodId) {
790         case METHODID_LIST_CONTEXTS:
791           serviceImpl.listContexts(
792               (com.google.cloud.dialogflow.v2.ListContextsRequest) request,
793               (io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.ListContextsResponse>)
794                   responseObserver);
795           break;
796         case METHODID_GET_CONTEXT:
797           serviceImpl.getContext(
798               (com.google.cloud.dialogflow.v2.GetContextRequest) request,
799               (io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Context>)
800                   responseObserver);
801           break;
802         case METHODID_CREATE_CONTEXT:
803           serviceImpl.createContext(
804               (com.google.cloud.dialogflow.v2.CreateContextRequest) request,
805               (io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Context>)
806                   responseObserver);
807           break;
808         case METHODID_UPDATE_CONTEXT:
809           serviceImpl.updateContext(
810               (com.google.cloud.dialogflow.v2.UpdateContextRequest) request,
811               (io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Context>)
812                   responseObserver);
813           break;
814         case METHODID_DELETE_CONTEXT:
815           serviceImpl.deleteContext(
816               (com.google.cloud.dialogflow.v2.DeleteContextRequest) request,
817               (io.grpc.stub.StreamObserver<com.google.protobuf.Empty>) responseObserver);
818           break;
819         case METHODID_DELETE_ALL_CONTEXTS:
820           serviceImpl.deleteAllContexts(
821               (com.google.cloud.dialogflow.v2.DeleteAllContextsRequest) request,
822               (io.grpc.stub.StreamObserver<com.google.protobuf.Empty>) responseObserver);
823           break;
824         default:
825           throw new AssertionError();
826       }
827     }
828 
829     @java.lang.Override
830     @java.lang.SuppressWarnings("unchecked")
invoke( io.grpc.stub.StreamObserver<Resp> responseObserver)831     public io.grpc.stub.StreamObserver<Req> invoke(
832         io.grpc.stub.StreamObserver<Resp> responseObserver) {
833       switch (methodId) {
834         default:
835           throw new AssertionError();
836       }
837     }
838   }
839 
bindService(AsyncService service)840   public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) {
841     return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
842         .addMethod(
843             getListContextsMethod(),
844             io.grpc.stub.ServerCalls.asyncUnaryCall(
845                 new MethodHandlers<
846                     com.google.cloud.dialogflow.v2.ListContextsRequest,
847                     com.google.cloud.dialogflow.v2.ListContextsResponse>(
848                     service, METHODID_LIST_CONTEXTS)))
849         .addMethod(
850             getGetContextMethod(),
851             io.grpc.stub.ServerCalls.asyncUnaryCall(
852                 new MethodHandlers<
853                     com.google.cloud.dialogflow.v2.GetContextRequest,
854                     com.google.cloud.dialogflow.v2.Context>(service, METHODID_GET_CONTEXT)))
855         .addMethod(
856             getCreateContextMethod(),
857             io.grpc.stub.ServerCalls.asyncUnaryCall(
858                 new MethodHandlers<
859                     com.google.cloud.dialogflow.v2.CreateContextRequest,
860                     com.google.cloud.dialogflow.v2.Context>(service, METHODID_CREATE_CONTEXT)))
861         .addMethod(
862             getUpdateContextMethod(),
863             io.grpc.stub.ServerCalls.asyncUnaryCall(
864                 new MethodHandlers<
865                     com.google.cloud.dialogflow.v2.UpdateContextRequest,
866                     com.google.cloud.dialogflow.v2.Context>(service, METHODID_UPDATE_CONTEXT)))
867         .addMethod(
868             getDeleteContextMethod(),
869             io.grpc.stub.ServerCalls.asyncUnaryCall(
870                 new MethodHandlers<
871                     com.google.cloud.dialogflow.v2.DeleteContextRequest, com.google.protobuf.Empty>(
872                     service, METHODID_DELETE_CONTEXT)))
873         .addMethod(
874             getDeleteAllContextsMethod(),
875             io.grpc.stub.ServerCalls.asyncUnaryCall(
876                 new MethodHandlers<
877                     com.google.cloud.dialogflow.v2.DeleteAllContextsRequest,
878                     com.google.protobuf.Empty>(service, METHODID_DELETE_ALL_CONTEXTS)))
879         .build();
880   }
881 
882   private abstract static class ContextsBaseDescriptorSupplier
883       implements io.grpc.protobuf.ProtoFileDescriptorSupplier,
884           io.grpc.protobuf.ProtoServiceDescriptorSupplier {
ContextsBaseDescriptorSupplier()885     ContextsBaseDescriptorSupplier() {}
886 
887     @java.lang.Override
getFileDescriptor()888     public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
889       return com.google.cloud.dialogflow.v2.ContextProto.getDescriptor();
890     }
891 
892     @java.lang.Override
getServiceDescriptor()893     public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
894       return getFileDescriptor().findServiceByName("Contexts");
895     }
896   }
897 
898   private static final class ContextsFileDescriptorSupplier extends ContextsBaseDescriptorSupplier {
ContextsFileDescriptorSupplier()899     ContextsFileDescriptorSupplier() {}
900   }
901 
902   private static final class ContextsMethodDescriptorSupplier extends ContextsBaseDescriptorSupplier
903       implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
904     private final String methodName;
905 
ContextsMethodDescriptorSupplier(String methodName)906     ContextsMethodDescriptorSupplier(String methodName) {
907       this.methodName = methodName;
908     }
909 
910     @java.lang.Override
getMethodDescriptor()911     public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
912       return getServiceDescriptor().findMethodByName(methodName);
913     }
914   }
915 
916   private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
917 
getServiceDescriptor()918   public static io.grpc.ServiceDescriptor getServiceDescriptor() {
919     io.grpc.ServiceDescriptor result = serviceDescriptor;
920     if (result == null) {
921       synchronized (ContextsGrpc.class) {
922         result = serviceDescriptor;
923         if (result == null) {
924           serviceDescriptor =
925               result =
926                   io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
927                       .setSchemaDescriptor(new ContextsFileDescriptorSupplier())
928                       .addMethod(getListContextsMethod())
929                       .addMethod(getGetContextMethod())
930                       .addMethod(getCreateContextMethod())
931                       .addMethod(getUpdateContextMethod())
932                       .addMethod(getDeleteContextMethod())
933                       .addMethod(getDeleteAllContextsMethod())
934                       .build();
935         }
936       }
937     }
938     return result;
939   }
940 }
941