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

feat!: release gapic-generator-java v2.0.0 #833

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -16,7 +16,6 @@

package com.google.cloud.automl.v1;

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 @@ -2442,12 +2441,7 @@ public static ApiFuture<ListDatasetsPagedResponse> createAsync(
ListDatasetsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListDatasetsPage, ListDatasetsPagedResponse>() {
@Override
public ListDatasetsPagedResponse apply(ListDatasetsPage input) {
return new ListDatasetsPagedResponse(input);
}
},
input -> new ListDatasetsPagedResponse(input),
MoreExecutors.directExecutor());
}

Expand Down Expand Up @@ -2521,14 +2515,7 @@ public static ApiFuture<ListModelsPagedResponse> createAsync(
ApiFuture<ListModelsPage> futurePage =
ListModelsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListModelsPage, ListModelsPagedResponse>() {
@Override
public ListModelsPagedResponse apply(ListModelsPage input) {
return new ListModelsPagedResponse(input);
}
},
MoreExecutors.directExecutor());
futurePage, input -> new ListModelsPagedResponse(input), MoreExecutors.directExecutor());
}

private ListModelsPagedResponse(ListModelsPage page) {
Expand Down Expand Up @@ -2603,12 +2590,7 @@ public static ApiFuture<ListModelEvaluationsPagedResponse> createAsync(
ListModelEvaluationsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListModelEvaluationsPage, ListModelEvaluationsPagedResponse>() {
@Override
public ListModelEvaluationsPagedResponse apply(ListModelEvaluationsPage input) {
return new ListModelEvaluationsPagedResponse(input);
}
},
input -> new ListModelEvaluationsPagedResponse(input),
MoreExecutors.directExecutor());
}

Expand Down
Expand Up @@ -308,14 +308,13 @@ public AutoMlStubSettings.Builder getStubSettingsBuilder() {
return ((AutoMlStubSettings.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 @@ -169,14 +169,13 @@ public PredictionServiceStubSettings.Builder getStubSettingsBuilder() {
return ((PredictionServiceStubSettings.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 @@ -1111,14 +1111,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

Large diffs are not rendered by default.

Expand Up @@ -22,7 +22,6 @@
import com.google.api.gax.grpc.GrpcStubCallableFactory;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.RequestParamsExtractor;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.automl.v1.BatchPredictRequest;
import com.google.cloud.automl.v1.BatchPredictResult;
Expand All @@ -35,7 +34,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 @@ -117,26 +115,20 @@ protected GrpcPredictionServiceStub(
GrpcCallSettings.<PredictRequest, PredictResponse>newBuilder()
.setMethodDescriptor(predictMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<PredictRequest>() {
@Override
public Map<String, String> extract(PredictRequest 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<BatchPredictRequest, Operation> batchPredictTransportSettings =
GrpcCallSettings.<BatchPredictRequest, Operation>newBuilder()
.setMethodDescriptor(batchPredictMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<BatchPredictRequest>() {
@Override
public Map<String, String> extract(BatchPredictRequest 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 @@ -179,7 +171,13 @@ public UnaryCallable<BatchPredictRequest, Operation> batchPredictCallable() {

@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 @@ -302,14 +302,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.automl.v1beta1;

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 @@ -3140,12 +3139,7 @@ public static ApiFuture<ListDatasetsPagedResponse> createAsync(
ListDatasetsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListDatasetsPage, ListDatasetsPagedResponse>() {
@Override
public ListDatasetsPagedResponse apply(ListDatasetsPage input) {
return new ListDatasetsPagedResponse(input);
}
},
input -> new ListDatasetsPagedResponse(input),
MoreExecutors.directExecutor());
}

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

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

Expand Down Expand Up @@ -3382,14 +3366,7 @@ public static ApiFuture<ListModelsPagedResponse> createAsync(
ApiFuture<ListModelsPage> futurePage =
ListModelsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListModelsPage, ListModelsPagedResponse>() {
@Override
public ListModelsPagedResponse apply(ListModelsPage input) {
return new ListModelsPagedResponse(input);
}
},
MoreExecutors.directExecutor());
futurePage, input -> new ListModelsPagedResponse(input), MoreExecutors.directExecutor());
}

private ListModelsPagedResponse(ListModelsPage page) {
Expand Down Expand Up @@ -3464,12 +3441,7 @@ public static ApiFuture<ListModelEvaluationsPagedResponse> createAsync(
ListModelEvaluationsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListModelEvaluationsPage, ListModelEvaluationsPagedResponse>() {
@Override
public ListModelEvaluationsPagedResponse apply(ListModelEvaluationsPage input) {
return new ListModelEvaluationsPagedResponse(input);
}
},
input -> new ListModelEvaluationsPagedResponse(input),
MoreExecutors.directExecutor());
}

Expand Down
Expand Up @@ -346,14 +346,13 @@ public AutoMlStubSettings.Builder getStubSettingsBuilder() {
return ((AutoMlStubSettings.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 @@ -170,14 +170,13 @@ public PredictionServiceStubSettings.Builder getStubSettingsBuilder() {
return ((PredictionServiceStubSettings.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 @@ -1356,14 +1356,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