Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

Commit

Permalink
chore: Re-generated to pick up changes from googleapis (#615)
Browse files Browse the repository at this point in the history
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/65fbd59d-5c6b-402d-aaaf-fdf6962fdbbc/targets

- [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.)

PiperOrigin-RevId: 389755489
Source-Link: googleapis/googleapis@10185d0
PiperOrigin-RevId: 388535346
Source-Link: googleapis/googleapis@d9eaf41
PiperOrigin-RevId: 388499329
Source-Link: googleapis/googleapis@bb0a090
  • Loading branch information
yoshi-automation committed Aug 19, 2021
1 parent 5e665ac commit 445f9df
Show file tree
Hide file tree
Showing 30 changed files with 1,495 additions and 306 deletions.
Expand Up @@ -175,14 +175,13 @@ public SpeechStubSettings.Builder getStubSettingsBuilder() {
return ((SpeechStubSettings.Builder) getStubSettings());
}

// NEXT_MAJOR_VER: remove 'throws Exception'.
/**
* Applies the given settings updater function to all of the unary API methods in this service.
*
* <p>Note: This method does not support applying settings to streaming methods.
*/
public Builder applyToAllUnaryMethods(
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) throws Exception {
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
super.applyToAllUnaryMethods(
getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
return this;
Expand Down
Expand Up @@ -191,7 +191,13 @@ public UnaryCallable<LongRunningRecognizeRequest, Operation> longRunningRecogniz

@Override
public final void close() {
shutdown();
try {
backgroundResources.close();
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new IllegalStateException("Failed to close resource", e);
}
}

@Override
Expand Down
Expand Up @@ -342,14 +342,13 @@ private static Builder initDefaults(Builder builder) {
return builder;
}

// NEXT_MAJOR_VER: remove 'throws Exception'.
/**
* Applies the given settings updater function to all of the unary API methods in this service.
*
* <p>Note: This method does not support applying settings to streaming methods.
*/
public Builder applyToAllUnaryMethods(
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) throws Exception {
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater);
return this;
}
Expand Down
Expand Up @@ -16,7 +16,6 @@

package com.google.cloud.speech.v1p1beta1;

import com.google.api.core.ApiFunction;
import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutures;
import com.google.api.core.BetaApi;
Expand Down Expand Up @@ -1233,12 +1232,7 @@ public static ApiFuture<ListPhraseSetPagedResponse> createAsync(
ListPhraseSetPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListPhraseSetPage, ListPhraseSetPagedResponse>() {
@Override
public ListPhraseSetPagedResponse apply(ListPhraseSetPage input) {
return new ListPhraseSetPagedResponse(input);
}
},
input -> new ListPhraseSetPagedResponse(input),
MoreExecutors.directExecutor());
}

Expand Down Expand Up @@ -1314,12 +1308,7 @@ public static ApiFuture<ListCustomClassesPagedResponse> createAsync(
ListCustomClassesPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListCustomClassesPage, ListCustomClassesPagedResponse>() {
@Override
public ListCustomClassesPagedResponse apply(ListCustomClassesPage input) {
return new ListCustomClassesPagedResponse(input);
}
},
input -> new ListCustomClassesPagedResponse(input),
MoreExecutors.directExecutor());
}

Expand Down
Expand Up @@ -208,14 +208,13 @@ public AdaptationStubSettings.Builder getStubSettingsBuilder() {
return ((AdaptationStubSettings.Builder) getStubSettings());
}

