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

Commit

Permalink
feat!: release gapic-generator-java v2.0.0 (#169)
Browse files Browse the repository at this point in the history
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/50fabbbe-ea15-4bf8-a62b-fa4218acd676/targets

- [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.)

PiperOrigin-RevId: 388769359
Source-Link: googleapis/googleapis@a47f0a4
PiperOrigin-RevId: 388535346
Source-Link: googleapis/googleapis@d9eaf41
PiperOrigin-RevId: 388499329
Source-Link: googleapis/googleapis@bb0a090
PiperOrigin-RevId: 387885619
Source-Link: googleapis/googleapis@2f9af29

docs: Remove HTML tags from Cloud Retail API library docs
docs(retail): Quote several literal expressions for better rendering
  • Loading branch information
yoshi-automation committed Aug 12, 2021
1 parent dbdbd64 commit 0134460
Show file tree
Hide file tree
Showing 25 changed files with 693 additions and 2,109 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.google.cloud.retail.v2;

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,13 @@ public CatalogServiceStubSettings.Builder getStubSettingsBuilder() {
return ((CatalogServiceStubSettings.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
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,13 @@ public CompletionServiceStubSettings.Builder getStubSettingsBuilder() {
return ((CompletionServiceStubSettings.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
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,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
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.google.cloud.retail.v2;

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

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

package com.google.cloud.retail.v2;

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 @@ -361,14 +360,7 @@ public static ApiFuture<SearchPagedResponse> createAsync(
ApiFuture<SearchPage> futurePage =
SearchPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
new ApiFunction<SearchPage, SearchPagedResponse>() {
@Override
public SearchPagedResponse apply(SearchPage input) {
return new SearchPagedResponse(input);
}
},
MoreExecutors.directExecutor());
futurePage, input -> new SearchPagedResponse(input), MoreExecutors.directExecutor());
}

private SearchPagedResponse(SearchPage page) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,13 @@ public SearchServiceStubSettings.Builder getStubSettingsBuilder() {
return ((SearchServiceStubSettings.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
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,13 @@ public UserEventServiceStubSettings.Builder getStubSettingsBuilder() {
return ((UserEventServiceStubSettings.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
Original file line number Diff line number Diff line change
Expand Up @@ -376,14 +376,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
Original file line number Diff line number Diff line change
Expand Up @@ -319,14 +319,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
Original file line number Diff line number Diff line change
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.retail.v2.Catalog;
import com.google.cloud.retail.v2.GetDefaultBranchRequest;
Expand All @@ -38,7 +37,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 @@ -147,53 +145,41 @@ protected GrpcCatalogServiceStub(
GrpcCallSettings.<ListCatalogsRequest, ListCatalogsResponse>newBuilder()
.setMethodDescriptor(listCatalogsMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ListCatalogsRequest>() {
@Override
public Map<String, String> extract(ListCatalogsRequest 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<UpdateCatalogRequest, Catalog> updateCatalogTransportSettings =
GrpcCallSettings.<UpdateCatalogRequest, Catalog>newBuilder()
.setMethodDescriptor(updateCatalogMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<UpdateCatalogRequest>() {
@Override
public Map<String, String> extract(UpdateCatalogRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("catalog.name", String.valueOf(request.getCatalog().getName()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("catalog.name", String.valueOf(request.getCatalog().getName()));
return params.build();
})
.build();
GrpcCallSettings<SetDefaultBranchRequest, Empty> setDefaultBranchTransportSettings =
GrpcCallSettings.<SetDefaultBranchRequest, Empty>newBuilder()
.setMethodDescriptor(setDefaultBranchMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<SetDefaultBranchRequest>() {
@Override
public Map<String, String> extract(SetDefaultBranchRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("catalog", String.valueOf(request.getCatalog()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("catalog", String.valueOf(request.getCatalog()));
return params.build();
})
.build();
GrpcCallSettings<GetDefaultBranchRequest, GetDefaultBranchResponse>
getDefaultBranchTransportSettings =
GrpcCallSettings.<GetDefaultBranchRequest, GetDefaultBranchResponse>newBuilder()
.setMethodDescriptor(getDefaultBranchMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<GetDefaultBranchRequest>() {
@Override
public Map<String, String> extract(GetDefaultBranchRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("catalog", String.valueOf(request.getCatalog()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("catalog", String.valueOf(request.getCatalog()));
return params.build();
})
.build();

Expand Down Expand Up @@ -249,7 +235,13 @@ public UnaryCallable<SetDefaultBranchRequest, Empty> setDefaultBranchCallable()

@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
Original file line number Diff line number Diff line change
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.retail.v2.CompleteQueryRequest;
import com.google.cloud.retail.v2.CompleteQueryResponse;
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 @@ -122,26 +120,20 @@ protected GrpcCompletionServiceStub(
GrpcCallSettings.<CompleteQueryRequest, CompleteQueryResponse>newBuilder()
.setMethodDescriptor(completeQueryMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<CompleteQueryRequest>() {
@Override
public Map<String, String> extract(CompleteQueryRequest request) {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("catalog", String.valueOf(request.getCatalog()));
return params.build();
}
request -> {
ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
params.put("catalog", String.valueOf(request.getCatalog()));
return params.build();
})
.build();
GrpcCallSettings<ImportCompletionDataRequest, Operation> importCompletionDataTransportSettings =
GrpcCallSettings.<ImportCompletionDataRequest, Operation>newBuilder()
.setMethodDescriptor(importCompletionDataMethodDescriptor)
.setParamsExtractor(
new RequestParamsExtractor<ImportCompletionDataRequest>() {
@Override
public Map<String, String> extract(ImportCompletionDataRequest 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 @@ -187,7 +179,13 @@ public UnaryCallable<ImportCompletionDataRequest, Operation> importCompletionDat

@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
Loading

0 comments on commit 0134460

Please sign in to comment.