• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.CatalogServiceClient.ListCatalogsPagedResponse;
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.UnaryCallable;
27 import com.google.cloud.retail.v2.AddCatalogAttributeRequest;
28 import com.google.cloud.retail.v2.AttributesConfig;
29 import com.google.cloud.retail.v2.Catalog;
30 import com.google.cloud.retail.v2.CompletionConfig;
31 import com.google.cloud.retail.v2.GetAttributesConfigRequest;
32 import com.google.cloud.retail.v2.GetCompletionConfigRequest;
33 import com.google.cloud.retail.v2.GetDefaultBranchRequest;
34 import com.google.cloud.retail.v2.GetDefaultBranchResponse;
35 import com.google.cloud.retail.v2.ListCatalogsRequest;
36 import com.google.cloud.retail.v2.ListCatalogsResponse;
37 import com.google.cloud.retail.v2.RemoveCatalogAttributeRequest;
38 import com.google.cloud.retail.v2.ReplaceCatalogAttributeRequest;
39 import com.google.cloud.retail.v2.SetDefaultBranchRequest;
40 import com.google.cloud.retail.v2.UpdateAttributesConfigRequest;
41 import com.google.cloud.retail.v2.UpdateCatalogRequest;
42 import com.google.cloud.retail.v2.UpdateCompletionConfigRequest;
43 import com.google.common.collect.ImmutableMap;
44 import com.google.longrunning.stub.GrpcOperationsStub;
45 import com.google.protobuf.Empty;
46 import io.grpc.MethodDescriptor;
47 import io.grpc.protobuf.ProtoUtils;
48 import java.io.IOException;
49 import java.util.concurrent.TimeUnit;
50 import javax.annotation.Generated;
51 
52 // AUTO-GENERATED DOCUMENTATION AND CLASS.
53 /**
54  * gRPC stub implementation for the CatalogService service API.
55  *
56  * <p>This class is for advanced usage and reflects the underlying API directly.
57  */
58 @Generated("by gapic-generator-java")
59 public class GrpcCatalogServiceStub extends CatalogServiceStub {
60   private static final MethodDescriptor<ListCatalogsRequest, ListCatalogsResponse>
61       listCatalogsMethodDescriptor =
62           MethodDescriptor.<ListCatalogsRequest, ListCatalogsResponse>newBuilder()
63               .setType(MethodDescriptor.MethodType.UNARY)
64               .setFullMethodName("google.cloud.retail.v2.CatalogService/ListCatalogs")
65               .setRequestMarshaller(ProtoUtils.marshaller(ListCatalogsRequest.getDefaultInstance()))
66               .setResponseMarshaller(
67                   ProtoUtils.marshaller(ListCatalogsResponse.getDefaultInstance()))
68               .build();
69 
70   private static final MethodDescriptor<UpdateCatalogRequest, Catalog>
71       updateCatalogMethodDescriptor =
72           MethodDescriptor.<UpdateCatalogRequest, Catalog>newBuilder()
73               .setType(MethodDescriptor.MethodType.UNARY)
74               .setFullMethodName("google.cloud.retail.v2.CatalogService/UpdateCatalog")
75               .setRequestMarshaller(
76                   ProtoUtils.marshaller(UpdateCatalogRequest.getDefaultInstance()))
77               .setResponseMarshaller(ProtoUtils.marshaller(Catalog.getDefaultInstance()))
78               .build();
79 
80   private static final MethodDescriptor<SetDefaultBranchRequest, Empty>
81       setDefaultBranchMethodDescriptor =
82           MethodDescriptor.<SetDefaultBranchRequest, Empty>newBuilder()
83               .setType(MethodDescriptor.MethodType.UNARY)
84               .setFullMethodName("google.cloud.retail.v2.CatalogService/SetDefaultBranch")
85               .setRequestMarshaller(
86                   ProtoUtils.marshaller(SetDefaultBranchRequest.getDefaultInstance()))
87               .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
88               .build();
89 
90   private static final MethodDescriptor<GetDefaultBranchRequest, GetDefaultBranchResponse>
91       getDefaultBranchMethodDescriptor =
92           MethodDescriptor.<GetDefaultBranchRequest, GetDefaultBranchResponse>newBuilder()
93               .setType(MethodDescriptor.MethodType.UNARY)
94               .setFullMethodName("google.cloud.retail.v2.CatalogService/GetDefaultBranch")
95               .setRequestMarshaller(
96                   ProtoUtils.marshaller(GetDefaultBranchRequest.getDefaultInstance()))
97               .setResponseMarshaller(
98                   ProtoUtils.marshaller(GetDefaultBranchResponse.getDefaultInstance()))
99               .build();
100 
101   private static final MethodDescriptor<GetCompletionConfigRequest, CompletionConfig>
102       getCompletionConfigMethodDescriptor =
103           MethodDescriptor.<GetCompletionConfigRequest, CompletionConfig>newBuilder()
104               .setType(MethodDescriptor.MethodType.UNARY)
105               .setFullMethodName("google.cloud.retail.v2.CatalogService/GetCompletionConfig")
106               .setRequestMarshaller(
107                   ProtoUtils.marshaller(GetCompletionConfigRequest.getDefaultInstance()))
108               .setResponseMarshaller(ProtoUtils.marshaller(CompletionConfig.getDefaultInstance()))
109               .build();
110 
111   private static final MethodDescriptor<UpdateCompletionConfigRequest, CompletionConfig>
112       updateCompletionConfigMethodDescriptor =
113           MethodDescriptor.<UpdateCompletionConfigRequest, CompletionConfig>newBuilder()
114               .setType(MethodDescriptor.MethodType.UNARY)
115               .setFullMethodName("google.cloud.retail.v2.CatalogService/UpdateCompletionConfig")
116               .setRequestMarshaller(
117                   ProtoUtils.marshaller(UpdateCompletionConfigRequest.getDefaultInstance()))
118               .setResponseMarshaller(ProtoUtils.marshaller(CompletionConfig.getDefaultInstance()))
119               .build();
120 
121   private static final MethodDescriptor<GetAttributesConfigRequest, AttributesConfig>
122       getAttributesConfigMethodDescriptor =
123           MethodDescriptor.<GetAttributesConfigRequest, AttributesConfig>newBuilder()
124               .setType(MethodDescriptor.MethodType.UNARY)
125               .setFullMethodName("google.cloud.retail.v2.CatalogService/GetAttributesConfig")
126               .setRequestMarshaller(
127                   ProtoUtils.marshaller(GetAttributesConfigRequest.getDefaultInstance()))
128               .setResponseMarshaller(ProtoUtils.marshaller(AttributesConfig.getDefaultInstance()))
129               .build();
130 
131   private static final MethodDescriptor<UpdateAttributesConfigRequest, AttributesConfig>
132       updateAttributesConfigMethodDescriptor =
133           MethodDescriptor.<UpdateAttributesConfigRequest, AttributesConfig>newBuilder()
134               .setType(MethodDescriptor.MethodType.UNARY)
135               .setFullMethodName("google.cloud.retail.v2.CatalogService/UpdateAttributesConfig")
136               .setRequestMarshaller(
137                   ProtoUtils.marshaller(UpdateAttributesConfigRequest.getDefaultInstance()))
138               .setResponseMarshaller(ProtoUtils.marshaller(AttributesConfig.getDefaultInstance()))
139               .build();
140 
141   private static final MethodDescriptor<AddCatalogAttributeRequest, AttributesConfig>
142       addCatalogAttributeMethodDescriptor =
143           MethodDescriptor.<AddCatalogAttributeRequest, AttributesConfig>newBuilder()
144               .setType(MethodDescriptor.MethodType.UNARY)
145               .setFullMethodName("google.cloud.retail.v2.CatalogService/AddCatalogAttribute")
146               .setRequestMarshaller(
147                   ProtoUtils.marshaller(AddCatalogAttributeRequest.getDefaultInstance()))
148               .setResponseMarshaller(ProtoUtils.marshaller(AttributesConfig.getDefaultInstance()))
149               .build();
150 
151   private static final MethodDescriptor<RemoveCatalogAttributeRequest, AttributesConfig>
152       removeCatalogAttributeMethodDescriptor =
153           MethodDescriptor.<RemoveCatalogAttributeRequest, AttributesConfig>newBuilder()
154               .setType(MethodDescriptor.MethodType.UNARY)
155               .setFullMethodName("google.cloud.retail.v2.CatalogService/RemoveCatalogAttribute")
156               .setRequestMarshaller(
157                   ProtoUtils.marshaller(RemoveCatalogAttributeRequest.getDefaultInstance()))
158               .setResponseMarshaller(ProtoUtils.marshaller(AttributesConfig.getDefaultInstance()))
159               .build();
160 
161   private static final MethodDescriptor<ReplaceCatalogAttributeRequest, AttributesConfig>
162       replaceCatalogAttributeMethodDescriptor =
163           MethodDescriptor.<ReplaceCatalogAttributeRequest, AttributesConfig>newBuilder()
164               .setType(MethodDescriptor.MethodType.UNARY)
165               .setFullMethodName("google.cloud.retail.v2.CatalogService/ReplaceCatalogAttribute")
166               .setRequestMarshaller(
167                   ProtoUtils.marshaller(ReplaceCatalogAttributeRequest.getDefaultInstance()))
168               .setResponseMarshaller(ProtoUtils.marshaller(AttributesConfig.getDefaultInstance()))
169               .build();
170 
171   private final UnaryCallable<ListCatalogsRequest, ListCatalogsResponse> listCatalogsCallable;
172   private final UnaryCallable<ListCatalogsRequest, ListCatalogsPagedResponse>
173       listCatalogsPagedCallable;
174   private final UnaryCallable<UpdateCatalogRequest, Catalog> updateCatalogCallable;
175   private final UnaryCallable<SetDefaultBranchRequest, Empty> setDefaultBranchCallable;
176   private final UnaryCallable<GetDefaultBranchRequest, GetDefaultBranchResponse>
177       getDefaultBranchCallable;
178   private final UnaryCallable<GetCompletionConfigRequest, CompletionConfig>
179       getCompletionConfigCallable;
180   private final UnaryCallable<UpdateCompletionConfigRequest, CompletionConfig>
181       updateCompletionConfigCallable;
182   private final UnaryCallable<GetAttributesConfigRequest, AttributesConfig>
183       getAttributesConfigCallable;
184   private final UnaryCallable<UpdateAttributesConfigRequest, AttributesConfig>
185       updateAttributesConfigCallable;
186   private final UnaryCallable<AddCatalogAttributeRequest, AttributesConfig>
187       addCatalogAttributeCallable;
188   private final UnaryCallable<RemoveCatalogAttributeRequest, AttributesConfig>
189       removeCatalogAttributeCallable;
190   private final UnaryCallable<ReplaceCatalogAttributeRequest, AttributesConfig>
191       replaceCatalogAttributeCallable;
192 
193   private final BackgroundResource backgroundResources;
194   private final GrpcOperationsStub operationsStub;
195   private final GrpcStubCallableFactory callableFactory;
196 
create(CatalogServiceStubSettings settings)197   public static final GrpcCatalogServiceStub create(CatalogServiceStubSettings settings)
198       throws IOException {
199     return new GrpcCatalogServiceStub(settings, ClientContext.create(settings));
200   }
201 
create(ClientContext clientContext)202   public static final GrpcCatalogServiceStub create(ClientContext clientContext)
203       throws IOException {
204     return new GrpcCatalogServiceStub(
205         CatalogServiceStubSettings.newBuilder().build(), clientContext);
206   }
207 
create( ClientContext clientContext, GrpcStubCallableFactory callableFactory)208   public static final GrpcCatalogServiceStub create(
209       ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException {
210     return new GrpcCatalogServiceStub(
211         CatalogServiceStubSettings.newBuilder().build(), clientContext, callableFactory);
212   }
213 
214   /**
215    * Constructs an instance of GrpcCatalogServiceStub, using the given settings. This is protected
216    * so that it is easy to make a subclass, but otherwise, the static factory methods should be
217    * preferred.
218    */
GrpcCatalogServiceStub(CatalogServiceStubSettings settings, ClientContext clientContext)219   protected GrpcCatalogServiceStub(CatalogServiceStubSettings settings, ClientContext clientContext)
220       throws IOException {
221     this(settings, clientContext, new GrpcCatalogServiceCallableFactory());
222   }
223 
224   /**
225    * Constructs an instance of GrpcCatalogServiceStub, using the given settings. This is protected
226    * so that it is easy to make a subclass, but otherwise, the static factory methods should be
227    * preferred.
228    */
GrpcCatalogServiceStub( CatalogServiceStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory)229   protected GrpcCatalogServiceStub(
230       CatalogServiceStubSettings settings,
231       ClientContext clientContext,
232       GrpcStubCallableFactory callableFactory)
233       throws IOException {
234     this.callableFactory = callableFactory;
235     this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory);
236 
237     GrpcCallSettings<ListCatalogsRequest, ListCatalogsResponse> listCatalogsTransportSettings =
238         GrpcCallSettings.<ListCatalogsRequest, ListCatalogsResponse>newBuilder()
239             .setMethodDescriptor(listCatalogsMethodDescriptor)
240             .setParamsExtractor(
241                 request -> {
242                   ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
243                   params.put("parent", String.valueOf(request.getParent()));
244                   return params.build();
245                 })
246             .build();
247     GrpcCallSettings<UpdateCatalogRequest, Catalog> updateCatalogTransportSettings =
248         GrpcCallSettings.<UpdateCatalogRequest, Catalog>newBuilder()
249             .setMethodDescriptor(updateCatalogMethodDescriptor)
250             .setParamsExtractor(
251                 request -> {
252                   ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
253                   params.put("catalog.name", String.valueOf(request.getCatalog().getName()));
254                   return params.build();
255                 })
256             .build();
257     GrpcCallSettings<SetDefaultBranchRequest, Empty> setDefaultBranchTransportSettings =
258         GrpcCallSettings.<SetDefaultBranchRequest, Empty>newBuilder()
259             .setMethodDescriptor(setDefaultBranchMethodDescriptor)
260             .setParamsExtractor(
261                 request -> {
262                   ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
263                   params.put("catalog", String.valueOf(request.getCatalog()));
264                   return params.build();
265                 })
266             .build();
267     GrpcCallSettings<GetDefaultBranchRequest, GetDefaultBranchResponse>
268         getDefaultBranchTransportSettings =
269             GrpcCallSettings.<GetDefaultBranchRequest, GetDefaultBranchResponse>newBuilder()
270                 .setMethodDescriptor(getDefaultBranchMethodDescriptor)
271                 .setParamsExtractor(
272                     request -> {
273                       ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
274                       params.put("catalog", String.valueOf(request.getCatalog()));
275                       return params.build();
276                     })
277                 .build();
278     GrpcCallSettings<GetCompletionConfigRequest, CompletionConfig>
279         getCompletionConfigTransportSettings =
280             GrpcCallSettings.<GetCompletionConfigRequest, CompletionConfig>newBuilder()
281                 .setMethodDescriptor(getCompletionConfigMethodDescriptor)
282                 .setParamsExtractor(
283                     request -> {
284                       ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
285                       params.put("name", String.valueOf(request.getName()));
286                       return params.build();
287                     })
288                 .build();
289     GrpcCallSettings<UpdateCompletionConfigRequest, CompletionConfig>
290         updateCompletionConfigTransportSettings =
291             GrpcCallSettings.<UpdateCompletionConfigRequest, CompletionConfig>newBuilder()
292                 .setMethodDescriptor(updateCompletionConfigMethodDescriptor)
293                 .setParamsExtractor(
294                     request -> {
295                       ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
296                       params.put(
297                           "completion_config.name",
298                           String.valueOf(request.getCompletionConfig().getName()));
299                       return params.build();
300                     })
301                 .build();
302     GrpcCallSettings<GetAttributesConfigRequest, AttributesConfig>
303         getAttributesConfigTransportSettings =
304             GrpcCallSettings.<GetAttributesConfigRequest, AttributesConfig>newBuilder()
305                 .setMethodDescriptor(getAttributesConfigMethodDescriptor)
306                 .setParamsExtractor(
307                     request -> {
308                       ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
309                       params.put("name", String.valueOf(request.getName()));
310                       return params.build();
311                     })
312                 .build();
313     GrpcCallSettings<UpdateAttributesConfigRequest, AttributesConfig>
314         updateAttributesConfigTransportSettings =
315             GrpcCallSettings.<UpdateAttributesConfigRequest, AttributesConfig>newBuilder()
316                 .setMethodDescriptor(updateAttributesConfigMethodDescriptor)
317                 .setParamsExtractor(
318                     request -> {
319                       ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
320                       params.put(
321                           "attributes_config.name",
322                           String.valueOf(request.getAttributesConfig().getName()));
323                       return params.build();
324                     })
325                 .build();
326     GrpcCallSettings<AddCatalogAttributeRequest, AttributesConfig>
327         addCatalogAttributeTransportSettings =
328             GrpcCallSettings.<AddCatalogAttributeRequest, AttributesConfig>newBuilder()
329                 .setMethodDescriptor(addCatalogAttributeMethodDescriptor)
330                 .setParamsExtractor(
331                     request -> {
332                       ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
333                       params.put(
334                           "attributes_config", String.valueOf(request.getAttributesConfig()));
335                       return params.build();
336                     })
337                 .build();
338     GrpcCallSettings<RemoveCatalogAttributeRequest, AttributesConfig>
339         removeCatalogAttributeTransportSettings =
340             GrpcCallSettings.<RemoveCatalogAttributeRequest, AttributesConfig>newBuilder()
341                 .setMethodDescriptor(removeCatalogAttributeMethodDescriptor)
342                 .setParamsExtractor(
343                     request -> {
344                       ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
345                       params.put(
346                           "attributes_config", String.valueOf(request.getAttributesConfig()));
347                       return params.build();
348                     })
349                 .build();
350     GrpcCallSettings<ReplaceCatalogAttributeRequest, AttributesConfig>
351         replaceCatalogAttributeTransportSettings =
352             GrpcCallSettings.<ReplaceCatalogAttributeRequest, AttributesConfig>newBuilder()
353                 .setMethodDescriptor(replaceCatalogAttributeMethodDescriptor)
354                 .setParamsExtractor(
355                     request -> {
356                       ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
357                       params.put(
358                           "attributes_config", String.valueOf(request.getAttributesConfig()));
359                       return params.build();
360                     })
361                 .build();
362 
363     this.listCatalogsCallable =
364         callableFactory.createUnaryCallable(
365             listCatalogsTransportSettings, settings.listCatalogsSettings(), clientContext);
366     this.listCatalogsPagedCallable =
367         callableFactory.createPagedCallable(
368             listCatalogsTransportSettings, settings.listCatalogsSettings(), clientContext);
369     this.updateCatalogCallable =
370         callableFactory.createUnaryCallable(
371             updateCatalogTransportSettings, settings.updateCatalogSettings(), clientContext);
372     this.setDefaultBranchCallable =
373         callableFactory.createUnaryCallable(
374             setDefaultBranchTransportSettings, settings.setDefaultBranchSettings(), clientContext);
375     this.getDefaultBranchCallable =
376         callableFactory.createUnaryCallable(
377             getDefaultBranchTransportSettings, settings.getDefaultBranchSettings(), clientContext);
378     this.getCompletionConfigCallable =
379         callableFactory.createUnaryCallable(
380             getCompletionConfigTransportSettings,
381             settings.getCompletionConfigSettings(),
382             clientContext);
383     this.updateCompletionConfigCallable =
384         callableFactory.createUnaryCallable(
385             updateCompletionConfigTransportSettings,
386             settings.updateCompletionConfigSettings(),
387             clientContext);
388     this.getAttributesConfigCallable =
389         callableFactory.createUnaryCallable(
390             getAttributesConfigTransportSettings,
391             settings.getAttributesConfigSettings(),
392             clientContext);
393     this.updateAttributesConfigCallable =
394         callableFactory.createUnaryCallable(
395             updateAttributesConfigTransportSettings,
396             settings.updateAttributesConfigSettings(),
397             clientContext);
398     this.addCatalogAttributeCallable =
399         callableFactory.createUnaryCallable(
400             addCatalogAttributeTransportSettings,
401             settings.addCatalogAttributeSettings(),
402             clientContext);
403     this.removeCatalogAttributeCallable =
404         callableFactory.createUnaryCallable(
405             removeCatalogAttributeTransportSettings,
406             settings.removeCatalogAttributeSettings(),
407             clientContext);
408     this.replaceCatalogAttributeCallable =
409         callableFactory.createUnaryCallable(
410             replaceCatalogAttributeTransportSettings,
411             settings.replaceCatalogAttributeSettings(),
412             clientContext);
413 
414     this.backgroundResources =
415         new BackgroundResourceAggregation(clientContext.getBackgroundResources());
416   }
417 
getOperationsStub()418   public GrpcOperationsStub getOperationsStub() {
419     return operationsStub;
420   }
421 
422   @Override
listCatalogsCallable()423   public UnaryCallable<ListCatalogsRequest, ListCatalogsResponse> listCatalogsCallable() {
424     return listCatalogsCallable;
425   }
426 
427   @Override
listCatalogsPagedCallable()428   public UnaryCallable<ListCatalogsRequest, ListCatalogsPagedResponse> listCatalogsPagedCallable() {
429     return listCatalogsPagedCallable;
430   }
431 
432   @Override
updateCatalogCallable()433   public UnaryCallable<UpdateCatalogRequest, Catalog> updateCatalogCallable() {
434     return updateCatalogCallable;
435   }
436 
437   @Override
setDefaultBranchCallable()438   public UnaryCallable<SetDefaultBranchRequest, Empty> setDefaultBranchCallable() {
439     return setDefaultBranchCallable;
440   }
441 
442   @Override
443   public UnaryCallable<GetDefaultBranchRequest, GetDefaultBranchResponse>
getDefaultBranchCallable()444       getDefaultBranchCallable() {
445     return getDefaultBranchCallable;
446   }
447 
448   @Override
getCompletionConfigCallable()449   public UnaryCallable<GetCompletionConfigRequest, CompletionConfig> getCompletionConfigCallable() {
450     return getCompletionConfigCallable;
451   }
452 
453   @Override
454   public UnaryCallable<UpdateCompletionConfigRequest, CompletionConfig>
updateCompletionConfigCallable()455       updateCompletionConfigCallable() {
456     return updateCompletionConfigCallable;
457   }
458 
459   @Override
getAttributesConfigCallable()460   public UnaryCallable<GetAttributesConfigRequest, AttributesConfig> getAttributesConfigCallable() {
461     return getAttributesConfigCallable;
462   }
463 
464   @Override
465   public UnaryCallable<UpdateAttributesConfigRequest, AttributesConfig>
updateAttributesConfigCallable()466       updateAttributesConfigCallable() {
467     return updateAttributesConfigCallable;
468   }
469 
470   @Override
addCatalogAttributeCallable()471   public UnaryCallable<AddCatalogAttributeRequest, AttributesConfig> addCatalogAttributeCallable() {
472     return addCatalogAttributeCallable;
473   }
474 
475   @Override
476   public UnaryCallable<RemoveCatalogAttributeRequest, AttributesConfig>
removeCatalogAttributeCallable()477       removeCatalogAttributeCallable() {
478     return removeCatalogAttributeCallable;
479   }
480 
481   @Override
482   public UnaryCallable<ReplaceCatalogAttributeRequest, AttributesConfig>
replaceCatalogAttributeCallable()483       replaceCatalogAttributeCallable() {
484     return replaceCatalogAttributeCallable;
485   }
486 
487   @Override
close()488   public final void close() {
489     try {
490       backgroundResources.close();
491     } catch (RuntimeException e) {
492       throw e;
493     } catch (Exception e) {
494       throw new IllegalStateException("Failed to close resource", e);
495     }
496   }
497 
498   @Override
shutdown()499   public void shutdown() {
500     backgroundResources.shutdown();
501   }
502 
503   @Override
isShutdown()504   public boolean isShutdown() {
505     return backgroundResources.isShutdown();
506   }
507 
508   @Override
isTerminated()509   public boolean isTerminated() {
510     return backgroundResources.isTerminated();
511   }
512 
513   @Override
shutdownNow()514   public void shutdownNow() {
515     backgroundResources.shutdownNow();
516   }
517 
518   @Override
awaitTermination(long duration, TimeUnit unit)519   public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
520     return backgroundResources.awaitTermination(duration, unit);
521   }
522 }
523