Skip to content

Commit

Permalink
chore: update showcase version (#2234)
Browse files Browse the repository at this point in the history
* chore: update showcase version

* update showcase goldens

* add a it test

* remove it test
  • Loading branch information
JoeWang1127 authored Nov 13, 2023
1 parent 94d1dd2 commit 9d30ed9
Show file tree
Hide file tree
Showing 26 changed files with 5,229 additions and 327 deletions.
2 changes: 1 addition & 1 deletion showcase/gapic-showcase/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</parent>

<properties>
<gapic-showcase.version>0.28.2</gapic-showcase.version>
<gapic-showcase.version>0.29.0</gapic-showcase.version>
</properties>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,73 @@ public final UnaryCallable<EchoRequest, EchoResponse> echoCallable() {
return stub.echoCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* This method returns error details in a repeated "google.protobuf.Any" field. This method
* showcases handling errors thus encoded, particularly over REST transport. Note that GAPICs only
* allow the type "google.protobuf.Any" for field paths ending in "error.details", and, at
* run-time, the actual types for these fields must be one of the types in
* google/rpc/error_details.proto.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (EchoClient echoClient = EchoClient.create()) {
* EchoErrorDetailsRequest request =
* EchoErrorDetailsRequest.newBuilder()
* .setSingleDetailText("singleDetailText1774380934")
* .addAllMultiDetailText(new ArrayList<String>())
* .build();
* EchoErrorDetailsResponse response = echoClient.echoErrorDetails(request);
* }
* }</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 EchoErrorDetailsResponse echoErrorDetails(EchoErrorDetailsRequest request) {
return echoErrorDetailsCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* This method returns error details in a repeated "google.protobuf.Any" field. This method
* showcases handling errors thus encoded, particularly over REST transport. Note that GAPICs only
* allow the type "google.protobuf.Any" for field paths ending in "error.details", and, at
* run-time, the actual types for these fields must be one of the types in
* google/rpc/error_details.proto.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (EchoClient echoClient = EchoClient.create()) {
* EchoErrorDetailsRequest request =
* EchoErrorDetailsRequest.newBuilder()
* .setSingleDetailText("singleDetailText1774380934")
* .addAllMultiDetailText(new ArrayList<String>())
* .build();
* ApiFuture<EchoErrorDetailsResponse> future =
* echoClient.echoErrorDetailsCallable().futureCall(request);
* // Do something.
* EchoErrorDetailsResponse response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<EchoErrorDetailsRequest, EchoErrorDetailsResponse>
echoErrorDetailsCallable() {
return stub.echoErrorDetailsCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* This method splits the given content into words and will pass each word back through the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ public UnaryCallSettings<EchoRequest, EchoResponse> echoSettings() {
return ((EchoStubSettings) getStubSettings()).echoSettings();
}

/** Returns the object with the settings used for calls to echoErrorDetails. */
public UnaryCallSettings<EchoErrorDetailsRequest, EchoErrorDetailsResponse>
echoErrorDetailsSettings() {
return ((EchoStubSettings) getStubSettings()).echoErrorDetailsSettings();
}

/** Returns the object with the settings used for calls to expand. */
public ServerStreamingCallSettings<ExpandRequest, EchoResponse> expandSettings() {
return ((EchoStubSettings) getStubSettings()).expandSettings();
Expand Down Expand Up @@ -291,6 +297,12 @@ public UnaryCallSettings.Builder<EchoRequest, EchoResponse> echoSettings() {
return getStubSettingsBuilder().echoSettings();
}

/** Returns the builder for the settings used for calls to echoErrorDetails. */
public UnaryCallSettings.Builder<EchoErrorDetailsRequest, EchoErrorDetailsResponse>
echoErrorDetailsSettings() {
return getStubSettingsBuilder().echoErrorDetailsSettings();
}

/** Returns the builder for the settings used for calls to expand. */
public ServerStreamingCallSettings.Builder<ExpandRequest, EchoResponse> expandSettings() {
return getStubSettingsBuilder().expandSettings();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,7 @@ public final UnaryCallable<AttemptSequenceRequest, Empty> attemptSequenceCallabl
* AttemptStreamingSequenceRequest request =
* AttemptStreamingSequenceRequest.newBuilder()
* .setName(StreamingSequenceName.of("[STREAMING_SEQUENCE]").toString())
* .setLastFailIndex(2006482362)
* .build();
* ServerStream<AttemptStreamingSequenceResponse> stream =
* sequenceServiceClient.attemptStreamingSequenceCallable().call(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@
"Echo": {
"methods": ["echo", "echoCallable"]
},
"EchoErrorDetails": {
"methods": ["echoErrorDetails", "echoErrorDetailsCallable"]
},
"Expand": {
"methods": ["expandCallable"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
import com.google.longrunning.stub.OperationsStub;
import com.google.showcase.v1beta1.BlockRequest;
import com.google.showcase.v1beta1.BlockResponse;
import com.google.showcase.v1beta1.EchoErrorDetailsRequest;
import com.google.showcase.v1beta1.EchoErrorDetailsResponse;
import com.google.showcase.v1beta1.EchoRequest;
import com.google.showcase.v1beta1.EchoResponse;
import com.google.showcase.v1beta1.ExpandRequest;
Expand Down Expand Up @@ -74,6 +76,11 @@ public UnaryCallable<EchoRequest, EchoResponse> echoCallable() {
throw new UnsupportedOperationException("Not implemented: echoCallable()");
}

public UnaryCallable<EchoErrorDetailsRequest, EchoErrorDetailsResponse>
echoErrorDetailsCallable() {
throw new UnsupportedOperationException("Not implemented: echoErrorDetailsCallable()");
}

public ServerStreamingCallable<ExpandRequest, EchoResponse> expandCallable() {
throw new UnsupportedOperationException("Not implemented: expandCallable()");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
import com.google.longrunning.Operation;
import com.google.showcase.v1beta1.BlockRequest;
import com.google.showcase.v1beta1.BlockResponse;
import com.google.showcase.v1beta1.EchoErrorDetailsRequest;
import com.google.showcase.v1beta1.EchoErrorDetailsResponse;
import com.google.showcase.v1beta1.EchoRequest;
import com.google.showcase.v1beta1.EchoResponse;
import com.google.showcase.v1beta1.ExpandRequest;
Expand Down Expand Up @@ -129,6 +131,8 @@ public class EchoStubSettings extends StubSettings<EchoStubSettings> {
ImmutableList.<String>builder().build();

private final UnaryCallSettings<EchoRequest, EchoResponse> echoSettings;
private final UnaryCallSettings<EchoErrorDetailsRequest, EchoErrorDetailsResponse>
echoErrorDetailsSettings;
private final ServerStreamingCallSettings<ExpandRequest, EchoResponse> expandSettings;
private final StreamingCallSettings<EchoRequest, EchoResponse> collectSettings;
private final StreamingCallSettings<EchoRequest, EchoResponse> chatSettings;
Expand Down Expand Up @@ -330,6 +334,12 @@ public UnaryCallSettings<EchoRequest, EchoResponse> echoSettings() {
return echoSettings;
}

/** Returns the object with the settings used for calls to echoErrorDetails. */
public UnaryCallSettings<EchoErrorDetailsRequest, EchoErrorDetailsResponse>
echoErrorDetailsSettings() {
return echoErrorDetailsSettings;
}

/** Returns the object with the settings used for calls to expand. */
public ServerStreamingCallSettings<ExpandRequest, EchoResponse> expandSettings() {
return expandSettings;
Expand Down Expand Up @@ -511,6 +521,7 @@ protected EchoStubSettings(Builder settingsBuilder) throws IOException {
super(settingsBuilder);

echoSettings = settingsBuilder.echoSettings().build();
echoErrorDetailsSettings = settingsBuilder.echoErrorDetailsSettings().build();
expandSettings = settingsBuilder.expandSettings().build();
collectSettings = settingsBuilder.collectSettings().build();
chatSettings = settingsBuilder.chatSettings().build();
Expand All @@ -531,6 +542,8 @@ protected EchoStubSettings(Builder settingsBuilder) throws IOException {
public static class Builder extends StubSettings.Builder<EchoStubSettings, Builder> {
private final ImmutableList<UnaryCallSettings.Builder<?, ?>> unaryMethodSettingsBuilders;
private final UnaryCallSettings.Builder<EchoRequest, EchoResponse> echoSettings;
private final UnaryCallSettings.Builder<EchoErrorDetailsRequest, EchoErrorDetailsResponse>
echoErrorDetailsSettings;
private final ServerStreamingCallSettings.Builder<ExpandRequest, EchoResponse> expandSettings;
private final StreamingCallSettings.Builder<EchoRequest, EchoResponse> collectSettings;
private final StreamingCallSettings.Builder<EchoRequest, EchoResponse> chatSettings;
Expand Down Expand Up @@ -607,6 +620,7 @@ protected Builder(ClientContext clientContext) {
super(clientContext);

echoSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
echoErrorDetailsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
expandSettings = ServerStreamingCallSettings.newBuilder();
collectSettings = StreamingCallSettings.newBuilder();
chatSettings = StreamingCallSettings.newBuilder();
Expand All @@ -626,6 +640,7 @@ protected Builder(ClientContext clientContext) {
unaryMethodSettingsBuilders =
ImmutableList.<UnaryCallSettings.Builder<?, ?>>of(
echoSettings,
echoErrorDetailsSettings,
pagedExpandSettings,
pagedExpandLegacySettings,
pagedExpandLegacyMappedSettings,
Expand All @@ -643,6 +658,7 @@ protected Builder(EchoStubSettings settings) {
super(settings);

echoSettings = settings.echoSettings.toBuilder();
echoErrorDetailsSettings = settings.echoErrorDetailsSettings.toBuilder();
expandSettings = settings.expandSettings.toBuilder();
collectSettings = settings.collectSettings.toBuilder();
chatSettings = settings.chatSettings.toBuilder();
Expand All @@ -661,6 +677,7 @@ protected Builder(EchoStubSettings settings) {
unaryMethodSettingsBuilders =
ImmutableList.<UnaryCallSettings.Builder<?, ?>>of(
echoSettings,
echoErrorDetailsSettings,
pagedExpandSettings,
pagedExpandLegacySettings,
pagedExpandLegacyMappedSettings,
Expand Down Expand Up @@ -705,6 +722,11 @@ private static Builder initDefaults(Builder builder) {
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));

builder
.echoErrorDetailsSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params"));

builder
.expandSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
Expand Down Expand Up @@ -806,6 +828,12 @@ public UnaryCallSettings.Builder<EchoRequest, EchoResponse> echoSettings() {
return echoSettings;
}

/** Returns the builder for the settings used for calls to echoErrorDetails. */
public UnaryCallSettings.Builder<EchoErrorDetailsRequest, EchoErrorDetailsResponse>
echoErrorDetailsSettings() {
return echoErrorDetailsSettings;
}

/** Returns the builder for the settings used for calls to expand. */
public ServerStreamingCallSettings.Builder<ExpandRequest, EchoResponse> expandSettings() {
return expandSettings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
import com.google.longrunning.stub.GrpcOperationsStub;
import com.google.showcase.v1beta1.BlockRequest;
import com.google.showcase.v1beta1.BlockResponse;
import com.google.showcase.v1beta1.EchoErrorDetailsRequest;
import com.google.showcase.v1beta1.EchoErrorDetailsResponse;
import com.google.showcase.v1beta1.EchoRequest;
import com.google.showcase.v1beta1.EchoResponse;
import com.google.showcase.v1beta1.ExpandRequest;
Expand Down Expand Up @@ -80,6 +82,17 @@ public class GrpcEchoStub extends EchoStub {
.setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance()))
.build();

private static final MethodDescriptor<EchoErrorDetailsRequest, EchoErrorDetailsResponse>
echoErrorDetailsMethodDescriptor =
MethodDescriptor.<EchoErrorDetailsRequest, EchoErrorDetailsResponse>newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.showcase.v1beta1.Echo/EchoErrorDetails")
.setRequestMarshaller(
ProtoUtils.marshaller(EchoErrorDetailsRequest.getDefaultInstance()))
.setResponseMarshaller(
ProtoUtils.marshaller(EchoErrorDetailsResponse.getDefaultInstance()))
.build();

private static final MethodDescriptor<ExpandRequest, EchoResponse> expandMethodDescriptor =
MethodDescriptor.<ExpandRequest, EchoResponse>newBuilder()
.setType(MethodDescriptor.MethodType.SERVER_STREAMING)
Expand Down Expand Up @@ -198,6 +211,8 @@ public class GrpcEchoStub extends EchoStub {
.build();

private final UnaryCallable<EchoRequest, EchoResponse> echoCallable;
private final UnaryCallable<EchoErrorDetailsRequest, EchoErrorDetailsResponse>
echoErrorDetailsCallable;
private final ServerStreamingCallable<ExpandRequest, EchoResponse> expandCallable;
private final ClientStreamingCallable<EchoRequest, EchoResponse> collectCallable;
private final BidiStreamingCallable<EchoRequest, EchoResponse> chatCallable;
Expand Down Expand Up @@ -291,6 +306,11 @@ protected GrpcEchoStub(
return builder.build();
})
.build();
GrpcCallSettings<EchoErrorDetailsRequest, EchoErrorDetailsResponse>
echoErrorDetailsTransportSettings =
GrpcCallSettings.<EchoErrorDetailsRequest, EchoErrorDetailsResponse>newBuilder()
.setMethodDescriptor(echoErrorDetailsMethodDescriptor)
.build();
GrpcCallSettings<ExpandRequest, EchoResponse> expandTransportSettings =
GrpcCallSettings.<ExpandRequest, EchoResponse>newBuilder()
.setMethodDescriptor(expandMethodDescriptor)
Expand Down Expand Up @@ -380,6 +400,9 @@ protected GrpcEchoStub(
this.echoCallable =
callableFactory.createUnaryCallable(
echoTransportSettings, settings.echoSettings(), clientContext);
this.echoErrorDetailsCallable =
callableFactory.createUnaryCallable(
echoErrorDetailsTransportSettings, settings.echoErrorDetailsSettings(), clientContext);
this.expandCallable =
callableFactory.createServerStreamingCallable(
expandTransportSettings, settings.expandSettings(), clientContext);
Expand Down Expand Up @@ -453,6 +476,12 @@ public UnaryCallable<EchoRequest, EchoResponse> echoCallable() {
return echoCallable;
}

@Override
public UnaryCallable<EchoErrorDetailsRequest, EchoErrorDetailsResponse>
echoErrorDetailsCallable() {
return echoErrorDetailsCallable;
}

@Override
public ServerStreamingCallable<ExpandRequest, EchoResponse> expandCallable() {
return expandCallable;
Expand Down
Loading

0 comments on commit 9d30ed9

Please sign in to comment.