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.retail.v2; 17 18 import static io.grpc.MethodDescriptor.generateFullMethodName; 19 20 /** 21 * 22 * 23 * <pre> 24 * Service for ingesting end user actions on the customer website. 25 * </pre> 26 */ 27 @javax.annotation.Generated( 28 value = "by gRPC proto compiler", 29 comments = "Source: google/cloud/retail/v2/user_event_service.proto") 30 @io.grpc.stub.annotations.GrpcGenerated 31 public final class UserEventServiceGrpc { 32 UserEventServiceGrpc()33 private UserEventServiceGrpc() {} 34 35 public static final String SERVICE_NAME = "google.cloud.retail.v2.UserEventService"; 36 37 // Static method descriptors that strictly reflect the proto. 38 private static volatile io.grpc.MethodDescriptor< 39 com.google.cloud.retail.v2.WriteUserEventRequest, com.google.cloud.retail.v2.UserEvent> 40 getWriteUserEventMethod; 41 42 @io.grpc.stub.annotations.RpcMethod( 43 fullMethodName = SERVICE_NAME + '/' + "WriteUserEvent", 44 requestType = com.google.cloud.retail.v2.WriteUserEventRequest.class, 45 responseType = com.google.cloud.retail.v2.UserEvent.class, 46 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 47 public static io.grpc.MethodDescriptor< 48 com.google.cloud.retail.v2.WriteUserEventRequest, com.google.cloud.retail.v2.UserEvent> getWriteUserEventMethod()49 getWriteUserEventMethod() { 50 io.grpc.MethodDescriptor< 51 com.google.cloud.retail.v2.WriteUserEventRequest, com.google.cloud.retail.v2.UserEvent> 52 getWriteUserEventMethod; 53 if ((getWriteUserEventMethod = UserEventServiceGrpc.getWriteUserEventMethod) == null) { 54 synchronized (UserEventServiceGrpc.class) { 55 if ((getWriteUserEventMethod = UserEventServiceGrpc.getWriteUserEventMethod) == null) { 56 UserEventServiceGrpc.getWriteUserEventMethod = 57 getWriteUserEventMethod = 58 io.grpc.MethodDescriptor 59 .<com.google.cloud.retail.v2.WriteUserEventRequest, 60 com.google.cloud.retail.v2.UserEvent> 61 newBuilder() 62 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 63 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "WriteUserEvent")) 64 .setSampledToLocalTracing(true) 65 .setRequestMarshaller( 66 io.grpc.protobuf.ProtoUtils.marshaller( 67 com.google.cloud.retail.v2.WriteUserEventRequest 68 .getDefaultInstance())) 69 .setResponseMarshaller( 70 io.grpc.protobuf.ProtoUtils.marshaller( 71 com.google.cloud.retail.v2.UserEvent.getDefaultInstance())) 72 .setSchemaDescriptor( 73 new UserEventServiceMethodDescriptorSupplier("WriteUserEvent")) 74 .build(); 75 } 76 } 77 } 78 return getWriteUserEventMethod; 79 } 80 81 private static volatile io.grpc.MethodDescriptor< 82 com.google.cloud.retail.v2.CollectUserEventRequest, com.google.api.HttpBody> 83 getCollectUserEventMethod; 84 85 @io.grpc.stub.annotations.RpcMethod( 86 fullMethodName = SERVICE_NAME + '/' + "CollectUserEvent", 87 requestType = com.google.cloud.retail.v2.CollectUserEventRequest.class, 88 responseType = com.google.api.HttpBody.class, 89 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 90 public static io.grpc.MethodDescriptor< 91 com.google.cloud.retail.v2.CollectUserEventRequest, com.google.api.HttpBody> getCollectUserEventMethod()92 getCollectUserEventMethod() { 93 io.grpc.MethodDescriptor< 94 com.google.cloud.retail.v2.CollectUserEventRequest, com.google.api.HttpBody> 95 getCollectUserEventMethod; 96 if ((getCollectUserEventMethod = UserEventServiceGrpc.getCollectUserEventMethod) == null) { 97 synchronized (UserEventServiceGrpc.class) { 98 if ((getCollectUserEventMethod = UserEventServiceGrpc.getCollectUserEventMethod) == null) { 99 UserEventServiceGrpc.getCollectUserEventMethod = 100 getCollectUserEventMethod = 101 io.grpc.MethodDescriptor 102 .<com.google.cloud.retail.v2.CollectUserEventRequest, com.google.api.HttpBody> 103 newBuilder() 104 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 105 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CollectUserEvent")) 106 .setSampledToLocalTracing(true) 107 .setRequestMarshaller( 108 io.grpc.protobuf.ProtoUtils.marshaller( 109 com.google.cloud.retail.v2.CollectUserEventRequest 110 .getDefaultInstance())) 111 .setResponseMarshaller( 112 io.grpc.protobuf.ProtoUtils.marshaller( 113 com.google.api.HttpBody.getDefaultInstance())) 114 .setSchemaDescriptor( 115 new UserEventServiceMethodDescriptorSupplier("CollectUserEvent")) 116 .build(); 117 } 118 } 119 } 120 return getCollectUserEventMethod; 121 } 122 123 private static volatile io.grpc.MethodDescriptor< 124 com.google.cloud.retail.v2.PurgeUserEventsRequest, com.google.longrunning.Operation> 125 getPurgeUserEventsMethod; 126 127 @io.grpc.stub.annotations.RpcMethod( 128 fullMethodName = SERVICE_NAME + '/' + "PurgeUserEvents", 129 requestType = com.google.cloud.retail.v2.PurgeUserEventsRequest.class, 130 responseType = com.google.longrunning.Operation.class, 131 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 132 public static io.grpc.MethodDescriptor< 133 com.google.cloud.retail.v2.PurgeUserEventsRequest, com.google.longrunning.Operation> getPurgeUserEventsMethod()134 getPurgeUserEventsMethod() { 135 io.grpc.MethodDescriptor< 136 com.google.cloud.retail.v2.PurgeUserEventsRequest, com.google.longrunning.Operation> 137 getPurgeUserEventsMethod; 138 if ((getPurgeUserEventsMethod = UserEventServiceGrpc.getPurgeUserEventsMethod) == null) { 139 synchronized (UserEventServiceGrpc.class) { 140 if ((getPurgeUserEventsMethod = UserEventServiceGrpc.getPurgeUserEventsMethod) == null) { 141 UserEventServiceGrpc.getPurgeUserEventsMethod = 142 getPurgeUserEventsMethod = 143 io.grpc.MethodDescriptor 144 .<com.google.cloud.retail.v2.PurgeUserEventsRequest, 145 com.google.longrunning.Operation> 146 newBuilder() 147 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 148 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PurgeUserEvents")) 149 .setSampledToLocalTracing(true) 150 .setRequestMarshaller( 151 io.grpc.protobuf.ProtoUtils.marshaller( 152 com.google.cloud.retail.v2.PurgeUserEventsRequest 153 .getDefaultInstance())) 154 .setResponseMarshaller( 155 io.grpc.protobuf.ProtoUtils.marshaller( 156 com.google.longrunning.Operation.getDefaultInstance())) 157 .setSchemaDescriptor( 158 new UserEventServiceMethodDescriptorSupplier("PurgeUserEvents")) 159 .build(); 160 } 161 } 162 } 163 return getPurgeUserEventsMethod; 164 } 165 166 private static volatile io.grpc.MethodDescriptor< 167 com.google.cloud.retail.v2.ImportUserEventsRequest, com.google.longrunning.Operation> 168 getImportUserEventsMethod; 169 170 @io.grpc.stub.annotations.RpcMethod( 171 fullMethodName = SERVICE_NAME + '/' + "ImportUserEvents", 172 requestType = com.google.cloud.retail.v2.ImportUserEventsRequest.class, 173 responseType = com.google.longrunning.Operation.class, 174 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 175 public static io.grpc.MethodDescriptor< 176 com.google.cloud.retail.v2.ImportUserEventsRequest, com.google.longrunning.Operation> getImportUserEventsMethod()177 getImportUserEventsMethod() { 178 io.grpc.MethodDescriptor< 179 com.google.cloud.retail.v2.ImportUserEventsRequest, com.google.longrunning.Operation> 180 getImportUserEventsMethod; 181 if ((getImportUserEventsMethod = UserEventServiceGrpc.getImportUserEventsMethod) == null) { 182 synchronized (UserEventServiceGrpc.class) { 183 if ((getImportUserEventsMethod = UserEventServiceGrpc.getImportUserEventsMethod) == null) { 184 UserEventServiceGrpc.getImportUserEventsMethod = 185 getImportUserEventsMethod = 186 io.grpc.MethodDescriptor 187 .<com.google.cloud.retail.v2.ImportUserEventsRequest, 188 com.google.longrunning.Operation> 189 newBuilder() 190 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 191 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ImportUserEvents")) 192 .setSampledToLocalTracing(true) 193 .setRequestMarshaller( 194 io.grpc.protobuf.ProtoUtils.marshaller( 195 com.google.cloud.retail.v2.ImportUserEventsRequest 196 .getDefaultInstance())) 197 .setResponseMarshaller( 198 io.grpc.protobuf.ProtoUtils.marshaller( 199 com.google.longrunning.Operation.getDefaultInstance())) 200 .setSchemaDescriptor( 201 new UserEventServiceMethodDescriptorSupplier("ImportUserEvents")) 202 .build(); 203 } 204 } 205 } 206 return getImportUserEventsMethod; 207 } 208 209 private static volatile io.grpc.MethodDescriptor< 210 com.google.cloud.retail.v2.RejoinUserEventsRequest, com.google.longrunning.Operation> 211 getRejoinUserEventsMethod; 212 213 @io.grpc.stub.annotations.RpcMethod( 214 fullMethodName = SERVICE_NAME + '/' + "RejoinUserEvents", 215 requestType = com.google.cloud.retail.v2.RejoinUserEventsRequest.class, 216 responseType = com.google.longrunning.Operation.class, 217 methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 218 public static io.grpc.MethodDescriptor< 219 com.google.cloud.retail.v2.RejoinUserEventsRequest, com.google.longrunning.Operation> getRejoinUserEventsMethod()220 getRejoinUserEventsMethod() { 221 io.grpc.MethodDescriptor< 222 com.google.cloud.retail.v2.RejoinUserEventsRequest, com.google.longrunning.Operation> 223 getRejoinUserEventsMethod; 224 if ((getRejoinUserEventsMethod = UserEventServiceGrpc.getRejoinUserEventsMethod) == null) { 225 synchronized (UserEventServiceGrpc.class) { 226 if ((getRejoinUserEventsMethod = UserEventServiceGrpc.getRejoinUserEventsMethod) == null) { 227 UserEventServiceGrpc.getRejoinUserEventsMethod = 228 getRejoinUserEventsMethod = 229 io.grpc.MethodDescriptor 230 .<com.google.cloud.retail.v2.RejoinUserEventsRequest, 231 com.google.longrunning.Operation> 232 newBuilder() 233 .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 234 .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RejoinUserEvents")) 235 .setSampledToLocalTracing(true) 236 .setRequestMarshaller( 237 io.grpc.protobuf.ProtoUtils.marshaller( 238 com.google.cloud.retail.v2.RejoinUserEventsRequest 239 .getDefaultInstance())) 240 .setResponseMarshaller( 241 io.grpc.protobuf.ProtoUtils.marshaller( 242 com.google.longrunning.Operation.getDefaultInstance())) 243 .setSchemaDescriptor( 244 new UserEventServiceMethodDescriptorSupplier("RejoinUserEvents")) 245 .build(); 246 } 247 } 248 } 249 return getRejoinUserEventsMethod; 250 } 251 252 /** Creates a new async stub that supports all call types for the service */ newStub(io.grpc.Channel channel)253 public static UserEventServiceStub newStub(io.grpc.Channel channel) { 254 io.grpc.stub.AbstractStub.StubFactory<UserEventServiceStub> factory = 255 new io.grpc.stub.AbstractStub.StubFactory<UserEventServiceStub>() { 256 @java.lang.Override 257 public UserEventServiceStub newStub( 258 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 259 return new UserEventServiceStub(channel, callOptions); 260 } 261 }; 262 return UserEventServiceStub.newStub(factory, channel); 263 } 264 265 /** 266 * Creates a new blocking-style stub that supports unary and streaming output calls on the service 267 */ newBlockingStub(io.grpc.Channel channel)268 public static UserEventServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { 269 io.grpc.stub.AbstractStub.StubFactory<UserEventServiceBlockingStub> factory = 270 new io.grpc.stub.AbstractStub.StubFactory<UserEventServiceBlockingStub>() { 271 @java.lang.Override 272 public UserEventServiceBlockingStub newStub( 273 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 274 return new UserEventServiceBlockingStub(channel, callOptions); 275 } 276 }; 277 return UserEventServiceBlockingStub.newStub(factory, channel); 278 } 279 280 /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ newFutureStub(io.grpc.Channel channel)281 public static UserEventServiceFutureStub newFutureStub(io.grpc.Channel channel) { 282 io.grpc.stub.AbstractStub.StubFactory<UserEventServiceFutureStub> factory = 283 new io.grpc.stub.AbstractStub.StubFactory<UserEventServiceFutureStub>() { 284 @java.lang.Override 285 public UserEventServiceFutureStub newStub( 286 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 287 return new UserEventServiceFutureStub(channel, callOptions); 288 } 289 }; 290 return UserEventServiceFutureStub.newStub(factory, channel); 291 } 292 293 /** 294 * 295 * 296 * <pre> 297 * Service for ingesting end user actions on the customer website. 298 * </pre> 299 */ 300 public interface AsyncService { 301 302 /** 303 * 304 * 305 * <pre> 306 * Writes a single user event. 307 * </pre> 308 */ writeUserEvent( com.google.cloud.retail.v2.WriteUserEventRequest request, io.grpc.stub.StreamObserver<com.google.cloud.retail.v2.UserEvent> responseObserver)309 default void writeUserEvent( 310 com.google.cloud.retail.v2.WriteUserEventRequest request, 311 io.grpc.stub.StreamObserver<com.google.cloud.retail.v2.UserEvent> responseObserver) { 312 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 313 getWriteUserEventMethod(), responseObserver); 314 } 315 316 /** 317 * 318 * 319 * <pre> 320 * Writes a single user event from the browser. This uses a GET request to 321 * due to browser restriction of POST-ing to a 3rd party domain. 322 * This method is used only by the Retail API JavaScript pixel and Google Tag 323 * Manager. Users should not call this method directly. 324 * </pre> 325 */ collectUserEvent( com.google.cloud.retail.v2.CollectUserEventRequest request, io.grpc.stub.StreamObserver<com.google.api.HttpBody> responseObserver)326 default void collectUserEvent( 327 com.google.cloud.retail.v2.CollectUserEventRequest request, 328 io.grpc.stub.StreamObserver<com.google.api.HttpBody> responseObserver) { 329 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 330 getCollectUserEventMethod(), responseObserver); 331 } 332 333 /** 334 * 335 * 336 * <pre> 337 * Deletes permanently all user events specified by the filter provided. 338 * Depending on the number of events specified by the filter, this operation 339 * could take hours or days to complete. To test a filter, use the list 340 * command first. 341 * </pre> 342 */ purgeUserEvents( com.google.cloud.retail.v2.PurgeUserEventsRequest request, io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver)343 default void purgeUserEvents( 344 com.google.cloud.retail.v2.PurgeUserEventsRequest request, 345 io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) { 346 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 347 getPurgeUserEventsMethod(), responseObserver); 348 } 349 350 /** 351 * 352 * 353 * <pre> 354 * Bulk import of User events. Request processing might be 355 * synchronous. Events that already exist are skipped. 356 * Use this method for backfilling historical user events. 357 * `Operation.response` is of type `ImportResponse`. Note that it is 358 * possible for a subset of the items to be successfully inserted. 359 * `Operation.metadata` is of type `ImportMetadata`. 360 * </pre> 361 */ importUserEvents( com.google.cloud.retail.v2.ImportUserEventsRequest request, io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver)362 default void importUserEvents( 363 com.google.cloud.retail.v2.ImportUserEventsRequest request, 364 io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) { 365 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 366 getImportUserEventsMethod(), responseObserver); 367 } 368 369 /** 370 * 371 * 372 * <pre> 373 * Starts a user-event rejoin operation with latest product catalog. Events 374 * are not annotated with detailed product information for products that are 375 * missing from the catalog when the user event is ingested. These 376 * events are stored as unjoined events with limited usage on training and 377 * serving. You can use this method to start a join operation on specified 378 * events with the latest version of product catalog. You can also use this 379 * method to correct events joined with the wrong product catalog. A rejoin 380 * operation can take hours or days to complete. 381 * </pre> 382 */ rejoinUserEvents( com.google.cloud.retail.v2.RejoinUserEventsRequest request, io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver)383 default void rejoinUserEvents( 384 com.google.cloud.retail.v2.RejoinUserEventsRequest request, 385 io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) { 386 io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( 387 getRejoinUserEventsMethod(), responseObserver); 388 } 389 } 390 391 /** 392 * Base class for the server implementation of the service UserEventService. 393 * 394 * <pre> 395 * Service for ingesting end user actions on the customer website. 396 * </pre> 397 */ 398 public abstract static class UserEventServiceImplBase 399 implements io.grpc.BindableService, AsyncService { 400 401 @java.lang.Override bindService()402 public final io.grpc.ServerServiceDefinition bindService() { 403 return UserEventServiceGrpc.bindService(this); 404 } 405 } 406 407 /** 408 * A stub to allow clients to do asynchronous rpc calls to service UserEventService. 409 * 410 * <pre> 411 * Service for ingesting end user actions on the customer website. 412 * </pre> 413 */ 414 public static final class UserEventServiceStub 415 extends io.grpc.stub.AbstractAsyncStub<UserEventServiceStub> { UserEventServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)416 private UserEventServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 417 super(channel, callOptions); 418 } 419 420 @java.lang.Override build(io.grpc.Channel channel, io.grpc.CallOptions callOptions)421 protected UserEventServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 422 return new UserEventServiceStub(channel, callOptions); 423 } 424 425 /** 426 * 427 * 428 * <pre> 429 * Writes a single user event. 430 * </pre> 431 */ writeUserEvent( com.google.cloud.retail.v2.WriteUserEventRequest request, io.grpc.stub.StreamObserver<com.google.cloud.retail.v2.UserEvent> responseObserver)432 public void writeUserEvent( 433 com.google.cloud.retail.v2.WriteUserEventRequest request, 434 io.grpc.stub.StreamObserver<com.google.cloud.retail.v2.UserEvent> responseObserver) { 435 io.grpc.stub.ClientCalls.asyncUnaryCall( 436 getChannel().newCall(getWriteUserEventMethod(), getCallOptions()), 437 request, 438 responseObserver); 439 } 440 441 /** 442 * 443 * 444 * <pre> 445 * Writes a single user event from the browser. This uses a GET request to 446 * due to browser restriction of POST-ing to a 3rd party domain. 447 * This method is used only by the Retail API JavaScript pixel and Google Tag 448 * Manager. Users should not call this method directly. 449 * </pre> 450 */ collectUserEvent( com.google.cloud.retail.v2.CollectUserEventRequest request, io.grpc.stub.StreamObserver<com.google.api.HttpBody> responseObserver)451 public void collectUserEvent( 452 com.google.cloud.retail.v2.CollectUserEventRequest request, 453 io.grpc.stub.StreamObserver<com.google.api.HttpBody> responseObserver) { 454 io.grpc.stub.ClientCalls.asyncUnaryCall( 455 getChannel().newCall(getCollectUserEventMethod(), getCallOptions()), 456 request, 457 responseObserver); 458 } 459 460 /** 461 * 462 * 463 * <pre> 464 * Deletes permanently all user events specified by the filter provided. 465 * Depending on the number of events specified by the filter, this operation 466 * could take hours or days to complete. To test a filter, use the list 467 * command first. 468 * </pre> 469 */ purgeUserEvents( com.google.cloud.retail.v2.PurgeUserEventsRequest request, io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver)470 public void purgeUserEvents( 471 com.google.cloud.retail.v2.PurgeUserEventsRequest request, 472 io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) { 473 io.grpc.stub.ClientCalls.asyncUnaryCall( 474 getChannel().newCall(getPurgeUserEventsMethod(), getCallOptions()), 475 request, 476 responseObserver); 477 } 478 479 /** 480 * 481 * 482 * <pre> 483 * Bulk import of User events. Request processing might be 484 * synchronous. Events that already exist are skipped. 485 * Use this method for backfilling historical user events. 486 * `Operation.response` is of type `ImportResponse`. Note that it is 487 * possible for a subset of the items to be successfully inserted. 488 * `Operation.metadata` is of type `ImportMetadata`. 489 * </pre> 490 */ importUserEvents( com.google.cloud.retail.v2.ImportUserEventsRequest request, io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver)491 public void importUserEvents( 492 com.google.cloud.retail.v2.ImportUserEventsRequest request, 493 io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) { 494 io.grpc.stub.ClientCalls.asyncUnaryCall( 495 getChannel().newCall(getImportUserEventsMethod(), getCallOptions()), 496 request, 497 responseObserver); 498 } 499 500 /** 501 * 502 * 503 * <pre> 504 * Starts a user-event rejoin operation with latest product catalog. Events 505 * are not annotated with detailed product information for products that are 506 * missing from the catalog when the user event is ingested. These 507 * events are stored as unjoined events with limited usage on training and 508 * serving. You can use this method to start a join operation on specified 509 * events with the latest version of product catalog. You can also use this 510 * method to correct events joined with the wrong product catalog. A rejoin 511 * operation can take hours or days to complete. 512 * </pre> 513 */ rejoinUserEvents( com.google.cloud.retail.v2.RejoinUserEventsRequest request, io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver)514 public void rejoinUserEvents( 515 com.google.cloud.retail.v2.RejoinUserEventsRequest request, 516 io.grpc.stub.StreamObserver<com.google.longrunning.Operation> responseObserver) { 517 io.grpc.stub.ClientCalls.asyncUnaryCall( 518 getChannel().newCall(getRejoinUserEventsMethod(), getCallOptions()), 519 request, 520 responseObserver); 521 } 522 } 523 524 /** 525 * A stub to allow clients to do synchronous rpc calls to service UserEventService. 526 * 527 * <pre> 528 * Service for ingesting end user actions on the customer website. 529 * </pre> 530 */ 531 public static final class UserEventServiceBlockingStub 532 extends io.grpc.stub.AbstractBlockingStub<UserEventServiceBlockingStub> { UserEventServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)533 private UserEventServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 534 super(channel, callOptions); 535 } 536 537 @java.lang.Override build( io.grpc.Channel channel, io.grpc.CallOptions callOptions)538 protected UserEventServiceBlockingStub build( 539 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 540 return new UserEventServiceBlockingStub(channel, callOptions); 541 } 542 543 /** 544 * 545 * 546 * <pre> 547 * Writes a single user event. 548 * </pre> 549 */ writeUserEvent( com.google.cloud.retail.v2.WriteUserEventRequest request)550 public com.google.cloud.retail.v2.UserEvent writeUserEvent( 551 com.google.cloud.retail.v2.WriteUserEventRequest request) { 552 return io.grpc.stub.ClientCalls.blockingUnaryCall( 553 getChannel(), getWriteUserEventMethod(), getCallOptions(), request); 554 } 555 556 /** 557 * 558 * 559 * <pre> 560 * Writes a single user event from the browser. This uses a GET request to 561 * due to browser restriction of POST-ing to a 3rd party domain. 562 * This method is used only by the Retail API JavaScript pixel and Google Tag 563 * Manager. Users should not call this method directly. 564 * </pre> 565 */ collectUserEvent( com.google.cloud.retail.v2.CollectUserEventRequest request)566 public com.google.api.HttpBody collectUserEvent( 567 com.google.cloud.retail.v2.CollectUserEventRequest request) { 568 return io.grpc.stub.ClientCalls.blockingUnaryCall( 569 getChannel(), getCollectUserEventMethod(), getCallOptions(), request); 570 } 571 572 /** 573 * 574 * 575 * <pre> 576 * Deletes permanently all user events specified by the filter provided. 577 * Depending on the number of events specified by the filter, this operation 578 * could take hours or days to complete. To test a filter, use the list 579 * command first. 580 * </pre> 581 */ purgeUserEvents( com.google.cloud.retail.v2.PurgeUserEventsRequest request)582 public com.google.longrunning.Operation purgeUserEvents( 583 com.google.cloud.retail.v2.PurgeUserEventsRequest request) { 584 return io.grpc.stub.ClientCalls.blockingUnaryCall( 585 getChannel(), getPurgeUserEventsMethod(), getCallOptions(), request); 586 } 587 588 /** 589 * 590 * 591 * <pre> 592 * Bulk import of User events. Request processing might be 593 * synchronous. Events that already exist are skipped. 594 * Use this method for backfilling historical user events. 595 * `Operation.response` is of type `ImportResponse`. Note that it is 596 * possible for a subset of the items to be successfully inserted. 597 * `Operation.metadata` is of type `ImportMetadata`. 598 * </pre> 599 */ importUserEvents( com.google.cloud.retail.v2.ImportUserEventsRequest request)600 public com.google.longrunning.Operation importUserEvents( 601 com.google.cloud.retail.v2.ImportUserEventsRequest request) { 602 return io.grpc.stub.ClientCalls.blockingUnaryCall( 603 getChannel(), getImportUserEventsMethod(), getCallOptions(), request); 604 } 605 606 /** 607 * 608 * 609 * <pre> 610 * Starts a user-event rejoin operation with latest product catalog. Events 611 * are not annotated with detailed product information for products that are 612 * missing from the catalog when the user event is ingested. These 613 * events are stored as unjoined events with limited usage on training and 614 * serving. You can use this method to start a join operation on specified 615 * events with the latest version of product catalog. You can also use this 616 * method to correct events joined with the wrong product catalog. A rejoin 617 * operation can take hours or days to complete. 618 * </pre> 619 */ rejoinUserEvents( com.google.cloud.retail.v2.RejoinUserEventsRequest request)620 public com.google.longrunning.Operation rejoinUserEvents( 621 com.google.cloud.retail.v2.RejoinUserEventsRequest request) { 622 return io.grpc.stub.ClientCalls.blockingUnaryCall( 623 getChannel(), getRejoinUserEventsMethod(), getCallOptions(), request); 624 } 625 } 626 627 /** 628 * A stub to allow clients to do ListenableFuture-style rpc calls to service UserEventService. 629 * 630 * <pre> 631 * Service for ingesting end user actions on the customer website. 632 * </pre> 633 */ 634 public static final class UserEventServiceFutureStub 635 extends io.grpc.stub.AbstractFutureStub<UserEventServiceFutureStub> { UserEventServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions)636 private UserEventServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 637 super(channel, callOptions); 638 } 639 640 @java.lang.Override build( io.grpc.Channel channel, io.grpc.CallOptions callOptions)641 protected UserEventServiceFutureStub build( 642 io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 643 return new UserEventServiceFutureStub(channel, callOptions); 644 } 645 646 /** 647 * 648 * 649 * <pre> 650 * Writes a single user event. 651 * </pre> 652 */ 653 public com.google.common.util.concurrent.ListenableFuture<com.google.cloud.retail.v2.UserEvent> writeUserEvent(com.google.cloud.retail.v2.WriteUserEventRequest request)654 writeUserEvent(com.google.cloud.retail.v2.WriteUserEventRequest request) { 655 return io.grpc.stub.ClientCalls.futureUnaryCall( 656 getChannel().newCall(getWriteUserEventMethod(), getCallOptions()), request); 657 } 658 659 /** 660 * 661 * 662 * <pre> 663 * Writes a single user event from the browser. This uses a GET request to 664 * due to browser restriction of POST-ing to a 3rd party domain. 665 * This method is used only by the Retail API JavaScript pixel and Google Tag 666 * Manager. Users should not call this method directly. 667 * </pre> 668 */ 669 public com.google.common.util.concurrent.ListenableFuture<com.google.api.HttpBody> collectUserEvent(com.google.cloud.retail.v2.CollectUserEventRequest request)670 collectUserEvent(com.google.cloud.retail.v2.CollectUserEventRequest request) { 671 return io.grpc.stub.ClientCalls.futureUnaryCall( 672 getChannel().newCall(getCollectUserEventMethod(), getCallOptions()), request); 673 } 674 675 /** 676 * 677 * 678 * <pre> 679 * Deletes permanently all user events specified by the filter provided. 680 * Depending on the number of events specified by the filter, this operation 681 * could take hours or days to complete. To test a filter, use the list 682 * command first. 683 * </pre> 684 */ 685 public com.google.common.util.concurrent.ListenableFuture<com.google.longrunning.Operation> purgeUserEvents(com.google.cloud.retail.v2.PurgeUserEventsRequest request)686 purgeUserEvents(com.google.cloud.retail.v2.PurgeUserEventsRequest request) { 687 return io.grpc.stub.ClientCalls.futureUnaryCall( 688 getChannel().newCall(getPurgeUserEventsMethod(), getCallOptions()), request); 689 } 690 691 /** 692 * 693 * 694 * <pre> 695 * Bulk import of User events. Request processing might be 696 * synchronous. Events that already exist are skipped. 697 * Use this method for backfilling historical user events. 698 * `Operation.response` is of type `ImportResponse`. Note that it is 699 * possible for a subset of the items to be successfully inserted. 700 * `Operation.metadata` is of type `ImportMetadata`. 701 * </pre> 702 */ 703 public com.google.common.util.concurrent.ListenableFuture<com.google.longrunning.Operation> importUserEvents(com.google.cloud.retail.v2.ImportUserEventsRequest request)704 importUserEvents(com.google.cloud.retail.v2.ImportUserEventsRequest request) { 705 return io.grpc.stub.ClientCalls.futureUnaryCall( 706 getChannel().newCall(getImportUserEventsMethod(), getCallOptions()), request); 707 } 708 709 /** 710 * 711 * 712 * <pre> 713 * Starts a user-event rejoin operation with latest product catalog. Events 714 * are not annotated with detailed product information for products that are 715 * missing from the catalog when the user event is ingested. These 716 * events are stored as unjoined events with limited usage on training and 717 * serving. You can use this method to start a join operation on specified 718 * events with the latest version of product catalog. You can also use this 719 * method to correct events joined with the wrong product catalog. A rejoin 720 * operation can take hours or days to complete. 721 * </pre> 722 */ 723 public com.google.common.util.concurrent.ListenableFuture<com.google.longrunning.Operation> rejoinUserEvents(com.google.cloud.retail.v2.RejoinUserEventsRequest request)724 rejoinUserEvents(com.google.cloud.retail.v2.RejoinUserEventsRequest request) { 725 return io.grpc.stub.ClientCalls.futureUnaryCall( 726 getChannel().newCall(getRejoinUserEventsMethod(), getCallOptions()), request); 727 } 728 } 729 730 private static final int METHODID_WRITE_USER_EVENT = 0; 731 private static final int METHODID_COLLECT_USER_EVENT = 1; 732 private static final int METHODID_PURGE_USER_EVENTS = 2; 733 private static final int METHODID_IMPORT_USER_EVENTS = 3; 734 private static final int METHODID_REJOIN_USER_EVENTS = 4; 735 736 private static final class MethodHandlers<Req, Resp> 737 implements io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, 738 io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, 739 io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, 740 io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { 741 private final AsyncService serviceImpl; 742 private final int methodId; 743 MethodHandlers(AsyncService serviceImpl, int methodId)744 MethodHandlers(AsyncService serviceImpl, int methodId) { 745 this.serviceImpl = serviceImpl; 746 this.methodId = methodId; 747 } 748 749 @java.lang.Override 750 @java.lang.SuppressWarnings("unchecked") invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver)751 public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) { 752 switch (methodId) { 753 case METHODID_WRITE_USER_EVENT: 754 serviceImpl.writeUserEvent( 755 (com.google.cloud.retail.v2.WriteUserEventRequest) request, 756 (io.grpc.stub.StreamObserver<com.google.cloud.retail.v2.UserEvent>) responseObserver); 757 break; 758 case METHODID_COLLECT_USER_EVENT: 759 serviceImpl.collectUserEvent( 760 (com.google.cloud.retail.v2.CollectUserEventRequest) request, 761 (io.grpc.stub.StreamObserver<com.google.api.HttpBody>) responseObserver); 762 break; 763 case METHODID_PURGE_USER_EVENTS: 764 serviceImpl.purgeUserEvents( 765 (com.google.cloud.retail.v2.PurgeUserEventsRequest) request, 766 (io.grpc.stub.StreamObserver<com.google.longrunning.Operation>) responseObserver); 767 break; 768 case METHODID_IMPORT_USER_EVENTS: 769 serviceImpl.importUserEvents( 770 (com.google.cloud.retail.v2.ImportUserEventsRequest) request, 771 (io.grpc.stub.StreamObserver<com.google.longrunning.Operation>) responseObserver); 772 break; 773 case METHODID_REJOIN_USER_EVENTS: 774 serviceImpl.rejoinUserEvents( 775 (com.google.cloud.retail.v2.RejoinUserEventsRequest) request, 776 (io.grpc.stub.StreamObserver<com.google.longrunning.Operation>) responseObserver); 777 break; 778 default: 779 throw new AssertionError(); 780 } 781 } 782 783 @java.lang.Override 784 @java.lang.SuppressWarnings("unchecked") invoke( io.grpc.stub.StreamObserver<Resp> responseObserver)785 public io.grpc.stub.StreamObserver<Req> invoke( 786 io.grpc.stub.StreamObserver<Resp> responseObserver) { 787 switch (methodId) { 788 default: 789 throw new AssertionError(); 790 } 791 } 792 } 793 bindService(AsyncService service)794 public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { 795 return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) 796 .addMethod( 797 getWriteUserEventMethod(), 798 io.grpc.stub.ServerCalls.asyncUnaryCall( 799 new MethodHandlers< 800 com.google.cloud.retail.v2.WriteUserEventRequest, 801 com.google.cloud.retail.v2.UserEvent>(service, METHODID_WRITE_USER_EVENT))) 802 .addMethod( 803 getCollectUserEventMethod(), 804 io.grpc.stub.ServerCalls.asyncUnaryCall( 805 new MethodHandlers< 806 com.google.cloud.retail.v2.CollectUserEventRequest, com.google.api.HttpBody>( 807 service, METHODID_COLLECT_USER_EVENT))) 808 .addMethod( 809 getPurgeUserEventsMethod(), 810 io.grpc.stub.ServerCalls.asyncUnaryCall( 811 new MethodHandlers< 812 com.google.cloud.retail.v2.PurgeUserEventsRequest, 813 com.google.longrunning.Operation>(service, METHODID_PURGE_USER_EVENTS))) 814 .addMethod( 815 getImportUserEventsMethod(), 816 io.grpc.stub.ServerCalls.asyncUnaryCall( 817 new MethodHandlers< 818 com.google.cloud.retail.v2.ImportUserEventsRequest, 819 com.google.longrunning.Operation>(service, METHODID_IMPORT_USER_EVENTS))) 820 .addMethod( 821 getRejoinUserEventsMethod(), 822 io.grpc.stub.ServerCalls.asyncUnaryCall( 823 new MethodHandlers< 824 com.google.cloud.retail.v2.RejoinUserEventsRequest, 825 com.google.longrunning.Operation>(service, METHODID_REJOIN_USER_EVENTS))) 826 .build(); 827 } 828 829 private abstract static class UserEventServiceBaseDescriptorSupplier 830 implements io.grpc.protobuf.ProtoFileDescriptorSupplier, 831 io.grpc.protobuf.ProtoServiceDescriptorSupplier { UserEventServiceBaseDescriptorSupplier()832 UserEventServiceBaseDescriptorSupplier() {} 833 834 @java.lang.Override getFileDescriptor()835 public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { 836 return com.google.cloud.retail.v2.UserEventServiceProto.getDescriptor(); 837 } 838 839 @java.lang.Override getServiceDescriptor()840 public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { 841 return getFileDescriptor().findServiceByName("UserEventService"); 842 } 843 } 844 845 private static final class UserEventServiceFileDescriptorSupplier 846 extends UserEventServiceBaseDescriptorSupplier { UserEventServiceFileDescriptorSupplier()847 UserEventServiceFileDescriptorSupplier() {} 848 } 849 850 private static final class UserEventServiceMethodDescriptorSupplier 851 extends UserEventServiceBaseDescriptorSupplier 852 implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { 853 private final String methodName; 854 UserEventServiceMethodDescriptorSupplier(String methodName)855 UserEventServiceMethodDescriptorSupplier(String methodName) { 856 this.methodName = methodName; 857 } 858 859 @java.lang.Override getMethodDescriptor()860 public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { 861 return getServiceDescriptor().findMethodByName(methodName); 862 } 863 } 864 865 private static volatile io.grpc.ServiceDescriptor serviceDescriptor; 866 getServiceDescriptor()867 public static io.grpc.ServiceDescriptor getServiceDescriptor() { 868 io.grpc.ServiceDescriptor result = serviceDescriptor; 869 if (result == null) { 870 synchronized (UserEventServiceGrpc.class) { 871 result = serviceDescriptor; 872 if (result == null) { 873 serviceDescriptor = 874 result = 875 io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) 876 .setSchemaDescriptor(new UserEventServiceFileDescriptorSupplier()) 877 .addMethod(getWriteUserEventMethod()) 878 .addMethod(getCollectUserEventMethod()) 879 .addMethod(getPurgeUserEventsMethod()) 880 .addMethod(getImportUserEventsMethod()) 881 .addMethod(getRejoinUserEventsMethod()) 882 .build(); 883 } 884 } 885 } 886 return result; 887 } 888 } 889