com.google.cloud.speech.v1p1beta1.stub.HttpJsonAdaptationStub Maven / Gradle / Ivy
Show all versions of google-cloud-speech Show documentation
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.cloud.speech.v1p1beta1.stub;
import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListCustomClassesPagedResponse;
import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListPhraseSetPagedResponse;
import com.google.api.core.BetaApi;
import com.google.api.core.InternalApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.core.BackgroundResourceAggregation;
import com.google.api.gax.httpjson.ApiMethodDescriptor;
import com.google.api.gax.httpjson.HttpJsonCallSettings;
import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
import com.google.api.gax.httpjson.ProtoMessageRequestFormatter;
import com.google.api.gax.httpjson.ProtoMessageResponseParser;
import com.google.api.gax.httpjson.ProtoRestSerializer;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.RequestParamsBuilder;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest;
import com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest;
import com.google.cloud.speech.v1p1beta1.CustomClass;
import com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest;
import com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest;
import com.google.cloud.speech.v1p1beta1.GetCustomClassRequest;
import com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest;
import com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest;
import com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse;
import com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest;
import com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse;
import com.google.cloud.speech.v1p1beta1.PhraseSet;
import com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest;
import com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest;
import com.google.protobuf.Empty;
import com.google.protobuf.TypeRegistry;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;
// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
* REST stub implementation for the Adaptation service API.
*
* This class is for advanced usage and reflects the underlying API directly.
*/
@BetaApi
@Generated("by gapic-generator-java")
public class HttpJsonAdaptationStub extends AdaptationStub {
private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build();
private static final ApiMethodDescriptor
createPhraseSetMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/CreatePhraseSet")
.setHttpMethod("POST")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1p1beta1/{parent=projects/*/locations/*}/phraseSets",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "parent", request.getParent());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("*", request.toBuilder().clearParent().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(PhraseSet.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();
private static final ApiMethodDescriptor
getPhraseSetMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/GetPhraseSet")
.setHttpMethod("GET")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1p1beta1/{name=projects/*/locations/*/phraseSets/*}",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "name", request.getName());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(PhraseSet.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();
private static final ApiMethodDescriptor
listPhraseSetMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/ListPhraseSet")
.setHttpMethod("GET")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1p1beta1/{parent=projects/*/locations/*}/phraseSets",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "parent", request.getParent());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "pageSize", request.getPageSize());
serializer.putQueryParam(fields, "pageToken", request.getPageToken());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(ListPhraseSetResponse.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();
private static final ApiMethodDescriptor
updatePhraseSetMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/UpdatePhraseSet")
.setHttpMethod("PATCH")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1p1beta1/{phraseSet.name=projects/*/locations/*/phraseSets/*}",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(
fields, "phraseSet.name", request.getPhraseSet().getName());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "updateMask", request.getUpdateMask());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("phraseSet", request.getPhraseSet(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(PhraseSet.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();
private static final ApiMethodDescriptor
deletePhraseSetMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/DeletePhraseSet")
.setHttpMethod("DELETE")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1p1beta1/{name=projects/*/locations/*/phraseSets/*}",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "name", request.getName());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(Empty.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();
private static final ApiMethodDescriptor
createCustomClassMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/CreateCustomClass")
.setHttpMethod("POST")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1p1beta1/{parent=projects/*/locations/*}/customClasses",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "parent", request.getParent());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("*", request.toBuilder().clearParent().build(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(CustomClass.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();
private static final ApiMethodDescriptor
getCustomClassMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/GetCustomClass")
.setHttpMethod("GET")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1p1beta1/{name=projects/*/locations/*/customClasses/*}",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "name", request.getName());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(CustomClass.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();
private static final ApiMethodDescriptor
listCustomClassesMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/ListCustomClasses")
.setHttpMethod("GET")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1p1beta1/{parent=projects/*/locations/*}/customClasses",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "parent", request.getParent());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "pageSize", request.getPageSize());
serializer.putQueryParam(fields, "pageToken", request.getPageToken());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(ListCustomClassesResponse.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();
private static final ApiMethodDescriptor
updateCustomClassMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/UpdateCustomClass")
.setHttpMethod("PATCH")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1p1beta1/{customClass.name=projects/*/locations/*/customClasses/*}",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(
fields, "customClass.name", request.getCustomClass().getName());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "updateMask", request.getUpdateMask());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(
request ->
ProtoRestSerializer.create()
.toBody("customClass", request.getCustomClass(), true))
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(CustomClass.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();
private static final ApiMethodDescriptor
deleteCustomClassMethodDescriptor =
ApiMethodDescriptor.newBuilder()
.setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/DeleteCustomClass")
.setHttpMethod("DELETE")
.setType(ApiMethodDescriptor.MethodType.UNARY)
.setRequestFormatter(
ProtoMessageRequestFormatter.newBuilder()
.setPath(
"/v1p1beta1/{name=projects/*/locations/*/customClasses/*}",
request -> {
Map fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "name", request.getName());
return fields;
})
.setQueryParamsExtractor(
request -> {
Map> fields = new HashMap<>();
ProtoRestSerializer serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
.setRequestBodyExtractor(request -> null)
.build())
.setResponseParser(
ProtoMessageResponseParser.newBuilder()
.setDefaultInstance(Empty.getDefaultInstance())
.setDefaultTypeRegistry(typeRegistry)
.build())
.build();
private final UnaryCallable createPhraseSetCallable;
private final UnaryCallable getPhraseSetCallable;
private final UnaryCallable listPhraseSetCallable;
private final UnaryCallable
listPhraseSetPagedCallable;
private final UnaryCallable updatePhraseSetCallable;
private final UnaryCallable deletePhraseSetCallable;
private final UnaryCallable createCustomClassCallable;
private final UnaryCallable getCustomClassCallable;
private final UnaryCallable
listCustomClassesCallable;
private final UnaryCallable
listCustomClassesPagedCallable;
private final UnaryCallable updateCustomClassCallable;
private final UnaryCallable deleteCustomClassCallable;
private final BackgroundResource backgroundResources;
private final HttpJsonStubCallableFactory callableFactory;
public static final HttpJsonAdaptationStub create(AdaptationStubSettings settings)
throws IOException {
return new HttpJsonAdaptationStub(settings, ClientContext.create(settings));
}
public static final HttpJsonAdaptationStub create(ClientContext clientContext)
throws IOException {
return new HttpJsonAdaptationStub(
AdaptationStubSettings.newHttpJsonBuilder().build(), clientContext);
}
public static final HttpJsonAdaptationStub create(
ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException {
return new HttpJsonAdaptationStub(
AdaptationStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory);
}
/**
* Constructs an instance of HttpJsonAdaptationStub, using the given settings. This is protected
* so that it is easy to make a subclass, but otherwise, the static factory methods should be
* preferred.
*/
protected HttpJsonAdaptationStub(AdaptationStubSettings settings, ClientContext clientContext)
throws IOException {
this(settings, clientContext, new HttpJsonAdaptationCallableFactory());
}
/**
* Constructs an instance of HttpJsonAdaptationStub, using the given settings. This is protected
* so that it is easy to make a subclass, but otherwise, the static factory methods should be
* preferred.
*/
protected HttpJsonAdaptationStub(
AdaptationStubSettings settings,
ClientContext clientContext,
HttpJsonStubCallableFactory callableFactory)
throws IOException {
this.callableFactory = callableFactory;
HttpJsonCallSettings createPhraseSetTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(createPhraseSetMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
HttpJsonCallSettings getPhraseSetTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(getPhraseSetMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
HttpJsonCallSettings
listPhraseSetTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(listPhraseSetMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
HttpJsonCallSettings updatePhraseSetTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(updatePhraseSetMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("phrase_set.name", String.valueOf(request.getPhraseSet().getName()));
return builder.build();
})
.build();
HttpJsonCallSettings deletePhraseSetTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(deletePhraseSetMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
HttpJsonCallSettings createCustomClassTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(createCustomClassMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
HttpJsonCallSettings getCustomClassTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(getCustomClassMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
HttpJsonCallSettings
listCustomClassesTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(listCustomClassesMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("parent", String.valueOf(request.getParent()));
return builder.build();
})
.build();
HttpJsonCallSettings updateCustomClassTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(updateCustomClassMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add(
"custom_class.name", String.valueOf(request.getCustomClass().getName()));
return builder.build();
})
.build();
HttpJsonCallSettings deleteCustomClassTransportSettings =
HttpJsonCallSettings.newBuilder()
.setMethodDescriptor(deleteCustomClassMethodDescriptor)
.setTypeRegistry(typeRegistry)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();
this.createPhraseSetCallable =
callableFactory.createUnaryCallable(
createPhraseSetTransportSettings, settings.createPhraseSetSettings(), clientContext);
this.getPhraseSetCallable =
callableFactory.createUnaryCallable(
getPhraseSetTransportSettings, settings.getPhraseSetSettings(), clientContext);
this.listPhraseSetCallable =
callableFactory.createUnaryCallable(
listPhraseSetTransportSettings, settings.listPhraseSetSettings(), clientContext);
this.listPhraseSetPagedCallable =
callableFactory.createPagedCallable(
listPhraseSetTransportSettings, settings.listPhraseSetSettings(), clientContext);
this.updatePhraseSetCallable =
callableFactory.createUnaryCallable(
updatePhraseSetTransportSettings, settings.updatePhraseSetSettings(), clientContext);
this.deletePhraseSetCallable =
callableFactory.createUnaryCallable(
deletePhraseSetTransportSettings, settings.deletePhraseSetSettings(), clientContext);
this.createCustomClassCallable =
callableFactory.createUnaryCallable(
createCustomClassTransportSettings,
settings.createCustomClassSettings(),
clientContext);
this.getCustomClassCallable =
callableFactory.createUnaryCallable(
getCustomClassTransportSettings, settings.getCustomClassSettings(), clientContext);
this.listCustomClassesCallable =
callableFactory.createUnaryCallable(
listCustomClassesTransportSettings,
settings.listCustomClassesSettings(),
clientContext);
this.listCustomClassesPagedCallable =
callableFactory.createPagedCallable(
listCustomClassesTransportSettings,
settings.listCustomClassesSettings(),
clientContext);
this.updateCustomClassCallable =
callableFactory.createUnaryCallable(
updateCustomClassTransportSettings,
settings.updateCustomClassSettings(),
clientContext);
this.deleteCustomClassCallable =
callableFactory.createUnaryCallable(
deleteCustomClassTransportSettings,
settings.deleteCustomClassSettings(),
clientContext);
this.backgroundResources =
new BackgroundResourceAggregation(clientContext.getBackgroundResources());
}
@InternalApi
public static List getMethodDescriptors() {
List methodDescriptors = new ArrayList<>();
methodDescriptors.add(createPhraseSetMethodDescriptor);
methodDescriptors.add(getPhraseSetMethodDescriptor);
methodDescriptors.add(listPhraseSetMethodDescriptor);
methodDescriptors.add(updatePhraseSetMethodDescriptor);
methodDescriptors.add(deletePhraseSetMethodDescriptor);
methodDescriptors.add(createCustomClassMethodDescriptor);
methodDescriptors.add(getCustomClassMethodDescriptor);
methodDescriptors.add(listCustomClassesMethodDescriptor);
methodDescriptors.add(updateCustomClassMethodDescriptor);
methodDescriptors.add(deleteCustomClassMethodDescriptor);
return methodDescriptors;
}
@Override
public UnaryCallable createPhraseSetCallable() {
return createPhraseSetCallable;
}
@Override
public UnaryCallable getPhraseSetCallable() {
return getPhraseSetCallable;
}
@Override
public UnaryCallable listPhraseSetCallable() {
return listPhraseSetCallable;
}
@Override
public UnaryCallable
listPhraseSetPagedCallable() {
return listPhraseSetPagedCallable;
}
@Override
public UnaryCallable updatePhraseSetCallable() {
return updatePhraseSetCallable;
}
@Override
public UnaryCallable deletePhraseSetCallable() {
return deletePhraseSetCallable;
}
@Override
public UnaryCallable createCustomClassCallable() {
return createCustomClassCallable;
}
@Override
public UnaryCallable getCustomClassCallable() {
return getCustomClassCallable;
}
@Override
public UnaryCallable
listCustomClassesCallable() {
return listCustomClassesCallable;
}
@Override
public UnaryCallable
listCustomClassesPagedCallable() {
return listCustomClassesPagedCallable;
}
@Override
public UnaryCallable updateCustomClassCallable() {
return updateCustomClassCallable;
}
@Override
public UnaryCallable deleteCustomClassCallable() {
return deleteCustomClassCallable;
}
@Override
public final void close() {
try {
backgroundResources.close();
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new IllegalStateException("Failed to close resource", e);
}
}
@Override
public void shutdown() {
backgroundResources.shutdown();
}
@Override
public boolean isShutdown() {
return backgroundResources.isShutdown();
}
@Override
public boolean isTerminated() {
return backgroundResources.isTerminated();
}
@Override
public void shutdownNow() {
backgroundResources.shutdownNow();
}
@Override
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
return backgroundResources.awaitTermination(duration, unit);
}
}