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

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.security.privateca.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 @@ -2858,7 +2857,7 @@ public final UnaryCallable<ListCaPoolsRequest, ListCaPoolsResponse> listCaPoolsC
* try (CertificateAuthorityServiceClient certificateAuthorityServiceClient =
* CertificateAuthorityServiceClient.create()) {
* CaPoolName name = CaPoolName.of("[PROJECT]", "[LOCATION]", "[CA_POOL]");
* CaPool response = certificateAuthorityServiceClient.deleteCaPoolAsync(name).get();
* certificateAuthorityServiceClient.deleteCaPoolAsync(name).get();
* }
* }</pre>
*
Expand All @@ -2867,7 +2866,7 @@ public final UnaryCallable<ListCaPoolsRequest, ListCaPoolsResponse> listCaPoolsC
* `projects/&#42;/locations/&#42;/caPools/&#42;`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture<CaPool, OperationMetadata> deleteCaPoolAsync(CaPoolName name) {
public final OperationFuture<Empty, OperationMetadata> deleteCaPoolAsync(CaPoolName name) {
DeleteCaPoolRequest request =
DeleteCaPoolRequest.newBuilder().setName(name == null ? null : name.toString()).build();
return deleteCaPoolAsync(request);
Expand All @@ -2883,7 +2882,7 @@ public final OperationFuture<CaPool, OperationMetadata> deleteCaPoolAsync(CaPool
* try (CertificateAuthorityServiceClient certificateAuthorityServiceClient =
* CertificateAuthorityServiceClient.create()) {
* String name = CaPoolName.of("[PROJECT]", "[LOCATION]", "[CA_POOL]").toString();
* CaPool response = certificateAuthorityServiceClient.deleteCaPoolAsync(name).get();
* certificateAuthorityServiceClient.deleteCaPoolAsync(name).get();
* }
* }</pre>
*
Expand All @@ -2892,7 +2891,7 @@ public final OperationFuture<CaPool, OperationMetadata> deleteCaPoolAsync(CaPool
* `projects/&#42;/locations/&#42;/caPools/&#42;`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture<CaPool, OperationMetadata> deleteCaPoolAsync(String name) {
public final OperationFuture<Empty, OperationMetadata> deleteCaPoolAsync(String name) {
DeleteCaPoolRequest request = DeleteCaPoolRequest.newBuilder().setName(name).build();
return deleteCaPoolAsync(request);
}
Expand All @@ -2911,14 +2910,14 @@ public final OperationFuture<CaPool, OperationMetadata> deleteCaPoolAsync(String
* .setName(CaPoolName.of("[PROJECT]", "[LOCATION]", "[CA_POOL]").toString())
* .setRequestId("requestId693933066")
* .build();
* CaPool response = certificateAuthorityServiceClient.deleteCaPoolAsync(request).get();
* certificateAuthorityServiceClient.deleteCaPoolAsync(request).get();
* }
* }</pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture<CaPool, OperationMetadata> deleteCaPoolAsync(
public final OperationFuture<Empty, OperationMetadata> deleteCaPoolAsync(
DeleteCaPoolRequest request) {
return deleteCaPoolOperationCallable().futureCall(request);
}
Expand All @@ -2937,14 +2936,14 @@ public final OperationFuture<CaPool, OperationMetadata> deleteCaPoolAsync(
* .setName(CaPoolName.of("[PROJECT]", "[LOCATION]", "[CA_POOL]").toString())
* .setRequestId("requestId693933066")
* .build();
* OperationFuture<CaPool, OperationMetadata> future =
* OperationFuture<Empty, OperationMetadata> future =
* certificateAuthorityServiceClient.deleteCaPoolOperationCallable().futureCall(request);
* // Do something.
* CaPool response = future.get();
* future.get();
* }
* }</pre>
*/
public final OperationCallable<DeleteCaPoolRequest, CaPool, OperationMetadata>
public final OperationCallable<DeleteCaPoolRequest, Empty, OperationMetadata>
deleteCaPoolOperationCallable() {
return stub.deleteCaPoolOperationCallable();
}
Expand All @@ -2966,7 +2965,7 @@ public final OperationFuture<CaPool, OperationMetadata> deleteCaPoolAsync(
* ApiFuture<Operation> future =
* certificateAuthorityServiceClient.deleteCaPoolCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* future.get();
* }
* }</pre>
*/
Expand Down Expand Up @@ -4301,12 +4300,7 @@ public static ApiFuture<ListCertificatesPagedResponse> createAsync(
ListCertificatesPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<ListCertificatesPage, ListCertificatesPagedResponse>() {
@Override
public ListCertificatesPagedResponse apply(ListCertificatesPage input) {
return new ListCertificatesPagedResponse(input);
}
},
input -> new ListCertificatesPagedResponse(input),
MoreExecutors.directExecutor());
}

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

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

private ListCaPoolsPagedResponse(ListCaPoolsPage page) {
Expand Down Expand Up @@ -4571,14 +4551,7 @@ public static ApiFuture<ListCertificateRevocationListsPagedResponse> createAsync
.createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<
ListCertificateRevocationListsPage, ListCertificateRevocationListsPagedResponse>() {
@Override
public ListCertificateRevocationListsPagedResponse apply(
ListCertificateRevocationListsPage input) {
return new ListCertificateRevocationListsPagedResponse(input);
}
},
input -> new ListCertificateRevocationListsPagedResponse(input),
MoreExecutors.directExecutor());
}

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

