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.speech.v1; 17 18 import static io.grpc.MethodDescriptor.generateFullMethodName; 19 20 /** 21 * 22 * 23 * <pre> 24 * Service that implements Google Cloud Speech API. 25 * </pre> 26 */ 27 @javax.annotation.Generated( 28 value = "by gRPC proto compiler", 29 comments = "Source: google/cloud/speech/v1/cloud_speech.proto") 30 @io.grpc.stub.annotations.GrpcGenerated 31 public final class SpeechGrpc { 32 SpeechGrpc()33 private SpeechGrpc() {} 34 35 public static final String SERVICE_NAME = "google.cloud.speech.v1.Speech"; 36 37 // Static method descriptors that strictly reflect the proto. 38 private static volatile io.grpc.MethodDescriptor< 39 com.google.cloud.speech.v1.RecognizeRequest, com.google.cloud.speech.v1.RecognizeResponse> 40 getRecognizeMethod; 41 42 @io.grpc.stub.annotations.RpcMethod( 43 fullMethodName = SERVICE_NAME + '/' + "Recognize", 44 requestType = com.google.cloud.speech.v1.RecognizeRequest.class, 45 responseType = com.google.cloud.speech.v1.RecognizeResponse.class, 46 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 47 public static io.grpc.MethodDescriptor< 48 com.google.cloud.speech.v1.RecognizeRequest, com.google.cloud.speech.v1.RecognizeResponse> getRecognizeMethod()49 getRecognizeMethod() { 50 io.grpc.MethodDescriptor< 51 com.google.cloud.speech.v1.RecognizeRequest, 52 com.google.cloud.speech.v1.RecognizeResponse> 53 getRecognizeMethod; 54 if ((getRecognizeMethod = SpeechGrpc.getRecognizeMethod) == null) { 55 synchronized (SpeechGrpc.class) { 56 if ((getRecognizeMethod = SpeechGrpc.getRecognizeMethod) == null) { 57 SpeechGrpc.getRecognizeMethod = 58 getRecognizeMethod = 59 io.grpc.MethodDescriptor 60 .<com.google.cloud.speech.v1.RecognizeRequest, 61 com.google.cloud.speech.v1.RecognizeResponse> 62 newBuilder() 63 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 64 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Recognize")) 65 .setSampledToLocalTracing(true) 66 .setRequestMarshaller( 67 io.grpc.protobuf.ProtoUtils.marshaller( 68 com.google.cloud.speech.v1.RecognizeRequest.getDefaultInstance())) 69 .setResponseMarshaller( 70 io.grpc.protobuf.ProtoUtils.marshaller( 71 com.google.cloud.speech.v1.RecognizeResponse.getDefaultInstance())) 72 .setSchemaDescriptor(new SpeechMethodDescriptorSupplier("Recognize")) 73 .build(); 74 } 75 } 76 } 77 return getRecognizeMethod; 78 } 79 80 private static volatile io.grpc.MethodDescriptor< 81 com.google.cloud.speech.v1.LongRunningRecognizeRequest, com.google.longrunning.Operation> 82 getLongRunningRecognizeMethod; 83 84 @io.grpc.stub.annotations.RpcMethod( 85 fullMethodName = SERVICE_NAME + '/' + "LongRunningRecognize", 86 requestType = com.google.cloud.speech.v1.LongRunningRecognizeRequest.class, 87 responseType = com.google.longrunning.Operation.class, 88 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 89 public static io.grpc.MethodDescriptor< 90 com.google.cloud.speech.v1.LongRunningRecognizeRequest, com.google.longrunning.Operation> getLongRunningRecognizeMethod()91 getLongRunningRecognizeMethod() { 92 io.grpc.MethodDescriptor< 93 com.google.cloud.speech.v1.LongRunningRecognizeRequest, 94 com.google.longrunning.Operation> 95 getLongRunningRecognizeMethod; 96 if ((getLongRunningRecognizeMethod = SpeechGrpc.getLongRunningRecognizeMethod) == null) { 97 synchronized (SpeechGrpc.class) { 98 if ((getLongRunningRecognizeMethod = SpeechGrpc.getLongRunningRecognizeMethod) == null) { 99 SpeechGrpc.getLongRunningRecognizeMethod = 100 getLongRunningRecognizeMethod = 101 io.grpc.MethodDescriptor 102 .<com.google.cloud.speech.v1.LongRunningRecognizeRequest, 103 com.google.longrunning.Operation> 104 newBuilder() 105 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 106 .setFullMethodName( 107 generateFullMethodName(SERVICE_NAME, "LongRunningRecognize")) 108 .setSampledToLocalTracing(true) 109 .setRequestMarshaller( 110 io.grpc.protobuf.ProtoUtils.marshaller( 111 com.google.cloud.speech.v1.LongRunningRecognizeRequest 112 .getDefaultInstance())) 113 .setResponseMarshaller( 114 io.grpc.protobuf.ProtoUtils.marshaller( 115 com.google.longrunning.Operation.getDefaultInstance())) 116 .setSchemaDescriptor( 117 new SpeechMethodDescriptorSupplier("LongRunningRecognize")) 118 .build(); 119 } 120 } 121 } 122 return getLongRunningRecognizeMethod; 123 } 124 125 private static volatile io.grpc.MethodDescriptor< 126 com.google.cloud.speech.v1.StreamingRecognizeRequest, 127 com.google.cloud.speech.v1.StreamingRecognizeResponse> 128 getStreamingRecognizeMethod; 129 130 @io.grpc.stub.annotations.RpcMethod( 131 fullMethodName = SERVICE_NAME + '/' + "StreamingRecognize", 132 requestType = com.google.cloud.speech.v1.StreamingRecognizeRequest.class, 133 responseType = com.google.cloud.speech.v1.StreamingRecognizeResponse.class, 134 methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) 135 public static io.grpc.MethodDescriptor< 136 com.google.cloud.speech.v1.StreamingRecognizeRequest, 137 com.google.cloud.speech.v1.StreamingRecognizeResponse> getStreamingRecognizeMethod()138 getStreamingRecognizeMethod() { 139 io.grpc.MethodDescriptor< 140 com.google.cloud.speech.v1.StreamingRecognizeRequest, 141 com.google.cloud.speech.v1.StreamingRecognizeResponse> 142 getStreamingRecognizeMethod; 143 if ((getStreamingRecognizeMethod = SpeechGrpc.getStreamingRecognizeMethod) == null) { 144 synchronized (SpeechGrpc.class) { 145 if ((getStreamingRecognizeMethod = SpeechGrpc.getStreamingRecognizeMethod) == null) { 146 SpeechGrpc.getStreamingRecognizeMethod = 147 getStreamingRecognizeMethod = 148 io.grpc.MethodDescriptor 149 .<com.google.cloud.speech.v1.StreamingRecognizeRequest, 150 com.google.cloud.speech.v1.StreamingRecognizeResponse> 151 newBuilder() 152 .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) 153 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamingRecognize")) 154 .setSampledToLocalTracing(true) 155 .setRequestMarshaller( 156 io.grpc.protobuf.ProtoUtils.marshaller( 157 com.google.cloud.speech.v1.StreamingRecognizeRequest 158 .getDefaultInstance())) 159 .setResponseMarshaller( 160 io.grpc.protobuf.ProtoUtils.marshaller( 161 com.google.cloud.speech.v1.StreamingRecognizeResponse 162 .getDefaultInstance())) 163 .setSchemaDescriptor(new SpeechMethodDescriptorSupplier("StreamingRecognize")) 164 .build(); 165 } 166 } 167 } 168 return getStreamingRecognizeMethod; 169 } 170 171 /** Creates a new async stub that supports all call types for the service */ newStub(io.grpc.Channel channel)172 public static SpeechStub newStub(io.grpc.Channel channel) { 173 io.grpc.stub.AbstractStub.StubFactory<SpeechStub> factory = 174 new io.grpc.stub.AbstractStub.StubFactory<SpeechStub>() { 175 @java.lang.Override 176 public SpeechStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 177 return new SpeechStub(channel, callOptions); 178 } 179 }; 180 return SpeechStub.newStub(factory, channel); 181 } 182 183 /** 184 * Creates a new blocking-style stub that supports unary and streaming output calls on the service 185 */ newBlockingStub(io.grpc.Channel channel)186 public static SpeechBlockingStub newBlockingStub(io.grpc.Channel channel) { 187 io.grpc.stub.AbstractStub.StubFactory<SpeechBlockingStub> factory = 188 new io.grpc.stub.AbstractStub.StubFactory<SpeechBlockingStub>() { 189 @java.lang.Override 190 public SpeechBlockingStub newStub( 191 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 192 return new SpeechBlockingStub(channel, callOptions); 193 } 194 }; 195 return SpeechBlockingStub.newStub(factory, channel); 196 } 197 198 /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ newFutureStub(io.grpc.Channel channel)199 public static SpeechFutureStub newFutureStub(io.grpc.Channel channel) { 200 io.grpc.stub.AbstractStub.StubFactory<SpeechFutureStub> factory = 201 new io.grpc.stub.AbstractStub.StubFactory<SpeechFutureStub>() { 202 @java.lang.Override 203 public SpeechFutureStub newStub( 204 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 205 return new SpeechFutureStub(channel, callOptions); 206 } 207 }; 208 return SpeechFutureStub.newStub(factory, channel); 209 } 210 211 /** 212 * 213 * 214 * <pre> 215 * Service that implements Google Cloud Speech API. 216 * </pre> 217 */ 218 public interface AsyncService { 219 220 /** 221 * 222 * 223 * <pre> 224 * Performs synchronous speech recognition: receive results after all audio 225 * has been sent and processed. 226 * </pre> 227 */ recognize( com.google.cloud.speech.v1.RecognizeRequest request, io.grpc.stub.StreamObserver<com.google.cloud.speech.v1.RecognizeResponse> responseObserver)228 default void recognize( 229 com.google.cloud.speech.v1.RecognizeRequest request, 230 io.grpc.stub.StreamObserver<com.google.cloud.speech.v1.RecognizeResponse> 231 responseObserver) { 232 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRecognizeMethod(), responseObserver); 233 } 234 235 /** 236 * 237 * 238 * <pre> 239 * Performs asynchronous speech recognition: receive results via the 240 * google.longrunning.Operations interface. Returns either an 241 * `Operation.error` or an `Operation.response` which contains 242 * a `LongRunningRecognizeResponse` message. 243 * For more information on asynchronous speech recognition, see the 244 * [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). 245 * </pre> 246 */ longRunningRecognize( com.google.cloud.speech.v1.LongRunningRecognizeRequest request, io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver)247 default void longRunningRecognize( 248 com.google.cloud.speech.v1.LongRunningRecognizeRequest request, 249 io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) { 250 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 251 getLongRunningRecognizeMethod(), responseObserver); 252 } 253 254 /** 255 * 256 * 257 * <pre> 258 * Performs bidirectional streaming speech recognition: receive results while 259 * sending audio. This method is only available via the gRPC API (not REST). 260 * </pre> 261 */ 262 default io.grpc.stub.StreamObserver<com.google.cloud.speech.v1.StreamingRecognizeRequest> streamingRecognize( io.grpc.stub.StreamObserver<com.google.cloud.speech.v1.StreamingRecognizeResponse> responseObserver)263 streamingRecognize( 264 io.grpc.stub.StreamObserver<com.google.cloud.speech.v1.StreamingRecognizeResponse> 265 responseObserver) { 266 return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall( 267 getStreamingRecognizeMethod(), responseObserver); 268 } 269 } 270 271 /** 272 * Base class for the server implementation of the service Speech. 273 * 274 * <pre> 275 * Service that implements Google Cloud Speech API. 276 * </pre> 277 */ 278 public abstract static class SpeechImplBase implements io.grpc.BindableService, AsyncService { 279 280 @java.lang.Override bindService()281 public final io.grpc.ServerServiceDefinition bindService() { 282 return SpeechGrpc.bindService(this); 283 } 284 } 285 286 /** 287 * A stub to allow clients to do asynchronous rpc calls to service Speech. 288 * 289 * <pre> 290 * Service that implements Google Cloud Speech API. 291 * </pre> 292 */ 293 public static final class SpeechStub extends io.grpc.stub.AbstractAsyncStub<SpeechStub> { SpeechStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)294 private SpeechStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 295 super(channel, callOptions); 296 } 297 298 @java.lang.Override build(io.grpc.Channel channel, io.grpc.CallOptions callOptions)299 protected SpeechStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 300 return new SpeechStub(channel, callOptions); 301 } 302 303 /** 304 * 305 * 306 * <pre> 307 * Performs synchronous speech recognition: receive results after all audio 308 * has been sent and processed. 309 * </pre> 310 */ recognize( com.google.cloud.speech.v1.RecognizeRequest request, io.grpc.stub.StreamObserver<com.google.cloud.speech.v1.RecognizeResponse> responseObserver)311 public void recognize( 312 com.google.cloud.speech.v1.RecognizeRequest request, 313 io.grpc.stub.StreamObserver<com.google.cloud.speech.v1.RecognizeResponse> 314 responseObserver) { 315 io.grpc.stub.ClientCalls.asyncUnaryCall( 316 getChannel().newCall(getRecognizeMethod(), getCallOptions()), request, responseObserver); 317 } 318 319 /** 320 * 321 * 322 * <pre> 323 * Performs asynchronous speech recognition: receive results via the 324 * google.longrunning.Operations interface. Returns either an 325 * `Operation.error` or an `Operation.response` which contains 326 * a `LongRunningRecognizeResponse` message. 327 * For more information on asynchronous speech recognition, see the 328 * [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). 329 * </pre> 330 */ longRunningRecognize( com.google.cloud.speech.v1.LongRunningRecognizeRequest request, io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver)331 public void longRunningRecognize( 332 com.google.cloud.speech.v1.LongRunningRecognizeRequest request, 333 io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) { 334 io.grpc.stub.ClientCalls.asyncUnaryCall( 335 getChannel().newCall(getLongRunningRecognizeMethod(), getCallOptions()), 336 request, 337 responseObserver); 338 } 339 340 /** 341 * 342 * 343 * <pre> 344 * Performs bidirectional streaming speech recognition: receive results while 345 * sending audio. This method is only available via the gRPC API (not REST). 346 * </pre> 347 */ 348 public io.grpc.stub.StreamObserver<com.google.cloud.speech.v1.StreamingRecognizeRequest> streamingRecognize( io.grpc.stub.StreamObserver<com.google.cloud.speech.v1.StreamingRecognizeResponse> responseObserver)349 streamingRecognize( 350 io.grpc.stub.StreamObserver<com.google.cloud.speech.v1.StreamingRecognizeResponse> 351 responseObserver) { 352 return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( 353 getChannel().newCall(getStreamingRecognizeMethod(), getCallOptions()), responseObserver); 354 } 355 } 356 357 /** 358 * A stub to allow clients to do synchronous rpc calls to service Speech. 359 * 360 * <pre> 361 * Service that implements Google Cloud Speech API. 362 * </pre> 363 */ 364 public static final class SpeechBlockingStub 365 extends io.grpc.stub.AbstractBlockingStub<SpeechBlockingStub> { SpeechBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)366 private SpeechBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 367 super(channel, callOptions); 368 } 369 370 @java.lang.Override build(io.grpc.Channel channel, io.grpc.CallOptions callOptions)371 protected SpeechBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 372 return new SpeechBlockingStub(channel, callOptions); 373 } 374 375 /** 376 * 377 * 378 * <pre> 379 * Performs synchronous speech recognition: receive results after all audio 380 * has been sent and processed. 381 * </pre> 382 */ recognize( com.google.cloud.speech.v1.RecognizeRequest request)383 public com.google.cloud.speech.v1.RecognizeResponse recognize( 384 com.google.cloud.speech.v1.RecognizeRequest request) { 385 return io.grpc.stub.ClientCalls.blockingUnaryCall( 386 getChannel(), getRecognizeMethod(), getCallOptions(), request); 387 } 388 389 /** 390 * 391 * 392 * <pre> 393 * Performs asynchronous speech recognition: receive results via the 394 * google.longrunning.Operations interface. Returns either an 395 * `Operation.error` or an `Operation.response` which contains 396 * a `LongRunningRecognizeResponse` message. 397 * For more information on asynchronous speech recognition, see the 398 * [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). 399 * </pre> 400 */ longRunningRecognize( com.google.cloud.speech.v1.LongRunningRecognizeRequest request)401 public com.google.longrunning.Operation longRunningRecognize( 402 com.google.cloud.speech.v1.LongRunningRecognizeRequest request) { 403 return io.grpc.stub.ClientCalls.blockingUnaryCall( 404 getChannel(), getLongRunningRecognizeMethod(), getCallOptions(), request); 405 } 406 } 407 408 /** 409 * A stub to allow clients to do ListenableFuture-style rpc calls to service Speech. 410 * 411 * <pre> 412 * Service that implements Google Cloud Speech API. 413 * </pre> 414 */ 415 public static final class SpeechFutureStub 416 extends io.grpc.stub.AbstractFutureStub<SpeechFutureStub> { SpeechFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)417 private SpeechFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 418 super(channel, callOptions); 419 } 420 421 @java.lang.Override build(io.grpc.Channel channel, io.grpc.CallOptions callOptions)422 protected SpeechFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 423 return new SpeechFutureStub(channel, callOptions); 424 } 425 426 /** 427 * 428 * 429 * <pre> 430 * Performs synchronous speech recognition: receive results after all audio 431 * has been sent and processed. 432 * </pre> 433 */ 434 public com.google.common.util.concurrent.ListenableFuture< 435 com.google.cloud.speech.v1.RecognizeResponse> recognize(com.google.cloud.speech.v1.RecognizeRequest request)436 recognize(com.google.cloud.speech.v1.RecognizeRequest request) { 437 return io.grpc.stub.ClientCalls.futureUnaryCall( 438 getChannel().newCall(getRecognizeMethod(), getCallOptions()), request); 439 } 440 441 /** 442 * 443 * 444 * <pre> 445 * Performs asynchronous speech recognition: receive results via the 446 * google.longrunning.Operations interface. Returns either an 447 * `Operation.error` or an `Operation.response` which contains 448 * a `LongRunningRecognizeResponse` message. 449 * For more information on asynchronous speech recognition, see the 450 * [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). 451 * </pre> 452 */ 453 public com.google.common.util.concurrent.ListenableFuture<com.google.longrunning.Operation> longRunningRecognize(com.google.cloud.speech.v1.LongRunningRecognizeRequest request)454 longRunningRecognize(com.google.cloud.speech.v1.LongRunningRecognizeRequest request) { 455 return io.grpc.stub.ClientCalls.futureUnaryCall( 456 getChannel().newCall(getLongRunningRecognizeMethod(), getCallOptions()), request); 457 } 458 } 459 460 private static final int METHODID_RECOGNIZE = 0; 461 private static final int METHODID_LONG_RUNNING_RECOGNIZE = 1; 462 private static final int METHODID_STREAMING_RECOGNIZE = 2; 463 464 private static final class MethodHandlers<Req, Resp> 465 implements io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, 466 io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, 467 io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, 468 io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { 469 private final AsyncService serviceImpl; 470 private final int methodId; 471 MethodHandlers(AsyncService serviceImpl, int methodId)472 MethodHandlers(AsyncService serviceImpl, int methodId) { 473 this.serviceImpl = serviceImpl; 474 this.methodId = methodId; 475 } 476 477 @java.lang.Override 478 @java.lang.SuppressWarnings("unchecked") invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver)479 public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) { 480 switch (methodId) { 481 case METHODID_RECOGNIZE: 482 serviceImpl.recognize( 483 (com.google.cloud.speech.v1.RecognizeRequest) request, 484 (io.grpc.stub.StreamObserver<com.google.cloud.speech.v1.RecognizeResponse>) 485 responseObserver); 486 break; 487 case METHODID_LONG_RUNNING_RECOGNIZE: 488 serviceImpl.longRunningRecognize( 489 (com.google.cloud.speech.v1.LongRunningRecognizeRequest) request, 490 (io.grpc.stub.StreamObserver<com.google.longrunning.Operation>) responseObserver); 491 break; 492 default: 493 throw new AssertionError(); 494 } 495 } 496 497 @java.lang.Override 498 @java.lang.SuppressWarnings("unchecked") invoke( io.grpc.stub.StreamObserver<Resp> responseObserver)499 public io.grpc.stub.StreamObserver<Req> invoke( 500 io.grpc.stub.StreamObserver<Resp> responseObserver) { 501 switch (methodId) { 502 case METHODID_STREAMING_RECOGNIZE: 503 return (io.grpc.stub.StreamObserver<Req>) 504 serviceImpl.streamingRecognize( 505 (io.grpc.stub.StreamObserver< 506 com.google.cloud.speech.v1.StreamingRecognizeResponse>) 507 responseObserver); 508 default: 509 throw new AssertionError(); 510 } 511 } 512 } 513 bindService(AsyncService service)514 public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { 515 return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) 516 .addMethod( 517 getRecognizeMethod(), 518 io.grpc.stub.ServerCalls.asyncUnaryCall( 519 new MethodHandlers< 520 com.google.cloud.speech.v1.RecognizeRequest, 521 com.google.cloud.speech.v1.RecognizeResponse>(service, METHODID_RECOGNIZE))) 522 .addMethod( 523 getLongRunningRecognizeMethod(), 524 io.grpc.stub.ServerCalls.asyncUnaryCall( 525 new MethodHandlers< 526 com.google.cloud.speech.v1.LongRunningRecognizeRequest, 527 com.google.longrunning.Operation>(service, METHODID_LONG_RUNNING_RECOGNIZE))) 528 .addMethod( 529 getStreamingRecognizeMethod(), 530 io.grpc.stub.ServerCalls.asyncBidiStreamingCall( 531 new MethodHandlers< 532 com.google.cloud.speech.v1.StreamingRecognizeRequest, 533 com.google.cloud.speech.v1.StreamingRecognizeResponse>( 534 service, METHODID_STREAMING_RECOGNIZE))) 535 .build(); 536 } 537 538 private abstract static class SpeechBaseDescriptorSupplier 539 implements io.grpc.protobuf.ProtoFileDescriptorSupplier, 540 io.grpc.protobuf.ProtoServiceDescriptorSupplier { SpeechBaseDescriptorSupplier()541 SpeechBaseDescriptorSupplier() {} 542 543 @java.lang.Override getFileDescriptor()544 public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { 545 return com.google.cloud.speech.v1.SpeechProto.getDescriptor(); 546 } 547 548 @java.lang.Override getServiceDescriptor()549 public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { 550 return getFileDescriptor().findServiceByName("Speech"); 551 } 552 } 553 554 private static final class SpeechFileDescriptorSupplier extends SpeechBaseDescriptorSupplier { SpeechFileDescriptorSupplier()555 SpeechFileDescriptorSupplier() {} 556 } 557 558 private static final class SpeechMethodDescriptorSupplier extends SpeechBaseDescriptorSupplier 559 implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { 560 private final String methodName; 561 SpeechMethodDescriptorSupplier(String methodName)562 SpeechMethodDescriptorSupplier(String methodName) { 563 this.methodName = methodName; 564 } 565 566 @java.lang.Override getMethodDescriptor()567 public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { 568 return getServiceDescriptor().findMethodByName(methodName); 569 } 570 } 571 572 private static volatile io.grpc.ServiceDescriptor serviceDescriptor; 573 getServiceDescriptor()574 public static io.grpc.ServiceDescriptor getServiceDescriptor() { 575 io.grpc.ServiceDescriptor result = serviceDescriptor; 576 if (result == null) { 577 synchronized (SpeechGrpc.class) { 578 result = serviceDescriptor; 579 if (result == null) { 580 serviceDescriptor = 581 result = 582 io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) 583 .setSchemaDescriptor(new SpeechFileDescriptorSupplier()) 584 .addMethod(getRecognizeMethod()) 585 .addMethod(getLongRunningRecognizeMethod()) 586 .addMethod(getStreamingRecognizeMethod()) 587 .build(); 588 } 589 } 590 } 591 return result; 592 } 593 } 594