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.talent.v4; 17 18 import static io.grpc.MethodDescriptor.generateFullMethodName; 19 20 /** 21 * 22 * 23 * <pre> 24 * A service handles client event report. 25 * </pre> 26 */ 27 @javax.annotation.Generated( 28 value = "by gRPC proto compiler", 29 comments = "Source: google/cloud/talent/v4/event_service.proto") 30 @io.grpc.stub.annotations.GrpcGenerated 31 public final class EventServiceGrpc { 32 EventServiceGrpc()33 private EventServiceGrpc() {} 34 35 public static final String SERVICE_NAME = "google.cloud.talent.v4.EventService"; 36 37 // Static method descriptors that strictly reflect the proto. 38 private static volatile io.grpc.MethodDescriptor< 39 com.google.cloud.talent.v4.CreateClientEventRequest, 40 com.google.cloud.talent.v4.ClientEvent> 41 getCreateClientEventMethod; 42 43 @io.grpc.stub.annotations.RpcMethod( 44 fullMethodName = SERVICE_NAME + '/' + "CreateClientEvent", 45 requestType = com.google.cloud.talent.v4.CreateClientEventRequest.class, 46 responseType = com.google.cloud.talent.v4.ClientEvent.class, 47 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 48 public static io.grpc.MethodDescriptor< 49 com.google.cloud.talent.v4.CreateClientEventRequest, 50 com.google.cloud.talent.v4.ClientEvent> getCreateClientEventMethod()51 getCreateClientEventMethod() { 52 io.grpc.MethodDescriptor< 53 com.google.cloud.talent.v4.CreateClientEventRequest, 54 com.google.cloud.talent.v4.ClientEvent> 55 getCreateClientEventMethod; 56 if ((getCreateClientEventMethod = EventServiceGrpc.getCreateClientEventMethod) == null) { 57 synchronized (EventServiceGrpc.class) { 58 if ((getCreateClientEventMethod = EventServiceGrpc.getCreateClientEventMethod) == null) { 59 EventServiceGrpc.getCreateClientEventMethod = 60 getCreateClientEventMethod = 61 io.grpc.MethodDescriptor 62 .<com.google.cloud.talent.v4.CreateClientEventRequest, 63 com.google.cloud.talent.v4.ClientEvent> 64 newBuilder() 65 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 66 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateClientEvent")) 67 .setSampledToLocalTracing(true) 68 .setRequestMarshaller( 69 io.grpc.protobuf.ProtoUtils.marshaller( 70 com.google.cloud.talent.v4.CreateClientEventRequest 71 .getDefaultInstance())) 72 .setResponseMarshaller( 73 io.grpc.protobuf.ProtoUtils.marshaller( 74 com.google.cloud.talent.v4.ClientEvent.getDefaultInstance())) 75 .setSchemaDescriptor( 76 new EventServiceMethodDescriptorSupplier("CreateClientEvent")) 77 .build(); 78 } 79 } 80 } 81 return getCreateClientEventMethod; 82 } 83 84 /** Creates a new async stub that supports all call types for the service */ newStub(io.grpc.Channel channel)85 public static EventServiceStub newStub(io.grpc.Channel channel) { 86 io.grpc.stub.AbstractStub.StubFactory<EventServiceStub> factory = 87 new io.grpc.stub.AbstractStub.StubFactory<EventServiceStub>() { 88 @java.lang.Override 89 public EventServiceStub newStub( 90 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 91 return new EventServiceStub(channel, callOptions); 92 } 93 }; 94 return EventServiceStub.newStub(factory, channel); 95 } 96 97 /** 98 * Creates a new blocking-style stub that supports unary and streaming output calls on the service 99 */ newBlockingStub(io.grpc.Channel channel)100 public static EventServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { 101 io.grpc.stub.AbstractStub.StubFactory<EventServiceBlockingStub> factory = 102 new io.grpc.stub.AbstractStub.StubFactory<EventServiceBlockingStub>() { 103 @java.lang.Override 104 public EventServiceBlockingStub newStub( 105 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 106 return new EventServiceBlockingStub(channel, callOptions); 107 } 108 }; 109 return EventServiceBlockingStub.newStub(factory, channel); 110 } 111 112 /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ newFutureStub(io.grpc.Channel channel)113 public static EventServiceFutureStub newFutureStub(io.grpc.Channel channel) { 114 io.grpc.stub.AbstractStub.StubFactory<EventServiceFutureStub> factory = 115 new io.grpc.stub.AbstractStub.StubFactory<EventServiceFutureStub>() { 116 @java.lang.Override 117 public EventServiceFutureStub newStub( 118 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 119 return new EventServiceFutureStub(channel, callOptions); 120 } 121 }; 122 return EventServiceFutureStub.newStub(factory, channel); 123 } 124 125 /** 126 * 127 * 128 * <pre> 129 * A service handles client event report. 130 * </pre> 131 */ 132 public interface AsyncService { 133 134 /** 135 * 136 * 137 * <pre> 138 * Report events issued when end user interacts with customer's application 139 * that uses Cloud Talent Solution. You may inspect the created events in 140 * [self service 141 * tools](https://console.cloud.google.com/talent-solution/overview). 142 * [Learn 143 * more](https://cloud.google.com/talent-solution/docs/management-tools) 144 * about self service tools. 145 * </pre> 146 */ createClientEvent( com.google.cloud.talent.v4.CreateClientEventRequest request, io.grpc.stub.StreamObserver<com.google.cloud.talent.v4.ClientEvent> responseObserver)147 default void createClientEvent( 148 com.google.cloud.talent.v4.CreateClientEventRequest request, 149 io.grpc.stub.StreamObserver<com.google.cloud.talent.v4.ClientEvent> responseObserver) { 150 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 151 getCreateClientEventMethod(), responseObserver); 152 } 153 } 154 155 /** 156 * Base class for the server implementation of the service EventService. 157 * 158 * <pre> 159 * A service handles client event report. 160 * </pre> 161 */ 162 public abstract static class EventServiceImplBase 163 implements io.grpc.BindableService, AsyncService { 164 165 @java.lang.Override bindService()166 public final io.grpc.ServerServiceDefinition bindService() { 167 return EventServiceGrpc.bindService(this); 168 } 169 } 170 171 /** 172 * A stub to allow clients to do asynchronous rpc calls to service EventService. 173 * 174 * <pre> 175 * A service handles client event report. 176 * </pre> 177 */ 178 public static final class EventServiceStub 179 extends io.grpc.stub.AbstractAsyncStub<EventServiceStub> { EventServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)180 private EventServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 181 super(channel, callOptions); 182 } 183 184 @java.lang.Override build(io.grpc.Channel channel, io.grpc.CallOptions callOptions)185 protected EventServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 186 return new EventServiceStub(channel, callOptions); 187 } 188 189 /** 190 * 191 * 192 * <pre> 193 * Report events issued when end user interacts with customer's application 194 * that uses Cloud Talent Solution. You may inspect the created events in 195 * [self service 196 * tools](https://console.cloud.google.com/talent-solution/overview). 197 * [Learn 198 * more](https://cloud.google.com/talent-solution/docs/management-tools) 199 * about self service tools. 200 * </pre> 201 */ createClientEvent( com.google.cloud.talent.v4.CreateClientEventRequest request, io.grpc.stub.StreamObserver<com.google.cloud.talent.v4.ClientEvent> responseObserver)202 public void createClientEvent( 203 com.google.cloud.talent.v4.CreateClientEventRequest request, 204 io.grpc.stub.StreamObserver<com.google.cloud.talent.v4.ClientEvent> responseObserver) { 205 io.grpc.stub.ClientCalls.asyncUnaryCall( 206 getChannel().newCall(getCreateClientEventMethod(), getCallOptions()), 207 request, 208 responseObserver); 209 } 210 } 211 212 /** 213 * A stub to allow clients to do synchronous rpc calls to service EventService. 214 * 215 * <pre> 216 * A service handles client event report. 217 * </pre> 218 */ 219 public static final class EventServiceBlockingStub 220 extends io.grpc.stub.AbstractBlockingStub<EventServiceBlockingStub> { EventServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)221 private EventServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 222 super(channel, callOptions); 223 } 224 225 @java.lang.Override build( io.grpc.Channel channel, io.grpc.CallOptions callOptions)226 protected EventServiceBlockingStub build( 227 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 228 return new EventServiceBlockingStub(channel, callOptions); 229 } 230 231 /** 232 * 233 * 234 * <pre> 235 * Report events issued when end user interacts with customer's application 236 * that uses Cloud Talent Solution. You may inspect the created events in 237 * [self service 238 * tools](https://console.cloud.google.com/talent-solution/overview). 239 * [Learn 240 * more](https://cloud.google.com/talent-solution/docs/management-tools) 241 * about self service tools. 242 * </pre> 243 */ createClientEvent( com.google.cloud.talent.v4.CreateClientEventRequest request)244 public com.google.cloud.talent.v4.ClientEvent createClientEvent( 245 com.google.cloud.talent.v4.CreateClientEventRequest request) { 246 return io.grpc.stub.ClientCalls.blockingUnaryCall( 247 getChannel(), getCreateClientEventMethod(), getCallOptions(), request); 248 } 249 } 250 251 /** 252 * A stub to allow clients to do ListenableFuture-style rpc calls to service EventService. 253 * 254 * <pre> 255 * A service handles client event report. 256 * </pre> 257 */ 258 public static final class EventServiceFutureStub 259 extends io.grpc.stub.AbstractFutureStub<EventServiceFutureStub> { EventServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)260 private EventServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 261 super(channel, callOptions); 262 } 263 264 @java.lang.Override build( io.grpc.Channel channel, io.grpc.CallOptions callOptions)265 protected EventServiceFutureStub build( 266 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 267 return new EventServiceFutureStub(channel, callOptions); 268 } 269 270 /** 271 * 272 * 273 * <pre> 274 * Report events issued when end user interacts with customer's application 275 * that uses Cloud Talent Solution. You may inspect the created events in 276 * [self service 277 * tools](https://console.cloud.google.com/talent-solution/overview). 278 * [Learn 279 * more](https://cloud.google.com/talent-solution/docs/management-tools) 280 * about self service tools. 281 * </pre> 282 */ 283 public com.google.common.util.concurrent.ListenableFuture< 284 com.google.cloud.talent.v4.ClientEvent> createClientEvent(com.google.cloud.talent.v4.CreateClientEventRequest request)285 createClientEvent(com.google.cloud.talent.v4.CreateClientEventRequest request) { 286 return io.grpc.stub.ClientCalls.futureUnaryCall( 287 getChannel().newCall(getCreateClientEventMethod(), getCallOptions()), request); 288 } 289 } 290 291 private static final int METHODID_CREATE_CLIENT_EVENT = 0; 292 293 private static final class MethodHandlers<Req, Resp> 294 implements io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, 295 io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, 296 io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, 297 io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { 298 private final AsyncService serviceImpl; 299 private final int methodId; 300 MethodHandlers(AsyncService serviceImpl, int methodId)301 MethodHandlers(AsyncService serviceImpl, int methodId) { 302 this.serviceImpl = serviceImpl; 303 this.methodId = methodId; 304 } 305 306 @java.lang.Override 307 @java.lang.SuppressWarnings("unchecked") invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver)308 public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) { 309 switch (methodId) { 310 case METHODID_CREATE_CLIENT_EVENT: 311 serviceImpl.createClientEvent( 312 (com.google.cloud.talent.v4.CreateClientEventRequest) request, 313 (io.grpc.stub.StreamObserver<com.google.cloud.talent.v4.ClientEvent>) 314 responseObserver); 315 break; 316 default: 317 throw new AssertionError(); 318 } 319 } 320 321 @java.lang.Override 322 @java.lang.SuppressWarnings("unchecked") invoke( io.grpc.stub.StreamObserver<Resp> responseObserver)323 public io.grpc.stub.StreamObserver<Req> invoke( 324 io.grpc.stub.StreamObserver<Resp> responseObserver) { 325 switch (methodId) { 326 default: 327 throw new AssertionError(); 328 } 329 } 330 } 331 bindService(AsyncService service)332 public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { 333 return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) 334 .addMethod( 335 getCreateClientEventMethod(), 336 io.grpc.stub.ServerCalls.asyncUnaryCall( 337 new MethodHandlers< 338 com.google.cloud.talent.v4.CreateClientEventRequest, 339 com.google.cloud.talent.v4.ClientEvent>(service, METHODID_CREATE_CLIENT_EVENT))) 340 .build(); 341 } 342 343 private abstract static class EventServiceBaseDescriptorSupplier 344 implements io.grpc.protobuf.ProtoFileDescriptorSupplier, 345 io.grpc.protobuf.ProtoServiceDescriptorSupplier { EventServiceBaseDescriptorSupplier()346 EventServiceBaseDescriptorSupplier() {} 347 348 @java.lang.Override getFileDescriptor()349 public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { 350 return com.google.cloud.talent.v4.EventServiceProto.getDescriptor(); 351 } 352 353 @java.lang.Override getServiceDescriptor()354 public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { 355 return getFileDescriptor().findServiceByName("EventService"); 356 } 357 } 358 359 private static final class EventServiceFileDescriptorSupplier 360 extends EventServiceBaseDescriptorSupplier { EventServiceFileDescriptorSupplier()361 EventServiceFileDescriptorSupplier() {} 362 } 363 364 private static final class EventServiceMethodDescriptorSupplier 365 extends EventServiceBaseDescriptorSupplier 366 implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { 367 private final String methodName; 368 EventServiceMethodDescriptorSupplier(String methodName)369 EventServiceMethodDescriptorSupplier(String methodName) { 370 this.methodName = methodName; 371 } 372 373 @java.lang.Override getMethodDescriptor()374 public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { 375 return getServiceDescriptor().findMethodByName(methodName); 376 } 377 } 378 379 private static volatile io.grpc.ServiceDescriptor serviceDescriptor; 380 getServiceDescriptor()381 public static io.grpc.ServiceDescriptor getServiceDescriptor() { 382 io.grpc.ServiceDescriptor result = serviceDescriptor; 383 if (result == null) { 384 synchronized (EventServiceGrpc.class) { 385 result = serviceDescriptor; 386 if (result == null) { 387 serviceDescriptor = 388 result = 389 io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) 390 .setSchemaDescriptor(new EventServiceFileDescriptorSupplier()) 391 .addMethod(getCreateClientEventMethod()) 392 .build(); 393 } 394 } 395 } 396 return result; 397 } 398 } 399