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 [Fulfillments][google.cloud.dialogflow.v2.Fulfillment]. 25 * </pre> 26 */ 27 @javax.annotation.Generated( 28 value = "by gRPC proto compiler", 29 comments = "Source: google/cloud/dialogflow/v2/fulfillment.proto") 30 @io.grpc.stub.annotations.GrpcGenerated 31 public final class FulfillmentsGrpc { 32 FulfillmentsGrpc()33 private FulfillmentsGrpc() {} 34 35 public static final String SERVICE_NAME = "google.cloud.dialogflow.v2.Fulfillments"; 36 37 // Static method descriptors that strictly reflect the proto. 38 private static volatile io.grpc.MethodDescriptor< 39 com.google.cloud.dialogflow.v2.GetFulfillmentRequest, 40 com.google.cloud.dialogflow.v2.Fulfillment> 41 getGetFulfillmentMethod; 42 43 @io.grpc.stub.annotations.RpcMethod( 44 fullMethodName = SERVICE_NAME + '/' + "GetFulfillment", 45 requestType = com.google.cloud.dialogflow.v2.GetFulfillmentRequest.class, 46 responseType = com.google.cloud.dialogflow.v2.Fulfillment.class, 47 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 48 public static io.grpc.MethodDescriptor< 49 com.google.cloud.dialogflow.v2.GetFulfillmentRequest, 50 com.google.cloud.dialogflow.v2.Fulfillment> getGetFulfillmentMethod()51 getGetFulfillmentMethod() { 52 io.grpc.MethodDescriptor< 53 com.google.cloud.dialogflow.v2.GetFulfillmentRequest, 54 com.google.cloud.dialogflow.v2.Fulfillment> 55 getGetFulfillmentMethod; 56 if ((getGetFulfillmentMethod = FulfillmentsGrpc.getGetFulfillmentMethod) == null) { 57 synchronized (FulfillmentsGrpc.class) { 58 if ((getGetFulfillmentMethod = FulfillmentsGrpc.getGetFulfillmentMethod) == null) { 59 FulfillmentsGrpc.getGetFulfillmentMethod = 60 getGetFulfillmentMethod = 61 io.grpc.MethodDescriptor 62 .<com.google.cloud.dialogflow.v2.GetFulfillmentRequest, 63 com.google.cloud.dialogflow.v2.Fulfillment> 64 newBuilder() 65 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 66 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetFulfillment")) 67 .setSampledToLocalTracing(true) 68 .setRequestMarshaller( 69 io.grpc.protobuf.ProtoUtils.marshaller( 70 com.google.cloud.dialogflow.v2.GetFulfillmentRequest 71 .getDefaultInstance())) 72 .setResponseMarshaller( 73 io.grpc.protobuf.ProtoUtils.marshaller( 74 com.google.cloud.dialogflow.v2.Fulfillment.getDefaultInstance())) 75 .setSchemaDescriptor( 76 new FulfillmentsMethodDescriptorSupplier("GetFulfillment")) 77 .build(); 78 } 79 } 80 } 81 return getGetFulfillmentMethod; 82 } 83 84 private static volatile io.grpc.MethodDescriptor< 85 com.google.cloud.dialogflow.v2.UpdateFulfillmentRequest, 86 com.google.cloud.dialogflow.v2.Fulfillment> 87 getUpdateFulfillmentMethod; 88 89 @io.grpc.stub.annotations.RpcMethod( 90 fullMethodName = SERVICE_NAME + '/' + "UpdateFulfillment", 91 requestType = com.google.cloud.dialogflow.v2.UpdateFulfillmentRequest.class, 92 responseType = com.google.cloud.dialogflow.v2.Fulfillment.class, 93 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 94 public static io.grpc.MethodDescriptor< 95 com.google.cloud.dialogflow.v2.UpdateFulfillmentRequest, 96 com.google.cloud.dialogflow.v2.Fulfillment> getUpdateFulfillmentMethod()97 getUpdateFulfillmentMethod() { 98 io.grpc.MethodDescriptor< 99 com.google.cloud.dialogflow.v2.UpdateFulfillmentRequest, 100 com.google.cloud.dialogflow.v2.Fulfillment> 101 getUpdateFulfillmentMethod; 102 if ((getUpdateFulfillmentMethod = FulfillmentsGrpc.getUpdateFulfillmentMethod) == null) { 103 synchronized (FulfillmentsGrpc.class) { 104 if ((getUpdateFulfillmentMethod = FulfillmentsGrpc.getUpdateFulfillmentMethod) == null) { 105 FulfillmentsGrpc.getUpdateFulfillmentMethod = 106 getUpdateFulfillmentMethod = 107 io.grpc.MethodDescriptor 108 .<com.google.cloud.dialogflow.v2.UpdateFulfillmentRequest, 109 com.google.cloud.dialogflow.v2.Fulfillment> 110 newBuilder() 111 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 112 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateFulfillment")) 113 .setSampledToLocalTracing(true) 114 .setRequestMarshaller( 115 io.grpc.protobuf.ProtoUtils.marshaller( 116 com.google.cloud.dialogflow.v2.UpdateFulfillmentRequest 117 .getDefaultInstance())) 118 .setResponseMarshaller( 119 io.grpc.protobuf.ProtoUtils.marshaller( 120 com.google.cloud.dialogflow.v2.Fulfillment.getDefaultInstance())) 121 .setSchemaDescriptor( 122 new FulfillmentsMethodDescriptorSupplier("UpdateFulfillment")) 123 .build(); 124 } 125 } 126 } 127 return getUpdateFulfillmentMethod; 128 } 129 130 /** Creates a new async stub that supports all call types for the service */ newStub(io.grpc.Channel channel)131 public static FulfillmentsStub newStub(io.grpc.Channel channel) { 132 io.grpc.stub.AbstractStub.StubFactory<FulfillmentsStub> factory = 133 new io.grpc.stub.AbstractStub.StubFactory<FulfillmentsStub>() { 134 @java.lang.Override 135 public FulfillmentsStub newStub( 136 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 137 return new FulfillmentsStub(channel, callOptions); 138 } 139 }; 140 return FulfillmentsStub.newStub(factory, channel); 141 } 142 143 /** 144 * Creates a new blocking-style stub that supports unary and streaming output calls on the service 145 */ newBlockingStub(io.grpc.Channel channel)146 public static FulfillmentsBlockingStub newBlockingStub(io.grpc.Channel channel) { 147 io.grpc.stub.AbstractStub.StubFactory<FulfillmentsBlockingStub> factory = 148 new io.grpc.stub.AbstractStub.StubFactory<FulfillmentsBlockingStub>() { 149 @java.lang.Override 150 public FulfillmentsBlockingStub newStub( 151 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 152 return new FulfillmentsBlockingStub(channel, callOptions); 153 } 154 }; 155 return FulfillmentsBlockingStub.newStub(factory, channel); 156 } 157 158 /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ newFutureStub(io.grpc.Channel channel)159 public static FulfillmentsFutureStub newFutureStub(io.grpc.Channel channel) { 160 io.grpc.stub.AbstractStub.StubFactory<FulfillmentsFutureStub> factory = 161 new io.grpc.stub.AbstractStub.StubFactory<FulfillmentsFutureStub>() { 162 @java.lang.Override 163 public FulfillmentsFutureStub newStub( 164 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 165 return new FulfillmentsFutureStub(channel, callOptions); 166 } 167 }; 168 return FulfillmentsFutureStub.newStub(factory, channel); 169 } 170 171 /** 172 * 173 * 174 * <pre> 175 * Service for managing [Fulfillments][google.cloud.dialogflow.v2.Fulfillment]. 176 * </pre> 177 */ 178 public interface AsyncService { 179 180 /** 181 * 182 * 183 * <pre> 184 * Retrieves the fulfillment. 185 * </pre> 186 */ getFulfillment( com.google.cloud.dialogflow.v2.GetFulfillmentRequest request, io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Fulfillment> responseObserver)187 default void getFulfillment( 188 com.google.cloud.dialogflow.v2.GetFulfillmentRequest request, 189 io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Fulfillment> responseObserver) { 190 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 191 getGetFulfillmentMethod(), responseObserver); 192 } 193 194 /** 195 * 196 * 197 * <pre> 198 * Updates the fulfillment. 199 * </pre> 200 */ updateFulfillment( com.google.cloud.dialogflow.v2.UpdateFulfillmentRequest request, io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Fulfillment> responseObserver)201 default void updateFulfillment( 202 com.google.cloud.dialogflow.v2.UpdateFulfillmentRequest request, 203 io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Fulfillment> responseObserver) { 204 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 205 getUpdateFulfillmentMethod(), responseObserver); 206 } 207 } 208 209 /** 210 * Base class for the server implementation of the service Fulfillments. 211 * 212 * <pre> 213 * Service for managing [Fulfillments][google.cloud.dialogflow.v2.Fulfillment]. 214 * </pre> 215 */ 216 public abstract static class FulfillmentsImplBase 217 implements io.grpc.BindableService, AsyncService { 218 219 @java.lang.Override bindService()220 public final io.grpc.ServerServiceDefinition bindService() { 221 return FulfillmentsGrpc.bindService(this); 222 } 223 } 224 225 /** 226 * A stub to allow clients to do asynchronous rpc calls to service Fulfillments. 227 * 228 * <pre> 229 * Service for managing [Fulfillments][google.cloud.dialogflow.v2.Fulfillment]. 230 * </pre> 231 */ 232 public static final class FulfillmentsStub 233 extends io.grpc.stub.AbstractAsyncStub<FulfillmentsStub> { FulfillmentsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)234 private FulfillmentsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 235 super(channel, callOptions); 236 } 237 238 @java.lang.Override build(io.grpc.Channel channel, io.grpc.CallOptions callOptions)239 protected FulfillmentsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 240 return new FulfillmentsStub(channel, callOptions); 241 } 242 243 /** 244 * 245 * 246 * <pre> 247 * Retrieves the fulfillment. 248 * </pre> 249 */ getFulfillment( com.google.cloud.dialogflow.v2.GetFulfillmentRequest request, io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Fulfillment> responseObserver)250 public void getFulfillment( 251 com.google.cloud.dialogflow.v2.GetFulfillmentRequest request, 252 io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Fulfillment> responseObserver) { 253 io.grpc.stub.ClientCalls.asyncUnaryCall( 254 getChannel().newCall(getGetFulfillmentMethod(), getCallOptions()), 255 request, 256 responseObserver); 257 } 258 259 /** 260 * 261 * 262 * <pre> 263 * Updates the fulfillment. 264 * </pre> 265 */ updateFulfillment( com.google.cloud.dialogflow.v2.UpdateFulfillmentRequest request, io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Fulfillment> responseObserver)266 public void updateFulfillment( 267 com.google.cloud.dialogflow.v2.UpdateFulfillmentRequest request, 268 io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Fulfillment> responseObserver) { 269 io.grpc.stub.ClientCalls.asyncUnaryCall( 270 getChannel().newCall(getUpdateFulfillmentMethod(), getCallOptions()), 271 request, 272 responseObserver); 273 } 274 } 275 276 /** 277 * A stub to allow clients to do synchronous rpc calls to service Fulfillments. 278 * 279 * <pre> 280 * Service for managing [Fulfillments][google.cloud.dialogflow.v2.Fulfillment]. 281 * </pre> 282 */ 283 public static final class FulfillmentsBlockingStub 284 extends io.grpc.stub.AbstractBlockingStub<FulfillmentsBlockingStub> { FulfillmentsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)285 private FulfillmentsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 286 super(channel, callOptions); 287 } 288 289 @java.lang.Override build( io.grpc.Channel channel, io.grpc.CallOptions callOptions)290 protected FulfillmentsBlockingStub build( 291 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 292 return new FulfillmentsBlockingStub(channel, callOptions); 293 } 294 295 /** 296 * 297 * 298 * <pre> 299 * Retrieves the fulfillment. 300 * </pre> 301 */ getFulfillment( com.google.cloud.dialogflow.v2.GetFulfillmentRequest request)302 public com.google.cloud.dialogflow.v2.Fulfillment getFulfillment( 303 com.google.cloud.dialogflow.v2.GetFulfillmentRequest request) { 304 return io.grpc.stub.ClientCalls.blockingUnaryCall( 305 getChannel(), getGetFulfillmentMethod(), getCallOptions(), request); 306 } 307 308 /** 309 * 310 * 311 * <pre> 312 * Updates the fulfillment. 313 * </pre> 314 */ updateFulfillment( com.google.cloud.dialogflow.v2.UpdateFulfillmentRequest request)315 public com.google.cloud.dialogflow.v2.Fulfillment updateFulfillment( 316 com.google.cloud.dialogflow.v2.UpdateFulfillmentRequest request) { 317 return io.grpc.stub.ClientCalls.blockingUnaryCall( 318 getChannel(), getUpdateFulfillmentMethod(), getCallOptions(), request); 319 } 320 } 321 322 /** 323 * A stub to allow clients to do ListenableFuture-style rpc calls to service Fulfillments. 324 * 325 * <pre> 326 * Service for managing [Fulfillments][google.cloud.dialogflow.v2.Fulfillment]. 327 * </pre> 328 */ 329 public static final class FulfillmentsFutureStub 330 extends io.grpc.stub.AbstractFutureStub<FulfillmentsFutureStub> { FulfillmentsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)331 private FulfillmentsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 332 super(channel, callOptions); 333 } 334 335 @java.lang.Override build( io.grpc.Channel channel, io.grpc.CallOptions callOptions)336 protected FulfillmentsFutureStub build( 337 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 338 return new FulfillmentsFutureStub(channel, callOptions); 339 } 340 341 /** 342 * 343 * 344 * <pre> 345 * Retrieves the fulfillment. 346 * </pre> 347 */ 348 public com.google.common.util.concurrent.ListenableFuture< 349 com.google.cloud.dialogflow.v2.Fulfillment> getFulfillment(com.google.cloud.dialogflow.v2.GetFulfillmentRequest request)350 getFulfillment(com.google.cloud.dialogflow.v2.GetFulfillmentRequest request) { 351 return io.grpc.stub.ClientCalls.futureUnaryCall( 352 getChannel().newCall(getGetFulfillmentMethod(), getCallOptions()), request); 353 } 354 355 /** 356 * 357 * 358 * <pre> 359 * Updates the fulfillment. 360 * </pre> 361 */ 362 public com.google.common.util.concurrent.ListenableFuture< 363 com.google.cloud.dialogflow.v2.Fulfillment> updateFulfillment(com.google.cloud.dialogflow.v2.UpdateFulfillmentRequest request)364 updateFulfillment(com.google.cloud.dialogflow.v2.UpdateFulfillmentRequest request) { 365 return io.grpc.stub.ClientCalls.futureUnaryCall( 366 getChannel().newCall(getUpdateFulfillmentMethod(), getCallOptions()), request); 367 } 368 } 369 370 private static final int METHODID_GET_FULFILLMENT = 0; 371 private static final int METHODID_UPDATE_FULFILLMENT = 1; 372 373 private static final class MethodHandlers<Req, Resp> 374 implements io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, 375 io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, 376 io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, 377 io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { 378 private final AsyncService serviceImpl; 379 private final int methodId; 380 MethodHandlers(AsyncService serviceImpl, int methodId)381 MethodHandlers(AsyncService serviceImpl, int methodId) { 382 this.serviceImpl = serviceImpl; 383 this.methodId = methodId; 384 } 385 386 @java.lang.Override 387 @java.lang.SuppressWarnings("unchecked") invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver)388 public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) { 389 switch (methodId) { 390 case METHODID_GET_FULFILLMENT: 391 serviceImpl.getFulfillment( 392 (com.google.cloud.dialogflow.v2.GetFulfillmentRequest) request, 393 (io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Fulfillment>) 394 responseObserver); 395 break; 396 case METHODID_UPDATE_FULFILLMENT: 397 serviceImpl.updateFulfillment( 398 (com.google.cloud.dialogflow.v2.UpdateFulfillmentRequest) request, 399 (io.grpc.stub.StreamObserver<com.google.cloud.dialogflow.v2.Fulfillment>) 400 responseObserver); 401 break; 402 default: 403 throw new AssertionError(); 404 } 405 } 406 407 @java.lang.Override 408 @java.lang.SuppressWarnings("unchecked") invoke( io.grpc.stub.StreamObserver<Resp> responseObserver)409 public io.grpc.stub.StreamObserver<Req> invoke( 410 io.grpc.stub.StreamObserver<Resp> responseObserver) { 411 switch (methodId) { 412 default: 413 throw new AssertionError(); 414 } 415 } 416 } 417 bindService(AsyncService service)418 public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { 419 return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) 420 .addMethod( 421 getGetFulfillmentMethod(), 422 io.grpc.stub.ServerCalls.asyncUnaryCall( 423 new MethodHandlers< 424 com.google.cloud.dialogflow.v2.GetFulfillmentRequest, 425 com.google.cloud.dialogflow.v2.Fulfillment>(service, METHODID_GET_FULFILLMENT))) 426 .addMethod( 427 getUpdateFulfillmentMethod(), 428 io.grpc.stub.ServerCalls.asyncUnaryCall( 429 new MethodHandlers< 430 com.google.cloud.dialogflow.v2.UpdateFulfillmentRequest, 431 com.google.cloud.dialogflow.v2.Fulfillment>( 432 service, METHODID_UPDATE_FULFILLMENT))) 433 .build(); 434 } 435 436 private abstract static class FulfillmentsBaseDescriptorSupplier 437 implements io.grpc.protobuf.ProtoFileDescriptorSupplier, 438 io.grpc.protobuf.ProtoServiceDescriptorSupplier { FulfillmentsBaseDescriptorSupplier()439 FulfillmentsBaseDescriptorSupplier() {} 440 441 @java.lang.Override getFileDescriptor()442 public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { 443 return com.google.cloud.dialogflow.v2.FulfillmentProto.getDescriptor(); 444 } 445 446 @java.lang.Override getServiceDescriptor()447 public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { 448 return getFileDescriptor().findServiceByName("Fulfillments"); 449 } 450 } 451 452 private static final class FulfillmentsFileDescriptorSupplier 453 extends FulfillmentsBaseDescriptorSupplier { FulfillmentsFileDescriptorSupplier()454 FulfillmentsFileDescriptorSupplier() {} 455 } 456 457 private static final class FulfillmentsMethodDescriptorSupplier 458 extends FulfillmentsBaseDescriptorSupplier 459 implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { 460 private final String methodName; 461 FulfillmentsMethodDescriptorSupplier(String methodName)462 FulfillmentsMethodDescriptorSupplier(String methodName) { 463 this.methodName = methodName; 464 } 465 466 @java.lang.Override getMethodDescriptor()467 public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { 468 return getServiceDescriptor().findMethodByName(methodName); 469 } 470 } 471 472 private static volatile io.grpc.ServiceDescriptor serviceDescriptor; 473 getServiceDescriptor()474 public static io.grpc.ServiceDescriptor getServiceDescriptor() { 475 io.grpc.ServiceDescriptor result = serviceDescriptor; 476 if (result == null) { 477 synchronized (FulfillmentsGrpc.class) { 478 result = serviceDescriptor; 479 if (result == null) { 480 serviceDescriptor = 481 result = 482 io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) 483 .setSchemaDescriptor(new FulfillmentsFileDescriptorSupplier()) 484 .addMethod(getGetFulfillmentMethod()) 485 .addMethod(getUpdateFulfillmentMethod()) 486 .build(); 487 } 488 } 489 } 490 return result; 491 } 492 } 493