This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: @@ -73,7 +75,7 @@ *
Creates a new testing session.
Creates a new testing session. Adding this comment with special characters for comment formatting tests: 1. (abra->kadabra->alakazam) 2) [Nonsense][]: `pokemon/*/psychic/*`
Request object method variants only take one parameter, a request object, which must be constructed before the call.
*Sample code: * @@ -392,7 +396,9 @@ public final Session createSession(CreateSessionRequest request) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Creates a new testing session. + * Creates a new testing session. Adding this comment with special characters for comment + * formatting tests: 1. (abra->kadabra->alakazam) 2) [Nonsense][]: + * `pokemon/*/psychic/*` * *
Sample code: * diff --git a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/package-info.java b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/package-info.java index 3e4b18d27e..8b10221563 100644 --- a/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/package-info.java +++ b/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/package-info.java @@ -75,6 +75,7 @@ * .setSeverity(Severity.forNumber(0)) * .setHeader("header-1221270899") * .setOtherHeader("otherHeader-2026585667") + * .setRequestId("requestId693933066") * .build(); * EchoResponse response = echoClient.echo(request); * } @@ -140,6 +141,8 @@ *
======================= TestingClient ======================= * *
Service Description: A service to facilitate running discrete sets of tests against Showcase. + * Adding this comment with special characters for comment formatting tests: 1. + * (abra->kadabra->alakazam) 2) [Nonsense][]: `pokemon/*/psychic/*` * *
Sample for TestingClient: * diff --git a/showcase/gapic-showcase/src/main/resources/META-INF/native-image/com.google.showcase.v1beta1/reflect-config.json b/showcase/gapic-showcase/src/main/resources/META-INF/native-image/com.google.showcase.v1beta1/reflect-config.json index 417da67b50..27722fa934 100644 --- a/showcase/gapic-showcase/src/main/resources/META-INF/native-image/com.google.showcase.v1beta1/reflect-config.json +++ b/showcase/gapic-showcase/src/main/resources/META-INF/native-image/com.google.showcase.v1beta1/reflect-config.json @@ -116,6 +116,33 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.api.FieldInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldInfo$Format", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.api.GoSettings", "queryAllDeclaredConstructors": true, diff --git a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingGrpc.java b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingGrpc.java index 890e11e6ec..61c3d974e4 100644 --- a/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingGrpc.java +++ b/showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingGrpc.java @@ -6,6 +6,9 @@ *
* A service to facilitate running discrete sets of tests * against Showcase. + * Adding this comment with special characters for comment formatting tests: + * 1. (abra->kadabra->alakazam) + * 2) [Nonsense][]: `pokemon/*/psychic/*` **/ @javax.annotation.Generated( @@ -315,6 +318,9 @@ public TestingFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions ca *
* A service to facilitate running discrete sets of tests * against Showcase. + * Adding this comment with special characters for comment formatting tests: + * 1. (abra->kadabra->alakazam) + * 2) [Nonsense][]: `pokemon/*/psychic/*` **/ public interface AsyncService { @@ -322,6 +328,9 @@ public interface AsyncService { /** *
* Creates a new testing session. + * Adding this comment with special characters for comment formatting tests: + * 1. (abra->kadabra->alakazam) + * 2) [Nonsense][]: `pokemon/*/psychic/*` **/ default void createSession(com.google.showcase.v1beta1.CreateSessionRequest request, @@ -412,6 +421,9 @@ default void verifyTest(com.google.showcase.v1beta1.VerifyTestRequest request, *
* A service to facilitate running discrete sets of tests * against Showcase. + * Adding this comment with special characters for comment formatting tests: + * 1. (abra->kadabra->alakazam) + * 2) [Nonsense][]: `pokemon/*/psychic/*` **/ public static abstract class TestingImplBase @@ -427,6 +439,9 @@ public static abstract class TestingImplBase *
* A service to facilitate running discrete sets of tests * against Showcase. + * Adding this comment with special characters for comment formatting tests: + * 1. (abra->kadabra->alakazam) + * 2) [Nonsense][]: `pokemon/*/psychic/*` **/ public static final class TestingStub @@ -445,6 +460,9 @@ protected TestingStub build( /** *
* Creates a new testing session. + * Adding this comment with special characters for comment formatting tests: + * 1. (abra->kadabra->alakazam) + * 2) [Nonsense][]: `pokemon/*/psychic/*` **/ public void createSession(com.google.showcase.v1beta1.CreateSessionRequest request, @@ -543,6 +561,9 @@ public void verifyTest(com.google.showcase.v1beta1.VerifyTestRequest request, *
* A service to facilitate running discrete sets of tests * against Showcase. + * Adding this comment with special characters for comment formatting tests: + * 1. (abra->kadabra->alakazam) + * 2) [Nonsense][]: `pokemon/*/psychic/*` **/ public static final class TestingBlockingStub @@ -561,6 +582,9 @@ protected TestingBlockingStub build( /** *
* Creates a new testing session. + * Adding this comment with special characters for comment formatting tests: + * 1. (abra->kadabra->alakazam) + * 2) [Nonsense][]: `pokemon/*/psychic/*` **/ public com.google.showcase.v1beta1.Session createSession(com.google.showcase.v1beta1.CreateSessionRequest request) { @@ -651,6 +675,9 @@ public com.google.showcase.v1beta1.VerifyTestResponse verifyTest(com.google.show *
* A service to facilitate running discrete sets of tests * against Showcase. + * Adding this comment with special characters for comment formatting tests: + * 1. (abra->kadabra->alakazam) + * 2) [Nonsense][]: `pokemon/*/psychic/*` **/ public static final class TestingFutureStub @@ -669,6 +696,9 @@ protected TestingFutureStub build( /** *
* Creates a new testing session. + * Adding this comment with special characters for comment formatting tests: + * 1. (abra->kadabra->alakazam) + * 2) [Nonsense][]: `pokemon/*/psychic/*` **/ public com.google.common.util.concurrent.ListenableFuture
+ * Based on go/client-populate-request-id-design; subject to change + *+ * + *
string request_id = 7 [(.google.api.field_info) = { ... }
+ * @return The requestId.
+ */
+ @java.lang.Override
+ public java.lang.String getRequestId() {
+ java.lang.Object ref = requestId_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ requestId_ = s;
+ return s;
+ }
+ }
+ /**
+ * + * Based on go/client-populate-request-id-design; subject to change + *+ * + *
string request_id = 7 [(.google.api.field_info) = { ... }
+ * @return The bytes for requestId.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString
+ getRequestIdBytes() {
+ java.lang.Object ref = requestId_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ requestId_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
@@ -347,6 +395,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output)
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(otherHeader_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 5, otherHeader_);
}
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 7, requestId_);
+ }
getUnknownFields().writeTo(output);
}
@@ -373,6 +424,9 @@ public int getSerializedSize() {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(otherHeader_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, otherHeader_);
}
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, requestId_);
+ }
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
@@ -393,6 +447,8 @@ public boolean equals(final java.lang.Object obj) {
.equals(other.getHeader())) return false;
if (!getOtherHeader()
.equals(other.getOtherHeader())) return false;
+ if (!getRequestId()
+ .equals(other.getRequestId())) return false;
if (!getResponseCase().equals(other.getResponseCase())) return false;
switch (responseCase_) {
case 1:
@@ -423,6 +479,8 @@ public int hashCode() {
hash = (53 * hash) + getHeader().hashCode();
hash = (37 * hash) + OTHER_HEADER_FIELD_NUMBER;
hash = (53 * hash) + getOtherHeader().hashCode();
+ hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER;
+ hash = (53 * hash) + getRequestId().hashCode();
switch (responseCase_) {
case 1:
hash = (37 * hash) + CONTENT_FIELD_NUMBER;
@@ -579,6 +637,7 @@ public Builder clear() {
severity_ = 0;
header_ = "";
otherHeader_ = "";
+ requestId_ = "";
responseCase_ = 0;
response_ = null;
return this;
@@ -624,6 +683,9 @@ private void buildPartial0(com.google.showcase.v1beta1.EchoRequest result) {
if (((from_bitField0_ & 0x00000010) != 0)) {
result.otherHeader_ = otherHeader_;
}
+ if (((from_bitField0_ & 0x00000020) != 0)) {
+ result.requestId_ = requestId_;
+ }
}
private void buildPartialOneofs(com.google.showcase.v1beta1.EchoRequest result) {
@@ -692,6 +754,11 @@ public Builder mergeFrom(com.google.showcase.v1beta1.EchoRequest other) {
bitField0_ |= 0x00000010;
onChanged();
}
+ if (!other.getRequestId().isEmpty()) {
+ requestId_ = other.requestId_;
+ bitField0_ |= 0x00000020;
+ onChanged();
+ }
switch (other.getResponseCase()) {
case CONTENT: {
responseCase_ = 1;
@@ -761,6 +828,11 @@ public Builder mergeFrom(
bitField0_ |= 0x00000010;
break;
} // case 42
+ case 58: {
+ requestId_ = input.readStringRequireUtf8();
+ bitField0_ |= 0x00000020;
+ break;
+ } // case 58
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
@@ -1344,6 +1416,98 @@ public Builder setOtherHeaderBytes(
onChanged();
return this;
}
+
+ private java.lang.Object requestId_ = "";
+ /**
+ * + * Based on go/client-populate-request-id-design; subject to change + *+ * + *
string request_id = 7 [(.google.api.field_info) = { ... }
+ * @return The requestId.
+ */
+ public java.lang.String getRequestId() {
+ java.lang.Object ref = requestId_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ requestId_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * + * Based on go/client-populate-request-id-design; subject to change + *+ * + *
string request_id = 7 [(.google.api.field_info) = { ... }
+ * @return The bytes for requestId.
+ */
+ public com.google.protobuf.ByteString
+ getRequestIdBytes() {
+ java.lang.Object ref = requestId_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ requestId_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * + * Based on go/client-populate-request-id-design; subject to change + *+ * + *
string request_id = 7 [(.google.api.field_info) = { ... }
+ * @param value The requestId to set.
+ * @return This builder for chaining.
+ */
+ public Builder setRequestId(
+ java.lang.String value) {
+ if (value == null) { throw new NullPointerException(); }
+ requestId_ = value;
+ bitField0_ |= 0x00000020;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Based on go/client-populate-request-id-design; subject to change + *+ * + *
string request_id = 7 [(.google.api.field_info) = { ... }
+ * @return This builder for chaining.
+ */
+ public Builder clearRequestId() {
+ requestId_ = getDefaultInstance().getRequestId();
+ bitField0_ = (bitField0_ & ~0x00000020);
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Based on go/client-populate-request-id-design; subject to change + *+ * + *
string request_id = 7 [(.google.api.field_info) = { ... }
+ * @param value The bytes for requestId to set.
+ * @return This builder for chaining.
+ */
+ public Builder setRequestIdBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) { throw new NullPointerException(); }
+ checkByteStringIsUtf8(value);
+ requestId_ = value;
+ bitField0_ |= 0x00000020;
+ onChanged();
+ return this;
+ }
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequestOrBuilder.java b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequestOrBuilder.java
index d804458923..6a4b297a58 100644
--- a/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequestOrBuilder.java
+++ b/showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequestOrBuilder.java
@@ -123,5 +123,25 @@ public interface EchoRequestOrBuilder extends
com.google.protobuf.ByteString
getOtherHeaderBytes();
+ /**
+ * + * Based on go/client-populate-request-id-design; subject to change + *+ * + *
string request_id = 7 [(.google.api.field_info) = { ... }
+ * @return The requestId.
+ */
+ java.lang.String getRequestId();
+ /**
+ * + * Based on go/client-populate-request-id-design; subject to change + *+ * + *
string request_id = 7 [(.google.api.field_info) = { ... }
+ * @return The bytes for requestId.
+ */
+ com.google.protobuf.ByteString
+ getRequestIdBytes();
+
com.google.showcase.v1beta1.EchoRequest.ResponseCase getResponseCase();
}
diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/echo.proto b/showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/echo.proto
index 101b37c25f..3e797adfc3 100644
--- a/showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/echo.proto
+++ b/showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/echo.proto
@@ -17,6 +17,7 @@ syntax = "proto3";
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
+import "google/api/field_info.proto";
import "google/api/routing.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/any.proto";
@@ -209,6 +210,11 @@ 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
+ string request_id = 7 [
+ (google.api.field_info).format = UUID4
+ ];
}
// The response message for the Echo methods.
diff --git a/showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/testing.proto b/showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/testing.proto
index 56e85e97e5..be66091074 100644
--- a/showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/testing.proto
+++ b/showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/testing.proto
@@ -28,12 +28,18 @@ option ruby_package = "Google::Showcase::V1beta1";
// A service to facilitate running discrete sets of tests
// against Showcase.
+// Adding this comment with special characters for comment formatting tests:
+// 1. (abra->kadabra->alakazam)
+// 2) [Nonsense][]: `pokemon/*/psychic/*`
service Testing {
// This service is meant to only run locally on the port 7469 (keypad digits
// for "show").
option (google.api.default_host) = "localhost:7469";
// Creates a new testing session.
+ // Adding this comment with special characters for comment formatting tests:
+ // 1. (abra->kadabra->alakazam)
+ // 2) [Nonsense][]: `pokemon/*/psychic/*`
rpc CreateSession(CreateSessionRequest) returns (Session) {
option (google.api.http) = {
post: "/v1beta1/sessions"