// NEXT_MAJOR_VER: remove 'throws Exception'.
/**
* Applies the given settings updater function to all of the unary API methods in this service.
*
* <p>Note: This method does not support applying settings to streaming methods.
*/
public Builder applyToAllUnaryMethods(
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) throws Exception {
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
super.applyToAllUnaryMethods(
getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
return this;
Expand Down
Expand Up @@ -176,14 +176,13 @@ public SpeechStubSettings.Builder getStubSettingsBuilder() {
return ((SpeechStubSettings.Builder) getStubSettings());
}

// NEXT_MAJOR_VER: remove 'throws Exception'.
/**
* Applies the given settings updater function to all of the unary API methods in this service.
*
* <p>Note: This method does not support applying settings to streaming methods.
*/
public Builder applyToAllUnaryMethods(
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) throws Exception {
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
super.applyToAllUnaryMethods(
getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
return this;
Expand Down
Expand Up @@ -541,14 +541,13 @@ private static Builder initDefaults(Builder builder) {
return builder;
}

// NEXT_MAJOR_VER: remove 'throws Exception'.
/**
* Applies the given settings updater function to all of the unary API methods in this service.
*
* <p>Note: This method does not support applying settings to streaming methods.
*/
public Builder applyToAllUnaryMethods(
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) throws Exception {
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater);
return this;
}
Expand Down
Expand Up @@ -25,7 +25,6 @@
import com.google.api.gax.grpc.GrpcCallSettings;
import com.google.api.gax.grpc.GrpcStubCallableFactory;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.RequestParamsExtractor;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest;
import com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest;
Expand All @@ -47,7 +46,6 @@
import io.grpc.MethodDescriptor;
import io.grpc.protobuf.ProtoUtils;
import java.io.IOException;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;

Expand Down Expand Up @@ -223,132 +221,102 @@ protected GrpcAdaptationStub(
GrpcCallSettings.<CreatePhraseSetRequest, PhraseSet>newBuilder()
.setMethodDescriptor(createPhraseSetMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<CreatePhraseSetRequest>() {
@Override
public Map<String, String> extract(CreatePhraseSetRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
})
.build();
GrpcCallSettings<GetPhraseSetRequest, PhraseSet> getPhraseSetTransportSettings =
GrpcCallSettings.<GetPhraseSetRequest, PhraseSet>newBuilder()
.setMethodDescriptor(getPhraseSetMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<GetPhraseSetRequest>() {
@Override
public Map<String, String> extract(GetPhraseSetRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
})
.build();
GrpcCallSettings<ListPhraseSetRequest, ListPhraseSetResponse> listPhraseSetTransportSettings =
GrpcCallSettings.<ListPhraseSetRequest, ListPhraseSetResponse>newBuilder()
.setMethodDescriptor(listPhraseSetMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListPhraseSetRequest>() {
@Override
public Map<String, String> extract(ListPhraseSetRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
})
.build();
GrpcCallSettings<UpdatePhraseSetRequest, PhraseSet> updatePhraseSetTransportSettings =
GrpcCallSettings.<UpdatePhraseSetRequest, PhraseSet>newBuilder()
.setMethodDescriptor(updatePhraseSetMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<UpdatePhraseSetRequest>() {
@Override
public Map<String, String> extract(UpdatePhraseSetRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("phrase_set.name", String.valueOf(request.getPhraseSet().getName()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("phrase_set.name", String.valueOf(request.getPhraseSet().getName()));
return params.build();
})
.build();
GrpcCallSettings<DeletePhraseSetRequest, Empty> deletePhraseSetTransportSettings =
GrpcCallSettings.<DeletePhraseSetRequest, Empty>newBuilder()
.setMethodDescriptor(deletePhraseSetMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<DeletePhraseSetRequest>() {
@Override
public Map<String, String> extract(DeletePhraseSetRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
})
.build();
GrpcCallSettings<CreateCustomClassRequest, CustomClass> createCustomClassTransportSettings =
GrpcCallSettings.<CreateCustomClassRequest, CustomClass>newBuilder()
.setMethodDescriptor(createCustomClassMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<CreateCustomClassRequest>() {
@Override
public Map<String, String> extract(CreateCustomClassRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
})
.build();
GrpcCallSettings<GetCustomClassRequest, CustomClass> getCustomClassTransportSettings =
GrpcCallSettings.<GetCustomClassRequest, CustomClass>newBuilder()
.setMethodDescriptor(getCustomClassMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<GetCustomClassRequest>() {
@Override
public Map<String, String> extract(GetCustomClassRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
})
.build();
GrpcCallSettings<ListCustomClassesRequest, ListCustomClassesResponse>
listCustomClassesTransportSettings =
GrpcCallSettings.<ListCustomClassesRequest, ListCustomClassesResponse>newBuilder()
.setMethodDescriptor(listCustomClassesMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListCustomClassesRequest>() {
@Override
public Map<String, String> extract(ListCustomClassesRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("parent", String.valueOf(request.getParent()));
return params.build();
})
.build();
GrpcCallSettings<UpdateCustomClassRequest, CustomClass> updateCustomClassTransportSettings =
GrpcCallSettings.<UpdateCustomClassRequest, CustomClass>newBuilder()
.setMethodDescriptor(updateCustomClassMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<UpdateCustomClassRequest>() {
@Override
public Map<String, String> extract(UpdateCustomClassRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put(
"custom_class.name", String.valueOf(request.getCustomClass().getName()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put(
"custom_class.name", String.valueOf(request.getCustomClass().getName()));
return params.build();
})
.build();
GrpcCallSettings<DeleteCustomClassRequest, Empty> deleteCustomClassTransportSettings =
GrpcCallSettings.<DeleteCustomClassRequest, Empty>newBuilder()
.setMethodDescriptor(deleteCustomClassMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<DeleteCustomClassRequest>() {
@Override
public Map<String, String> extract(DeleteCustomClassRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("name", String.valueOf(request.getName()));
return params.build();
})
.build();

Expand Down Expand Up @@ -472,7 +440,13 @@ public UnaryCallable<DeleteCustomClassRequest, Empty> deleteCustomClassCallable(

@Override
public final void close() {
shutdown();
try {
backgroundResources.close();
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new IllegalStateException("Failed to close resource", e);
}
}

@Override
Expand Down
Expand Up @@ -193,7 +193,13 @@ public UnaryCallable<LongRunningRecognizeRequest, Operation> longRunningRecogniz

@Override
public final void close() {
shutdown();
try {
backgroundResources.close();
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new IllegalStateException("Failed to close resource", e);
}
}

@Override
Expand Down
Expand Up @@ -343,14 +343,13 @@ private static Builder initDefaults(Builder builder) {
return builder;
}

// NEXT_MAJOR_VER: remove 'throws Exception'.
/**
* Applies the given settings updater function to all of the unary API methods in this service.
*
* <p>Note: This method does not support applying settings to streaming methods.
*/
public Builder applyToAllUnaryMethods(
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) throws Exception {
ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) {
super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater);
return this;
}
Expand Down
Expand Up @@ -30,6 +30,7 @@
import com.google.longrunning.Operation;
import com.google.protobuf.AbstractMessage;
import com.google.protobuf.Any;
import com.google.protobuf.Duration;
import com.google.rpc.Status;
import io.grpc.StatusRuntimeException;
import java.io.IOException;
Expand Down Expand Up @@ -89,6 +90,7 @@ public void recognizeTest() throws Exception {
RecognizeResponse expectedResponse =
RecognizeResponse.newBuilder()
.addAllResults(new ArrayList<SpeechRecognitionResult>())
.setTotalBilledTime(Duration.newBuilder().build())
.build();
mockSpeech.addResponse(expectedResponse);

Expand Down Expand Up @@ -130,6 +132,7 @@ public void longRunningRecognizeTest() throws Exception {
LongRunningRecognizeResponse expectedResponse =
LongRunningRecognizeResponse.newBuilder()
.addAllResults(new ArrayList<SpeechRecognitionResult>())
.setTotalBilledTime(Duration.newBuilder().build())
.build();
Operation resultOperation =
Operation.newBuilder()
Expand Down Expand Up @@ -182,6 +185,7 @@ public void streamingRecognizeTest() throws Exception {
StreamingRecognizeResponse.newBuilder()
.setError(Status.newBuilder().build())
.addAllResults(new ArrayList<StreamingRecognitionResult>())
.setTotalBilledTime(Duration.newBuilder().build())
.build();
mockSpeech.addResponse(expectedResponse);
StreamingRecognizeRequest request = StreamingRecognizeRequest.newBuilder().build();
Expand Down

0 comments on commit 445f9df

Please sign in to comment.