1 /* 2 * Copyright 2022 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 17 package com.google.cloud.retail.v2.stub; 18 19 import static com.google.cloud.retail.v2.ProductServiceClient.ListProductsPagedResponse; 20 21 import com.google.api.gax.core.BackgroundResource; 22 import com.google.api.gax.core.BackgroundResourceAggregation; 23 import com.google.api.gax.grpc.GrpcCallSettings; 24 import com.google.api.gax.grpc.GrpcStubCallableFactory; 25 import com.google.api.gax.rpc.ClientContext; 26 import com.google.api.gax.rpc.OperationCallable; 27 import com.google.api.gax.rpc.UnaryCallable; 28 import com.google.cloud.retail.v2.AddFulfillmentPlacesMetadata; 29 import com.google.cloud.retail.v2.AddFulfillmentPlacesRequest; 30 import com.google.cloud.retail.v2.AddFulfillmentPlacesResponse; 31 import com.google.cloud.retail.v2.AddLocalInventoriesMetadata; 32 import com.google.cloud.retail.v2.AddLocalInventoriesRequest; 33 import com.google.cloud.retail.v2.AddLocalInventoriesResponse; 34 import com.google.cloud.retail.v2.CreateProductRequest; 35 import com.google.cloud.retail.v2.DeleteProductRequest; 36 import com.google.cloud.retail.v2.GetProductRequest; 37 import com.google.cloud.retail.v2.ImportMetadata; 38 import com.google.cloud.retail.v2.ImportProductsRequest; 39 import com.google.cloud.retail.v2.ImportProductsResponse; 40 import com.google.cloud.retail.v2.ListProductsRequest; 41 import com.google.cloud.retail.v2.ListProductsResponse; 42 import com.google.cloud.retail.v2.Product; 43 import com.google.cloud.retail.v2.RemoveFulfillmentPlacesMetadata; 44 import com.google.cloud.retail.v2.RemoveFulfillmentPlacesRequest; 45 import com.google.cloud.retail.v2.RemoveFulfillmentPlacesResponse; 46 import com.google.cloud.retail.v2.RemoveLocalInventoriesMetadata; 47 import com.google.cloud.retail.v2.RemoveLocalInventoriesRequest; 48 import com.google.cloud.retail.v2.RemoveLocalInventoriesResponse; 49 import com.google.cloud.retail.v2.SetInventoryMetadata; 50 import com.google.cloud.retail.v2.SetInventoryRequest; 51 import com.google.cloud.retail.v2.SetInventoryResponse; 52 import com.google.cloud.retail.v2.UpdateProductRequest; 53 import com.google.common.collect.ImmutableMap; 54 import com.google.longrunning.Operation; 55 import com.google.longrunning.stub.GrpcOperationsStub; 56 import com.google.protobuf.Empty; 57 import io.grpc.MethodDescriptor; 58 import io.grpc.protobuf.ProtoUtils; 59 import java.io.IOException; 60 import java.util.concurrent.TimeUnit; 61 import javax.annotation.Generated; 62 63 // AUTO-GENERATED DOCUMENTATION AND CLASS. 64 /** 65 * gRPC stub implementation for the ProductService service API. 66 * 67 * <p>This class is for advanced usage and reflects the underlying API directly. 68 */ 69 @Generated("by gapic-generator-java") 70 public class GrpcProductServiceStub extends ProductServiceStub { 71 private static final MethodDescriptor<CreateProductRequest, Product> 72 createProductMethodDescriptor = 73 MethodDescriptor.<CreateProductRequest, Product>newBuilder() 74 .setType(MethodDescriptor.MethodType.UNARY) 75 .setFullMethodName("google.cloud.retail.v2.ProductService/CreateProduct") 76 .setRequestMarshaller( 77 ProtoUtils.marshaller(CreateProductRequest.getDefaultInstance())) 78 .setResponseMarshaller(ProtoUtils.marshaller(Product.getDefaultInstance())) 79 .build(); 80 81 private static final MethodDescriptor<GetProductRequest, Product> getProductMethodDescriptor = 82 MethodDescriptor.<GetProductRequest, Product>newBuilder() 83 .setType(MethodDescriptor.MethodType.UNARY) 84 .setFullMethodName("google.cloud.retail.v2.ProductService/GetProduct") 85 .setRequestMarshaller(ProtoUtils.marshaller(GetProductRequest.getDefaultInstance())) 86 .setResponseMarshaller(ProtoUtils.marshaller(Product.getDefaultInstance())) 87 .build(); 88 89 private static final MethodDescriptor<ListProductsRequest, ListProductsResponse> 90 listProductsMethodDescriptor = 91 MethodDescriptor.<ListProductsRequest, ListProductsResponse>newBuilder() 92 .setType(MethodDescriptor.MethodType.UNARY) 93 .setFullMethodName("google.cloud.retail.v2.ProductService/ListProducts") 94 .setRequestMarshaller(ProtoUtils.marshaller(ListProductsRequest.getDefaultInstance())) 95 .setResponseMarshaller( 96 ProtoUtils.marshaller(ListProductsResponse.getDefaultInstance())) 97 .build(); 98 99 private static final MethodDescriptor<UpdateProductRequest, Product> 100 updateProductMethodDescriptor = 101 MethodDescriptor.<UpdateProductRequest, Product>newBuilder() 102 .setType(MethodDescriptor.MethodType.UNARY) 103 .setFullMethodName("google.cloud.retail.v2.ProductService/UpdateProduct") 104 .setRequestMarshaller( 105 ProtoUtils.marshaller(UpdateProductRequest.getDefaultInstance())) 106 .setResponseMarshaller(ProtoUtils.marshaller(Product.getDefaultInstance())) 107 .build(); 108 109 private static final MethodDescriptor<DeleteProductRequest, Empty> deleteProductMethodDescriptor = 110 MethodDescriptor.<DeleteProductRequest, Empty>newBuilder() 111 .setType(MethodDescriptor.MethodType.UNARY) 112 .setFullMethodName("google.cloud.retail.v2.ProductService/DeleteProduct") 113 .setRequestMarshaller(ProtoUtils.marshaller(DeleteProductRequest.getDefaultInstance())) 114 .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) 115 .build(); 116 117 private static final MethodDescriptor<ImportProductsRequest, Operation> 118 importProductsMethodDescriptor = 119 MethodDescriptor.<ImportProductsRequest, Operation>newBuilder() 120 .setType(MethodDescriptor.MethodType.UNARY) 121 .setFullMethodName("google.cloud.retail.v2.ProductService/ImportProducts") 122 .setRequestMarshaller( 123 ProtoUtils.marshaller(ImportProductsRequest.getDefaultInstance())) 124 .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) 125 .build(); 126 127 private static final MethodDescriptor<SetInventoryRequest, Operation> 128 setInventoryMethodDescriptor = 129 MethodDescriptor.<SetInventoryRequest, Operation>newBuilder() 130 .setType(MethodDescriptor.MethodType.UNARY) 131 .setFullMethodName("google.cloud.retail.v2.ProductService/SetInventory") 132 .setRequestMarshaller(ProtoUtils.marshaller(SetInventoryRequest.getDefaultInstance())) 133 .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) 134 .build(); 135 136 private static final MethodDescriptor<AddFulfillmentPlacesRequest, Operation> 137 addFulfillmentPlacesMethodDescriptor = 138 MethodDescriptor.<AddFulfillmentPlacesRequest, Operation>newBuilder() 139 .setType(MethodDescriptor.MethodType.UNARY) 140 .setFullMethodName("google.cloud.retail.v2.ProductService/AddFulfillmentPlaces") 141 .setRequestMarshaller( 142 ProtoUtils.marshaller(AddFulfillmentPlacesRequest.getDefaultInstance())) 143 .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) 144 .build(); 145 146 private static final MethodDescriptor<RemoveFulfillmentPlacesRequest, Operation> 147 removeFulfillmentPlacesMethodDescriptor = 148 MethodDescriptor.<RemoveFulfillmentPlacesRequest, Operation>newBuilder() 149 .setType(MethodDescriptor.MethodType.UNARY) 150 .setFullMethodName("google.cloud.retail.v2.ProductService/RemoveFulfillmentPlaces") 151 .setRequestMarshaller( 152 ProtoUtils.marshaller(RemoveFulfillmentPlacesRequest.getDefaultInstance())) 153 .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) 154 .build(); 155 156 private static final MethodDescriptor<AddLocalInventoriesRequest, Operation> 157 addLocalInventoriesMethodDescriptor = 158 MethodDescriptor.<AddLocalInventoriesRequest, Operation>newBuilder() 159 .setType(MethodDescriptor.MethodType.UNARY) 160 .setFullMethodName("google.cloud.retail.v2.ProductService/AddLocalInventories") 161 .setRequestMarshaller( 162 ProtoUtils.marshaller(AddLocalInventoriesRequest.getDefaultInstance())) 163 .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) 164 .build(); 165 166 private static final MethodDescriptor<RemoveLocalInventoriesRequest, Operation> 167 removeLocalInventoriesMethodDescriptor = 168 MethodDescriptor.<RemoveLocalInventoriesRequest, Operation>newBuilder() 169 .setType(MethodDescriptor.MethodType.UNARY) 170 .setFullMethodName("google.cloud.retail.v2.ProductService/RemoveLocalInventories") 171 .setRequestMarshaller( 172 ProtoUtils.marshaller(RemoveLocalInventoriesRequest.getDefaultInstance())) 173 .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) 174 .build(); 175 176 private final UnaryCallable<CreateProductRequest, Product> createProductCallable; 177 private final UnaryCallable<GetProductRequest, Product> getProductCallable; 178 private final UnaryCallable<ListProductsRequest, ListProductsResponse> listProductsCallable; 179 private final UnaryCallable<ListProductsRequest, ListProductsPagedResponse> 180 listProductsPagedCallable; 181 private final UnaryCallable<UpdateProductRequest, Product> updateProductCallable; 182 private final UnaryCallable<DeleteProductRequest, Empty> deleteProductCallable; 183 private final UnaryCallable<ImportProductsRequest, Operation> importProductsCallable; 184 private final OperationCallable<ImportProductsRequest, ImportProductsResponse, ImportMetadata> 185 importProductsOperationCallable; 186 private final UnaryCallable<SetInventoryRequest, Operation> setInventoryCallable; 187 private final OperationCallable<SetInventoryRequest, SetInventoryResponse, SetInventoryMetadata> 188 setInventoryOperationCallable; 189 private final UnaryCallable<AddFulfillmentPlacesRequest, Operation> addFulfillmentPlacesCallable; 190 private final OperationCallable< 191 AddFulfillmentPlacesRequest, AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> 192 addFulfillmentPlacesOperationCallable; 193 private final UnaryCallable<RemoveFulfillmentPlacesRequest, Operation> 194 removeFulfillmentPlacesCallable; 195 private final OperationCallable< 196 RemoveFulfillmentPlacesRequest, 197 RemoveFulfillmentPlacesResponse, 198 RemoveFulfillmentPlacesMetadata> 199 removeFulfillmentPlacesOperationCallable; 200 private final UnaryCallable<AddLocalInventoriesRequest, Operation> addLocalInventoriesCallable; 201 private final OperationCallable< 202 AddLocalInventoriesRequest, AddLocalInventoriesResponse, AddLocalInventoriesMetadata> 203 addLocalInventoriesOperationCallable; 204 private final UnaryCallable<RemoveLocalInventoriesRequest, Operation> 205 removeLocalInventoriesCallable; 206 private final OperationCallable< 207 RemoveLocalInventoriesRequest, 208 RemoveLocalInventoriesResponse, 209 RemoveLocalInventoriesMetadata> 210 removeLocalInventoriesOperationCallable; 211 212 private final BackgroundResource backgroundResources; 213 private final GrpcOperationsStub operationsStub; 214 private final GrpcStubCallableFactory callableFactory; 215 create(ProductServiceStubSettings settings)216 public static final GrpcProductServiceStub create(ProductServiceStubSettings settings) 217 throws IOException { 218 return new GrpcProductServiceStub(settings, ClientContext.create(settings)); 219 } 220 create(ClientContext clientContext)221 public static final GrpcProductServiceStub create(ClientContext clientContext) 222 throws IOException { 223 return new GrpcProductServiceStub( 224 ProductServiceStubSettings.newBuilder().build(), clientContext); 225 } 226 create( ClientContext clientContext, GrpcStubCallableFactory callableFactory)227 public static final GrpcProductServiceStub create( 228 ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { 229 return new GrpcProductServiceStub( 230 ProductServiceStubSettings.newBuilder().build(), clientContext, callableFactory); 231 } 232 233 /** 234 * Constructs an instance of GrpcProductServiceStub, using the given settings. This is protected 235 * so that it is easy to make a subclass, but otherwise, the static factory methods should be 236 * preferred. 237 */ GrpcProductServiceStub(ProductServiceStubSettings settings, ClientContext clientContext)238 protected GrpcProductServiceStub(ProductServiceStubSettings settings, ClientContext clientContext) 239 throws IOException { 240 this(settings, clientContext, new GrpcProductServiceCallableFactory()); 241 } 242 243 /** 244 * Constructs an instance of GrpcProductServiceStub, using the given settings. This is protected 245 * so that it is easy to make a subclass, but otherwise, the static factory methods should be 246 * preferred. 247 */ GrpcProductServiceStub( ProductServiceStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory)248 protected GrpcProductServiceStub( 249 ProductServiceStubSettings settings, 250 ClientContext clientContext, 251 GrpcStubCallableFactory callableFactory) 252 throws IOException { 253 this.callableFactory = callableFactory; 254 this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); 255 256 GrpcCallSettings<CreateProductRequest, Product> createProductTransportSettings = 257 GrpcCallSettings.<CreateProductRequest, Product>newBuilder() 258 .setMethodDescriptor(createProductMethodDescriptor) 259 .setParamsExtractor( 260 request -> { 261 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 262 params.put("parent", String.valueOf(request.getParent())); 263 return params.build(); 264 }) 265 .build(); 266 GrpcCallSettings<GetProductRequest, Product> getProductTransportSettings = 267 GrpcCallSettings.<GetProductRequest, Product>newBuilder() 268 .setMethodDescriptor(getProductMethodDescriptor) 269 .setParamsExtractor( 270 request -> { 271 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 272 params.put("name", String.valueOf(request.getName())); 273 return params.build(); 274 }) 275 .build(); 276 GrpcCallSettings<ListProductsRequest, ListProductsResponse> listProductsTransportSettings = 277 GrpcCallSettings.<ListProductsRequest, ListProductsResponse>newBuilder() 278 .setMethodDescriptor(listProductsMethodDescriptor) 279 .setParamsExtractor( 280 request -> { 281 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 282 params.put("parent", String.valueOf(request.getParent())); 283 return params.build(); 284 }) 285 .build(); 286 GrpcCallSettings<UpdateProductRequest, Product> updateProductTransportSettings = 287 GrpcCallSettings.<UpdateProductRequest, Product>newBuilder() 288 .setMethodDescriptor(updateProductMethodDescriptor) 289 .setParamsExtractor( 290 request -> { 291 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 292 params.put("product.name", String.valueOf(request.getProduct().getName())); 293 return params.build(); 294 }) 295 .build(); 296 GrpcCallSettings<DeleteProductRequest, Empty> deleteProductTransportSettings = 297 GrpcCallSettings.<DeleteProductRequest, Empty>newBuilder() 298 .setMethodDescriptor(deleteProductMethodDescriptor) 299 .setParamsExtractor( 300 request -> { 301 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 302 params.put("name", String.valueOf(request.getName())); 303 return params.build(); 304 }) 305 .build(); 306 GrpcCallSettings<ImportProductsRequest, Operation> importProductsTransportSettings = 307 GrpcCallSettings.<ImportProductsRequest, Operation>newBuilder() 308 .setMethodDescriptor(importProductsMethodDescriptor) 309 .setParamsExtractor( 310 request -> { 311 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 312 params.put("parent", String.valueOf(request.getParent())); 313 return params.build(); 314 }) 315 .build(); 316 GrpcCallSettings<SetInventoryRequest, Operation> setInventoryTransportSettings = 317 GrpcCallSettings.<SetInventoryRequest, Operation>newBuilder() 318 .setMethodDescriptor(setInventoryMethodDescriptor) 319 .setParamsExtractor( 320 request -> { 321 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 322 params.put("inventory.name", String.valueOf(request.getInventory().getName())); 323 return params.build(); 324 }) 325 .build(); 326 GrpcCallSettings<AddFulfillmentPlacesRequest, Operation> addFulfillmentPlacesTransportSettings = 327 GrpcCallSettings.<AddFulfillmentPlacesRequest, Operation>newBuilder() 328 .setMethodDescriptor(addFulfillmentPlacesMethodDescriptor) 329 .setParamsExtractor( 330 request -> { 331 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 332 params.put("product", String.valueOf(request.getProduct())); 333 return params.build(); 334 }) 335 .build(); 336 GrpcCallSettings<RemoveFulfillmentPlacesRequest, Operation> 337 removeFulfillmentPlacesTransportSettings = 338 GrpcCallSettings.<RemoveFulfillmentPlacesRequest, Operation>newBuilder() 339 .setMethodDescriptor(removeFulfillmentPlacesMethodDescriptor) 340 .setParamsExtractor( 341 request -> { 342 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 343 params.put("product", String.valueOf(request.getProduct())); 344 return params.build(); 345 }) 346 .build(); 347 GrpcCallSettings<AddLocalInventoriesRequest, Operation> addLocalInventoriesTransportSettings = 348 GrpcCallSettings.<AddLocalInventoriesRequest, Operation>newBuilder() 349 .setMethodDescriptor(addLocalInventoriesMethodDescriptor) 350 .setParamsExtractor( 351 request -> { 352 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 353 params.put("product", String.valueOf(request.getProduct())); 354 return params.build(); 355 }) 356 .build(); 357 GrpcCallSettings<RemoveLocalInventoriesRequest, Operation> 358 removeLocalInventoriesTransportSettings = 359 GrpcCallSettings.<RemoveLocalInventoriesRequest, Operation>newBuilder() 360 .setMethodDescriptor(removeLocalInventoriesMethodDescriptor) 361 .setParamsExtractor( 362 request -> { 363 ImmutableMap.Builder<String, String> params = ImmutableMap.builder(); 364 params.put("product", String.valueOf(request.getProduct())); 365 return params.build(); 366 }) 367 .build(); 368 369 this.createProductCallable = 370 callableFactory.createUnaryCallable( 371 createProductTransportSettings, settings.createProductSettings(), clientContext); 372 this.getProductCallable = 373 callableFactory.createUnaryCallable( 374 getProductTransportSettings, settings.getProductSettings(), clientContext); 375 this.listProductsCallable = 376 callableFactory.createUnaryCallable( 377 listProductsTransportSettings, settings.listProductsSettings(), clientContext); 378 this.listProductsPagedCallable = 379 callableFactory.createPagedCallable( 380 listProductsTransportSettings, settings.listProductsSettings(), clientContext); 381 this.updateProductCallable = 382 callableFactory.createUnaryCallable( 383 updateProductTransportSettings, settings.updateProductSettings(), clientContext); 384 this.deleteProductCallable = 385 callableFactory.createUnaryCallable( 386 deleteProductTransportSettings, settings.deleteProductSettings(), clientContext); 387 this.importProductsCallable = 388 callableFactory.createUnaryCallable( 389 importProductsTransportSettings, settings.importProductsSettings(), clientContext); 390 this.importProductsOperationCallable = 391 callableFactory.createOperationCallable( 392 importProductsTransportSettings, 393 settings.importProductsOperationSettings(), 394 clientContext, 395 operationsStub); 396 this.setInventoryCallable = 397 callableFactory.createUnaryCallable( 398 setInventoryTransportSettings, settings.setInventorySettings(), clientContext); 399 this.setInventoryOperationCallable = 400 callableFactory.createOperationCallable( 401 setInventoryTransportSettings, 402 settings.setInventoryOperationSettings(), 403 clientContext, 404 operationsStub); 405 this.addFulfillmentPlacesCallable = 406 callableFactory.createUnaryCallable( 407 addFulfillmentPlacesTransportSettings, 408 settings.addFulfillmentPlacesSettings(), 409 clientContext); 410 this.addFulfillmentPlacesOperationCallable = 411 callableFactory.createOperationCallable( 412 addFulfillmentPlacesTransportSettings, 413 settings.addFulfillmentPlacesOperationSettings(), 414 clientContext, 415 operationsStub); 416 this.removeFulfillmentPlacesCallable = 417 callableFactory.createUnaryCallable( 418 removeFulfillmentPlacesTransportSettings, 419 settings.removeFulfillmentPlacesSettings(), 420 clientContext); 421 this.removeFulfillmentPlacesOperationCallable = 422 callableFactory.createOperationCallable( 423 removeFulfillmentPlacesTransportSettings, 424 settings.removeFulfillmentPlacesOperationSettings(), 425 clientContext, 426 operationsStub); 427 this.addLocalInventoriesCallable = 428 callableFactory.createUnaryCallable( 429 addLocalInventoriesTransportSettings, 430 settings.addLocalInventoriesSettings(), 431 clientContext); 432 this.addLocalInventoriesOperationCallable = 433 callableFactory.createOperationCallable( 434 addLocalInventoriesTransportSettings, 435 settings.addLocalInventoriesOperationSettings(), 436 clientContext, 437 operationsStub); 438 this.removeLocalInventoriesCallable = 439 callableFactory.createUnaryCallable( 440 removeLocalInventoriesTransportSettings, 441 settings.removeLocalInventoriesSettings(), 442 clientContext); 443 this.removeLocalInventoriesOperationCallable = 444 callableFactory.createOperationCallable( 445 removeLocalInventoriesTransportSettings, 446 settings.removeLocalInventoriesOperationSettings(), 447 clientContext, 448 operationsStub); 449 450 this.backgroundResources = 451 new BackgroundResourceAggregation(clientContext.getBackgroundResources()); 452 } 453 getOperationsStub()454 public GrpcOperationsStub getOperationsStub() { 455 return operationsStub; 456 } 457 458 @Override createProductCallable()459 public UnaryCallable<CreateProductRequest, Product> createProductCallable() { 460 return createProductCallable; 461 } 462 463 @Override getProductCallable()464 public UnaryCallable<GetProductRequest, Product> getProductCallable() { 465 return getProductCallable; 466 } 467 468 @Override listProductsCallable()469 public UnaryCallable<ListProductsRequest, ListProductsResponse> listProductsCallable() { 470 return listProductsCallable; 471 } 472 473 @Override listProductsPagedCallable()474 public UnaryCallable<ListProductsRequest, ListProductsPagedResponse> listProductsPagedCallable() { 475 return listProductsPagedCallable; 476 } 477 478 @Override updateProductCallable()479 public UnaryCallable<UpdateProductRequest, Product> updateProductCallable() { 480 return updateProductCallable; 481 } 482 483 @Override deleteProductCallable()484 public UnaryCallable<DeleteProductRequest, Empty> deleteProductCallable() { 485 return deleteProductCallable; 486 } 487 488 @Override importProductsCallable()489 public UnaryCallable<ImportProductsRequest, Operation> importProductsCallable() { 490 return importProductsCallable; 491 } 492 493 @Override 494 public OperationCallable<ImportProductsRequest, ImportProductsResponse, ImportMetadata> importProductsOperationCallable()495 importProductsOperationCallable() { 496 return importProductsOperationCallable; 497 } 498 499 @Override setInventoryCallable()500 public UnaryCallable<SetInventoryRequest, Operation> setInventoryCallable() { 501 return setInventoryCallable; 502 } 503 504 @Override 505 public OperationCallable<SetInventoryRequest, SetInventoryResponse, SetInventoryMetadata> setInventoryOperationCallable()506 setInventoryOperationCallable() { 507 return setInventoryOperationCallable; 508 } 509 510 @Override addFulfillmentPlacesCallable()511 public UnaryCallable<AddFulfillmentPlacesRequest, Operation> addFulfillmentPlacesCallable() { 512 return addFulfillmentPlacesCallable; 513 } 514 515 @Override 516 public OperationCallable< 517 AddFulfillmentPlacesRequest, AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> addFulfillmentPlacesOperationCallable()518 addFulfillmentPlacesOperationCallable() { 519 return addFulfillmentPlacesOperationCallable; 520 } 521 522 @Override 523 public UnaryCallable<RemoveFulfillmentPlacesRequest, Operation> removeFulfillmentPlacesCallable()524 removeFulfillmentPlacesCallable() { 525 return removeFulfillmentPlacesCallable; 526 } 527 528 @Override 529 public OperationCallable< 530 RemoveFulfillmentPlacesRequest, 531 RemoveFulfillmentPlacesResponse, 532 RemoveFulfillmentPlacesMetadata> removeFulfillmentPlacesOperationCallable()533 removeFulfillmentPlacesOperationCallable() { 534 return removeFulfillmentPlacesOperationCallable; 535 } 536 537 @Override addLocalInventoriesCallable()538 public UnaryCallable<AddLocalInventoriesRequest, Operation> addLocalInventoriesCallable() { 539 return addLocalInventoriesCallable; 540 } 541 542 @Override 543 public OperationCallable< 544 AddLocalInventoriesRequest, AddLocalInventoriesResponse, AddLocalInventoriesMetadata> addLocalInventoriesOperationCallable()545 addLocalInventoriesOperationCallable() { 546 return addLocalInventoriesOperationCallable; 547 } 548 549 @Override removeLocalInventoriesCallable()550 public UnaryCallable<RemoveLocalInventoriesRequest, Operation> removeLocalInventoriesCallable() { 551 return removeLocalInventoriesCallable; 552 } 553 554 @Override 555 public OperationCallable< 556 RemoveLocalInventoriesRequest, 557 RemoveLocalInventoriesResponse, 558 RemoveLocalInventoriesMetadata> removeLocalInventoriesOperationCallable()559 removeLocalInventoriesOperationCallable() { 560 return removeLocalInventoriesOperationCallable; 561 } 562 563 @Override close()564 public final void close() { 565 try { 566 backgroundResources.close(); 567 } catch (RuntimeException e) { 568 throw e; 569 } catch (Exception e) { 570 throw new IllegalStateException("Failed to close resource", e); 571 } 572 } 573 574 @Override shutdown()575 public void shutdown() { 576 backgroundResources.shutdown(); 577 } 578 579 @Override isShutdown()580 public boolean isShutdown() { 581 return backgroundResources.isShutdown(); 582 } 583 584 @Override isTerminated()585 public boolean isTerminated() { 586 return backgroundResources.isTerminated(); 587 } 588 589 @Override shutdownNow()590 public void shutdownNow() { 591 backgroundResources.shutdownNow(); 592 } 593 594 @Override awaitTermination(long duration, TimeUnit unit)595 public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { 596 return backgroundResources.awaitTermination(duration, unit); 597 } 598 } 599