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 knowledge 25 * [Documents][google.cloud.dialogflow.v2.Document]. 26 * </pre> 27 */ 28 @javax.annotation.Generated( 29 value = "by gRPC proto compiler", 30 comments = "Source: google/cloud/dialogflow/v2/document.proto") 31 @io.grpc.stub.annotations.GrpcGenerated 32 public final class DocumentsGrpc { 33 DocumentsGrpc()34 private DocumentsGrpc() {} 35 36 public static final String SERVICE_NAME = "google.cloud.dialogflow.v2.Documents"; 37 38 // Static method descriptors that strictly reflect the proto. 39 private static volatile io.grpc.MethodDescriptor< 40 com.google.cloud.dialogflow.v2.ListDocumentsRequest, 41 com.google.cloud.dialogflow.v2.ListDocumentsResponse> 42 getListDocumentsMethod; 43 44 @io.grpc.stub.annotations.RpcMethod( 45 fullMethodName = SERVICE_NAME + '/' + "ListDocuments", 46 requestType = com.google.cloud.dialogflow.v2.ListDocumentsRequest.class, 47 responseType = com.google.cloud.dialogflow.v2.ListDocumentsResponse.class, 48 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 49 public static io.grpc.MethodDescriptor< 50 com.google.cloud.dialogflow.v2.ListDocumentsRequest, 51 com.google.cloud.dialogflow.v2.ListDocumentsResponse> getListDocumentsMethod()52 getListDocumentsMethod() { 53 io.grpc.MethodDescriptor< 54 com.google.cloud.dialogflow.v2.ListDocumentsRequest, 55 com.google.cloud.dialogflow.v2.ListDocumentsResponse> 56 getListDocumentsMethod; 57 if ((getListDocumentsMethod = DocumentsGrpc.getListDocumentsMethod) == null) { 58 synchronized (DocumentsGrpc.class) { 59 if ((getListDocumentsMethod = DocumentsGrpc.getListDocumentsMethod) == null) { 60 DocumentsGrpc.getListDocumentsMethod = 61 getListDocumentsMethod = 62 io.grpc.MethodDescriptor 63 .<com.google.cloud.dialogflow.v2.ListDocumentsRequest, 64 com.google.cloud.dialogflow.v2.ListDocumentsResponse> 65 newBuilder() 66 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 67 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListDocuments")) 68 .setSampledToLocalTracing(true) 69 .setRequestMarshaller( 70 io.grpc.protobuf.ProtoUtils.marshaller( 71 com.google.cloud.dialogflow.v2.ListDocumentsRequest 72 .getDefaultInstance())) 73 .setResponseMarshaller( 74 io.grpc.protobuf.ProtoUtils.marshaller( 75 com.google.cloud.dialogflow.v2.ListDocumentsResponse 76 .getDefaultInstance())) 77 .setSchemaDescriptor(new DocumentsMethodDescriptorSupplier("ListDocuments")) 78 .build(); 79 } 80 } 81 } 82 return getListDocumentsMethod; 83 } 84 85 private static volatile io.grpc.MethodDescriptor< 86 com.google.cloud.dialogflow.v2.GetDocumentRequest, 87 com.google.cloud.dialogflow.v2.Document> 88 getGetDocumentMethod; 89 90 @io.grpc.stub.annotations.RpcMethod( 91 fullMethodName = SERVICE_NAME + '/' + "GetDocument", 92 requestType = com.google.cloud.dialogflow.v2.GetDocumentRequest.class, 93 responseType = com.google.cloud.dialogflow.v2.Document.class, 94 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 95 public static io.grpc.MethodDescriptor< 96 com.google.cloud.dialogflow.v2.GetDocumentRequest, 97 com.google.cloud.dialogflow.v2.Document> getGetDocumentMethod()98 getGetDocumentMethod() { 99 io.grpc.MethodDescriptor< 100 com.google.cloud.dialogflow.v2.GetDocumentRequest, 101 com.google.cloud.dialogflow.v2.Document> 102 getGetDocumentMethod; 103 if ((getGetDocumentMethod = DocumentsGrpc.getGetDocumentMethod) == null) { 104 synchronized (DocumentsGrpc.class) { 105 if ((getGetDocumentMethod = DocumentsGrpc.getGetDocumentMethod) == null) { 106 DocumentsGrpc.getGetDocumentMethod = 107 getGetDocumentMethod = 108 io.grpc.MethodDescriptor 109 .<com.google.cloud.dialogflow.v2.GetDocumentRequest, 110 com.google.cloud.dialogflow.v2.Document> 111 newBuilder() 112 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 113 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetDocument")) 114 .setSampledToLocalTracing(true) 115 .setRequestMarshaller( 116 io.grpc.protobuf.ProtoUtils.marshaller( 117 com.google.cloud.dialogflow.v2.GetDocumentRequest 118 .getDefaultInstance())) 119 .setResponseMarshaller( 120 io.grpc.protobuf.ProtoUtils.marshaller( 121 com.google.cloud.dialogflow.v2.Document.getDefaultInstance())) 122 .setSchemaDescriptor(new DocumentsMethodDescriptorSupplier("GetDocument")) 123 .build(); 124 } 125 } 126 } 127 return getGetDocumentMethod; 128 } 129 130 private static volatile io.grpc.MethodDescriptor< 131 com.google.cloud.dialogflow.v2.CreateDocumentRequest, com.google.longrunning.Operation> 132 getCreateDocumentMethod; 133 134 @io.grpc.stub.annotations.RpcMethod( 135 fullMethodName = SERVICE_NAME + '/' + "CreateDocument", 136 requestType = com.google.cloud.dialogflow.v2.CreateDocumentRequest.class, 137 responseType = com.google.longrunning.Operation.class, 138 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 139 public static io.grpc.MethodDescriptor< 140 com.google.cloud.dialogflow.v2.CreateDocumentRequest, com.google.longrunning.Operation> getCreateDocumentMethod()141 getCreateDocumentMethod() { 142 io.grpc.MethodDescriptor< 143 com.google.cloud.dialogflow.v2.CreateDocumentRequest, com.google.longrunning.Operation> 144 getCreateDocumentMethod; 145 if ((getCreateDocumentMethod = DocumentsGrpc.getCreateDocumentMethod) == null) { 146 synchronized (DocumentsGrpc.class) { 147 if ((getCreateDocumentMethod = DocumentsGrpc.getCreateDocumentMethod) == null) { 148 DocumentsGrpc.getCreateDocumentMethod = 149 getCreateDocumentMethod = 150 io.grpc.MethodDescriptor 151 .<com.google.cloud.dialogflow.v2.CreateDocumentRequest, 152 com.google.longrunning.Operation> 153 newBuilder() 154 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 155 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateDocument")) 156 .setSampledToLocalTracing(true) 157 .setRequestMarshaller( 158 io.grpc.protobuf.ProtoUtils.marshaller( 159 com.google.cloud.dialogflow.v2.CreateDocumentRequest 160 .getDefaultInstance())) 161 .setResponseMarshaller( 162 io.grpc.protobuf.ProtoUtils.marshaller( 163 com.google.longrunning.Operation.getDefaultInstance())) 164 .setSchemaDescriptor(new DocumentsMethodDescriptorSupplier("CreateDocument")) 165 .build(); 166 } 167 } 168 } 169 return getCreateDocumentMethod; 170 } 171 172 private static volatile io.grpc.MethodDescriptor< 173 com.google.cloud.dialogflow.v2.ImportDocumentsRequest, com.google.longrunning.Operation> 174 getImportDocumentsMethod; 175 176 @io.grpc.stub.annotations.RpcMethod( 177 fullMethodName = SERVICE_NAME + '/' + "ImportDocuments", 178 requestType = com.google.cloud.dialogflow.v2.ImportDocumentsRequest.class, 179 responseType = com.google.longrunning.Operation.class, 180 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 181 public static io.grpc.MethodDescriptor< 182 com.google.cloud.dialogflow.v2.ImportDocumentsRequest, com.google.longrunning.Operation> getImportDocumentsMethod()183 getImportDocumentsMethod() { 184 io.grpc.MethodDescriptor< 185 com.google.cloud.dialogflow.v2.ImportDocumentsRequest, com.google.longrunning.Operation> 186 getImportDocumentsMethod; 187 if ((getImportDocumentsMethod = DocumentsGrpc.getImportDocumentsMethod) == null) { 188 synchronized (DocumentsGrpc.class) { 189 if ((getImportDocumentsMethod = DocumentsGrpc.getImportDocumentsMethod) == null) { 190 DocumentsGrpc.getImportDocumentsMethod = 191 getImportDocumentsMethod = 192 io.grpc.MethodDescriptor 193 .<com.google.cloud.dialogflow.v2.ImportDocumentsRequest, 194 com.google.longrunning.Operation> 195 newBuilder() 196 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 197 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ImportDocuments")) 198 .setSampledToLocalTracing(true) 199 .setRequestMarshaller( 200 io.grpc.protobuf.ProtoUtils.marshaller( 201 com.google.cloud.dialogflow.v2.ImportDocumentsRequest 202 .getDefaultInstance())) 203 .setResponseMarshaller( 204 io.grpc.protobuf.ProtoUtils.marshaller( 205 com.google.longrunning.Operation.getDefaultInstance())) 206 .setSchemaDescriptor(new DocumentsMethodDescriptorSupplier("ImportDocuments")) 207 .build(); 208 } 209 } 210 } 211 return getImportDocumentsMethod; 212 } 213 214 private static volatile io.grpc.MethodDescriptor< 215 com.google.cloud.dialogflow.v2.DeleteDocumentRequest, com.google.longrunning.Operation> 216 getDeleteDocumentMethod; 217 218 @io.grpc.stub.annotations.RpcMethod( 219 fullMethodName = SERVICE_NAME + '/' + "DeleteDocument", 220 requestType = com.google.cloud.dialogflow.v2.DeleteDocumentRequest.class, 221 responseType = com.google.longrunning.Operation.class, 222 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 223 public static io.grpc.MethodDescriptor< 224 com.google.cloud.dialogflow.v2.DeleteDocumentRequest, com.google.longrunning.Operation> getDeleteDocumentMethod()225 getDeleteDocumentMethod() { 226 io.grpc.MethodDescriptor< 227 com.google.cloud.dialogflow.v2.DeleteDocumentRequest, com.google.longrunning.Operation> 228 getDeleteDocumentMethod; 229 if ((getDeleteDocumentMethod = DocumentsGrpc.getDeleteDocumentMethod) == null) { 230 synchronized (DocumentsGrpc.class) { 231 if ((getDeleteDocumentMethod = DocumentsGrpc.getDeleteDocumentMethod) == null) { 232 DocumentsGrpc.getDeleteDocumentMethod = 233 getDeleteDocumentMethod = 234 io.grpc.MethodDescriptor 235 .<com.google.cloud.dialogflow.v2.DeleteDocumentRequest, 236 com.google.longrunning.Operation> 237 newBuilder() 238 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 239 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteDocument")) 240 .setSampledToLocalTracing(true) 241 .setRequestMarshaller( 242 io.grpc.protobuf.ProtoUtils.marshaller( 243 com.google.cloud.dialogflow.v2.DeleteDocumentRequest 244 .getDefaultInstance())) 245 .setResponseMarshaller( 246 io.grpc.protobuf.ProtoUtils.marshaller( 247 com.google.longrunning.Operation.getDefaultInstance())) 248 .setSchemaDescriptor(new DocumentsMethodDescriptorSupplier("DeleteDocument")) 249 .build(); 250 } 251 } 252 } 253 return getDeleteDocumentMethod; 254 } 255 256 private static volatile io.grpc.MethodDescriptor< 257 com.google.cloud.dialogflow.v2.UpdateDocumentRequest, com.google.longrunning.Operation> 258 getUpdateDocumentMethod; 259 260 @io.grpc.stub.annotations.RpcMethod( 261 fullMethodName = SERVICE_NAME + '/' + "UpdateDocument", 262 requestType = com.google.cloud.dialogflow.v2.UpdateDocumentRequest.class, 263 responseType = com.google.longrunning.Operation.class, 264 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 265 public static io.grpc.MethodDescriptor< 266 com.google.cloud.dialogflow.v2.UpdateDocumentRequest, com.google.longrunning.Operation> getUpdateDocumentMethod()267 getUpdateDocumentMethod() { 268 io.grpc.MethodDescriptor< 269 com.google.cloud.dialogflow.v2.UpdateDocumentRequest, com.google.longrunning.Operation> 270 getUpdateDocumentMethod; 271 if ((getUpdateDocumentMethod = DocumentsGrpc.getUpdateDocumentMethod) == null) { 272 synchronized (DocumentsGrpc.class) { 273 if ((getUpdateDocumentMethod = DocumentsGrpc.getUpdateDocumentMethod) == null) { 274 DocumentsGrpc.getUpdateDocumentMethod = 275 getUpdateDocumentMethod = 276 io.grpc.MethodDescriptor 277 .<com.google.cloud.dialogflow.v2.UpdateDocumentRequest, 278 com.google.longrunning.Operation> 279 newBuilder() 280 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 281 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateDocument")) 282 .setSampledToLocalTracing(true) 283 .setRequestMarshaller( 284 io.grpc.protobuf.ProtoUtils.marshaller( 285 com.google.cloud.dialogflow.v2.UpdateDocumentRequest 286 .getDefaultInstance())) 287 .setResponseMarshaller( 288 io.grpc.protobuf.ProtoUtils.marshaller( 289 com.google.longrunning.Operation.getDefaultInstance())) 290 .setSchemaDescriptor(new DocumentsMethodDescriptorSupplier("UpdateDocument")) 291 .build(); 292 } 293 } 294 } 295 return getUpdateDocumentMethod; 296 } 297 298 private static volatile io.grpc.MethodDescriptor< 299 com.google.cloud.dialogflow.v2.ReloadDocumentRequest, com.google.longrunning.Operation> 300 getReloadDocumentMethod; 301 302 @io.grpc.stub.annotations.RpcMethod( 303 fullMethodName = SERVICE_NAME + '/' + "ReloadDocument", 304 requestType = com.google.cloud.dialogflow.v2.ReloadDocumentRequest.class, 305 responseType = com.google.longrunning.Operation.class, 306 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 307 public static io.grpc.MethodDescriptor< 308 com.google.cloud.dialogflow.v2.ReloadDocumentRequest, com.google.longrunning.Operation> getReloadDocumentMethod()309 getReloadDocumentMethod() { 310 io.grpc.MethodDescriptor< 311 com.google.cloud.dialogflow.v2.ReloadDocumentRequest, com.google.longrunning.Operation> 312 getReloadDocumentMethod; 313 if ((getReloadDocumentMethod = DocumentsGrpc.getReloadDocumentMethod) == null) { 314 synchronized (DocumentsGrpc.class) { 315 if ((getReloadDocumentMethod = DocumentsGrpc.getReloadDocumentMethod) == null) { 316 DocumentsGrpc.getReloadDocumentMethod = 317 getReloadDocumentMethod = 318 io.grpc.MethodDescriptor 319 .<com.google.cloud.dialogflow.v2.ReloadDocumentRequest, 320 com.google.longrunning.Operation> 321 newBuilder() 322 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 323 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ReloadDocument")) 324 .setSampledToLocalTracing(true) 325 .setRequestMarshaller( 326 io.grpc.protobuf.ProtoUtils.marshaller( 327 com.google.cloud.dialogflow.v2.ReloadDocumentRequest 328 .getDefaultInstance())) 329 .setResponseMarshaller( 330 io.grpc.protobuf.ProtoUtils.marshaller( 331 com.google.longrunning.Operation.getDefaultInstance())) 332 .setSchemaDescriptor(new DocumentsMethodDescriptorSupplier("ReloadDocument")) 333 .build(); 334 } 335 } 336 } 337 return getReloadDocumentMethod; 338 } 339 340 private static volatile io.grpc.MethodDescriptor< 341 com.google.cloud.dialogflow.v2.ExportDocumentRequest, com.google.longrunning.Operation> 342 getExportDocumentMethod; 343 344 @io.grpc.stub.annotations.RpcMethod( 345 fullMethodName = SERVICE_NAME + '/' + "ExportDocument", 346 requestType = com.google.cloud.dialogflow.v2.ExportDocumentRequest.class, 347 responseType = com.google.longrunning.Operation.class, 348 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 349 public static io.grpc.MethodDescriptor< 350 com.google.cloud.dialogflow.v2.ExportDocumentRequest, com.google.longrunning.Operation> getExportDocumentMethod()351 getExportDocumentMethod() { 352 io.grpc.MethodDescriptor< 353 com.google.cloud.dialogflow.v2.ExportDocumentRequest, com.google.longrunning.Operation> 354 getExportDocumentMethod; 355 if ((getExportDocumentMethod = DocumentsGrpc.getExportDocumentMethod) == null) { 356 synchronized (DocumentsGrpc.class) { 357 if ((getExportDocumentMethod = DocumentsGrpc.getExportDocumentMethod) == null) { 358 DocumentsGrpc.getExportDocumentMethod = 359 getExportDocumentMethod = 360 io.grpc.MethodDescriptor 361 .<com.google.cloud.dialogflow.v2.ExportDocumentRequest, 362 com.google.longrunning.Operation> 363 newBuilder() 364 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 365 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ExportDocument")) 366 .setSampledToLocalTracing(true) 367 .setRequestMarshaller( 368 io.grpc.protobuf.ProtoUtils.marshaller( 369 com.google.cloud.dialogflow.v2.ExportDocumentRequest 370 .getDefaultInstance())) 371 .setResponseMarshaller( 372 io.grpc.protobuf.ProtoUtils.marshaller( 373 com.google.longrunning.Operation.getDefaultInstance())) 374 .setSchemaDescriptor(new DocumentsMethodDescriptorSupplier("ExportDocument")) 375 .build(); 376 } 377 } 378 } 379 return getExportDocumentMethod; 380 } 381 382 /** Creates a new async stub that supports all call types for the service */ newStub(io.grpc.Channel channel)383 public static DocumentsStub newStub(io.grpc.Channel channel) { 384 io.grpc.stub.AbstractStub.StubFactory<DocumentsStub> factory = 385 new io.grpc.stub.AbstractStub.StubFactory<DocumentsStub>() { 386 @java.lang.Override 387 public DocumentsStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 388 return new DocumentsStub(channel, callOptions); 389 } 390 }; 391 return DocumentsStub.newStub(factory, channel); 392 } 393 394 /** 395 * Creates a new blocking-style stub that supports unary and streaming output calls on the service 396 */ newBlockingStub(io.grpc.Channel channel)397 public static DocumentsBlockingStub newBlockingStub(io.grpc.Channel channel) { 398 io.grpc.stub.AbstractStub.StubFactory<DocumentsBlockingStub> factory = 399 new io.grpc.stub.AbstractStub.StubFactory<DocumentsBlockingStub>() { 400 @java.lang.Override 401 public DocumentsBlockingStub newStub( 402 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 403 return new DocumentsBlockingStub(channel, callOptions); 404 } 405 }; 406 return DocumentsBlockingStub.newStub(factory, channel); 407 } 408 409 /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ newFutureStub(io.grpc.Channel channel)410 public static DocumentsFutureStub newFutureStub(io.grpc.Channel channel) { 411 io.grpc.stub.AbstractStub.StubFactory<DocumentsFutureStub> factory = 412 new io.grpc.stub.AbstractStub.StubFactory<DocumentsFutureStub>() { 413 @java.lang.Override 414 public DocumentsFutureStub newStub( 415 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 416 return new DocumentsFutureStub(channel, callOptions); 417 } 418 }; 419 return DocumentsFutureStub.newStub(factory, channel); 420 } 421 422 /** 423 * 424 * 425 * <pre> 426 * Service for managing knowledge 427 * [Documents][google.cloud.dialogflow.v2.Document]. 428 * </pre> 429 */ 430 public interface AsyncService { 431 432 /** 433 * 434 * 435 * <pre> 436 * Returns the list of all documents of the knowledge base. 437 * </pre> 438 */ listDocuments( com.google.cloud.dialogflow.v2.ListDocumentsRequest request, io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.ListDocumentsResponse> responseObserver)439 default void listDocuments( 440 com.google.cloud.dialogflow.v2.ListDocumentsRequest request, 441 io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.ListDocumentsResponse> 442 responseObserver) { 443 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 444 getListDocumentsMethod(), responseObserver); 445 } 446 447 /** 448 * 449 * 450 * <pre> 451 * Retrieves the specified document. 452 * </pre> 453 */ getDocument( com.google.cloud.dialogflow.v2.GetDocumentRequest request, io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Document> responseObserver)454 default void getDocument( 455 com.google.cloud.dialogflow.v2.GetDocumentRequest request, 456 io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Document> responseObserver) { 457 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 458 getGetDocumentMethod(), responseObserver); 459 } 460 461 /** 462 * 463 * 464 * <pre> 465 * Creates a new document. 466 * This method is a [long-running 467 * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 468 * The returned `Operation` type has the following method-specific fields: 469 * - `metadata`: 470 * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] 471 * - `response`: [Document][google.cloud.dialogflow.v2.Document] 472 * </pre> 473 */ createDocument( com.google.cloud.dialogflow.v2.CreateDocumentRequest request, io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver)474 default void createDocument( 475 com.google.cloud.dialogflow.v2.CreateDocumentRequest request, 476 io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) { 477 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 478 getCreateDocumentMethod(), responseObserver); 479 } 480 481 /** 482 * 483 * 484 * <pre> 485 * Creates documents by importing data from external sources. 486 * Dialogflow supports up to 350 documents in each request. If you try to 487 * import more, Dialogflow will return an error. 488 * This method is a [long-running 489 * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 490 * The returned `Operation` type has the following method-specific fields: 491 * - `metadata`: 492 * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] 493 * - `response`: 494 * [ImportDocumentsResponse][google.cloud.dialogflow.v2.ImportDocumentsResponse] 495 * </pre> 496 */ importDocuments( com.google.cloud.dialogflow.v2.ImportDocumentsRequest request, io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver)497 default void importDocuments( 498 com.google.cloud.dialogflow.v2.ImportDocumentsRequest request, 499 io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) { 500 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 501 getImportDocumentsMethod(), responseObserver); 502 } 503 504 /** 505 * 506 * 507 * <pre> 508 * Deletes the specified document. 509 * This method is a [long-running 510 * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 511 * The returned `Operation` type has the following method-specific fields: 512 * - `metadata`: 513 * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] 514 * - `response`: An [Empty 515 * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) 516 * </pre> 517 */ deleteDocument( com.google.cloud.dialogflow.v2.DeleteDocumentRequest request, io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver)518 default void deleteDocument( 519 com.google.cloud.dialogflow.v2.DeleteDocumentRequest request, 520 io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) { 521 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 522 getDeleteDocumentMethod(), responseObserver); 523 } 524 525 /** 526 * 527 * 528 * <pre> 529 * Updates the specified document. 530 * This method is a [long-running 531 * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 532 * The returned `Operation` type has the following method-specific fields: 533 * - `metadata`: 534 * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] 535 * - `response`: [Document][google.cloud.dialogflow.v2.Document] 536 * </pre> 537 */ updateDocument( com.google.cloud.dialogflow.v2.UpdateDocumentRequest request, io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver)538 default void updateDocument( 539 com.google.cloud.dialogflow.v2.UpdateDocumentRequest request, 540 io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) { 541 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 542 getUpdateDocumentMethod(), responseObserver); 543 } 544 545 /** 546 * 547 * 548 * <pre> 549 * Reloads the specified document from its specified source, content_uri or 550 * content. The previously loaded content of the document will be deleted. 551 * Note: Even when the content of the document has not changed, there still 552 * may be side effects because of internal implementation changes. 553 * This method is a [long-running 554 * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 555 * The returned `Operation` type has the following method-specific fields: 556 * - `metadata`: 557 * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] 558 * - `response`: [Document][google.cloud.dialogflow.v2.Document] 559 * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; 560 * only use `projects.knowledgeBases.documents`. 561 * </pre> 562 */ reloadDocument( com.google.cloud.dialogflow.v2.ReloadDocumentRequest request, io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver)563 default void reloadDocument( 564 com.google.cloud.dialogflow.v2.ReloadDocumentRequest request, 565 io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) { 566 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 567 getReloadDocumentMethod(), responseObserver); 568 } 569 570 /** 571 * 572 * 573 * <pre> 574 * Exports a smart messaging candidate document into the specified 575 * destination. 576 * This method is a [long-running 577 * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 578 * The returned `Operation` type has the following method-specific fields: 579 * - `metadata`: 580 * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] 581 * - `response`: [Document][google.cloud.dialogflow.v2.Document] 582 * </pre> 583 */ exportDocument( com.google.cloud.dialogflow.v2.ExportDocumentRequest request, io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver)584 default void exportDocument( 585 com.google.cloud.dialogflow.v2.ExportDocumentRequest request, 586 io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) { 587 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 588 getExportDocumentMethod(), responseObserver); 589 } 590 } 591 592 /** 593 * Base class for the server implementation of the service Documents. 594 * 595 * <pre> 596 * Service for managing knowledge 597 * [Documents][google.cloud.dialogflow.v2.Document]. 598 * </pre> 599 */ 600 public abstract static class DocumentsImplBase implements io.grpc.BindableService, AsyncService { 601 602 @java.lang.Override bindService()603 public final io.grpc.ServerServiceDefinition bindService() { 604 return DocumentsGrpc.bindService(this); 605 } 606 } 607 608 /** 609 * A stub to allow clients to do asynchronous rpc calls to service Documents. 610 * 611 * <pre> 612 * Service for managing knowledge 613 * [Documents][google.cloud.dialogflow.v2.Document]. 614 * </pre> 615 */ 616 public static final class DocumentsStub extends io.grpc.stub.AbstractAsyncStub<DocumentsStub> { DocumentsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)617 private DocumentsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 618 super(channel, callOptions); 619 } 620 621 @java.lang.Override build(io.grpc.Channel channel, io.grpc.CallOptions callOptions)622 protected DocumentsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 623 return new DocumentsStub(channel, callOptions); 624 } 625 626 /** 627 * 628 * 629 * <pre> 630 * Returns the list of all documents of the knowledge base. 631 * </pre> 632 */ listDocuments( com.google.cloud.dialogflow.v2.ListDocumentsRequest request, io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.ListDocumentsResponse> responseObserver)633 public void listDocuments( 634 com.google.cloud.dialogflow.v2.ListDocumentsRequest request, 635 io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.ListDocumentsResponse> 636 responseObserver) { 637 io.grpc.stub.ClientCalls.asyncUnaryCall( 638 getChannel().newCall(getListDocumentsMethod(), getCallOptions()), 639 request, 640 responseObserver); 641 } 642 643 /** 644 * 645 * 646 * <pre> 647 * Retrieves the specified document. 648 * </pre> 649 */ getDocument( com.google.cloud.dialogflow.v2.GetDocumentRequest request, io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Document> responseObserver)650 public void getDocument( 651 com.google.cloud.dialogflow.v2.GetDocumentRequest request, 652 io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Document> responseObserver) { 653 io.grpc.stub.ClientCalls.asyncUnaryCall( 654 getChannel().newCall(getGetDocumentMethod(), getCallOptions()), 655 request, 656 responseObserver); 657 } 658 659 /** 660 * 661 * 662 * <pre> 663 * Creates a new document. 664 * This method is a [long-running 665 * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 666 * The returned `Operation` type has the following method-specific fields: 667 * - `metadata`: 668 * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] 669 * - `response`: [Document][google.cloud.dialogflow.v2.Document] 670 * </pre> 671 */ createDocument( com.google.cloud.dialogflow.v2.CreateDocumentRequest request, io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver)672 public void createDocument( 673 com.google.cloud.dialogflow.v2.CreateDocumentRequest request, 674 io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) { 675 io.grpc.stub.ClientCalls.asyncUnaryCall( 676 getChannel().newCall(getCreateDocumentMethod(), getCallOptions()), 677 request, 678 responseObserver); 679 } 680 681 /** 682 * 683 * 684 * <pre> 685 * Creates documents by importing data from external sources. 686 * Dialogflow supports up to 350 documents in each request. If you try to 687 * import more, Dialogflow will return an error. 688 * This method is a [long-running 689 * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 690 * The returned `Operation` type has the following method-specific fields: 691 * - `metadata`: 692 * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] 693 * - `response`: 694 * [ImportDocumentsResponse][google.cloud.dialogflow.v2.ImportDocumentsResponse] 695 * </pre> 696 */ importDocuments( com.google.cloud.dialogflow.v2.ImportDocumentsRequest request, io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver)697 public void importDocuments( 698 com.google.cloud.dialogflow.v2.ImportDocumentsRequest request, 699 io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) { 700 io.grpc.stub.ClientCalls.asyncUnaryCall( 701 getChannel().newCall(getImportDocumentsMethod(), getCallOptions()), 702 request, 703 responseObserver); 704 } 705 706 /** 707 * 708 * 709 * <pre> 710 * Deletes the specified document. 711 * This method is a [long-running 712 * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 713 * The returned `Operation` type has the following method-specific fields: 714 * - `metadata`: 715 * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] 716 * - `response`: An [Empty 717 * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) 718 * </pre> 719 */ deleteDocument( com.google.cloud.dialogflow.v2.DeleteDocumentRequest request, io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver)720 public void deleteDocument( 721 com.google.cloud.dialogflow.v2.DeleteDocumentRequest request, 722 io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) { 723 io.grpc.stub.ClientCalls.asyncUnaryCall( 724 getChannel().newCall(getDeleteDocumentMethod(), getCallOptions()), 725 request, 726 responseObserver); 727 } 728 729 /** 730 * 731 * 732 * <pre> 733 * Updates the specified document. 734 * This method is a [long-running 735 * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 736 * The returned `Operation` type has the following method-specific fields: 737 * - `metadata`: 738 * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] 739 * - `response`: [Document][google.cloud.dialogflow.v2.Document] 740 * </pre> 741 */ updateDocument( com.google.cloud.dialogflow.v2.UpdateDocumentRequest request, io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver)742 public void updateDocument( 743 com.google.cloud.dialogflow.v2.UpdateDocumentRequest request, 744 io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) { 745 io.grpc.stub.ClientCalls.asyncUnaryCall( 746 getChannel().newCall(getUpdateDocumentMethod(), getCallOptions()), 747 request, 748 responseObserver); 749 } 750 751 /** 752 * 753 * 754 * <pre> 755 * Reloads the specified document from its specified source, content_uri or 756 * content. The previously loaded content of the document will be deleted. 757 * Note: Even when the content of the document has not changed, there still 758 * may be side effects because of internal implementation changes. 759 * This method is a [long-running 760 * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 761 * The returned `Operation` type has the following method-specific fields: 762 * - `metadata`: 763 * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] 764 * - `response`: [Document][google.cloud.dialogflow.v2.Document] 765 * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; 766 * only use `projects.knowledgeBases.documents`. 767 * </pre> 768 */ reloadDocument( com.google.cloud.dialogflow.v2.ReloadDocumentRequest request, io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver)769 public void reloadDocument( 770 com.google.cloud.dialogflow.v2.ReloadDocumentRequest request, 771 io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) { 772 io.grpc.stub.ClientCalls.asyncUnaryCall( 773 getChannel().newCall(getReloadDocumentMethod(), getCallOptions()), 774 request, 775 responseObserver); 776 } 777 778 /** 779 * 780 * 781 * <pre> 782 * Exports a smart messaging candidate document into the specified 783 * destination. 784 * This method is a [long-running 785 * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 786 * The returned `Operation` type has the following method-specific fields: 787 * - `metadata`: 788 * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] 789 * - `response`: [Document][google.cloud.dialogflow.v2.Document] 790 * </pre> 791 */ exportDocument( com.google.cloud.dialogflow.v2.ExportDocumentRequest request, io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver)792 public void exportDocument( 793 com.google.cloud.dialogflow.v2.ExportDocumentRequest request, 794 io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) { 795 io.grpc.stub.ClientCalls.asyncUnaryCall( 796 getChannel().newCall(getExportDocumentMethod(), getCallOptions()), 797 request, 798 responseObserver); 799 } 800 } 801 802 /** 803 * A stub to allow clients to do synchronous rpc calls to service Documents. 804 * 805 * <pre> 806 * Service for managing knowledge 807 * [Documents][google.cloud.dialogflow.v2.Document]. 808 * </pre> 809 */ 810 public static final class DocumentsBlockingStub 811 extends io.grpc.stub.AbstractBlockingStub<DocumentsBlockingStub> { DocumentsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)812 private DocumentsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 813 super(channel, callOptions); 814 } 815 816 @java.lang.Override build( io.grpc.Channel channel, io.grpc.CallOptions callOptions)817 protected DocumentsBlockingStub build( 818 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 819 return new DocumentsBlockingStub(channel, callOptions); 820 } 821 822 /** 823 * 824 * 825 * <pre> 826 * Returns the list of all documents of the knowledge base. 827 * </pre> 828 */ listDocuments( com.google.cloud.dialogflow.v2.ListDocumentsRequest request)829 public com.google.cloud.dialogflow.v2.ListDocumentsResponse listDocuments( 830 com.google.cloud.dialogflow.v2.ListDocumentsRequest request) { 831 return io.grpc.stub.ClientCalls.blockingUnaryCall( 832 getChannel(), getListDocumentsMethod(), getCallOptions(), request); 833 } 834 835 /** 836 * 837 * 838 * <pre> 839 * Retrieves the specified document. 840 * </pre> 841 */ getDocument( com.google.cloud.dialogflow.v2.GetDocumentRequest request)842 public com.google.cloud.dialogflow.v2.Document getDocument( 843 com.google.cloud.dialogflow.v2.GetDocumentRequest request) { 844 return io.grpc.stub.ClientCalls.blockingUnaryCall( 845 getChannel(), getGetDocumentMethod(), getCallOptions(), request); 846 } 847 848 /** 849 * 850 * 851 * <pre> 852 * Creates a new document. 853 * This method is a [long-running 854 * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 855 * The returned `Operation` type has the following method-specific fields: 856 * - `metadata`: 857 * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] 858 * - `response`: [Document][google.cloud.dialogflow.v2.Document] 859 * </pre> 860 */ createDocument( com.google.cloud.dialogflow.v2.CreateDocumentRequest request)861 public com.google.longrunning.Operation createDocument( 862 com.google.cloud.dialogflow.v2.CreateDocumentRequest request) { 863 return io.grpc.stub.ClientCalls.blockingUnaryCall( 864 getChannel(), getCreateDocumentMethod(), getCallOptions(), request); 865 } 866 867 /** 868 * 869 * 870 * <pre> 871 * Creates documents by importing data from external sources. 872 * Dialogflow supports up to 350 documents in each request. If you try to 873 * import more, Dialogflow will return an error. 874 * This method is a [long-running 875 * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 876 * The returned `Operation` type has the following method-specific fields: 877 * - `metadata`: 878 * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] 879 * - `response`: 880 * [ImportDocumentsResponse][google.cloud.dialogflow.v2.ImportDocumentsResponse] 881 * </pre> 882 */ importDocuments( com.google.cloud.dialogflow.v2.ImportDocumentsRequest request)883 public com.google.longrunning.Operation importDocuments( 884 com.google.cloud.dialogflow.v2.ImportDocumentsRequest request) { 885 return io.grpc.stub.ClientCalls.blockingUnaryCall( 886 getChannel(), getImportDocumentsMethod(), getCallOptions(), request); 887 } 888 889 /** 890 * 891 * 892 * <pre> 893 * Deletes the specified document. 894 * This method is a [long-running 895 * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 896 * The returned `Operation` type has the following method-specific fields: 897 * - `metadata`: 898 * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] 899 * - `response`: An [Empty 900 * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) 901 * </pre> 902 */ deleteDocument( com.google.cloud.dialogflow.v2.DeleteDocumentRequest request)903 public com.google.longrunning.Operation deleteDocument( 904 com.google.cloud.dialogflow.v2.DeleteDocumentRequest request) { 905 return io.grpc.stub.ClientCalls.blockingUnaryCall( 906 getChannel(), getDeleteDocumentMethod(), getCallOptions(), request); 907 } 908 909 /** 910 * 911 * 912 * <pre> 913 * Updates the specified document. 914 * This method is a [long-running 915 * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 916 * The returned `Operation` type has the following method-specific fields: 917 * - `metadata`: 918 * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] 919 * - `response`: [Document][google.cloud.dialogflow.v2.Document] 920 * </pre> 921 */ updateDocument( com.google.cloud.dialogflow.v2.UpdateDocumentRequest request)922 public com.google.longrunning.Operation updateDocument( 923 com.google.cloud.dialogflow.v2.UpdateDocumentRequest request) { 924 return io.grpc.stub.ClientCalls.blockingUnaryCall( 925 getChannel(), getUpdateDocumentMethod(), getCallOptions(), request); 926 } 927 928 /** 929 * 930 * 931 * <pre> 932 * Reloads the specified document from its specified source, content_uri or 933 * content. The previously loaded content of the document will be deleted. 934 * Note: Even when the content of the document has not changed, there still 935 * may be side effects because of internal implementation changes. 936 * This method is a [long-running 937 * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 938 * The returned `Operation` type has the following method-specific fields: 939 * - `metadata`: 940 * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] 941 * - `response`: [Document][google.cloud.dialogflow.v2.Document] 942 * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; 943 * only use `projects.knowledgeBases.documents`. 944 * </pre> 945 */ reloadDocument( com.google.cloud.dialogflow.v2.ReloadDocumentRequest request)946 public com.google.longrunning.Operation reloadDocument( 947 com.google.cloud.dialogflow.v2.ReloadDocumentRequest request) { 948 return io.grpc.stub.ClientCalls.blockingUnaryCall( 949 getChannel(), getReloadDocumentMethod(), getCallOptions(), request); 950 } 951 952 /** 953 * 954 * 955 * <pre> 956 * Exports a smart messaging candidate document into the specified 957 * destination. 958 * This method is a [long-running 959 * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 960 * The returned `Operation` type has the following method-specific fields: 961 * - `metadata`: 962 * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] 963 * - `response`: [Document][google.cloud.dialogflow.v2.Document] 964 * </pre> 965 */ exportDocument( com.google.cloud.dialogflow.v2.ExportDocumentRequest request)966 public com.google.longrunning.Operation exportDocument( 967 com.google.cloud.dialogflow.v2.ExportDocumentRequest request) { 968 return io.grpc.stub.ClientCalls.blockingUnaryCall( 969 getChannel(), getExportDocumentMethod(), getCallOptions(), request); 970 } 971 } 972 973 /** 974 * A stub to allow clients to do ListenableFuture-style rpc calls to service Documents. 975 * 976 * <pre> 977 * Service for managing knowledge 978 * [Documents][google.cloud.dialogflow.v2.Document]. 979 * </pre> 980 */ 981 public static final class DocumentsFutureStub 982 extends io.grpc.stub.AbstractFutureStub<DocumentsFutureStub> { DocumentsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)983 private DocumentsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 984 super(channel, callOptions); 985 } 986 987 @java.lang.Override build(io.grpc.Channel channel, io.grpc.CallOptions callOptions)988 protected DocumentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 989 return new DocumentsFutureStub(channel, callOptions); 990 } 991 992 /** 993 * 994 * 995 * <pre> 996 * Returns the list of all documents of the knowledge base. 997 * </pre> 998 */ 999 public com.google.common.util.concurrent.ListenableFuture< 1000 com.google.cloud.dialogflow.v2.ListDocumentsResponse> listDocuments(com.google.cloud.dialogflow.v2.ListDocumentsRequest request)1001 listDocuments(com.google.cloud.dialogflow.v2.ListDocumentsRequest request) { 1002 return io.grpc.stub.ClientCalls.futureUnaryCall( 1003 getChannel().newCall(getListDocumentsMethod(), getCallOptions()), request); 1004 } 1005 1006 /** 1007 * 1008 * 1009 * <pre> 1010 * Retrieves the specified document. 1011 * </pre> 1012 */ 1013 public com.google.common.util.concurrent.ListenableFuture< 1014 com.google.cloud.dialogflow.v2.Document> getDocument(com.google.cloud.dialogflow.v2.GetDocumentRequest request)1015 getDocument(com.google.cloud.dialogflow.v2.GetDocumentRequest request) { 1016 return io.grpc.stub.ClientCalls.futureUnaryCall( 1017 getChannel().newCall(getGetDocumentMethod(), getCallOptions()), request); 1018 } 1019 1020 /** 1021 * 1022 * 1023 * <pre> 1024 * Creates a new document. 1025 * This method is a [long-running 1026 * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 1027 * The returned `Operation` type has the following method-specific fields: 1028 * - `metadata`: 1029 * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] 1030 * - `response`: [Document][google.cloud.dialogflow.v2.Document] 1031 * </pre> 1032 */ 1033 public com.google.common.util.concurrent.ListenableFuture<com.google.longrunning.Operation> createDocument(com.google.cloud.dialogflow.v2.CreateDocumentRequest request)1034 createDocument(com.google.cloud.dialogflow.v2.CreateDocumentRequest request) { 1035 return io.grpc.stub.ClientCalls.futureUnaryCall( 1036 getChannel().newCall(getCreateDocumentMethod(), getCallOptions()), request); 1037 } 1038 1039 /** 1040 * 1041 * 1042 * <pre> 1043 * Creates documents by importing data from external sources. 1044 * Dialogflow supports up to 350 documents in each request. If you try to 1045 * import more, Dialogflow will return an error. 1046 * This method is a [long-running 1047 * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 1048 * The returned `Operation` type has the following method-specific fields: 1049 * - `metadata`: 1050 * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] 1051 * - `response`: 1052 * [ImportDocumentsResponse][google.cloud.dialogflow.v2.ImportDocumentsResponse] 1053 * </pre> 1054 */ 1055 public com.google.common.util.concurrent.ListenableFuture<com.google.longrunning.Operation> importDocuments(com.google.cloud.dialogflow.v2.ImportDocumentsRequest request)1056 importDocuments(com.google.cloud.dialogflow.v2.ImportDocumentsRequest request) { 1057 return io.grpc.stub.ClientCalls.futureUnaryCall( 1058 getChannel().newCall(getImportDocumentsMethod(), getCallOptions()), request); 1059 } 1060 1061 /** 1062 * 1063 * 1064 * <pre> 1065 * Deletes the specified document. 1066 * This method is a [long-running 1067 * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 1068 * The returned `Operation` type has the following method-specific fields: 1069 * - `metadata`: 1070 * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] 1071 * - `response`: An [Empty 1072 * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) 1073 * </pre> 1074 */ 1075 public com.google.common.util.concurrent.ListenableFuture<com.google.longrunning.Operation> deleteDocument(com.google.cloud.dialogflow.v2.DeleteDocumentRequest request)1076 deleteDocument(com.google.cloud.dialogflow.v2.DeleteDocumentRequest request) { 1077 return io.grpc.stub.ClientCalls.futureUnaryCall( 1078 getChannel().newCall(getDeleteDocumentMethod(), getCallOptions()), request); 1079 } 1080 1081 /** 1082 * 1083 * 1084 * <pre> 1085 * Updates the specified document. 1086 * This method is a [long-running 1087 * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 1088 * The returned `Operation` type has the following method-specific fields: 1089 * - `metadata`: 1090 * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] 1091 * - `response`: [Document][google.cloud.dialogflow.v2.Document] 1092 * </pre> 1093 */ 1094 public com.google.common.util.concurrent.ListenableFuture<com.google.longrunning.Operation> updateDocument(com.google.cloud.dialogflow.v2.UpdateDocumentRequest request)1095 updateDocument(com.google.cloud.dialogflow.v2.UpdateDocumentRequest request) { 1096 return io.grpc.stub.ClientCalls.futureUnaryCall( 1097 getChannel().newCall(getUpdateDocumentMethod(), getCallOptions()), request); 1098 } 1099 1100 /** 1101 * 1102 * 1103 * <pre> 1104 * Reloads the specified document from its specified source, content_uri or 1105 * content. The previously loaded content of the document will be deleted. 1106 * Note: Even when the content of the document has not changed, there still 1107 * may be side effects because of internal implementation changes. 1108 * This method is a [long-running 1109 * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 1110 * The returned `Operation` type has the following method-specific fields: 1111 * - `metadata`: 1112 * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] 1113 * - `response`: [Document][google.cloud.dialogflow.v2.Document] 1114 * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; 1115 * only use `projects.knowledgeBases.documents`. 1116 * </pre> 1117 */ 1118 public com.google.common.util.concurrent.ListenableFuture<com.google.longrunning.Operation> reloadDocument(com.google.cloud.dialogflow.v2.ReloadDocumentRequest request)1119 reloadDocument(com.google.cloud.dialogflow.v2.ReloadDocumentRequest request) { 1120 return io.grpc.stub.ClientCalls.futureUnaryCall( 1121 getChannel().newCall(getReloadDocumentMethod(), getCallOptions()), request); 1122 } 1123 1124 /** 1125 * 1126 * 1127 * <pre> 1128 * Exports a smart messaging candidate document into the specified 1129 * destination. 1130 * This method is a [long-running 1131 * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). 1132 * The returned `Operation` type has the following method-specific fields: 1133 * - `metadata`: 1134 * [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] 1135 * - `response`: [Document][google.cloud.dialogflow.v2.Document] 1136 * </pre> 1137 */ 1138 public com.google.common.util.concurrent.ListenableFuture<com.google.longrunning.Operation> exportDocument(com.google.cloud.dialogflow.v2.ExportDocumentRequest request)1139 exportDocument(com.google.cloud.dialogflow.v2.ExportDocumentRequest request) { 1140 return io.grpc.stub.ClientCalls.futureUnaryCall( 1141 getChannel().newCall(getExportDocumentMethod(), getCallOptions()), request); 1142 } 1143 } 1144 1145 private static final int METHODID_LIST_DOCUMENTS = 0; 1146 private static final int METHODID_GET_DOCUMENT = 1; 1147 private static final int METHODID_CREATE_DOCUMENT = 2; 1148 private static final int METHODID_IMPORT_DOCUMENTS = 3; 1149 private static final int METHODID_DELETE_DOCUMENT = 4; 1150 private static final int METHODID_UPDATE_DOCUMENT = 5; 1151 private static final int METHODID_RELOAD_DOCUMENT = 6; 1152 private static final int METHODID_EXPORT_DOCUMENT = 7; 1153 1154 private static final class MethodHandlers<Req, Resp> 1155 implements io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, 1156 io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, 1157 io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, 1158 io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { 1159 private final AsyncService serviceImpl; 1160 private final int methodId; 1161 MethodHandlers(AsyncService serviceImpl, int methodId)1162 MethodHandlers(AsyncService serviceImpl, int methodId) { 1163 this.serviceImpl = serviceImpl; 1164 this.methodId = methodId; 1165 } 1166 1167 @java.lang.Override 1168 @java.lang.SuppressWarnings("unchecked") invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver)1169 public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) { 1170 switch (methodId) { 1171 case METHODID_LIST_DOCUMENTS: 1172 serviceImpl.listDocuments( 1173 (com.google.cloud.dialogflow.v2.ListDocumentsRequest) request, 1174 (io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.ListDocumentsResponse>) 1175 responseObserver); 1176 break; 1177 case METHODID_GET_DOCUMENT: 1178 serviceImpl.getDocument( 1179 (com.google.cloud.dialogflow.v2.GetDocumentRequest) request, 1180 (io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Document>) 1181 responseObserver); 1182 break; 1183 case METHODID_CREATE_DOCUMENT: 1184 serviceImpl.createDocument( 1185 (com.google.cloud.dialogflow.v2.CreateDocumentRequest) request, 1186 (io.grpc.stub.StreamObserver<com.google.longrunning.Operation>) responseObserver); 1187 break; 1188 case METHODID_IMPORT_DOCUMENTS: 1189 serviceImpl.importDocuments( 1190 (com.google.cloud.dialogflow.v2.ImportDocumentsRequest) request, 1191 (io.grpc.stub.StreamObserver<com.google.longrunning.Operation>) responseObserver); 1192 break; 1193 case METHODID_DELETE_DOCUMENT: 1194 serviceImpl.deleteDocument( 1195 (com.google.cloud.dialogflow.v2.DeleteDocumentRequest) request, 1196 (io.grpc.stub.StreamObserver<com.google.longrunning.Operation>) responseObserver); 1197 break; 1198 case METHODID_UPDATE_DOCUMENT: 1199 serviceImpl.updateDocument( 1200 (com.google.cloud.dialogflow.v2.UpdateDocumentRequest) request, 1201 (io.grpc.stub.StreamObserver<com.google.longrunning.Operation>) responseObserver); 1202 break; 1203 case METHODID_RELOAD_DOCUMENT: 1204 serviceImpl.reloadDocument( 1205 (com.google.cloud.dialogflow.v2.ReloadDocumentRequest) request, 1206 (io.grpc.stub.StreamObserver<com.google.longrunning.Operation>) responseObserver); 1207 break; 1208 case METHODID_EXPORT_DOCUMENT: 1209 serviceImpl.exportDocument( 1210 (com.google.cloud.dialogflow.v2.ExportDocumentRequest) request, 1211 (io.grpc.stub.StreamObserver<com.google.longrunning.Operation>) responseObserver); 1212 break; 1213 default: 1214 throw new AssertionError(); 1215 } 1216 } 1217 1218 @java.lang.Override 1219 @java.lang.SuppressWarnings("unchecked") invoke( io.grpc.stub.StreamObserver<Resp> responseObserver)1220 public io.grpc.stub.StreamObserver<Req> invoke( 1221 io.grpc.stub.StreamObserver<Resp> responseObserver) { 1222 switch (methodId) { 1223 default: 1224 throw new AssertionError(); 1225 } 1226 } 1227 } 1228 bindService(AsyncService service)1229 public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { 1230 return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) 1231 .addMethod( 1232 getListDocumentsMethod(), 1233 io.grpc.stub.ServerCalls.asyncUnaryCall( 1234 new MethodHandlers< 1235 com.google.cloud.dialogflow.v2.ListDocumentsRequest, 1236 com.google.cloud.dialogflow.v2.ListDocumentsResponse>( 1237 service, METHODID_LIST_DOCUMENTS))) 1238 .addMethod( 1239 getGetDocumentMethod(), 1240 io.grpc.stub.ServerCalls.asyncUnaryCall( 1241 new MethodHandlers< 1242 com.google.cloud.dialogflow.v2.GetDocumentRequest, 1243 com.google.cloud.dialogflow.v2.Document>(service, METHODID_GET_DOCUMENT))) 1244 .addMethod( 1245 getCreateDocumentMethod(), 1246 io.grpc.stub.ServerCalls.asyncUnaryCall( 1247 new MethodHandlers< 1248 com.google.cloud.dialogflow.v2.CreateDocumentRequest, 1249 com.google.longrunning.Operation>(service, METHODID_CREATE_DOCUMENT))) 1250 .addMethod( 1251 getImportDocumentsMethod(), 1252 io.grpc.stub.ServerCalls.asyncUnaryCall( 1253 new MethodHandlers< 1254 com.google.cloud.dialogflow.v2.ImportDocumentsRequest, 1255 com.google.longrunning.Operation>(service, METHODID_IMPORT_DOCUMENTS))) 1256 .addMethod( 1257 getDeleteDocumentMethod(), 1258 io.grpc.stub.ServerCalls.asyncUnaryCall( 1259 new MethodHandlers< 1260 com.google.cloud.dialogflow.v2.DeleteDocumentRequest, 1261 com.google.longrunning.Operation>(service, METHODID_DELETE_DOCUMENT))) 1262 .addMethod( 1263 getUpdateDocumentMethod(), 1264 io.grpc.stub.ServerCalls.asyncUnaryCall( 1265 new MethodHandlers< 1266 com.google.cloud.dialogflow.v2.UpdateDocumentRequest, 1267 com.google.longrunning.Operation>(service, METHODID_UPDATE_DOCUMENT))) 1268 .addMethod( 1269 getReloadDocumentMethod(), 1270 io.grpc.stub.ServerCalls.asyncUnaryCall( 1271 new MethodHandlers< 1272 com.google.cloud.dialogflow.v2.ReloadDocumentRequest, 1273 com.google.longrunning.Operation>(service, METHODID_RELOAD_DOCUMENT))) 1274 .addMethod( 1275 getExportDocumentMethod(), 1276 io.grpc.stub.ServerCalls.asyncUnaryCall( 1277 new MethodHandlers< 1278 com.google.cloud.dialogflow.v2.ExportDocumentRequest, 1279 com.google.longrunning.Operation>(service, METHODID_EXPORT_DOCUMENT))) 1280 .build(); 1281 } 1282 1283 private abstract static class DocumentsBaseDescriptorSupplier 1284 implements io.grpc.protobuf.ProtoFileDescriptorSupplier, 1285 io.grpc.protobuf.ProtoServiceDescriptorSupplier { DocumentsBaseDescriptorSupplier()1286 DocumentsBaseDescriptorSupplier() {} 1287 1288 @java.lang.Override getFileDescriptor()1289 public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { 1290 return com.google.cloud.dialogflow.v2.DocumentProto.getDescriptor(); 1291 } 1292 1293 @java.lang.Override getServiceDescriptor()1294 public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { 1295 return getFileDescriptor().findServiceByName("Documents"); 1296 } 1297 } 1298 1299 private static final class DocumentsFileDescriptorSupplier 1300 extends DocumentsBaseDescriptorSupplier { DocumentsFileDescriptorSupplier()1301 DocumentsFileDescriptorSupplier() {} 1302 } 1303 1304 private static final class DocumentsMethodDescriptorSupplier 1305 extends DocumentsBaseDescriptorSupplier 1306 implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { 1307 private final String methodName; 1308 DocumentsMethodDescriptorSupplier(String methodName)1309 DocumentsMethodDescriptorSupplier(String methodName) { 1310 this.methodName = methodName; 1311 } 1312 1313 @java.lang.Override getMethodDescriptor()1314 public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { 1315 return getServiceDescriptor().findMethodByName(methodName); 1316 } 1317 } 1318 1319 private static volatile io.grpc.ServiceDescriptor serviceDescriptor; 1320 getServiceDescriptor()1321 public static io.grpc.ServiceDescriptor getServiceDescriptor() { 1322 io.grpc.ServiceDescriptor result = serviceDescriptor; 1323 if (result == null) { 1324 synchronized (DocumentsGrpc.class) { 1325 result = serviceDescriptor; 1326 if (result == null) { 1327 serviceDescriptor = 1328 result = 1329 io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) 1330 .setSchemaDescriptor(new DocumentsFileDescriptorSupplier()) 1331 .addMethod(getListDocumentsMethod()) 1332 .addMethod(getGetDocumentMethod()) 1333 .addMethod(getCreateDocumentMethod()) 1334 .addMethod(getImportDocumentsMethod()) 1335 .addMethod(getDeleteDocumentMethod()) 1336 .addMethod(getUpdateDocumentMethod()) 1337 .addMethod(getReloadDocumentMethod()) 1338 .addMethod(getExportDocumentMethod()) 1339 .build(); 1340 } 1341 } 1342 } 1343 return result; 1344 } 1345 } 1346