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 #36

Merged
merged 4 commits into from Aug 10, 2021
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.orchestration.airflow.service.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 @@ -749,12 +748,7 @@ public static ApiFuture<ListEnvironmentsPagedResponse> createAsync(
ListEnvironmentsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListEnvironmentsPage, ListEnvironmentsPagedResponse>() {
@Override
public ListEnvironmentsPagedResponse apply(ListEnvironmentsPage input) {
return new ListEnvironmentsPagedResponse(input);
}
},
input -> new ListEnvironmentsPagedResponse(input),
MoreExecutors.directExecutor());
}

Expand Down
Expand Up @@ -201,14 +201,13 @@ public EnvironmentsStubSettings.Builder getStubSettingsBuilder() {
return ((EnvironmentsStubSettings.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 @@ -16,7 +16,6 @@

package com.google.cloud.orchestration.airflow.service.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 @@ -312,12 +311,7 @@ public static ApiFuture<ListImageVersionsPagedResponse> createAsync(
ListImageVersionsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListImageVersionsPage, ListImageVersionsPagedResponse>() {
@Override
public ListImageVersionsPagedResponse apply(ListImageVersionsPage input) {
return new ListImageVersionsPagedResponse(input);
}
},
input -> new ListImageVersionsPagedResponse(input),
MoreExecutors.directExecutor());
}

Expand Down
Expand Up @@ -160,14 +160,13 @@ public ImageVersionsStubSettings.Builder getStubSettingsBuilder() {
return ((ImageVersionsStubSettings.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 @@ -509,14 +509,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 @@ -24,7 +24,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.orchestration.airflow.service.v1.CreateEnvironmentRequest;
import com.google.cloud.orchestration.airflow.service.v1.DeleteEnvironmentRequest;
Expand All @@ -41,7 +40,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 @@ -170,66 +168,51 @@ protected GrpcEnvironmentsStub(
GrpcCallSettings.<CreateEnvironmentRequest, Operation>newBuilder()
.setMethodDescriptor(createEnvironmentMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<CreateEnvironmentRequest>() {
@Override
public Map<String, String> extract(CreateEnvironmentRequest 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<GetEnvironmentRequest, Environment> getEnvironmentTransportSettings =
GrpcCallSettings.<GetEnvironmentRequest, Environment>newBuilder()
.setMethodDescriptor(getEnvironmentMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<GetEnvironmentRequest>() {
@Override
public Map<String, String> extract(GetEnvironmentRequest 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<ListEnvironmentsRequest, ListEnvironmentsResponse>
listEnvironmentsTransportSettings =
GrpcCallSettings.<ListEnvironmentsRequest, ListEnvironmentsResponse>newBuilder()
.setMethodDescriptor(listEnvironmentsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListEnvironmentsRequest>() {
@Override
public Map<String, String> extract(ListEnvironmentsRequest 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<UpdateEnvironmentRequest, Operation> updateEnvironmentTransportSettings =
GrpcCallSettings.<UpdateEnvironmentRequest, Operation>newBuilder()
.setMethodDescriptor(updateEnvironmentMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<UpdateEnvironmentRequest>() {
@Override
public Map<String, String> extract(UpdateEnvironmentRequest 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<DeleteEnvironmentRequest, Operation> deleteEnvironmentTransportSettings =
GrpcCallSettings.<DeleteEnvironmentRequest, Operation>newBuilder()
.setMethodDescriptor(deleteEnvironmentMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<DeleteEnvironmentRequest>() {
@Override
public Map<String, String> extract(DeleteEnvironmentRequest 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 @@ -336,7 +319,13 @@ public UnaryCallable<DeleteEnvironmentRequest, Operation> deleteEnvironmentCalla

@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 @@ -23,7 +23,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.orchestration.airflow.service.v1.ListImageVersionsRequest;
import com.google.cloud.orchestration.airflow.service.v1.ListImageVersionsResponse;
Expand All @@ -32,7 +31,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 @@ -108,13 +106,10 @@ protected GrpcImageVersionsStub(
GrpcCallSettings.<ListImageVersionsRequest, ListImageVersionsResponse>newBuilder()
.setMethodDescriptor(listImageVersionsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListImageVersionsRequest>() {
@Override
public Map<String, String> extract(ListImageVersionsRequest 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();

Expand Down Expand Up @@ -151,7 +146,13 @@ public GrpcOperationsStub getOperationsStub() {

@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 @@ -309,14 +309,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.orchestration.airflow.service.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 @@ -908,12 +907,7 @@ public static ApiFuture<ListEnvironmentsPagedResponse> createAsync(
ListEnvironmentsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListEnvironmentsPage, ListEnvironmentsPagedResponse>() {
@Override
public ListEnvironmentsPagedResponse apply(ListEnvironmentsPage input) {
return new ListEnvironmentsPagedResponse(input);
}
},
input -> new ListEnvironmentsPagedResponse(input),
MoreExecutors.directExecutor());
}

Expand Down
Expand Up @@ -224,14 +224,13 @@ public EnvironmentsStubSettings.Builder getStubSettingsBuilder() {
return ((EnvironmentsStubSettings.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 @@ -16,7 +16,6 @@

package com.google.cloud.orchestration.airflow.service.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 @@ -313,12 +312,7 @@ public static ApiFuture<ListImageVersionsPagedResponse> createAsync(
ListImageVersionsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListImageVersionsPage, ListImageVersionsPagedResponse>() {
@Override
public ListImageVersionsPagedResponse apply(ListImageVersionsPage input) {
return new ListImageVersionsPagedResponse(input);
}
},
input -> new ListImageVersionsPagedResponse(input),
MoreExecutors.directExecutor());
}

Expand Down
Expand Up @@ -161,14 +161,13 @@ public ImageVersionsStubSettings.Builder getStubSettingsBuilder() {
return ((ImageVersionsStubSettings.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 @@ -624,14 +624,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