Skip to content

Commit 9d30ed9

Browse files
authored
chore: update showcase version (#2234)
* chore: update showcase version * update showcase goldens * add a it test * remove it test
1 parent 94d1dd2 commit 9d30ed9

26 files changed

+5229
-327
lines changed

showcase/gapic-showcase/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</parent>
2020

2121
<properties>
22-
<gapic-showcase.version>0.28.2</gapic-showcase.version>
22+
<gapic-showcase.version>0.29.0</gapic-showcase.version>
2323
</properties>
2424

2525
<build>

showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoClient.java

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,73 @@ public final UnaryCallable<EchoRequest, EchoResponse> echoCallable() {
280280
return stub.echoCallable();
281281
}
282282

283+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
284+
/**
285+
* This method returns error details in a repeated "google.protobuf.Any" field. This method
286+
* showcases handling errors thus encoded, particularly over REST transport. Note that GAPICs only
287+
* allow the type "google.protobuf.Any" for field paths ending in "error.details", and, at
288+
* run-time, the actual types for these fields must be one of the types in
289+
* google/rpc/error_details.proto.
290+
*
291+
* <p>Sample code:
292+
*
293+
* <pre>{@code
294+
* // This snippet has been automatically generated and should be regarded as a code template only.
295+
* // It will require modifications to work:
296+
* // - It may require correct/in-range values for request initialization.
297+
* // - It may require specifying regional endpoints when creating the service client as shown in
298+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
299+
* try (EchoClient echoClient = EchoClient.create()) {
300+
* EchoErrorDetailsRequest request =
301+
* EchoErrorDetailsRequest.newBuilder()
302+
* .setSingleDetailText("singleDetailText1774380934")
303+
* .addAllMultiDetailText(new ArrayList<String>())
304+
* .build();
305+
* EchoErrorDetailsResponse response = echoClient.echoErrorDetails(request);
306+
* }
307+
* }</pre>
308+
*
309+
* @param request The request object containing all of the parameters for the API call.
310+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
311+
*/
312+
public final EchoErrorDetailsResponse echoErrorDetails(EchoErrorDetailsRequest request) {
313+
return echoErrorDetailsCallable().call(request);
314+
}
315+
316+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
317+
/**
318+
* This method returns error details in a repeated "google.protobuf.Any" field. This method
319+
* showcases handling errors thus encoded, particularly over REST transport. Note that GAPICs only
320+
* allow the type "google.protobuf.Any" for field paths ending in "error.details", and, at
321+
* run-time, the actual types for these fields must be one of the types in
322+
* google/rpc/error_details.proto.
323+
*
324+
* <p>Sample code:
325+
*
326+
* <pre>{@code
327+
* // This snippet has been automatically generated and should be regarded as a code template only.
328+
* // It will require modifications to work:
329+
* // - It may require correct/in-range values for request initialization.
330+
* // - It may require specifying regional endpoints when creating the service client as shown in
331+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
332+
* try (EchoClient echoClient = EchoClient.create()) {
333+
* EchoErrorDetailsRequest request =
334+
* EchoErrorDetailsRequest.newBuilder()
335+
* .setSingleDetailText("singleDetailText1774380934")
336+
* .addAllMultiDetailText(new ArrayList<String>())
337+
* .build();
338+
* ApiFuture<EchoErrorDetailsResponse> future =
339+
* echoClient.echoErrorDetailsCallable().futureCall(request);
340+
* // Do something.
341+
* EchoErrorDetailsResponse response = future.get();
342+
* }
343+
* }</pre>
344+
*/
345+
public final UnaryCallable<EchoErrorDetailsRequest, EchoErrorDetailsResponse>
346+
echoErrorDetailsCallable() {
347+
return stub.echoErrorDetailsCallable();
348+
}
349+
283350
// AUTO-GENERATED DOCUMENTATION AND METHOD.
284351
/**
285352
* This method splits the given content into words and will pass each word back through the

showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ public UnaryCallSettings<EchoRequest, EchoResponse> echoSettings() {
9696
return ((EchoStubSettings) getStubSettings()).echoSettings();
9797
}
9898

99+
/** Returns the object with the settings used for calls to echoErrorDetails. */
100+
public UnaryCallSettings<EchoErrorDetailsRequest, EchoErrorDetailsResponse>
101+
echoErrorDetailsSettings() {
102+
return ((EchoStubSettings) getStubSettings()).echoErrorDetailsSettings();
103+
}
104+
99105
/** Returns the object with the settings used for calls to expand. */
100106
public ServerStreamingCallSettings<ExpandRequest, EchoResponse> expandSettings() {
101107
return ((EchoStubSettings) getStubSettings()).expandSettings();
@@ -291,6 +297,12 @@ public UnaryCallSettings.Builder<EchoRequest, EchoResponse> echoSettings() {
291297
return getStubSettingsBuilder().echoSettings();
292298
}
293299

300+
/** Returns the builder for the settings used for calls to echoErrorDetails. */
301+
public UnaryCallSettings.Builder<EchoErrorDetailsRequest, EchoErrorDetailsResponse>
302+
echoErrorDetailsSettings() {
303+
return getStubSettingsBuilder().echoErrorDetailsSettings();
304+
}
305+
294306
/** Returns the builder for the settings used for calls to expand. */
295307
public ServerStreamingCallSettings.Builder<ExpandRequest, EchoResponse> expandSettings() {
296308
return getStubSettingsBuilder().expandSettings();

showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,7 @@ public final UnaryCallable<AttemptSequenceRequest, Empty> attemptSequenceCallabl
699699
* AttemptStreamingSequenceRequest request =
700700
* AttemptStreamingSequenceRequest.newBuilder()
701701
* .setName(StreamingSequenceName.of("[STREAMING_SEQUENCE]").toString())
702+
* .setLastFailIndex(2006482362)
702703
* .build();
703704
* ServerStream<AttemptStreamingSequenceResponse> stream =
704705
* sequenceServiceClient.attemptStreamingSequenceCallable().call(request);

showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/gapic_metadata.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@
7676
"Echo": {
7777
"methods": ["echo", "echoCallable"]
7878
},
79+
"EchoErrorDetails": {
80+
"methods": ["echoErrorDetails", "echoErrorDetailsCallable"]
81+
},
7982
"Expand": {
8083
"methods": ["expandCallable"]
8184
},

showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStub.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
import com.google.longrunning.stub.OperationsStub;
4141
import com.google.showcase.v1beta1.BlockRequest;
4242
import com.google.showcase.v1beta1.BlockResponse;
43+
import com.google.showcase.v1beta1.EchoErrorDetailsRequest;
44+
import com.google.showcase.v1beta1.EchoErrorDetailsResponse;
4345
import com.google.showcase.v1beta1.EchoRequest;
4446
import com.google.showcase.v1beta1.EchoResponse;
4547
import com.google.showcase.v1beta1.ExpandRequest;
@@ -74,6 +76,11 @@ public UnaryCallable<EchoRequest, EchoResponse> echoCallable() {
7476
throw new UnsupportedOperationException("Not implemented: echoCallable()");
7577
}
7678

79+
public UnaryCallable<EchoErrorDetailsRequest, EchoErrorDetailsResponse>
80+
echoErrorDetailsCallable() {
81+
throw new UnsupportedOperationException("Not implemented: echoErrorDetailsCallable()");
82+
}
83+
7784
public ServerStreamingCallable<ExpandRequest, EchoResponse> expandCallable() {
7885
throw new UnsupportedOperationException("Not implemented: expandCallable()");
7986
}

showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@
6767
import com.google.longrunning.Operation;
6868
import com.google.showcase.v1beta1.BlockRequest;
6969
import com.google.showcase.v1beta1.BlockResponse;
70+
import com.google.showcase.v1beta1.EchoErrorDetailsRequest;
71+
import com.google.showcase.v1beta1.EchoErrorDetailsResponse;
7072
import com.google.showcase.v1beta1.EchoRequest;
7173
import com.google.showcase.v1beta1.EchoResponse;
7274
import com.google.showcase.v1beta1.ExpandRequest;
@@ -129,6 +131,8 @@ public class EchoStubSettings extends StubSettings<EchoStubSettings> {
129131
ImmutableList.<String>builder().build();
130132

131133
private final UnaryCallSettings<EchoRequest, EchoResponse> echoSettings;
134+
private final UnaryCallSettings<EchoErrorDetailsRequest, EchoErrorDetailsResponse>
135+
echoErrorDetailsSettings;
132136
private final ServerStreamingCallSettings<ExpandRequest, EchoResponse> expandSettings;
133137
private final StreamingCallSettings<EchoRequest, EchoResponse> collectSettings;
134138
private final StreamingCallSettings<EchoRequest, EchoResponse> chatSettings;
@@ -330,6 +334,12 @@ public UnaryCallSettings<EchoRequest, EchoResponse> echoSettings() {
330334
return echoSettings;
331335
}
332336

337+
/** Returns the object with the settings used for calls to echoErrorDetails. */
338+
public UnaryCallSettings<EchoErrorDetailsRequest, EchoErrorDetailsResponse>
339+
echoErrorDetailsSettings() {
340+
return echoErrorDetailsSettings;
341+
}
342+
333343
/** Returns the object with the settings used for calls to expand. */
334344
public ServerStreamingCallSettings<ExpandRequest, EchoResponse> expandSettings() {
335345
return expandSettings;
@@ -511,6 +521,7 @@ protected EchoStubSettings(Builder settingsBuilder) throws IOException {
511521
super(settingsBuilder);
512522

513523
echoSettings = settingsBuilder.echoSettings().build();
524+
echoErrorDetailsSettings = settingsBuilder.echoErrorDetailsSettings().build();
514525
expandSettings = settingsBuilder.expandSettings().build();
515526
collectSettings = settingsBuilder.collectSettings().build();
516527
chatSettings = settingsBuilder.chatSettings().build();
@@ -531,6 +542,8 @@ protected EchoStubSettings(Builder settingsBuilder) throws IOException {
531542
public static class Builder extends StubSettings.Builder<EchoStubSettings, Builder> {
532543
private final ImmutableList<UnaryCallSettings.Builder<?, ?>> unaryMethodSettingsBuilders;
533544
private final UnaryCallSettings.Builder<EchoRequest, EchoResponse> echoSettings;
545+
private final UnaryCallSettings.Builder<EchoErrorDetailsRequest, EchoErrorDetailsResponse>
546+
echoErrorDetailsSettings;
534547
private final ServerStreamingCallSettings.Builder<ExpandRequest, EchoResponse> expandSettings;
535548
private final StreamingCallSettings.Builder<EchoRequest, EchoResponse> collectSettings;
536549
private final StreamingCallSettings.Builder<EchoRequest, EchoResponse> chatSettings;
@@ -607,6 +620,7 @@ protected Builder(ClientContext clientContext) {
607620
super(clientContext);
608621

609622
echoSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
623+
echoErrorDetailsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
610624
expandSettings = ServerStreamingCallSettings.newBuilder();
611625
collectSettings = StreamingCallSettings.newBuilder();
612626
chatSettings = StreamingCallSettings.newBuilder();
@@ -626,6 +640,7 @@ protected Builder(ClientContext clientContext) {
626640
unaryMethodSettingsBuilders =
627641
ImmutableList.<UnaryCallSettings.Builder<?, ?>>of(
628642
echoSettings,
643+
echoErrorDetailsSettings,
629644
pagedExpandSettings,
630645
pagedExpandLegacySettings,
631646
pagedExpandLegacyMappedSettings,
@@ -643,6 +658,7 @@ protected Builder(EchoStubSettings settings) {
643658
super(settings);
644659

645660
echoSettings = settings.echoSettings.toBuilder();
661+
echoErrorDetailsSettings = settings.echoErrorDetailsSettings.toBuilder();
646662
expandSettings = settings.expandSettings.toBuilder();
647663
collectSettings = settings.collectSettings.toBuilder();
648664
chatSettings = settings.chatSettings.toBuilder();
@@ -661,6 +677,7 @@ protected Builder(EchoStubSettings settings) {
661677
unaryMethodSettingsBuilders =
662678
ImmutableList.<UnaryCallSettings.Builder<?, ?>>of(
663679
echoSettings,
680+
echoErrorDetailsSettings,
664681
pagedExpandSettings,
665682
pagedExpandLegacySettings,
666683
pagedExpandLegacyMappedSettings,
@@ -705,6 +722,11 @@ private static Builder initDefaults(Builder builder) {
705722
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
706723
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params"));
707724

725+
builder
726+
.echoErrorDetailsSettings()
727+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes"))
728+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params"));
729+
708730
builder
709731
.expandSettings()
710732
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes"))
@@ -806,6 +828,12 @@ public UnaryCallSettings.Builder<EchoRequest, EchoResponse> echoSettings() {
806828
return echoSettings;
807829
}
808830

831+
/** Returns the builder for the settings used for calls to echoErrorDetails. */
832+
public UnaryCallSettings.Builder<EchoErrorDetailsRequest, EchoErrorDetailsResponse>
833+
echoErrorDetailsSettings() {
834+
return echoErrorDetailsSettings;
835+
}
836+
809837
/** Returns the builder for the settings used for calls to expand. */
810838
public ServerStreamingCallSettings.Builder<ExpandRequest, EchoResponse> expandSettings() {
811839
return expandSettings;

showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoStub.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
import com.google.longrunning.stub.GrpcOperationsStub;
4747
import com.google.showcase.v1beta1.BlockRequest;
4848
import com.google.showcase.v1beta1.BlockResponse;
49+
import com.google.showcase.v1beta1.EchoErrorDetailsRequest;
50+
import com.google.showcase.v1beta1.EchoErrorDetailsResponse;
4951
import com.google.showcase.v1beta1.EchoRequest;
5052
import com.google.showcase.v1beta1.EchoResponse;
5153
import com.google.showcase.v1beta1.ExpandRequest;
@@ -80,6 +82,17 @@ public class GrpcEchoStub extends EchoStub {
8082
.setResponseMarshaller(ProtoUtils.marshaller(EchoResponse.getDefaultInstance()))
8183
.build();
8284

85+
private static final MethodDescriptor<EchoErrorDetailsRequest, EchoErrorDetailsResponse>
86+
echoErrorDetailsMethodDescriptor =
87+
MethodDescriptor.<EchoErrorDetailsRequest, EchoErrorDetailsResponse>newBuilder()
88+
.setType(MethodDescriptor.MethodType.UNARY)
89+
.setFullMethodName("google.showcase.v1beta1.Echo/EchoErrorDetails")
90+
.setRequestMarshaller(
91+
ProtoUtils.marshaller(EchoErrorDetailsRequest.getDefaultInstance()))
92+
.setResponseMarshaller(
93+
ProtoUtils.marshaller(EchoErrorDetailsResponse.getDefaultInstance()))
94+
.build();
95+
8396
private static final MethodDescriptor<ExpandRequest, EchoResponse> expandMethodDescriptor =
8497
MethodDescriptor.<ExpandRequest, EchoResponse>newBuilder()
8598
.setType(MethodDescriptor.MethodType.SERVER_STREAMING)
@@ -198,6 +211,8 @@ public class GrpcEchoStub extends EchoStub {
198211
.build();
199212

200213
private final UnaryCallable<EchoRequest, EchoResponse> echoCallable;
214+
private final UnaryCallable<EchoErrorDetailsRequest, EchoErrorDetailsResponse>
215+
echoErrorDetailsCallable;
201216
private final ServerStreamingCallable<ExpandRequest, EchoResponse> expandCallable;
202217
private final ClientStreamingCallable<EchoRequest, EchoResponse> collectCallable;
203218
private final BidiStreamingCallable<EchoRequest, EchoResponse> chatCallable;
@@ -291,6 +306,11 @@ protected GrpcEchoStub(
291306
return builder.build();
292307
})
293308
.build();
309+
GrpcCallSettings<EchoErrorDetailsRequest, EchoErrorDetailsResponse>
310+
echoErrorDetailsTransportSettings =
311+
GrpcCallSettings.<EchoErrorDetailsRequest, EchoErrorDetailsResponse>newBuilder()
312+
.setMethodDescriptor(echoErrorDetailsMethodDescriptor)
313+
.build();
294314
GrpcCallSettings<ExpandRequest, EchoResponse> expandTransportSettings =
295315
GrpcCallSettings.<ExpandRequest, EchoResponse>newBuilder()
296316
.setMethodDescriptor(expandMethodDescriptor)
@@ -380,6 +400,9 @@ protected GrpcEchoStub(
380400
this.echoCallable =
381401
callableFactory.createUnaryCallable(
382402
echoTransportSettings, settings.echoSettings(), clientContext);
403+
this.echoErrorDetailsCallable =
404+
callableFactory.createUnaryCallable(
405+
echoErrorDetailsTransportSettings, settings.echoErrorDetailsSettings(), clientContext);
383406
this.expandCallable =
384407
callableFactory.createServerStreamingCallable(
385408
expandTransportSettings, settings.expandSettings(), clientContext);
@@ -453,6 +476,12 @@ public UnaryCallable<EchoRequest, EchoResponse> echoCallable() {
453476
return echoCallable;
454477
}
455478

479+
@Override
480+
public UnaryCallable<EchoErrorDetailsRequest, EchoErrorDetailsResponse>
481+
echoErrorDetailsCallable() {
482+
return echoErrorDetailsCallable;
483+
}
484+
456485
@Override
457486
public ServerStreamingCallable<ExpandRequest, EchoResponse> expandCallable() {
458487
return expandCallable;

0 commit comments

Comments
 (0)