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

Merged
merged 5 commits into from
Aug 26, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.google.cloud.secretmanager.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 @@ -1595,7 +1594,7 @@ public final SecretVersion destroySecretVersion(DestroySecretVersionRequest requ
* SecretManagerServiceClient.create()) {
* SetIamPolicyRequest request =
* SetIamPolicyRequest.newBuilder()
* .setResource(SecretName.of("[PROJECT]", "[SECRET]").toString())
* .setResource(ProjectName.of("[PROJECT]").toString())
* .setPolicy(Policy.newBuilder().build())
* .build();
* Policy response = secretManagerServiceClient.setIamPolicy(request);
Expand Down Expand Up @@ -1623,7 +1622,7 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) {
* SecretManagerServiceClient.create()) {
* SetIamPolicyRequest request =
* SetIamPolicyRequest.newBuilder()
* .setResource(SecretName.of("[PROJECT]", "[SECRET]").toString())
* .setResource(ProjectName.of("[PROJECT]").toString())
* .setPolicy(Policy.newBuilder().build())
* .build();
* ApiFuture<Policy> future =
Expand All @@ -1649,7 +1648,7 @@ public final UnaryCallable<SetIamPolicyRequest, Policy> setIamPolicyCallable() {
* SecretManagerServiceClient.create()) {
* GetIamPolicyRequest request =
* GetIamPolicyRequest.newBuilder()
* .setResource(SecretName.of("[PROJECT]", "[SECRET]").toString())
* .setResource(ProjectName.of("[PROJECT]").toString())
* .setOptions(GetPolicyOptions.newBuilder().build())
* .build();
* Policy response = secretManagerServiceClient.getIamPolicy(request);
Expand All @@ -1675,7 +1674,7 @@ public final Policy getIamPolicy(GetIamPolicyRequest request) {
* SecretManagerServiceClient.create()) {
* GetIamPolicyRequest request =
* GetIamPolicyRequest.newBuilder()
* .setResource(SecretName.of("[PROJECT]", "[SECRET]").toString())
* .setResource(ProjectName.of("[PROJECT]").toString())
* .setOptions(GetPolicyOptions.newBuilder().build())
* .build();
* ApiFuture<Policy> future =
Expand Down Expand Up @@ -1705,7 +1704,7 @@ public final UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() {
* SecretManagerServiceClient.create()) {
* TestIamPermissionsRequest request =
* TestIamPermissionsRequest.newBuilder()
* .setResource(SecretName.of("[PROJECT]", "[SECRET]").toString())
* .setResource(ProjectName.of("[PROJECT]").toString())
* .addAllPermissions(new ArrayList<String>())
* .build();
* TestIamPermissionsResponse response = secretManagerServiceClient.testIamPermissions(request);
Expand Down Expand Up @@ -1735,7 +1734,7 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq
* SecretManagerServiceClient.create()) {
* TestIamPermissionsRequest request =
* TestIamPermissionsRequest.newBuilder()
* .setResource(SecretName.of("[PROJECT]", "[SECRET]").toString())
* .setResource(ProjectName.of("[PROJECT]").toString())
* .addAllPermissions(new ArrayList<String>())
* .build();
* ApiFuture<TestIamPermissionsResponse> future =
Expand Down Expand Up @@ -1794,14 +1793,7 @@ public static ApiFuture<ListSecretsPagedResponse> createAsync(
ApiFuture<ListSecretsPage> futurePage =
ListSecretsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListSecretsPage, ListSecretsPagedResponse>() {
@Override
public ListSecretsPagedResponse apply(ListSecretsPage input) {
return new ListSecretsPagedResponse(input);
}
},
MoreExecutors.directExecutor());
futurePage, input -> new ListSecretsPagedResponse(input), MoreExecutors.directExecutor());
}

private ListSecretsPagedResponse(ListSecretsPage page) {
Expand Down Expand Up @@ -1875,12 +1867,7 @@ public static ApiFuture<ListSecretVersionsPagedResponse> createAsync(
ListSecretVersionsPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListSecretVersionsPage, ListSecretVersionsPagedResponse>() {
@Override
public ListSecretVersionsPagedResponse apply(ListSecretVersionsPage input) {
return new ListSecretVersionsPagedResponse(input);
}
},
input -> new ListSecretVersionsPagedResponse(input),
MoreExecutors.directExecutor());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,13 @@ public SecretManagerServiceStubSettings.Builder getStubSettingsBuilder() {
return ((SecretManagerServiceStubSettings.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
Loading