Skip to content

chore: regenerate showcase #1752

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
8 changes: 4 additions & 4 deletions gax/test/browser-test/test/test.grpc-fallback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ describe('createStub', () => {
assert(echoStub.pagedExpand instanceof Function);
assert(echoStub.wait instanceof Function);

// There should be 11 methods for the echo service
assert.strictEqual(Object.keys(echoStub).length, 11);
// There should be 12 methods for the echo service
assert.strictEqual(Object.keys(echoStub).length, 12);

// Each of the service methods should take 4 arguments (so that it works
// with createApiCall)
Expand All @@ -102,8 +102,8 @@ describe('createStub', () => {
assert(echoStub.collect instanceof Function);
assert(echoStub.chat instanceof Function);

// There should be 11 methods for the echo service
assert.strictEqual(Object.keys(echoStub).length, 11);
// There should be 12 methods for the echo service
assert.strictEqual(Object.keys(echoStub).length, 12);

// Each of the service methods should take 4 arguments (so that it works
// with createApiCall)
Expand Down
4 changes: 2 additions & 2 deletions gax/test/showcase-echo-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
"google-gax": "./google-gax.tgz"
},
"devDependencies": {
"@types/node": "^20.11.26",
"@types/node": "^22.15.2",
"gapic-tools": "./gapic-tools.tgz",
"typescript": "^5.7.3"
"typescript": "5.8.3"
},
"engines": {
"node": ">=v18"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ service Echo {
// This service is meant to only run locally on the port 7469 (keypad digits
// for "show").
option (google.api.default_host) = "localhost:7469";
// See https://github.com/aip-dev/google.aip.dev/pull/1331
option (google.api.api_version) = "v1_20240408";

// This method simply echoes the request. This method showcases unary RPCs.
rpc Echo(EchoRequest) returns (EchoResponse) {
Expand Down Expand Up @@ -98,6 +100,20 @@ service Echo {
};
}

// This method always fails with a gRPC "Aborted" error status that contains
// multiple error details. These include one instance of each of the standard
// ones in error_details.proto
// (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto)
// plus a custom, Showcase-defined PoetryError. The intent of this RPC is to
// verify that GAPICs can process these various error details and surface them
// to the user in an idiomatic form.
rpc FailEchoWithDetails(FailEchoWithDetailsRequest) returns (FailEchoWithDetailsResponse) {
option (google.api.http) = {
post: "/v1beta1/echo:failWithDetails"
body: "*"
};
}

// This method splits the given content into words and will pass each word back
// through the stream. This method showcases server-side streaming RPCs.
rpc Expand(ExpandRequest) returns (stream EchoResponse) {
Expand Down Expand Up @@ -211,15 +227,15 @@ message EchoRequest {
// Optional. This field can be set to test the routing annotation on the Echo method.
string other_header = 5;

// Based on go/client-populate-request-id-design; subject to change
// To facilitate testing of https://google.aip.dev/client-libraries/4235
string request_id = 7 [
(google.api.field_info).format = UUID4
];

// If `error` is set, then this flag causes the Showcase server to append
// multiple fake error details in the error response. This is useful for
// testing client behavior on error responses.
bool generate_error_details = 8;
// To facilitate testing of https://google.aip.dev/client-libraries/4235
optional string other_request_id = 8 [
(google.api.field_info).format = UUID4
];
}

// The response message for the Echo methods.
Expand All @@ -232,6 +248,9 @@ message EchoResponse {

// The request ID specified or autopopulated in the request.
string request_id = 3;

// The other request ID specified or autopopulated in the request.
string other_request_id = 4;
}

// The request message used for the EchoErrorDetails method.
Expand Down Expand Up @@ -268,6 +287,24 @@ message ErrorWithMultipleDetails {
repeated google.protobuf.Any details = 1;
}

// The custom error detail to be included in the error response from the
// FailEchoWithDetails method. Client libraries should be able to
// surface this custom error detail.
message PoetryError {
string poem = 1;
}

// The request message used for the FailEchoWithDetails method.
message FailEchoWithDetailsRequest {
// Optional message to echo back in the PoetryError. If empty, a value will be
// provided.
string message = 1;
}

// The response message declared (but never used) for the FailEchoWithDetails
// method.
message FailEchoWithDetailsResponse {}

// The request message for the Expand method.
message ExpandRequest {
// The content that will be split into words and returned on the stream.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ service SequenceService {
};

// Attempts a streaming sequence.
// May not function as expected in HTTP mode due to when http statuses are sent
// See https://github.com/googleapis/gapic-showcase/issues/1377 for more details
rpc AttemptStreamingSequence(AttemptStreamingSequenceRequest) returns (stream AttemptStreamingSequenceResponse) {
option (google.api.http) = {
post: "/v1beta1/{name=streamingSequences/*}:stream"
Expand Down
2 changes: 1 addition & 1 deletion gax/test/showcase-echo-client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ type SequenceServiceClient = v1beta1.SequenceServiceClient;
export {v1beta1, EchoClient, SequenceServiceClient};
export default {v1beta1, EchoClient, SequenceServiceClient};
import * as protos from '../protos/protos';
export {protos}
export {protos};
Loading
Loading