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

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

Expand Down Expand Up @@ -1288,14 +1282,7 @@ public static ApiFuture<ListPatchJobInstanceDetailsPagedResponse> createAsync(
.createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<
ListPatchJobInstanceDetailsPage, ListPatchJobInstanceDetailsPagedResponse>() {
@Override
public ListPatchJobInstanceDetailsPagedResponse apply(
ListPatchJobInstanceDetailsPage input) {
return new ListPatchJobInstanceDetailsPagedResponse(input);
}
},
input -> new ListPatchJobInstanceDetailsPagedResponse(input),
MoreExecutors.directExecutor());
}

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

Expand Down
Expand Up @@ -221,14 +221,13 @@ public OsConfigServiceStubSettings.Builder getStubSettingsBuilder() {
return ((OsConfigServiceStubSettings.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 @@ -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.osconfig.v1.PatchDeployments;
import com.google.cloud.osconfig.v1.PatchJobs;
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 @@ -249,41 +247,32 @@ protected GrpcOsConfigServiceStub(
GrpcCallSettings.<PatchJobs.ExecutePatchJobRequest, PatchJobs.PatchJob>newBuilder()
.setMethodDescriptor(executePatchJobMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<PatchJobs.ExecutePatchJobRequest>() {
@Override
public Map<String, String> extract(PatchJobs.ExecutePatchJobRequest 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<PatchJobs.GetPatchJobRequest, PatchJobs.PatchJob>
getPatchJobTransportSettings =
GrpcCallSettings.<PatchJobs.GetPatchJobRequest, PatchJobs.PatchJob>newBuilder()
.setMethodDescriptor(getPatchJobMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<PatchJobs.GetPatchJobRequest>() {
@Override
public Map<String, String> extract(PatchJobs.GetPatchJobRequest 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<PatchJobs.CancelPatchJobRequest, PatchJobs.PatchJob>
cancelPatchJobTransportSettings =
GrpcCallSettings.<PatchJobs.CancelPatchJobRequest, PatchJobs.PatchJob>newBuilder()
.setMethodDescriptor(cancelPatchJobMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<PatchJobs.CancelPatchJobRequest>() {
@Override
public Map<String, String> extract(PatchJobs.CancelPatchJobRequest 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<PatchJobs.ListPatchJobsRequest, PatchJobs.ListPatchJobsResponse>
Expand All @@ -292,13 +281,10 @@ public Map<String, String> extract(PatchJobs.CancelPatchJobRequest request) {
.<PatchJobs.ListPatchJobsRequest, PatchJobs.ListPatchJobsResponse>newBuilder()
.setMethodDescriptor(listPatchJobsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<PatchJobs.ListPatchJobsRequest>() {
@Override
public Map<String, String> extract(PatchJobs.ListPatchJobsRequest 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<
Expand All @@ -311,14 +297,10 @@ public Map<String, String> extract(PatchJobs.ListPatchJobsRequest request) {
newBuilder()
.setMethodDescriptor(listPatchJobInstanceDetailsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<PatchJobs.ListPatchJobInstanceDetailsRequest>() {
@Override
public Map<String, String> extract(
PatchJobs.ListPatchJobInstanceDetailsRequest 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<
Expand All @@ -329,14 +311,10 @@ public Map<String, String> extract(
newBuilder()
.setMethodDescriptor(createPatchDeploymentMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<PatchDeployments.CreatePatchDeploymentRequest>() {
@Override
public Map<String, String> extract(
PatchDeployments.CreatePatchDeploymentRequest 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<PatchDeployments.GetPatchDeploymentRequest, PatchDeployments.PatchDeployment>
Expand All @@ -346,14 +324,10 @@ public Map<String, String> extract(
newBuilder()
.setMethodDescriptor(getPatchDeploymentMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<PatchDeployments.GetPatchDeploymentRequest>() {
@Override
public Map<String, String> extract(
PatchDeployments.GetPatchDeploymentRequest 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<
Expand All @@ -366,29 +340,21 @@ public Map<String, String> extract(
newBuilder()
.setMethodDescriptor(listPatchDeploymentsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<PatchDeployments.ListPatchDeploymentsRequest>() {
@Override
public Map<String, String> extract(
PatchDeployments.ListPatchDeploymentsRequest 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<PatchDeployments.DeletePatchDeploymentRequest, Empty>
deletePatchDeploymentTransportSettings =
GrpcCallSettings.<PatchDeployments.DeletePatchDeploymentRequest, Empty>newBuilder()
.setMethodDescriptor(deletePatchDeploymentMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<PatchDeployments.DeletePatchDeploymentRequest>() {
@Override
public Map<String, String> extract(
PatchDeployments.DeletePatchDeploymentRequest 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 @@ -531,7 +497,13 @@ public UnaryCallable<PatchJobs.GetPatchJobRequest, PatchJobs.PatchJob> getPatchJ

@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 @@ -688,14 +688,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.osconfig.v1alpha;

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

Expand Down Expand Up @@ -2121,14 +2115,7 @@ public static ApiFuture<ListOSPolicyAssignmentRevisionsPagedResponse> createAsyn
.createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<
ListOSPolicyAssignmentRevisionsPage, ListOSPolicyAssignmentRevisionsPagedResponse>() {
@Override
public ListOSPolicyAssignmentRevisionsPagedResponse apply(
ListOSPolicyAssignmentRevisionsPage input) {
return new ListOSPolicyAssignmentRevisionsPagedResponse(input);
}
},
input -> new ListOSPolicyAssignmentRevisionsPagedResponse(input),
MoreExecutors.directExecutor());
}

Expand Down Expand Up @@ -2225,15 +2212,7 @@ public static ApiFuture<ListInstanceOSPoliciesCompliancesPagedResponse> createAs
.createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<
ListInstanceOSPoliciesCompliancesPage,
ListInstanceOSPoliciesCompliancesPagedResponse>() {
@Override
public ListInstanceOSPoliciesCompliancesPagedResponse apply(
ListInstanceOSPoliciesCompliancesPage input) {
return new ListInstanceOSPoliciesCompliancesPagedResponse(input);
}
},
input -> new ListInstanceOSPoliciesCompliancesPagedResponse(input),
MoreExecutors.directExecutor());
}

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

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

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