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 25 * [Conversations][google.cloud.dialogflow.v2.Conversation]. 26 * </pre> 27 */ 28 @javax.annotation.Generated( 29 value = "by gRPC proto compiler", 30 comments = "Source: google/cloud/dialogflow/v2/conversation.proto") 31 @io.grpc.stub.annotations.GrpcGenerated 32 public final class ConversationsGrpc { 33 ConversationsGrpc()34 private ConversationsGrpc() {} 35 36 public static final String SERVICE_NAME = "google.cloud.dialogflow.v2.Conversations"; 37 38 // Static method descriptors that strictly reflect the proto. 39 private static volatile io.grpc.MethodDescriptor< 40 com.google.cloud.dialogflow.v2.CreateConversationRequest, 41 com.google.cloud.dialogflow.v2.Conversation> 42 getCreateConversationMethod; 43 44 @io.grpc.stub.annotations.RpcMethod( 45 fullMethodName = SERVICE_NAME + '/' + "CreateConversation", 46 requestType = com.google.cloud.dialogflow.v2.CreateConversationRequest.class, 47 responseType = com.google.cloud.dialogflow.v2.Conversation.class, 48 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 49 public static io.grpc.MethodDescriptor< 50 com.google.cloud.dialogflow.v2.CreateConversationRequest, 51 com.google.cloud.dialogflow.v2.Conversation> getCreateConversationMethod()52 getCreateConversationMethod() { 53 io.grpc.MethodDescriptor< 54 com.google.cloud.dialogflow.v2.CreateConversationRequest, 55 com.google.cloud.dialogflow.v2.Conversation> 56 getCreateConversationMethod; 57 if ((getCreateConversationMethod = ConversationsGrpc.getCreateConversationMethod) == null) { 58 synchronized (ConversationsGrpc.class) { 59 if ((getCreateConversationMethod = ConversationsGrpc.getCreateConversationMethod) == null) { 60 ConversationsGrpc.getCreateConversationMethod = 61 getCreateConversationMethod = 62 io.grpc.MethodDescriptor 63 .<com.google.cloud.dialogflow.v2.CreateConversationRequest, 64 com.google.cloud.dialogflow.v2.Conversation> 65 newBuilder() 66 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 67 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateConversation")) 68 .setSampledToLocalTracing(true) 69 .setRequestMarshaller( 70 io.grpc.protobuf.ProtoUtils.marshaller( 71 com.google.cloud.dialogflow.v2.CreateConversationRequest 72 .getDefaultInstance())) 73 .setResponseMarshaller( 74 io.grpc.protobuf.ProtoUtils.marshaller( 75 com.google.cloud.dialogflow.v2.Conversation.getDefaultInstance())) 76 .setSchemaDescriptor( 77 new ConversationsMethodDescriptorSupplier("CreateConversation")) 78 .build(); 79 } 80 } 81 } 82 return getCreateConversationMethod; 83 } 84 85 private static volatile io.grpc.MethodDescriptor< 86 com.google.cloud.dialogflow.v2.ListConversationsRequest, 87 com.google.cloud.dialogflow.v2.ListConversationsResponse> 88 getListConversationsMethod; 89 90 @io.grpc.stub.annotations.RpcMethod( 91 fullMethodName = SERVICE_NAME + '/' + "ListConversations", 92 requestType = com.google.cloud.dialogflow.v2.ListConversationsRequest.class, 93 responseType = com.google.cloud.dialogflow.v2.ListConversationsResponse.class, 94 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 95 public static io.grpc.MethodDescriptor< 96 com.google.cloud.dialogflow.v2.ListConversationsRequest, 97 com.google.cloud.dialogflow.v2.ListConversationsResponse> getListConversationsMethod()98 getListConversationsMethod() { 99 io.grpc.MethodDescriptor< 100 com.google.cloud.dialogflow.v2.ListConversationsRequest, 101 com.google.cloud.dialogflow.v2.ListConversationsResponse> 102 getListConversationsMethod; 103 if ((getListConversationsMethod = ConversationsGrpc.getListConversationsMethod) == null) { 104 synchronized (ConversationsGrpc.class) { 105 if ((getListConversationsMethod = ConversationsGrpc.getListConversationsMethod) == null) { 106 ConversationsGrpc.getListConversationsMethod = 107 getListConversationsMethod = 108 io.grpc.MethodDescriptor 109 .<com.google.cloud.dialogflow.v2.ListConversationsRequest, 110 com.google.cloud.dialogflow.v2.ListConversationsResponse> 111 newBuilder() 112 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 113 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListConversations")) 114 .setSampledToLocalTracing(true) 115 .setRequestMarshaller( 116 io.grpc.protobuf.ProtoUtils.marshaller( 117 com.google.cloud.dialogflow.v2.ListConversationsRequest 118 .getDefaultInstance())) 119 .setResponseMarshaller( 120 io.grpc.protobuf.ProtoUtils.marshaller( 121 com.google.cloud.dialogflow.v2.ListConversationsResponse 122 .getDefaultInstance())) 123 .setSchemaDescriptor( 124 new ConversationsMethodDescriptorSupplier("ListConversations")) 125 .build(); 126 } 127 } 128 } 129 return getListConversationsMethod; 130 } 131 132 private static volatile io.grpc.MethodDescriptor< 133 com.google.cloud.dialogflow.v2.GetConversationRequest, 134 com.google.cloud.dialogflow.v2.Conversation> 135 getGetConversationMethod; 136 137 @io.grpc.stub.annotations.RpcMethod( 138 fullMethodName = SERVICE_NAME + '/' + "GetConversation", 139 requestType = com.google.cloud.dialogflow.v2.GetConversationRequest.class, 140 responseType = com.google.cloud.dialogflow.v2.Conversation.class, 141 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 142 public static io.grpc.MethodDescriptor< 143 com.google.cloud.dialogflow.v2.GetConversationRequest, 144 com.google.cloud.dialogflow.v2.Conversation> getGetConversationMethod()145 getGetConversationMethod() { 146 io.grpc.MethodDescriptor< 147 com.google.cloud.dialogflow.v2.GetConversationRequest, 148 com.google.cloud.dialogflow.v2.Conversation> 149 getGetConversationMethod; 150 if ((getGetConversationMethod = ConversationsGrpc.getGetConversationMethod) == null) { 151 synchronized (ConversationsGrpc.class) { 152 if ((getGetConversationMethod = ConversationsGrpc.getGetConversationMethod) == null) { 153 ConversationsGrpc.getGetConversationMethod = 154 getGetConversationMethod = 155 io.grpc.MethodDescriptor 156 .<com.google.cloud.dialogflow.v2.GetConversationRequest, 157 com.google.cloud.dialogflow.v2.Conversation> 158 newBuilder() 159 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 160 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetConversation")) 161 .setSampledToLocalTracing(true) 162 .setRequestMarshaller( 163 io.grpc.protobuf.ProtoUtils.marshaller( 164 com.google.cloud.dialogflow.v2.GetConversationRequest 165 .getDefaultInstance())) 166 .setResponseMarshaller( 167 io.grpc.protobuf.ProtoUtils.marshaller( 168 com.google.cloud.dialogflow.v2.Conversation.getDefaultInstance())) 169 .setSchemaDescriptor( 170 new ConversationsMethodDescriptorSupplier("GetConversation")) 171 .build(); 172 } 173 } 174 } 175 return getGetConversationMethod; 176 } 177 178 private static volatile io.grpc.MethodDescriptor< 179 com.google.cloud.dialogflow.v2.CompleteConversationRequest, 180 com.google.cloud.dialogflow.v2.Conversation> 181 getCompleteConversationMethod; 182 183 @io.grpc.stub.annotations.RpcMethod( 184 fullMethodName = SERVICE_NAME + '/' + "CompleteConversation", 185 requestType = com.google.cloud.dialogflow.v2.CompleteConversationRequest.class, 186 responseType = com.google.cloud.dialogflow.v2.Conversation.class, 187 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 188 public static io.grpc.MethodDescriptor< 189 com.google.cloud.dialogflow.v2.CompleteConversationRequest, 190 com.google.cloud.dialogflow.v2.Conversation> getCompleteConversationMethod()191 getCompleteConversationMethod() { 192 io.grpc.MethodDescriptor< 193 com.google.cloud.dialogflow.v2.CompleteConversationRequest, 194 com.google.cloud.dialogflow.v2.Conversation> 195 getCompleteConversationMethod; 196 if ((getCompleteConversationMethod = ConversationsGrpc.getCompleteConversationMethod) == null) { 197 synchronized (ConversationsGrpc.class) { 198 if ((getCompleteConversationMethod = ConversationsGrpc.getCompleteConversationMethod) 199 == null) { 200 ConversationsGrpc.getCompleteConversationMethod = 201 getCompleteConversationMethod = 202 io.grpc.MethodDescriptor 203 .<com.google.cloud.dialogflow.v2.CompleteConversationRequest, 204 com.google.cloud.dialogflow.v2.Conversation> 205 newBuilder() 206 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 207 .setFullMethodName( 208 generateFullMethodName(SERVICE_NAME, "CompleteConversation")) 209 .setSampledToLocalTracing(true) 210 .setRequestMarshaller( 211 io.grpc.protobuf.ProtoUtils.marshaller( 212 com.google.cloud.dialogflow.v2.CompleteConversationRequest 213 .getDefaultInstance())) 214 .setResponseMarshaller( 215 io.grpc.protobuf.ProtoUtils.marshaller( 216 com.google.cloud.dialogflow.v2.Conversation.getDefaultInstance())) 217 .setSchemaDescriptor( 218 new ConversationsMethodDescriptorSupplier("CompleteConversation")) 219 .build(); 220 } 221 } 222 } 223 return getCompleteConversationMethod; 224 } 225 226 private static volatile io.grpc.MethodDescriptor< 227 com.google.cloud.dialogflow.v2.ListMessagesRequest, 228 com.google.cloud.dialogflow.v2.ListMessagesResponse> 229 getListMessagesMethod; 230 231 @io.grpc.stub.annotations.RpcMethod( 232 fullMethodName = SERVICE_NAME + '/' + "ListMessages", 233 requestType = com.google.cloud.dialogflow.v2.ListMessagesRequest.class, 234 responseType = com.google.cloud.dialogflow.v2.ListMessagesResponse.class, 235 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 236 public static io.grpc.MethodDescriptor< 237 com.google.cloud.dialogflow.v2.ListMessagesRequest, 238 com.google.cloud.dialogflow.v2.ListMessagesResponse> getListMessagesMethod()239 getListMessagesMethod() { 240 io.grpc.MethodDescriptor< 241 com.google.cloud.dialogflow.v2.ListMessagesRequest, 242 com.google.cloud.dialogflow.v2.ListMessagesResponse> 243 getListMessagesMethod; 244 if ((getListMessagesMethod = ConversationsGrpc.getListMessagesMethod) == null) { 245 synchronized (ConversationsGrpc.class) { 246 if ((getListMessagesMethod = ConversationsGrpc.getListMessagesMethod) == null) { 247 ConversationsGrpc.getListMessagesMethod = 248 getListMessagesMethod = 249 io.grpc.MethodDescriptor 250 .<com.google.cloud.dialogflow.v2.ListMessagesRequest, 251 com.google.cloud.dialogflow.v2.ListMessagesResponse> 252 newBuilder() 253 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 254 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListMessages")) 255 .setSampledToLocalTracing(true) 256 .setRequestMarshaller( 257 io.grpc.protobuf.ProtoUtils.marshaller( 258 com.google.cloud.dialogflow.v2.ListMessagesRequest 259 .getDefaultInstance())) 260 .setResponseMarshaller( 261 io.grpc.protobuf.ProtoUtils.marshaller( 262 com.google.cloud.dialogflow.v2.ListMessagesResponse 263 .getDefaultInstance())) 264 .setSchemaDescriptor( 265 new ConversationsMethodDescriptorSupplier("ListMessages")) 266 .build(); 267 } 268 } 269 } 270 return getListMessagesMethod; 271 } 272 273 private static volatile io.grpc.MethodDescriptor< 274 com.google.cloud.dialogflow.v2.SuggestConversationSummaryRequest, 275 com.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse> 276 getSuggestConversationSummaryMethod; 277 278 @io.grpc.stub.annotations.RpcMethod( 279 fullMethodName = SERVICE_NAME + '/' + "SuggestConversationSummary", 280 requestType = com.google.cloud.dialogflow.v2.SuggestConversationSummaryRequest.class, 281 responseType = com.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse.class, 282 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 283 public static io.grpc.MethodDescriptor< 284 com.google.cloud.dialogflow.v2.SuggestConversationSummaryRequest, 285 com.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse> getSuggestConversationSummaryMethod()286 getSuggestConversationSummaryMethod() { 287 io.grpc.MethodDescriptor< 288 com.google.cloud.dialogflow.v2.SuggestConversationSummaryRequest, 289 com.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse> 290 getSuggestConversationSummaryMethod; 291 if ((getSuggestConversationSummaryMethod = 292 ConversationsGrpc.getSuggestConversationSummaryMethod) 293 == null) { 294 synchronized (ConversationsGrpc.class) { 295 if ((getSuggestConversationSummaryMethod = 296 ConversationsGrpc.getSuggestConversationSummaryMethod) 297 == null) { 298 ConversationsGrpc.getSuggestConversationSummaryMethod = 299 getSuggestConversationSummaryMethod = 300 io.grpc.MethodDescriptor 301 .<com.google.cloud.dialogflow.v2.SuggestConversationSummaryRequest, 302 com.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse> 303 newBuilder() 304 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 305 .setFullMethodName( 306 generateFullMethodName(SERVICE_NAME, "SuggestConversationSummary")) 307 .setSampledToLocalTracing(true) 308 .setRequestMarshaller( 309 io.grpc.protobuf.ProtoUtils.marshaller( 310 com.google.cloud.dialogflow.v2.SuggestConversationSummaryRequest 311 .getDefaultInstance())) 312 .setResponseMarshaller( 313 io.grpc.protobuf.ProtoUtils.marshaller( 314 com.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse 315 .getDefaultInstance())) 316 .setSchemaDescriptor( 317 new ConversationsMethodDescriptorSupplier("SuggestConversationSummary")) 318 .build(); 319 } 320 } 321 } 322 return getSuggestConversationSummaryMethod; 323 } 324 325 private static volatile io.grpc.MethodDescriptor< 326 com.google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest, 327 com.google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse> 328 getGenerateStatelessSummaryMethod; 329 330 @io.grpc.stub.annotations.RpcMethod( 331 fullMethodName = SERVICE_NAME + '/' + "GenerateStatelessSummary", 332 requestType = com.google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest.class, 333 responseType = com.google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse.class, 334 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 335 public static io.grpc.MethodDescriptor< 336 com.google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest, 337 com.google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse> getGenerateStatelessSummaryMethod()338 getGenerateStatelessSummaryMethod() { 339 io.grpc.MethodDescriptor< 340 com.google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest, 341 com.google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse> 342 getGenerateStatelessSummaryMethod; 343 if ((getGenerateStatelessSummaryMethod = ConversationsGrpc.getGenerateStatelessSummaryMethod) 344 == null) { 345 synchronized (ConversationsGrpc.class) { 346 if ((getGenerateStatelessSummaryMethod = 347 ConversationsGrpc.getGenerateStatelessSummaryMethod) 348 == null) { 349 ConversationsGrpc.getGenerateStatelessSummaryMethod = 350 getGenerateStatelessSummaryMethod = 351 io.grpc.MethodDescriptor 352 .<com.google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest, 353 com.google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse> 354 newBuilder() 355 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 356 .setFullMethodName( 357 generateFullMethodName(SERVICE_NAME, "GenerateStatelessSummary")) 358 .setSampledToLocalTracing(true) 359 .setRequestMarshaller( 360 io.grpc.protobuf.ProtoUtils.marshaller( 361 com.google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest 362 .getDefaultInstance())) 363 .setResponseMarshaller( 364 io.grpc.protobuf.ProtoUtils.marshaller( 365 com.google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse 366 .getDefaultInstance())) 367 .setSchemaDescriptor( 368 new ConversationsMethodDescriptorSupplier("GenerateStatelessSummary")) 369 .build(); 370 } 371 } 372 } 373 return getGenerateStatelessSummaryMethod; 374 } 375 376 /** Creates a new async stub that supports all call types for the service */ newStub(io.grpc.Channel channel)377 public static ConversationsStub newStub(io.grpc.Channel channel) { 378 io.grpc.stub.AbstractStub.StubFactory<ConversationsStub> factory = 379 new io.grpc.stub.AbstractStub.StubFactory<ConversationsStub>() { 380 @java.lang.Override 381 public ConversationsStub newStub( 382 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 383 return new ConversationsStub(channel, callOptions); 384 } 385 }; 386 return ConversationsStub.newStub(factory, channel); 387 } 388 389 /** 390 * Creates a new blocking-style stub that supports unary and streaming output calls on the service 391 */ newBlockingStub(io.grpc.Channel channel)392 public static ConversationsBlockingStub newBlockingStub(io.grpc.Channel channel) { 393 io.grpc.stub.AbstractStub.StubFactory<ConversationsBlockingStub> factory = 394 new io.grpc.stub.AbstractStub.StubFactory<ConversationsBlockingStub>() { 395 @java.lang.Override 396 public ConversationsBlockingStub newStub( 397 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 398 return new ConversationsBlockingStub(channel, callOptions); 399 } 400 }; 401 return ConversationsBlockingStub.newStub(factory, channel); 402 } 403 404 /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ newFutureStub(io.grpc.Channel channel)405 public static ConversationsFutureStub newFutureStub(io.grpc.Channel channel) { 406 io.grpc.stub.AbstractStub.StubFactory<ConversationsFutureStub> factory = 407 new io.grpc.stub.AbstractStub.StubFactory<ConversationsFutureStub>() { 408 @java.lang.Override 409 public ConversationsFutureStub newStub( 410 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 411 return new ConversationsFutureStub(channel, callOptions); 412 } 413 }; 414 return ConversationsFutureStub.newStub(factory, channel); 415 } 416 417 /** 418 * 419 * 420 * <pre> 421 * Service for managing 422 * [Conversations][google.cloud.dialogflow.v2.Conversation]. 423 * </pre> 424 */ 425 public interface AsyncService { 426 427 /** 428 * 429 * 430 * <pre> 431 * Creates a new conversation. Conversations are auto-completed after 24 432 * hours. 433 * Conversation Lifecycle: 434 * There are two stages during a conversation: Automated Agent Stage and 435 * Assist Stage. 436 * For Automated Agent Stage, there will be a dialogflow agent responding to 437 * user queries. 438 * For Assist Stage, there's no dialogflow agent responding to user queries. 439 * But we will provide suggestions which are generated from conversation. 440 * If 441 * [Conversation.conversation_profile][google.cloud.dialogflow.v2.Conversation.conversation_profile] 442 * is configured for a dialogflow agent, conversation will start from 443 * `Automated Agent Stage`, otherwise, it will start from `Assist Stage`. And 444 * during `Automated Agent Stage`, once an 445 * [Intent][google.cloud.dialogflow.v2.Intent] with 446 * [Intent.live_agent_handoff][google.cloud.dialogflow.v2.Intent.live_agent_handoff] 447 * is triggered, conversation will transfer to Assist Stage. 448 * </pre> 449 */ createConversation( com.google.cloud.dialogflow.v2.CreateConversationRequest request, io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Conversation> responseObserver)450 default void createConversation( 451 com.google.cloud.dialogflow.v2.CreateConversationRequest request, 452 io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Conversation> responseObserver) { 453 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 454 getCreateConversationMethod(), responseObserver); 455 } 456 457 /** 458 * 459 * 460 * <pre> 461 * Returns the list of all conversations in the specified project. 462 * </pre> 463 */ listConversations( com.google.cloud.dialogflow.v2.ListConversationsRequest request, io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.ListConversationsResponse> responseObserver)464 default void listConversations( 465 com.google.cloud.dialogflow.v2.ListConversationsRequest request, 466 io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.ListConversationsResponse> 467 responseObserver) { 468 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 469 getListConversationsMethod(), responseObserver); 470 } 471 472 /** 473 * 474 * 475 * <pre> 476 * Retrieves the specific conversation. 477 * </pre> 478 */ getConversation( com.google.cloud.dialogflow.v2.GetConversationRequest request, io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Conversation> responseObserver)479 default void getConversation( 480 com.google.cloud.dialogflow.v2.GetConversationRequest request, 481 io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Conversation> responseObserver) { 482 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 483 getGetConversationMethod(), responseObserver); 484 } 485 486 /** 487 * 488 * 489 * <pre> 490 * Completes the specified conversation. Finished conversations are purged 491 * from the database after 30 days. 492 * </pre> 493 */ completeConversation( com.google.cloud.dialogflow.v2.CompleteConversationRequest request, io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Conversation> responseObserver)494 default void completeConversation( 495 com.google.cloud.dialogflow.v2.CompleteConversationRequest request, 496 io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Conversation> responseObserver) { 497 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 498 getCompleteConversationMethod(), responseObserver); 499 } 500 501 /** 502 * 503 * 504 * <pre> 505 * Lists messages that belong to a given conversation. 506 * `messages` are ordered by `create_time` in descending order. To fetch 507 * updates without duplication, send request with filter 508 * `create_time_epoch_microseconds > 509 * [first item's create_time of previous request]` and empty page_token. 510 * </pre> 511 */ listMessages( com.google.cloud.dialogflow.v2.ListMessagesRequest request, io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.ListMessagesResponse> responseObserver)512 default void listMessages( 513 com.google.cloud.dialogflow.v2.ListMessagesRequest request, 514 io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.ListMessagesResponse> 515 responseObserver) { 516 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 517 getListMessagesMethod(), responseObserver); 518 } 519 520 /** 521 * 522 * 523 * <pre> 524 * Suggests summary for a conversation based on specific historical messages. 525 * The range of the messages to be used for summary can be specified in the 526 * request. 527 * </pre> 528 */ suggestConversationSummary( com.google.cloud.dialogflow.v2.SuggestConversationSummaryRequest request, io.grpc.stub.StreamObserver< com.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse> responseObserver)529 default void suggestConversationSummary( 530 com.google.cloud.dialogflow.v2.SuggestConversationSummaryRequest request, 531 io.grpc.stub.StreamObserver< 532 com.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse> 533 responseObserver) { 534 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 535 getSuggestConversationSummaryMethod(), responseObserver); 536 } 537 538 /** 539 * 540 * 541 * <pre> 542 * Generates and returns a summary for a conversation that does not have a 543 * resource created for it. 544 * </pre> 545 */ generateStatelessSummary( com.google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest request, io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse> responseObserver)546 default void generateStatelessSummary( 547 com.google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest request, 548 io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse> 549 responseObserver) { 550 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 551 getGenerateStatelessSummaryMethod(), responseObserver); 552 } 553 } 554 555 /** 556 * Base class for the server implementation of the service Conversations. 557 * 558 * <pre> 559 * Service for managing 560 * [Conversations][google.cloud.dialogflow.v2.Conversation]. 561 * </pre> 562 */ 563 public abstract static class ConversationsImplBase 564 implements io.grpc.BindableService, AsyncService { 565 566 @java.lang.Override bindService()567 public final io.grpc.ServerServiceDefinition bindService() { 568 return ConversationsGrpc.bindService(this); 569 } 570 } 571 572 /** 573 * A stub to allow clients to do asynchronous rpc calls to service Conversations. 574 * 575 * <pre> 576 * Service for managing 577 * [Conversations][google.cloud.dialogflow.v2.Conversation]. 578 * </pre> 579 */ 580 public static final class ConversationsStub 581 extends io.grpc.stub.AbstractAsyncStub<ConversationsStub> { ConversationsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)582 private ConversationsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 583 super(channel, callOptions); 584 } 585 586 @java.lang.Override build(io.grpc.Channel channel, io.grpc.CallOptions callOptions)587 protected ConversationsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 588 return new ConversationsStub(channel, callOptions); 589 } 590 591 /** 592 * 593 * 594 * <pre> 595 * Creates a new conversation. Conversations are auto-completed after 24 596 * hours. 597 * Conversation Lifecycle: 598 * There are two stages during a conversation: Automated Agent Stage and 599 * Assist Stage. 600 * For Automated Agent Stage, there will be a dialogflow agent responding to 601 * user queries. 602 * For Assist Stage, there's no dialogflow agent responding to user queries. 603 * But we will provide suggestions which are generated from conversation. 604 * If 605 * [Conversation.conversation_profile][google.cloud.dialogflow.v2.Conversation.conversation_profile] 606 * is configured for a dialogflow agent, conversation will start from 607 * `Automated Agent Stage`, otherwise, it will start from `Assist Stage`. And 608 * during `Automated Agent Stage`, once an 609 * [Intent][google.cloud.dialogflow.v2.Intent] with 610 * [Intent.live_agent_handoff][google.cloud.dialogflow.v2.Intent.live_agent_handoff] 611 * is triggered, conversation will transfer to Assist Stage. 612 * </pre> 613 */ createConversation( com.google.cloud.dialogflow.v2.CreateConversationRequest request, io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Conversation> responseObserver)614 public void createConversation( 615 com.google.cloud.dialogflow.v2.CreateConversationRequest request, 616 io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Conversation> responseObserver) { 617 io.grpc.stub.ClientCalls.asyncUnaryCall( 618 getChannel().newCall(getCreateConversationMethod(), getCallOptions()), 619 request, 620 responseObserver); 621 } 622 623 /** 624 * 625 * 626 * <pre> 627 * Returns the list of all conversations in the specified project. 628 * </pre> 629 */ listConversations( com.google.cloud.dialogflow.v2.ListConversationsRequest request, io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.ListConversationsResponse> responseObserver)630 public void listConversations( 631 com.google.cloud.dialogflow.v2.ListConversationsRequest request, 632 io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.ListConversationsResponse> 633 responseObserver) { 634 io.grpc.stub.ClientCalls.asyncUnaryCall( 635 getChannel().newCall(getListConversationsMethod(), getCallOptions()), 636 request, 637 responseObserver); 638 } 639 640 /** 641 * 642 * 643 * <pre> 644 * Retrieves the specific conversation. 645 * </pre> 646 */ getConversation( com.google.cloud.dialogflow.v2.GetConversationRequest request, io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Conversation> responseObserver)647 public void getConversation( 648 com.google.cloud.dialogflow.v2.GetConversationRequest request, 649 io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Conversation> responseObserver) { 650 io.grpc.stub.ClientCalls.asyncUnaryCall( 651 getChannel().newCall(getGetConversationMethod(), getCallOptions()), 652 request, 653 responseObserver); 654 } 655 656 /** 657 * 658 * 659 * <pre> 660 * Completes the specified conversation. Finished conversations are purged 661 * from the database after 30 days. 662 * </pre> 663 */ completeConversation( com.google.cloud.dialogflow.v2.CompleteConversationRequest request, io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Conversation> responseObserver)664 public void completeConversation( 665 com.google.cloud.dialogflow.v2.CompleteConversationRequest request, 666 io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Conversation> responseObserver) { 667 io.grpc.stub.ClientCalls.asyncUnaryCall( 668 getChannel().newCall(getCompleteConversationMethod(), getCallOptions()), 669 request, 670 responseObserver); 671 } 672 673 /** 674 * 675 * 676 * <pre> 677 * Lists messages that belong to a given conversation. 678 * `messages` are ordered by `create_time` in descending order. To fetch 679 * updates without duplication, send request with filter 680 * `create_time_epoch_microseconds > 681 * [first item's create_time of previous request]` and empty page_token. 682 * </pre> 683 */ listMessages( com.google.cloud.dialogflow.v2.ListMessagesRequest request, io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.ListMessagesResponse> responseObserver)684 public void listMessages( 685 com.google.cloud.dialogflow.v2.ListMessagesRequest request, 686 io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.ListMessagesResponse> 687 responseObserver) { 688 io.grpc.stub.ClientCalls.asyncUnaryCall( 689 getChannel().newCall(getListMessagesMethod(), getCallOptions()), 690 request, 691 responseObserver); 692 } 693 694 /** 695 * 696 * 697 * <pre> 698 * Suggests summary for a conversation based on specific historical messages. 699 * The range of the messages to be used for summary can be specified in the 700 * request. 701 * </pre> 702 */ suggestConversationSummary( com.google.cloud.dialogflow.v2.SuggestConversationSummaryRequest request, io.grpc.stub.StreamObserver< com.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse> responseObserver)703 public void suggestConversationSummary( 704 com.google.cloud.dialogflow.v2.SuggestConversationSummaryRequest request, 705 io.grpc.stub.StreamObserver< 706 com.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse> 707 responseObserver) { 708 io.grpc.stub.ClientCalls.asyncUnaryCall( 709 getChannel().newCall(getSuggestConversationSummaryMethod(), getCallOptions()), 710 request, 711 responseObserver); 712 } 713 714 /** 715 * 716 * 717 * <pre> 718 * Generates and returns a summary for a conversation that does not have a 719 * resource created for it. 720 * </pre> 721 */ generateStatelessSummary( com.google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest request, io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse> responseObserver)722 public void generateStatelessSummary( 723 com.google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest request, 724 io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse> 725 responseObserver) { 726 io.grpc.stub.ClientCalls.asyncUnaryCall( 727 getChannel().newCall(getGenerateStatelessSummaryMethod(), getCallOptions()), 728 request, 729 responseObserver); 730 } 731 } 732 733 /** 734 * A stub to allow clients to do synchronous rpc calls to service Conversations. 735 * 736 * <pre> 737 * Service for managing 738 * [Conversations][google.cloud.dialogflow.v2.Conversation]. 739 * </pre> 740 */ 741 public static final class ConversationsBlockingStub 742 extends io.grpc.stub.AbstractBlockingStub<ConversationsBlockingStub> { ConversationsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)743 private ConversationsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 744 super(channel, callOptions); 745 } 746 747 @java.lang.Override build( io.grpc.Channel channel, io.grpc.CallOptions callOptions)748 protected ConversationsBlockingStub build( 749 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 750 return new ConversationsBlockingStub(channel, callOptions); 751 } 752 753 /** 754 * 755 * 756 * <pre> 757 * Creates a new conversation. Conversations are auto-completed after 24 758 * hours. 759 * Conversation Lifecycle: 760 * There are two stages during a conversation: Automated Agent Stage and 761 * Assist Stage. 762 * For Automated Agent Stage, there will be a dialogflow agent responding to 763 * user queries. 764 * For Assist Stage, there's no dialogflow agent responding to user queries. 765 * But we will provide suggestions which are generated from conversation. 766 * If 767 * [Conversation.conversation_profile][google.cloud.dialogflow.v2.Conversation.conversation_profile] 768 * is configured for a dialogflow agent, conversation will start from 769 * `Automated Agent Stage`, otherwise, it will start from `Assist Stage`. And 770 * during `Automated Agent Stage`, once an 771 * [Intent][google.cloud.dialogflow.v2.Intent] with 772 * [Intent.live_agent_handoff][google.cloud.dialogflow.v2.Intent.live_agent_handoff] 773 * is triggered, conversation will transfer to Assist Stage. 774 * </pre> 775 */ createConversation( com.google.cloud.dialogflow.v2.CreateConversationRequest request)776 public com.google.cloud.dialogflow.v2.Conversation createConversation( 777 com.google.cloud.dialogflow.v2.CreateConversationRequest request) { 778 return io.grpc.stub.ClientCalls.blockingUnaryCall( 779 getChannel(), getCreateConversationMethod(), getCallOptions(), request); 780 } 781 782 /** 783 * 784 * 785 * <pre> 786 * Returns the list of all conversations in the specified project. 787 * </pre> 788 */ listConversations( com.google.cloud.dialogflow.v2.ListConversationsRequest request)789 public com.google.cloud.dialogflow.v2.ListConversationsResponse listConversations( 790 com.google.cloud.dialogflow.v2.ListConversationsRequest request) { 791 return io.grpc.stub.ClientCalls.blockingUnaryCall( 792 getChannel(), getListConversationsMethod(), getCallOptions(), request); 793 } 794 795 /** 796 * 797 * 798 * <pre> 799 * Retrieves the specific conversation. 800 * </pre> 801 */ getConversation( com.google.cloud.dialogflow.v2.GetConversationRequest request)802 public com.google.cloud.dialogflow.v2.Conversation getConversation( 803 com.google.cloud.dialogflow.v2.GetConversationRequest request) { 804 return io.grpc.stub.ClientCalls.blockingUnaryCall( 805 getChannel(), getGetConversationMethod(), getCallOptions(), request); 806 } 807 808 /** 809 * 810 * 811 * <pre> 812 * Completes the specified conversation. Finished conversations are purged 813 * from the database after 30 days. 814 * </pre> 815 */ completeConversation( com.google.cloud.dialogflow.v2.CompleteConversationRequest request)816 public com.google.cloud.dialogflow.v2.Conversation completeConversation( 817 com.google.cloud.dialogflow.v2.CompleteConversationRequest request) { 818 return io.grpc.stub.ClientCalls.blockingUnaryCall( 819 getChannel(), getCompleteConversationMethod(), getCallOptions(), request); 820 } 821 822 /** 823 * 824 * 825 * <pre> 826 * Lists messages that belong to a given conversation. 827 * `messages` are ordered by `create_time` in descending order. To fetch 828 * updates without duplication, send request with filter 829 * `create_time_epoch_microseconds > 830 * [first item's create_time of previous request]` and empty page_token. 831 * </pre> 832 */ listMessages( com.google.cloud.dialogflow.v2.ListMessagesRequest request)833 public com.google.cloud.dialogflow.v2.ListMessagesResponse listMessages( 834 com.google.cloud.dialogflow.v2.ListMessagesRequest request) { 835 return io.grpc.stub.ClientCalls.blockingUnaryCall( 836 getChannel(), getListMessagesMethod(), getCallOptions(), request); 837 } 838 839 /** 840 * 841 * 842 * <pre> 843 * Suggests summary for a conversation based on specific historical messages. 844 * The range of the messages to be used for summary can be specified in the 845 * request. 846 * </pre> 847 */ 848 public com.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse suggestConversationSummary( com.google.cloud.dialogflow.v2.SuggestConversationSummaryRequest request)849 suggestConversationSummary( 850 com.google.cloud.dialogflow.v2.SuggestConversationSummaryRequest request) { 851 return io.grpc.stub.ClientCalls.blockingUnaryCall( 852 getChannel(), getSuggestConversationSummaryMethod(), getCallOptions(), request); 853 } 854 855 /** 856 * 857 * 858 * <pre> 859 * Generates and returns a summary for a conversation that does not have a 860 * resource created for it. 861 * </pre> 862 */ generateStatelessSummary( com.google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest request)863 public com.google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse generateStatelessSummary( 864 com.google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest request) { 865 return io.grpc.stub.ClientCalls.blockingUnaryCall( 866 getChannel(), getGenerateStatelessSummaryMethod(), getCallOptions(), request); 867 } 868 } 869 870 /** 871 * A stub to allow clients to do ListenableFuture-style rpc calls to service Conversations. 872 * 873 * <pre> 874 * Service for managing 875 * [Conversations][google.cloud.dialogflow.v2.Conversation]. 876 * </pre> 877 */ 878 public static final class ConversationsFutureStub 879 extends io.grpc.stub.AbstractFutureStub<ConversationsFutureStub> { ConversationsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)880 private ConversationsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 881 super(channel, callOptions); 882 } 883 884 @java.lang.Override build( io.grpc.Channel channel, io.grpc.CallOptions callOptions)885 protected ConversationsFutureStub build( 886 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 887 return new ConversationsFutureStub(channel, callOptions); 888 } 889 890 /** 891 * 892 * 893 * <pre> 894 * Creates a new conversation. Conversations are auto-completed after 24 895 * hours. 896 * Conversation Lifecycle: 897 * There are two stages during a conversation: Automated Agent Stage and 898 * Assist Stage. 899 * For Automated Agent Stage, there will be a dialogflow agent responding to 900 * user queries. 901 * For Assist Stage, there's no dialogflow agent responding to user queries. 902 * But we will provide suggestions which are generated from conversation. 903 * If 904 * [Conversation.conversation_profile][google.cloud.dialogflow.v2.Conversation.conversation_profile] 905 * is configured for a dialogflow agent, conversation will start from 906 * `Automated Agent Stage`, otherwise, it will start from `Assist Stage`. And 907 * during `Automated Agent Stage`, once an 908 * [Intent][google.cloud.dialogflow.v2.Intent] with 909 * [Intent.live_agent_handoff][google.cloud.dialogflow.v2.Intent.live_agent_handoff] 910 * is triggered, conversation will transfer to Assist Stage. 911 * </pre> 912 */ 913 public com.google.common.util.concurrent.ListenableFuture< 914 com.google.cloud.dialogflow.v2.Conversation> createConversation(com.google.cloud.dialogflow.v2.CreateConversationRequest request)915 createConversation(com.google.cloud.dialogflow.v2.CreateConversationRequest request) { 916 return io.grpc.stub.ClientCalls.futureUnaryCall( 917 getChannel().newCall(getCreateConversationMethod(), getCallOptions()), request); 918 } 919 920 /** 921 * 922 * 923 * <pre> 924 * Returns the list of all conversations in the specified project. 925 * </pre> 926 */ 927 public com.google.common.util.concurrent.ListenableFuture< 928 com.google.cloud.dialogflow.v2.ListConversationsResponse> listConversations(com.google.cloud.dialogflow.v2.ListConversationsRequest request)929 listConversations(com.google.cloud.dialogflow.v2.ListConversationsRequest request) { 930 return io.grpc.stub.ClientCalls.futureUnaryCall( 931 getChannel().newCall(getListConversationsMethod(), getCallOptions()), request); 932 } 933 934 /** 935 * 936 * 937 * <pre> 938 * Retrieves the specific conversation. 939 * </pre> 940 */ 941 public com.google.common.util.concurrent.ListenableFuture< 942 com.google.cloud.dialogflow.v2.Conversation> getConversation(com.google.cloud.dialogflow.v2.GetConversationRequest request)943 getConversation(com.google.cloud.dialogflow.v2.GetConversationRequest request) { 944 return io.grpc.stub.ClientCalls.futureUnaryCall( 945 getChannel().newCall(getGetConversationMethod(), getCallOptions()), request); 946 } 947 948 /** 949 * 950 * 951 * <pre> 952 * Completes the specified conversation. Finished conversations are purged 953 * from the database after 30 days. 954 * </pre> 955 */ 956 public com.google.common.util.concurrent.ListenableFuture< 957 com.google.cloud.dialogflow.v2.Conversation> completeConversation(com.google.cloud.dialogflow.v2.CompleteConversationRequest request)958 completeConversation(com.google.cloud.dialogflow.v2.CompleteConversationRequest request) { 959 return io.grpc.stub.ClientCalls.futureUnaryCall( 960 getChannel().newCall(getCompleteConversationMethod(), getCallOptions()), request); 961 } 962 963 /** 964 * 965 * 966 * <pre> 967 * Lists messages that belong to a given conversation. 968 * `messages` are ordered by `create_time` in descending order. To fetch 969 * updates without duplication, send request with filter 970 * `create_time_epoch_microseconds > 971 * [first item's create_time of previous request]` and empty page_token. 972 * </pre> 973 */ 974 public com.google.common.util.concurrent.ListenableFuture< 975 com.google.cloud.dialogflow.v2.ListMessagesResponse> listMessages(com.google.cloud.dialogflow.v2.ListMessagesRequest request)976 listMessages(com.google.cloud.dialogflow.v2.ListMessagesRequest request) { 977 return io.grpc.stub.ClientCalls.futureUnaryCall( 978 getChannel().newCall(getListMessagesMethod(), getCallOptions()), request); 979 } 980 981 /** 982 * 983 * 984 * <pre> 985 * Suggests summary for a conversation based on specific historical messages. 986 * The range of the messages to be used for summary can be specified in the 987 * request. 988 * </pre> 989 */ 990 public com.google.common.util.concurrent.ListenableFuture< 991 com.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse> suggestConversationSummary( com.google.cloud.dialogflow.v2.SuggestConversationSummaryRequest request)992 suggestConversationSummary( 993 com.google.cloud.dialogflow.v2.SuggestConversationSummaryRequest request) { 994 return io.grpc.stub.ClientCalls.futureUnaryCall( 995 getChannel().newCall(getSuggestConversationSummaryMethod(), getCallOptions()), request); 996 } 997 998 /** 999 * 1000 * 1001 * <pre> 1002 * Generates and returns a summary for a conversation that does not have a 1003 * resource created for it. 1004 * </pre> 1005 */ 1006 public com.google.common.util.concurrent.ListenableFuture< 1007 com.google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse> generateStatelessSummary( com.google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest request)1008 generateStatelessSummary( 1009 com.google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest request) { 1010 return io.grpc.stub.ClientCalls.futureUnaryCall( 1011 getChannel().newCall(getGenerateStatelessSummaryMethod(), getCallOptions()), request); 1012 } 1013 } 1014 1015 private static final int METHODID_CREATE_CONVERSATION = 0; 1016 private static final int METHODID_LIST_CONVERSATIONS = 1; 1017 private static final int METHODID_GET_CONVERSATION = 2; 1018 private static final int METHODID_COMPLETE_CONVERSATION = 3; 1019 private static final int METHODID_LIST_MESSAGES = 4; 1020 private static final int METHODID_SUGGEST_CONVERSATION_SUMMARY = 5; 1021 private static final int METHODID_GENERATE_STATELESS_SUMMARY = 6; 1022 1023 private static final class MethodHandlers<Req, Resp> 1024 implements io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, 1025 io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, 1026 io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, 1027 io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { 1028 private final AsyncService serviceImpl; 1029 private final int methodId; 1030 MethodHandlers(AsyncService serviceImpl, int methodId)1031 MethodHandlers(AsyncService serviceImpl, int methodId) { 1032 this.serviceImpl = serviceImpl; 1033 this.methodId = methodId; 1034 } 1035 1036 @java.lang.Override 1037 @java.lang.SuppressWarnings("unchecked") invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver)1038 public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) { 1039 switch (methodId) { 1040 case METHODID_CREATE_CONVERSATION: 1041 serviceImpl.createConversation( 1042 (com.google.cloud.dialogflow.v2.CreateConversationRequest) request, 1043 (io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Conversation>) 1044 responseObserver); 1045 break; 1046 case METHODID_LIST_CONVERSATIONS: 1047 serviceImpl.listConversations( 1048 (com.google.cloud.dialogflow.v2.ListConversationsRequest) request, 1049 (io.grpc.stub.StreamObserver< 1050 com.google.cloud.dialogflow.v2.ListConversationsResponse>) 1051 responseObserver); 1052 break; 1053 case METHODID_GET_CONVERSATION: 1054 serviceImpl.getConversation( 1055 (com.google.cloud.dialogflow.v2.GetConversationRequest) request, 1056 (io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Conversation>) 1057 responseObserver); 1058 break; 1059 case METHODID_COMPLETE_CONVERSATION: 1060 serviceImpl.completeConversation( 1061 (com.google.cloud.dialogflow.v2.CompleteConversationRequest) request, 1062 (io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Conversation>) 1063 responseObserver); 1064 break; 1065 case METHODID_LIST_MESSAGES: 1066 serviceImpl.listMessages( 1067 (com.google.cloud.dialogflow.v2.ListMessagesRequest) request, 1068 (io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.ListMessagesResponse>) 1069 responseObserver); 1070 break; 1071 case METHODID_SUGGEST_CONVERSATION_SUMMARY: 1072 serviceImpl.suggestConversationSummary( 1073 (com.google.cloud.dialogflow.v2.SuggestConversationSummaryRequest) request, 1074 (io.grpc.stub.StreamObserver< 1075 com.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse>) 1076 responseObserver); 1077 break; 1078 case METHODID_GENERATE_STATELESS_SUMMARY: 1079 serviceImpl.generateStatelessSummary( 1080 (com.google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest) request, 1081 (io.grpc.stub.StreamObserver< 1082 com.google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse>) 1083 responseObserver); 1084 break; 1085 default: 1086 throw new AssertionError(); 1087 } 1088 } 1089 1090 @java.lang.Override 1091 @java.lang.SuppressWarnings("unchecked") invoke( io.grpc.stub.StreamObserver<Resp> responseObserver)1092 public io.grpc.stub.StreamObserver<Req> invoke( 1093 io.grpc.stub.StreamObserver<Resp> responseObserver) { 1094 switch (methodId) { 1095 default: 1096 throw new AssertionError(); 1097 } 1098 } 1099 } 1100 bindService(AsyncService service)1101 public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { 1102 return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) 1103 .addMethod( 1104 getCreateConversationMethod(), 1105 io.grpc.stub.ServerCalls.asyncUnaryCall( 1106 new MethodHandlers< 1107 com.google.cloud.dialogflow.v2.CreateConversationRequest, 1108 com.google.cloud.dialogflow.v2.Conversation>( 1109 service, METHODID_CREATE_CONVERSATION))) 1110 .addMethod( 1111 getListConversationsMethod(), 1112 io.grpc.stub.ServerCalls.asyncUnaryCall( 1113 new MethodHandlers< 1114 com.google.cloud.dialogflow.v2.ListConversationsRequest, 1115 com.google.cloud.dialogflow.v2.ListConversationsResponse>( 1116 service, METHODID_LIST_CONVERSATIONS))) 1117 .addMethod( 1118 getGetConversationMethod(), 1119 io.grpc.stub.ServerCalls.asyncUnaryCall( 1120 new MethodHandlers< 1121 com.google.cloud.dialogflow.v2.GetConversationRequest, 1122 com.google.cloud.dialogflow.v2.Conversation>( 1123 service, METHODID_GET_CONVERSATION))) 1124 .addMethod( 1125 getCompleteConversationMethod(), 1126 io.grpc.stub.ServerCalls.asyncUnaryCall( 1127 new MethodHandlers< 1128 com.google.cloud.dialogflow.v2.CompleteConversationRequest, 1129 com.google.cloud.dialogflow.v2.Conversation>( 1130 service, METHODID_COMPLETE_CONVERSATION))) 1131 .addMethod( 1132 getListMessagesMethod(), 1133 io.grpc.stub.ServerCalls.asyncUnaryCall( 1134 new MethodHandlers< 1135 com.google.cloud.dialogflow.v2.ListMessagesRequest, 1136 com.google.cloud.dialogflow.v2.ListMessagesResponse>( 1137 service, METHODID_LIST_MESSAGES))) 1138 .addMethod( 1139 getSuggestConversationSummaryMethod(), 1140 io.grpc.stub.ServerCalls.asyncUnaryCall( 1141 new MethodHandlers< 1142 com.google.cloud.dialogflow.v2.SuggestConversationSummaryRequest, 1143 com.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse>( 1144 service, METHODID_SUGGEST_CONVERSATION_SUMMARY))) 1145 .addMethod( 1146 getGenerateStatelessSummaryMethod(), 1147 io.grpc.stub.ServerCalls.asyncUnaryCall( 1148 new MethodHandlers< 1149 com.google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest, 1150 com.google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse>( 1151 service, METHODID_GENERATE_STATELESS_SUMMARY))) 1152 .build(); 1153 } 1154 1155 private abstract static class ConversationsBaseDescriptorSupplier 1156 implements io.grpc.protobuf.ProtoFileDescriptorSupplier, 1157 io.grpc.protobuf.ProtoServiceDescriptorSupplier { ConversationsBaseDescriptorSupplier()1158 ConversationsBaseDescriptorSupplier() {} 1159 1160 @java.lang.Override getFileDescriptor()1161 public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { 1162 return com.google.cloud.dialogflow.v2.ConversationProto.getDescriptor(); 1163 } 1164 1165 @java.lang.Override getServiceDescriptor()1166 public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { 1167 return getFileDescriptor().findServiceByName("Conversations"); 1168 } 1169 } 1170 1171 private static final class ConversationsFileDescriptorSupplier 1172 extends ConversationsBaseDescriptorSupplier { ConversationsFileDescriptorSupplier()1173 ConversationsFileDescriptorSupplier() {} 1174 } 1175 1176 private static final class ConversationsMethodDescriptorSupplier 1177 extends ConversationsBaseDescriptorSupplier 1178 implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { 1179 private final String methodName; 1180 ConversationsMethodDescriptorSupplier(String methodName)1181 ConversationsMethodDescriptorSupplier(String methodName) { 1182 this.methodName = methodName; 1183 } 1184 1185 @java.lang.Override getMethodDescriptor()1186 public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { 1187 return getServiceDescriptor().findMethodByName(methodName); 1188 } 1189 } 1190 1191 private static volatile io.grpc.ServiceDescriptor serviceDescriptor; 1192 getServiceDescriptor()1193 public static io.grpc.ServiceDescriptor getServiceDescriptor() { 1194 io.grpc.ServiceDescriptor result = serviceDescriptor; 1195 if (result == null) { 1196 synchronized (ConversationsGrpc.class) { 1197 result = serviceDescriptor; 1198 if (result == null) { 1199 serviceDescriptor = 1200 result = 1201 io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) 1202 .setSchemaDescriptor(new ConversationsFileDescriptorSupplier()) 1203 .addMethod(getCreateConversationMethod()) 1204 .addMethod(getListConversationsMethod()) 1205 .addMethod(getGetConversationMethod()) 1206 .addMethod(getCompleteConversationMethod()) 1207 .addMethod(getListMessagesMethod()) 1208 .addMethod(getSuggestConversationSummaryMethod()) 1209 .addMethod(getGenerateStatelessSummaryMethod()) 1210 .build(); 1211 } 1212 } 1213 } 1214 return result; 1215 } 1216 } 1217