Expand Down
Expand Up @@ -279,7 +279,7 @@ public UnaryCallSettings<DeleteCaPoolRequest, Operation> deleteCaPoolSettings()
}

/** Returns the object with the settings used for calls to deleteCaPool. */
public OperationCallSettings<DeleteCaPoolRequest, CaPool, OperationMetadata>
public OperationCallSettings<DeleteCaPoolRequest, Empty, OperationMetadata>
deleteCaPoolOperationSettings() {
return ((CertificateAuthorityServiceStubSettings) getStubSettings())
.deleteCaPoolOperationSettings();
Expand Down Expand Up @@ -469,14 +469,13 @@ public CertificateAuthorityServiceStubSettings.Builder getStubSettingsBuilder()
return ((CertificateAuthorityServiceStubSettings.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 @@ -665,7 +664,7 @@ public UnaryCallSettings.Builder<DeleteCaPoolRequest, Operation> deleteCaPoolSet
}

/** Returns the builder for the settings used for calls to deleteCaPool. */
public OperationCallSettings.Builder<DeleteCaPoolRequest, CaPool, OperationMetadata>
public OperationCallSettings.Builder<DeleteCaPoolRequest, Empty, OperationMetadata>
deleteCaPoolOperationSettings() {
return getStubSettingsBuilder().deleteCaPoolOperationSettings();
}
Expand Down
Expand Up @@ -255,7 +255,7 @@ public UnaryCallable<ListCaPoolsRequest, ListCaPoolsResponse> listCaPoolsCallabl
throw new UnsupportedOperationException("Not implemented: listCaPoolsCallable()");
}

public OperationCallable<DeleteCaPoolRequest, CaPool, OperationMetadata>
public OperationCallable<DeleteCaPoolRequest, Empty, OperationMetadata>
deleteCaPoolOperationCallable() {
throw new UnsupportedOperationException("Not implemented: deleteCaPoolOperationCallable()");
}
Expand Down
Expand Up @@ -203,7 +203,7 @@ public class CertificateAuthorityServiceStubSettings
private final PagedCallSettings<ListCaPoolsRequest, ListCaPoolsResponse, ListCaPoolsPagedResponse>
listCaPoolsSettings;
private final UnaryCallSettings<DeleteCaPoolRequest, Operation> deleteCaPoolSettings;
private final OperationCallSettings<DeleteCaPoolRequest, CaPool, OperationMetadata>
private final OperationCallSettings<DeleteCaPoolRequest, Empty, OperationMetadata>
deleteCaPoolOperationSettings;
private final UnaryCallSettings<FetchCaCertsRequest, FetchCaCertsResponse> fetchCaCertsSettings;
private final UnaryCallSettings<GetCertificateRevocationListRequest, CertificateRevocationList>
Expand Down Expand Up @@ -764,7 +764,7 @@ public UnaryCallSettings<DeleteCaPoolRequest, Operation> deleteCaPoolSettings()
}

/** Returns the object with the settings used for calls to deleteCaPool. */
public OperationCallSettings<DeleteCaPoolRequest, CaPool, OperationMetadata>
public OperationCallSettings<DeleteCaPoolRequest, Empty, OperationMetadata>
deleteCaPoolOperationSettings() {
return deleteCaPoolOperationSettings;
}
Expand Down Expand Up @@ -1068,7 +1068,7 @@ public static class Builder
ListCaPoolsRequest, ListCaPoolsResponse, ListCaPoolsPagedResponse>
listCaPoolsSettings;
private final UnaryCallSettings.Builder<DeleteCaPoolRequest, Operation> deleteCaPoolSettings;
private final OperationCallSettings.Builder<DeleteCaPoolRequest, CaPool, OperationMetadata>
private final OperationCallSettings.Builder<DeleteCaPoolRequest, Empty, OperationMetadata>
deleteCaPoolOperationSettings;
private final UnaryCallSettings.Builder<FetchCaCertsRequest, FetchCaCertsResponse>
fetchCaCertsSettings;
Expand Down Expand Up @@ -1719,7 +1719,7 @@ private static Builder initDefaults(Builder builder) {
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"))
.build())
.setResponseTransformer(
ProtoOperationTransformers.ResponseTransformer.create(CaPool.class))
ProtoOperationTransformers.ResponseTransformer.create(Empty.class))
.setMetadataTransformer(
ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class))
.setPollingAlgorithm(
Expand Down Expand Up @@ -1838,14 +1838,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 @@ -2057,7 +2056,7 @@ public UnaryCallSettings.Builder<DeleteCaPoolRequest, Operation> deleteCaPoolSet
/** Returns the builder for the settings used for calls to deleteCaPool. */
@BetaApi(
"The surface for use by generated code is not stable yet and may change in the future.")
public OperationCallSettings.Builder<DeleteCaPoolRequest, CaPool, OperationMetadata>
public OperationCallSettings.Builder<DeleteCaPoolRequest, Empty, OperationMetadata>
deleteCaPoolOperationSettings() {
return deleteCaPoolOperationSettings;
}
Expand Down