diff --git a/proto-google-common-protos/src/main/java/com/google/api/RoutingParameter.java b/proto-google-common-protos/src/main/java/com/google/api/RoutingParameter.java new file mode 100644 index 00000000..664fd4be --- /dev/null +++ b/proto-google-common-protos/src/main/java/com/google/api/RoutingParameter.java @@ -0,0 +1,1120 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/routing.proto + +package com.google.api; + +/** + * + * + *
+ * A projection from an input message to the GRPC or REST header.
+ * 
+ * + * Protobuf type {@code google.api.RoutingParameter} + */ +public final class RoutingParameter extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.RoutingParameter) + RoutingParameterOrBuilder { + private static final long serialVersionUID = 0L; + // Use RoutingParameter.newBuilder() to construct. + private RoutingParameter(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RoutingParameter() { + field_ = ""; + pathTemplate_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RoutingParameter(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RoutingParameter( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + field_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + pathTemplate_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.RoutingProto.internal_static_google_api_RoutingParameter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.RoutingProto + .internal_static_google_api_RoutingParameter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.RoutingParameter.class, com.google.api.RoutingParameter.Builder.class); + } + + public static final int FIELD_FIELD_NUMBER = 1; + private volatile java.lang.Object field_; + /** + * + * + *
+   * A request field to extract the header key-value pair from.
+   * 
+ * + * string field = 1; + * + * @return The field. + */ + @java.lang.Override + public java.lang.String getField() { + java.lang.Object ref = field_; + 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(); + field_ = s; + return s; + } + } + /** + * + * + *
+   * A request field to extract the header key-value pair from.
+   * 
+ * + * string field = 1; + * + * @return The bytes for field. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFieldBytes() { + java.lang.Object ref = field_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + field_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PATH_TEMPLATE_FIELD_NUMBER = 2; + private volatile java.lang.Object pathTemplate_; + /** + * + * + *
+   * A pattern matching the key-value field. Optional.
+   * If not specified, the whole field specified in the `field` field will be
+   * taken as value, and its name used as key. If specified, it MUST contain
+   * exactly one named segment (along with any number of unnamed segments) The
+   * pattern will be matched over the field specified in the `field` field, then
+   * if the match is successful:
+   * - the name of the single named segment will be used as a header name,
+   * - the match value of the segment will be used as a header value;
+   * if the match is NOT successful, nothing will be sent.
+   * Example:
+   *               -- This is a field in the request message
+   *              |   that the header value will be extracted from.
+   *              |
+   *              |                     -- This is the key name in the
+   *              |                    |   routing header.
+   *              V                    |
+   *     field: "table_name"           v
+   *     path_template: "projects/*/{table_location=instances/*}/tables/*"
+   *                                                ^            ^
+   *                                                |            |
+   *       In the {} brackets is the pattern that --             |
+   *       specifies what to extract from the                    |
+   *       field as a value to be sent.                          |
+   *                                                             |
+   *      The string in the field must match the whole pattern --
+   *      before brackets, inside brackets, after brackets.
+   * When looking at this specific example, we can see that:
+   * - A key-value pair with the key `table_location`
+   *   and the value matching `instances/*` should be added
+   *   to the x-goog-request-params routing header.
+   * - The value is extracted from the request message's `table_name` field
+   *   if it matches the full pattern specified:
+   *   `projects/*/instances/*/tables/*`.
+   * **NB:** If the `path_template` field is not provided, the key name is
+   * equal to the field name, and the whole field should be sent as a value.
+   * This makes the pattern for the field and the value functionally equivalent
+   * to `**`, and the configuration
+   *     {
+   *       field: "table_name"
+   *     }
+   * is a functionally equivalent shorthand to:
+   *     {
+   *       field: "table_name"
+   *       path_template: "{table_name=**}"
+   *     }
+   * See Example 1 for more details.
+   * 
+ * + * string path_template = 2; + * + * @return The pathTemplate. + */ + @java.lang.Override + public java.lang.String getPathTemplate() { + java.lang.Object ref = pathTemplate_; + 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(); + pathTemplate_ = s; + return s; + } + } + /** + * + * + *
+   * A pattern matching the key-value field. Optional.
+   * If not specified, the whole field specified in the `field` field will be
+   * taken as value, and its name used as key. If specified, it MUST contain
+   * exactly one named segment (along with any number of unnamed segments) The
+   * pattern will be matched over the field specified in the `field` field, then
+   * if the match is successful:
+   * - the name of the single named segment will be used as a header name,
+   * - the match value of the segment will be used as a header value;
+   * if the match is NOT successful, nothing will be sent.
+   * Example:
+   *               -- This is a field in the request message
+   *              |   that the header value will be extracted from.
+   *              |
+   *              |                     -- This is the key name in the
+   *              |                    |   routing header.
+   *              V                    |
+   *     field: "table_name"           v
+   *     path_template: "projects/*/{table_location=instances/*}/tables/*"
+   *                                                ^            ^
+   *                                                |            |
+   *       In the {} brackets is the pattern that --             |
+   *       specifies what to extract from the                    |
+   *       field as a value to be sent.                          |
+   *                                                             |
+   *      The string in the field must match the whole pattern --
+   *      before brackets, inside brackets, after brackets.
+   * When looking at this specific example, we can see that:
+   * - A key-value pair with the key `table_location`
+   *   and the value matching `instances/*` should be added
+   *   to the x-goog-request-params routing header.
+   * - The value is extracted from the request message's `table_name` field
+   *   if it matches the full pattern specified:
+   *   `projects/*/instances/*/tables/*`.
+   * **NB:** If the `path_template` field is not provided, the key name is
+   * equal to the field name, and the whole field should be sent as a value.
+   * This makes the pattern for the field and the value functionally equivalent
+   * to `**`, and the configuration
+   *     {
+   *       field: "table_name"
+   *     }
+   * is a functionally equivalent shorthand to:
+   *     {
+   *       field: "table_name"
+   *       path_template: "{table_name=**}"
+   *     }
+   * See Example 1 for more details.
+   * 
+ * + * string path_template = 2; + * + * @return The bytes for pathTemplate. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPathTemplateBytes() { + java.lang.Object ref = pathTemplate_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pathTemplate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getFieldBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, field_); + } + if (!getPathTemplateBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pathTemplate_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getFieldBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, field_); + } + if (!getPathTemplateBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pathTemplate_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.api.RoutingParameter)) { + return super.equals(obj); + } + com.google.api.RoutingParameter other = (com.google.api.RoutingParameter) obj; + + if (!getField().equals(other.getField())) return false; + if (!getPathTemplate().equals(other.getPathTemplate())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + FIELD_FIELD_NUMBER; + hash = (53 * hash) + getField().hashCode(); + hash = (37 * hash) + PATH_TEMPLATE_FIELD_NUMBER; + hash = (53 * hash) + getPathTemplate().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.RoutingParameter parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.RoutingParameter parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.RoutingParameter parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.RoutingParameter parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.RoutingParameter parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.RoutingParameter parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.RoutingParameter parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.RoutingParameter parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.api.RoutingParameter parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.RoutingParameter parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.api.RoutingParameter parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.RoutingParameter parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.api.RoutingParameter prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A projection from an input message to the GRPC or REST header.
+   * 
+ * + * Protobuf type {@code google.api.RoutingParameter} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.RoutingParameter) + com.google.api.RoutingParameterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.RoutingProto.internal_static_google_api_RoutingParameter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.RoutingProto + .internal_static_google_api_RoutingParameter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.RoutingParameter.class, com.google.api.RoutingParameter.Builder.class); + } + + // Construct using com.google.api.RoutingParameter.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + field_ = ""; + + pathTemplate_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.RoutingProto.internal_static_google_api_RoutingParameter_descriptor; + } + + @java.lang.Override + public com.google.api.RoutingParameter getDefaultInstanceForType() { + return com.google.api.RoutingParameter.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.RoutingParameter build() { + com.google.api.RoutingParameter result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.RoutingParameter buildPartial() { + com.google.api.RoutingParameter result = new com.google.api.RoutingParameter(this); + result.field_ = field_; + result.pathTemplate_ = pathTemplate_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.api.RoutingParameter) { + return mergeFrom((com.google.api.RoutingParameter) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.RoutingParameter other) { + if (other == com.google.api.RoutingParameter.getDefaultInstance()) return this; + if (!other.getField().isEmpty()) { + field_ = other.field_; + onChanged(); + } + if (!other.getPathTemplate().isEmpty()) { + pathTemplate_ = other.pathTemplate_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.api.RoutingParameter parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.api.RoutingParameter) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object field_ = ""; + /** + * + * + *
+     * A request field to extract the header key-value pair from.
+     * 
+ * + * string field = 1; + * + * @return The field. + */ + public java.lang.String getField() { + java.lang.Object ref = field_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + field_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A request field to extract the header key-value pair from.
+     * 
+ * + * string field = 1; + * + * @return The bytes for field. + */ + public com.google.protobuf.ByteString getFieldBytes() { + java.lang.Object ref = field_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + field_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A request field to extract the header key-value pair from.
+     * 
+ * + * string field = 1; + * + * @param value The field to set. + * @return This builder for chaining. + */ + public Builder setField(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + field_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A request field to extract the header key-value pair from.
+     * 
+ * + * string field = 1; + * + * @return This builder for chaining. + */ + public Builder clearField() { + + field_ = getDefaultInstance().getField(); + onChanged(); + return this; + } + /** + * + * + *
+     * A request field to extract the header key-value pair from.
+     * 
+ * + * string field = 1; + * + * @param value The bytes for field to set. + * @return This builder for chaining. + */ + public Builder setFieldBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + field_ = value; + onChanged(); + return this; + } + + private java.lang.Object pathTemplate_ = ""; + /** + * + * + *
+     * A pattern matching the key-value field. Optional.
+     * If not specified, the whole field specified in the `field` field will be
+     * taken as value, and its name used as key. If specified, it MUST contain
+     * exactly one named segment (along with any number of unnamed segments) The
+     * pattern will be matched over the field specified in the `field` field, then
+     * if the match is successful:
+     * - the name of the single named segment will be used as a header name,
+     * - the match value of the segment will be used as a header value;
+     * if the match is NOT successful, nothing will be sent.
+     * Example:
+     *               -- This is a field in the request message
+     *              |   that the header value will be extracted from.
+     *              |
+     *              |                     -- This is the key name in the
+     *              |                    |   routing header.
+     *              V                    |
+     *     field: "table_name"           v
+     *     path_template: "projects/*/{table_location=instances/*}/tables/*"
+     *                                                ^            ^
+     *                                                |            |
+     *       In the {} brackets is the pattern that --             |
+     *       specifies what to extract from the                    |
+     *       field as a value to be sent.                          |
+     *                                                             |
+     *      The string in the field must match the whole pattern --
+     *      before brackets, inside brackets, after brackets.
+     * When looking at this specific example, we can see that:
+     * - A key-value pair with the key `table_location`
+     *   and the value matching `instances/*` should be added
+     *   to the x-goog-request-params routing header.
+     * - The value is extracted from the request message's `table_name` field
+     *   if it matches the full pattern specified:
+     *   `projects/*/instances/*/tables/*`.
+     * **NB:** If the `path_template` field is not provided, the key name is
+     * equal to the field name, and the whole field should be sent as a value.
+     * This makes the pattern for the field and the value functionally equivalent
+     * to `**`, and the configuration
+     *     {
+     *       field: "table_name"
+     *     }
+     * is a functionally equivalent shorthand to:
+     *     {
+     *       field: "table_name"
+     *       path_template: "{table_name=**}"
+     *     }
+     * See Example 1 for more details.
+     * 
+ * + * string path_template = 2; + * + * @return The pathTemplate. + */ + public java.lang.String getPathTemplate() { + java.lang.Object ref = pathTemplate_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pathTemplate_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A pattern matching the key-value field. Optional.
+     * If not specified, the whole field specified in the `field` field will be
+     * taken as value, and its name used as key. If specified, it MUST contain
+     * exactly one named segment (along with any number of unnamed segments) The
+     * pattern will be matched over the field specified in the `field` field, then
+     * if the match is successful:
+     * - the name of the single named segment will be used as a header name,
+     * - the match value of the segment will be used as a header value;
+     * if the match is NOT successful, nothing will be sent.
+     * Example:
+     *               -- This is a field in the request message
+     *              |   that the header value will be extracted from.
+     *              |
+     *              |                     -- This is the key name in the
+     *              |                    |   routing header.
+     *              V                    |
+     *     field: "table_name"           v
+     *     path_template: "projects/*/{table_location=instances/*}/tables/*"
+     *                                                ^            ^
+     *                                                |            |
+     *       In the {} brackets is the pattern that --             |
+     *       specifies what to extract from the                    |
+     *       field as a value to be sent.                          |
+     *                                                             |
+     *      The string in the field must match the whole pattern --
+     *      before brackets, inside brackets, after brackets.
+     * When looking at this specific example, we can see that:
+     * - A key-value pair with the key `table_location`
+     *   and the value matching `instances/*` should be added
+     *   to the x-goog-request-params routing header.
+     * - The value is extracted from the request message's `table_name` field
+     *   if it matches the full pattern specified:
+     *   `projects/*/instances/*/tables/*`.
+     * **NB:** If the `path_template` field is not provided, the key name is
+     * equal to the field name, and the whole field should be sent as a value.
+     * This makes the pattern for the field and the value functionally equivalent
+     * to `**`, and the configuration
+     *     {
+     *       field: "table_name"
+     *     }
+     * is a functionally equivalent shorthand to:
+     *     {
+     *       field: "table_name"
+     *       path_template: "{table_name=**}"
+     *     }
+     * See Example 1 for more details.
+     * 
+ * + * string path_template = 2; + * + * @return The bytes for pathTemplate. + */ + public com.google.protobuf.ByteString getPathTemplateBytes() { + java.lang.Object ref = pathTemplate_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pathTemplate_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A pattern matching the key-value field. Optional.
+     * If not specified, the whole field specified in the `field` field will be
+     * taken as value, and its name used as key. If specified, it MUST contain
+     * exactly one named segment (along with any number of unnamed segments) The
+     * pattern will be matched over the field specified in the `field` field, then
+     * if the match is successful:
+     * - the name of the single named segment will be used as a header name,
+     * - the match value of the segment will be used as a header value;
+     * if the match is NOT successful, nothing will be sent.
+     * Example:
+     *               -- This is a field in the request message
+     *              |   that the header value will be extracted from.
+     *              |
+     *              |                     -- This is the key name in the
+     *              |                    |   routing header.
+     *              V                    |
+     *     field: "table_name"           v
+     *     path_template: "projects/*/{table_location=instances/*}/tables/*"
+     *                                                ^            ^
+     *                                                |            |
+     *       In the {} brackets is the pattern that --             |
+     *       specifies what to extract from the                    |
+     *       field as a value to be sent.                          |
+     *                                                             |
+     *      The string in the field must match the whole pattern --
+     *      before brackets, inside brackets, after brackets.
+     * When looking at this specific example, we can see that:
+     * - A key-value pair with the key `table_location`
+     *   and the value matching `instances/*` should be added
+     *   to the x-goog-request-params routing header.
+     * - The value is extracted from the request message's `table_name` field
+     *   if it matches the full pattern specified:
+     *   `projects/*/instances/*/tables/*`.
+     * **NB:** If the `path_template` field is not provided, the key name is
+     * equal to the field name, and the whole field should be sent as a value.
+     * This makes the pattern for the field and the value functionally equivalent
+     * to `**`, and the configuration
+     *     {
+     *       field: "table_name"
+     *     }
+     * is a functionally equivalent shorthand to:
+     *     {
+     *       field: "table_name"
+     *       path_template: "{table_name=**}"
+     *     }
+     * See Example 1 for more details.
+     * 
+ * + * string path_template = 2; + * + * @param value The pathTemplate to set. + * @return This builder for chaining. + */ + public Builder setPathTemplate(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pathTemplate_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A pattern matching the key-value field. Optional.
+     * If not specified, the whole field specified in the `field` field will be
+     * taken as value, and its name used as key. If specified, it MUST contain
+     * exactly one named segment (along with any number of unnamed segments) The
+     * pattern will be matched over the field specified in the `field` field, then
+     * if the match is successful:
+     * - the name of the single named segment will be used as a header name,
+     * - the match value of the segment will be used as a header value;
+     * if the match is NOT successful, nothing will be sent.
+     * Example:
+     *               -- This is a field in the request message
+     *              |   that the header value will be extracted from.
+     *              |
+     *              |                     -- This is the key name in the
+     *              |                    |   routing header.
+     *              V                    |
+     *     field: "table_name"           v
+     *     path_template: "projects/*/{table_location=instances/*}/tables/*"
+     *                                                ^            ^
+     *                                                |            |
+     *       In the {} brackets is the pattern that --             |
+     *       specifies what to extract from the                    |
+     *       field as a value to be sent.                          |
+     *                                                             |
+     *      The string in the field must match the whole pattern --
+     *      before brackets, inside brackets, after brackets.
+     * When looking at this specific example, we can see that:
+     * - A key-value pair with the key `table_location`
+     *   and the value matching `instances/*` should be added
+     *   to the x-goog-request-params routing header.
+     * - The value is extracted from the request message's `table_name` field
+     *   if it matches the full pattern specified:
+     *   `projects/*/instances/*/tables/*`.
+     * **NB:** If the `path_template` field is not provided, the key name is
+     * equal to the field name, and the whole field should be sent as a value.
+     * This makes the pattern for the field and the value functionally equivalent
+     * to `**`, and the configuration
+     *     {
+     *       field: "table_name"
+     *     }
+     * is a functionally equivalent shorthand to:
+     *     {
+     *       field: "table_name"
+     *       path_template: "{table_name=**}"
+     *     }
+     * See Example 1 for more details.
+     * 
+ * + * string path_template = 2; + * + * @return This builder for chaining. + */ + public Builder clearPathTemplate() { + + pathTemplate_ = getDefaultInstance().getPathTemplate(); + onChanged(); + return this; + } + /** + * + * + *
+     * A pattern matching the key-value field. Optional.
+     * If not specified, the whole field specified in the `field` field will be
+     * taken as value, and its name used as key. If specified, it MUST contain
+     * exactly one named segment (along with any number of unnamed segments) The
+     * pattern will be matched over the field specified in the `field` field, then
+     * if the match is successful:
+     * - the name of the single named segment will be used as a header name,
+     * - the match value of the segment will be used as a header value;
+     * if the match is NOT successful, nothing will be sent.
+     * Example:
+     *               -- This is a field in the request message
+     *              |   that the header value will be extracted from.
+     *              |
+     *              |                     -- This is the key name in the
+     *              |                    |   routing header.
+     *              V                    |
+     *     field: "table_name"           v
+     *     path_template: "projects/*/{table_location=instances/*}/tables/*"
+     *                                                ^            ^
+     *                                                |            |
+     *       In the {} brackets is the pattern that --             |
+     *       specifies what to extract from the                    |
+     *       field as a value to be sent.                          |
+     *                                                             |
+     *      The string in the field must match the whole pattern --
+     *      before brackets, inside brackets, after brackets.
+     * When looking at this specific example, we can see that:
+     * - A key-value pair with the key `table_location`
+     *   and the value matching `instances/*` should be added
+     *   to the x-goog-request-params routing header.
+     * - The value is extracted from the request message's `table_name` field
+     *   if it matches the full pattern specified:
+     *   `projects/*/instances/*/tables/*`.
+     * **NB:** If the `path_template` field is not provided, the key name is
+     * equal to the field name, and the whole field should be sent as a value.
+     * This makes the pattern for the field and the value functionally equivalent
+     * to `**`, and the configuration
+     *     {
+     *       field: "table_name"
+     *     }
+     * is a functionally equivalent shorthand to:
+     *     {
+     *       field: "table_name"
+     *       path_template: "{table_name=**}"
+     *     }
+     * See Example 1 for more details.
+     * 
+ * + * string path_template = 2; + * + * @param value The bytes for pathTemplate to set. + * @return This builder for chaining. + */ + public Builder setPathTemplateBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pathTemplate_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.api.RoutingParameter) + } + + // @@protoc_insertion_point(class_scope:google.api.RoutingParameter) + private static final com.google.api.RoutingParameter DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.RoutingParameter(); + } + + public static com.google.api.RoutingParameter getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RoutingParameter parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RoutingParameter(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.api.RoutingParameter getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-common-protos/src/main/java/com/google/api/RoutingParameterOrBuilder.java b/proto-google-common-protos/src/main/java/com/google/api/RoutingParameterOrBuilder.java new file mode 100644 index 00000000..cb948dbd --- /dev/null +++ b/proto-google-common-protos/src/main/java/com/google/api/RoutingParameterOrBuilder.java @@ -0,0 +1,165 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/routing.proto + +package com.google.api; + +public interface RoutingParameterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.RoutingParameter) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A request field to extract the header key-value pair from.
+   * 
+ * + * string field = 1; + * + * @return The field. + */ + java.lang.String getField(); + /** + * + * + *
+   * A request field to extract the header key-value pair from.
+   * 
+ * + * string field = 1; + * + * @return The bytes for field. + */ + com.google.protobuf.ByteString getFieldBytes(); + + /** + * + * + *
+   * A pattern matching the key-value field. Optional.
+   * If not specified, the whole field specified in the `field` field will be
+   * taken as value, and its name used as key. If specified, it MUST contain
+   * exactly one named segment (along with any number of unnamed segments) The
+   * pattern will be matched over the field specified in the `field` field, then
+   * if the match is successful:
+   * - the name of the single named segment will be used as a header name,
+   * - the match value of the segment will be used as a header value;
+   * if the match is NOT successful, nothing will be sent.
+   * Example:
+   *               -- This is a field in the request message
+   *              |   that the header value will be extracted from.
+   *              |
+   *              |                     -- This is the key name in the
+   *              |                    |   routing header.
+   *              V                    |
+   *     field: "table_name"           v
+   *     path_template: "projects/*/{table_location=instances/*}/tables/*"
+   *                                                ^            ^
+   *                                                |            |
+   *       In the {} brackets is the pattern that --             |
+   *       specifies what to extract from the                    |
+   *       field as a value to be sent.                          |
+   *                                                             |
+   *      The string in the field must match the whole pattern --
+   *      before brackets, inside brackets, after brackets.
+   * When looking at this specific example, we can see that:
+   * - A key-value pair with the key `table_location`
+   *   and the value matching `instances/*` should be added
+   *   to the x-goog-request-params routing header.
+   * - The value is extracted from the request message's `table_name` field
+   *   if it matches the full pattern specified:
+   *   `projects/*/instances/*/tables/*`.
+   * **NB:** If the `path_template` field is not provided, the key name is
+   * equal to the field name, and the whole field should be sent as a value.
+   * This makes the pattern for the field and the value functionally equivalent
+   * to `**`, and the configuration
+   *     {
+   *       field: "table_name"
+   *     }
+   * is a functionally equivalent shorthand to:
+   *     {
+   *       field: "table_name"
+   *       path_template: "{table_name=**}"
+   *     }
+   * See Example 1 for more details.
+   * 
+ * + * string path_template = 2; + * + * @return The pathTemplate. + */ + java.lang.String getPathTemplate(); + /** + * + * + *
+   * A pattern matching the key-value field. Optional.
+   * If not specified, the whole field specified in the `field` field will be
+   * taken as value, and its name used as key. If specified, it MUST contain
+   * exactly one named segment (along with any number of unnamed segments) The
+   * pattern will be matched over the field specified in the `field` field, then
+   * if the match is successful:
+   * - the name of the single named segment will be used as a header name,
+   * - the match value of the segment will be used as a header value;
+   * if the match is NOT successful, nothing will be sent.
+   * Example:
+   *               -- This is a field in the request message
+   *              |   that the header value will be extracted from.
+   *              |
+   *              |                     -- This is the key name in the
+   *              |                    |   routing header.
+   *              V                    |
+   *     field: "table_name"           v
+   *     path_template: "projects/*/{table_location=instances/*}/tables/*"
+   *                                                ^            ^
+   *                                                |            |
+   *       In the {} brackets is the pattern that --             |
+   *       specifies what to extract from the                    |
+   *       field as a value to be sent.                          |
+   *                                                             |
+   *      The string in the field must match the whole pattern --
+   *      before brackets, inside brackets, after brackets.
+   * When looking at this specific example, we can see that:
+   * - A key-value pair with the key `table_location`
+   *   and the value matching `instances/*` should be added
+   *   to the x-goog-request-params routing header.
+   * - The value is extracted from the request message's `table_name` field
+   *   if it matches the full pattern specified:
+   *   `projects/*/instances/*/tables/*`.
+   * **NB:** If the `path_template` field is not provided, the key name is
+   * equal to the field name, and the whole field should be sent as a value.
+   * This makes the pattern for the field and the value functionally equivalent
+   * to `**`, and the configuration
+   *     {
+   *       field: "table_name"
+   *     }
+   * is a functionally equivalent shorthand to:
+   *     {
+   *       field: "table_name"
+   *       path_template: "{table_name=**}"
+   *     }
+   * See Example 1 for more details.
+   * 
+ * + * string path_template = 2; + * + * @return The bytes for pathTemplate. + */ + com.google.protobuf.ByteString getPathTemplateBytes(); +} diff --git a/proto-google-common-protos/src/main/java/com/google/api/RoutingProto.java b/proto-google-common-protos/src/main/java/com/google/api/RoutingProto.java new file mode 100644 index 00000000..31189bf5 --- /dev/null +++ b/proto-google-common-protos/src/main/java/com/google/api/RoutingProto.java @@ -0,0 +1,102 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/routing.proto + +package com.google.api; + +public final class RoutingProto { + private RoutingProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { + registry.add(com.google.api.RoutingProto.routing); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static final int ROUTING_FIELD_NUMBER = 72295729; + /** + * + * + *
+   * See RoutingRule.
+   * 
+ * + * extend .google.protobuf.MethodOptions { ... } + */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MethodOptions, com.google.api.RoutingRule> + routing = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + com.google.api.RoutingRule.class, com.google.api.RoutingRule.getDefaultInstance()); + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_RoutingRule_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_RoutingRule_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_RoutingParameter_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_RoutingParameter_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n\030google/api/routing.proto\022\ngoogle.api\032 " + + "google/protobuf/descriptor.proto\"G\n\013Rout" + + "ingRule\0228\n\022routing_parameters\030\002 \003(\0132\034.go" + + "ogle.api.RoutingParameter\"8\n\020RoutingPara" + + "meter\022\r\n\005field\030\001 \001(\t\022\025\n\rpath_template\030\002 " + + "\001(\t:K\n\007routing\022\036.google.protobuf.MethodO" + + "ptions\030\261\312\274\" \001(\0132\027.google.api.RoutingRule" + + "Bj\n\016com.google.apiB\014RoutingProtoP\001ZAgoog" + + "le.golang.org/genproto/googleapis/api/an" + + "notations;annotations\242\002\004GAPIb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.DescriptorProtos.getDescriptor(), + }); + internal_static_google_api_RoutingRule_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_api_RoutingRule_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_RoutingRule_descriptor, + new java.lang.String[] { + "RoutingParameters", + }); + internal_static_google_api_RoutingParameter_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_api_RoutingParameter_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_RoutingParameter_descriptor, + new java.lang.String[] { + "Field", "PathTemplate", + }); + routing.internalInit(descriptor.getExtensions().get(0)); + com.google.protobuf.DescriptorProtos.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-common-protos/src/main/java/com/google/api/RoutingRule.java b/proto-google-common-protos/src/main/java/com/google/api/RoutingRule.java new file mode 100644 index 00000000..08e1e223 --- /dev/null +++ b/proto-google-common-protos/src/main/java/com/google/api/RoutingRule.java @@ -0,0 +1,1588 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/routing.proto + +package com.google.api; + +/** + * + * + *
+ * Specifies the routing information that should be sent along with the request
+ * in the form of routing header.
+ * **NOTE:** All service configuration rules follow the "last one wins" order.
+ * The examples below will apply to an RPC which has the following request type:
+ * Message Definition:
+ *     message Request {
+ *       // The name of the Table
+ *       // Values can be of the following formats:
+ *       // - `projects/<project>/tables/<table>`
+ *       // - `projects/<project>/instances/<instance>/tables/<table>`
+ *       // - `region/<region>/zones/<zone>/tables/<table>`
+ *       string table_name = 1;
+ *       // This value specifies routing for replication.
+ *       // It can be in the following formats:
+ *       // - `profiles/<profile_id>`
+ *       // - a legacy `profile_id` that can be any string
+ *       string app_profile_id = 2;
+ *     }
+ * Example message:
+ *     {
+ *       table_name: projects/proj_foo/instances/instance_bar/table/table_baz,
+ *       app_profile_id: profiles/prof_qux
+ *     }
+ * The routing header consists of one or multiple key-value pairs. Every key
+ * and value must be percent-encoded, and joined together in the format of
+ * `key1=value1&key2=value2`.
+ * In the examples below I am skipping the percent-encoding for readablity.
+ * Example 1
+ * Extracting a field from the request to put into the routing header
+ * unchanged, with the key equal to the field name.
+ * annotation:
+ *     option (google.api.routing) = {
+ *       // Take the `app_profile_id`.
+ *       routing_parameters {
+ *         field: "app_profile_id"
+ *       }
+ *     };
+ * result:
+ *     x-goog-request-params: app_profile_id=profiles/prof_qux
+ * Example 2
+ * Extracting a field from the request to put into the routing header
+ * unchanged, with the key different from the field name.
+ * annotation:
+ *     option (google.api.routing) = {
+ *       // Take the `app_profile_id`, but name it `routing_id` in the header.
+ *       routing_parameters {
+ *         field: "app_profile_id"
+ *         path_template: "{routing_id=**}"
+ *       }
+ *     };
+ * result:
+ *     x-goog-request-params: routing_id=profiles/prof_qux
+ * Example 3
+ * Extracting a field from the request to put into the routing
+ * header, while matching a path template syntax on the field's value.
+ * NB: it is more useful to send nothing than to send garbage for the purpose
+ * of dynamic routing, since garbage pollutes cache. Thus the matching.
+ * Sub-example 3a
+ * The field matches the template.
+ * annotation:
+ *     option (google.api.routing) = {
+ *       // Take the `table_name`, if it's well-formed (with project-based
+ *       // syntax).
+ *       routing_parameters {
+ *         field: "table_name"
+ *         path_template: "{table_name=projects/*/instances/*/**}"
+ *       }
+ *     };
+ * result:
+ *     x-goog-request-params:
+ *     table_name=projects/proj_foo/instances/instance_bar/table/table_baz
+ * Sub-example 3b
+ * The field does not match the template.
+ * annotation:
+ *     option (google.api.routing) = {
+ *       // Take the `table_name`, if it's well-formed (with region-based
+ *       // syntax).
+ *       routing_parameters {
+ *         field: "table_name"
+ *         path_template: "{table_name=regions/*/zones/*/**}"
+ *       }
+ *     };
+ * result:
+ *     <no routing header will be sent>
+ * Sub-example 3c
+ * Multiple alternative conflictingly named path templates are
+ * specified. The one that matches is used to construct the header.
+ * annotation:
+ *     option (google.api.routing) = {
+ *       // Take the `table_name`, if it's well-formed, whether
+ *       // using the region- or projects-based syntax.
+ *       routing_parameters {
+ *         field: "table_name"
+ *         path_template: "{table_name=regions/*/zones/*/**}"
+ *       }
+ *       routing_parameters {
+ *         field: "table_name"
+ *         path_template: "{table_name=projects/*/instances/*/**}"
+ *       }
+ *     };
+ * result:
+ *     x-goog-request-params:
+ *     table_name=projects/proj_foo/instances/instance_bar/table/table_baz
+ * Example 4
+ * Extracting a single routing header key-value pair by matching a
+ * template syntax on (a part of) a single request field.
+ * annotation:
+ *     option (google.api.routing) = {
+ *       // Take just the project id from the `table_name` field.
+ *       routing_parameters {
+ *         field: "table_name"
+ *         path_template: "{routing_id=projects/*}/**"
+ *       }
+ *     };
+ * result:
+ *     x-goog-request-params: routing_id=projects/proj_foo
+ * Example 5
+ * Extracting a single routing header key-value pair by matching
+ * several conflictingly named path templates on (parts of) a single request
+ * field. The last template to match "wins" the conflict.
+ * annotation:
+ *     option (google.api.routing) = {
+ *       // If the `table_name` does not have instances information,
+ *       // take just the project id for routing.
+ *       // Otherwise take project + instance.
+ *       routing_parameters {
+ *         field: "table_name"
+ *         path_template: "{routing_id=projects/*}/**"
+ *       }
+ *       routing_parameters {
+ *         field: "table_name"
+ *         path_template: "{routing_id=projects/*/instances/*}/**"
+ *       }
+ *     };
+ * result:
+ *     x-goog-request-params:
+ *     routing_id=projects/proj_foo/instances/instance_bar
+ * Example 6
+ * Extracting multiple routing header key-value pairs by matching
+ * several non-conflicting path templates on (parts of) a single request field.
+ * Sub-example 6a
+ * Make the templates strict, so that if the `table_name` does not
+ * have an instance information, nothing is sent.
+ * annotation:
+ *     option (google.api.routing) = {
+ *       // The routing code needs two keys instead of one composite
+ *       // but works only for the tables with the "project-instance" name
+ *       // syntax.
+ *       routing_parameters {
+ *         field: "table_name"
+ *         path_template: "{project_id=projects/*}/instances/*/**"
+ *       }
+ *       routing_parameters {
+ *         field: "table_name"
+ *         path_template: "projects/*/{instance_id=instances/*}/**"
+ *       }
+ *     };
+ * result:
+ *     x-goog-request-params:
+ *     project_id=projects/proj_foo&instance_id=instances/instance_bar
+ * Sub-example 6b
+ * Make the templates loose, so that if the `table_name` does not
+ * have an instance information, just the project id part is sent.
+ * annotation:
+ *     option (google.api.routing) = {
+ *       // The routing code wants two keys instead of one composite
+ *       // but will work with just the `project_id` for tables without
+ *       // an instance in the `table_name`.
+ *       routing_parameters {
+ *         field: "table_name"
+ *         path_template: "{project_id=projects/*}/**"
+ *       }
+ *       routing_parameters {
+ *         field: "table_name"
+ *         path_template: "projects/*/{instance_id=instances/*}/**"
+ *       }
+ *     };
+ * result (is the same as 6a for our example message because it has the instance
+ * information):
+ *     x-goog-request-params:
+ *     project_id=projects/proj_foo&instance_id=instances/instance_bar
+ * Example 7
+ * Extracting multiple routing header key-value pairs by matching
+ * several path templates on multiple request fields.
+ * NB: note that here there is no way to specify sending nothing if one of the
+ * fields does not match its template. E.g. if the `table_name` is in the wrong
+ * format, the `project_id` will not be sent, but the `routing_id` will be.
+ * The backend routing code has to be aware of that and be prepared to not
+ * receive a full complement of keys if it expects multiple.
+ * annotation:
+ *     option (google.api.routing) = {
+ *       // The routing needs both `project_id` and `routing_id`
+ *       // (from the `app_profile_id` field) for routing.
+ *       routing_parameters {
+ *         field: "table_name"
+ *         path_template: "{project_id=projects/*}/**"
+ *       }
+ *       routing_parameters {
+ *         field: "app_profile_id"
+ *         path_template: "{routing_id=**}"
+ *       }
+ *     };
+ * result:
+ *     x-goog-request-params:
+ *     project_id=projects/proj_foo&routing_id=profiles/prof_qux
+ * Example 8
+ * Extracting a single routing header key-value pair by matching
+ * several conflictingly named path templates on several request fields. The
+ * last template to match "wins" the conflict.
+ * annotation:
+ *     option (google.api.routing) = {
+ *       // The `routing_id` can be a project id or a region id depending on
+ *       // the table name format, but only if the `app_profile_id` is not set.
+ *       // If `app_profile_id` is set it should be used instead.
+ *       routing_parameters {
+ *         field: "table_name"
+ *         path_template: "{routing_id=projects/*}/**"
+ *       }
+ *       routing_parameters {
+ *          field: "table_name"
+ *          path_template: "{routing_id=regions/*}/**"
+ *       }
+ *       routing_parameters {
+ *         field: "app_profile_id"
+ *         path_template: "{routing_id=**}"
+ *       }
+ *     };
+ * result:
+ *     x-goog-request-params: routing_id=profiles/prof_qux
+ * Example 9
+ * Bringing it all together.
+ * annotation:
+ *     option (google.api.routing) = {
+ *       // For routing both `table_location` and a `routing_id` are needed.
+ *       //
+ *       // table_location can be either an instance id or a region+zone id.
+ *       //
+ *       // For `routing_id`, take the value of `app_profile_id`
+ *       // - If it's in the format `profiles/<profile_id>`, send
+ *       // just the `<profile_id>` part.
+ *       // - If it's any other literal, send it as is.
+ *       // If the `app_profile_id` is empty, and the `table_name` starts with
+ *       // the project_id, send that instead.
+ *       routing_parameters {
+ *         field: "table_name"
+ *         path_template: "projects/*/{table_location=instances/*}/tables/*"
+ *       }
+ *       routing_parameters {
+ *         field: "table_name"
+ *         path_template: "{table_location=regions/*/zones/*}/tables/*"
+ *       }
+ *       routing_parameters {
+ *         field: "table_name"
+ *         path_template: "{routing_id=projects/*}/**"
+ *       }
+ *       routing_parameters {
+ *         field: "app_profile_id"
+ *         path_template: "{routing_id=**}"
+ *       }
+ *       routing_parameters {
+ *         field: "app_profile_id"
+ *         path_template: "profiles/{routing_id=*}"
+ *       }
+ *     };
+ * result:
+ *     x-goog-request-params:
+ *     table_location=instances/instance_bar&routing_id=prof_qux
+ * 
+ * + * Protobuf type {@code google.api.RoutingRule} + */ +public final class RoutingRule extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.RoutingRule) + RoutingRuleOrBuilder { + private static final long serialVersionUID = 0L; + // Use RoutingRule.newBuilder() to construct. + private RoutingRule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RoutingRule() { + routingParameters_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RoutingRule(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RoutingRule( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + routingParameters_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + routingParameters_.add( + input.readMessage(com.google.api.RoutingParameter.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + routingParameters_ = java.util.Collections.unmodifiableList(routingParameters_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.RoutingProto.internal_static_google_api_RoutingRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.RoutingProto.internal_static_google_api_RoutingRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.RoutingRule.class, com.google.api.RoutingRule.Builder.class); + } + + public static final int ROUTING_PARAMETERS_FIELD_NUMBER = 2; + private java.util.List routingParameters_; + /** + * + * + *
+   * A collection of Routing Parameter specifications.
+   * **NOTE:** If multiple Routing Parameters describe the same key
+   * (via the `path_template` field or via the `field` field when
+   * `path_template` is not provided), "last one wins" rule
+   * determines which Parameter gets used.
+   * See the examples for more details.
+   * 
+ * + * repeated .google.api.RoutingParameter routing_parameters = 2; + */ + @java.lang.Override + public java.util.List getRoutingParametersList() { + return routingParameters_; + } + /** + * + * + *
+   * A collection of Routing Parameter specifications.
+   * **NOTE:** If multiple Routing Parameters describe the same key
+   * (via the `path_template` field or via the `field` field when
+   * `path_template` is not provided), "last one wins" rule
+   * determines which Parameter gets used.
+   * See the examples for more details.
+   * 
+ * + * repeated .google.api.RoutingParameter routing_parameters = 2; + */ + @java.lang.Override + public java.util.List + getRoutingParametersOrBuilderList() { + return routingParameters_; + } + /** + * + * + *
+   * A collection of Routing Parameter specifications.
+   * **NOTE:** If multiple Routing Parameters describe the same key
+   * (via the `path_template` field or via the `field` field when
+   * `path_template` is not provided), "last one wins" rule
+   * determines which Parameter gets used.
+   * See the examples for more details.
+   * 
+ * + * repeated .google.api.RoutingParameter routing_parameters = 2; + */ + @java.lang.Override + public int getRoutingParametersCount() { + return routingParameters_.size(); + } + /** + * + * + *
+   * A collection of Routing Parameter specifications.
+   * **NOTE:** If multiple Routing Parameters describe the same key
+   * (via the `path_template` field or via the `field` field when
+   * `path_template` is not provided), "last one wins" rule
+   * determines which Parameter gets used.
+   * See the examples for more details.
+   * 
+ * + * repeated .google.api.RoutingParameter routing_parameters = 2; + */ + @java.lang.Override + public com.google.api.RoutingParameter getRoutingParameters(int index) { + return routingParameters_.get(index); + } + /** + * + * + *
+   * A collection of Routing Parameter specifications.
+   * **NOTE:** If multiple Routing Parameters describe the same key
+   * (via the `path_template` field or via the `field` field when
+   * `path_template` is not provided), "last one wins" rule
+   * determines which Parameter gets used.
+   * See the examples for more details.
+   * 
+ * + * repeated .google.api.RoutingParameter routing_parameters = 2; + */ + @java.lang.Override + public com.google.api.RoutingParameterOrBuilder getRoutingParametersOrBuilder(int index) { + return routingParameters_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < routingParameters_.size(); i++) { + output.writeMessage(2, routingParameters_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < routingParameters_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, routingParameters_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.api.RoutingRule)) { + return super.equals(obj); + } + com.google.api.RoutingRule other = (com.google.api.RoutingRule) obj; + + if (!getRoutingParametersList().equals(other.getRoutingParametersList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getRoutingParametersCount() > 0) { + hash = (37 * hash) + ROUTING_PARAMETERS_FIELD_NUMBER; + hash = (53 * hash) + getRoutingParametersList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.RoutingRule parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.RoutingRule parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.RoutingRule parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.RoutingRule parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.RoutingRule parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.RoutingRule parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.RoutingRule parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.RoutingRule parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.api.RoutingRule parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.RoutingRule parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.api.RoutingRule parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.RoutingRule parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.api.RoutingRule prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Specifies the routing information that should be sent along with the request
+   * in the form of routing header.
+   * **NOTE:** All service configuration rules follow the "last one wins" order.
+   * The examples below will apply to an RPC which has the following request type:
+   * Message Definition:
+   *     message Request {
+   *       // The name of the Table
+   *       // Values can be of the following formats:
+   *       // - `projects/<project>/tables/<table>`
+   *       // - `projects/<project>/instances/<instance>/tables/<table>`
+   *       // - `region/<region>/zones/<zone>/tables/<table>`
+   *       string table_name = 1;
+   *       // This value specifies routing for replication.
+   *       // It can be in the following formats:
+   *       // - `profiles/<profile_id>`
+   *       // - a legacy `profile_id` that can be any string
+   *       string app_profile_id = 2;
+   *     }
+   * Example message:
+   *     {
+   *       table_name: projects/proj_foo/instances/instance_bar/table/table_baz,
+   *       app_profile_id: profiles/prof_qux
+   *     }
+   * The routing header consists of one or multiple key-value pairs. Every key
+   * and value must be percent-encoded, and joined together in the format of
+   * `key1=value1&key2=value2`.
+   * In the examples below I am skipping the percent-encoding for readablity.
+   * Example 1
+   * Extracting a field from the request to put into the routing header
+   * unchanged, with the key equal to the field name.
+   * annotation:
+   *     option (google.api.routing) = {
+   *       // Take the `app_profile_id`.
+   *       routing_parameters {
+   *         field: "app_profile_id"
+   *       }
+   *     };
+   * result:
+   *     x-goog-request-params: app_profile_id=profiles/prof_qux
+   * Example 2
+   * Extracting a field from the request to put into the routing header
+   * unchanged, with the key different from the field name.
+   * annotation:
+   *     option (google.api.routing) = {
+   *       // Take the `app_profile_id`, but name it `routing_id` in the header.
+   *       routing_parameters {
+   *         field: "app_profile_id"
+   *         path_template: "{routing_id=**}"
+   *       }
+   *     };
+   * result:
+   *     x-goog-request-params: routing_id=profiles/prof_qux
+   * Example 3
+   * Extracting a field from the request to put into the routing
+   * header, while matching a path template syntax on the field's value.
+   * NB: it is more useful to send nothing than to send garbage for the purpose
+   * of dynamic routing, since garbage pollutes cache. Thus the matching.
+   * Sub-example 3a
+   * The field matches the template.
+   * annotation:
+   *     option (google.api.routing) = {
+   *       // Take the `table_name`, if it's well-formed (with project-based
+   *       // syntax).
+   *       routing_parameters {
+   *         field: "table_name"
+   *         path_template: "{table_name=projects/*/instances/*/**}"
+   *       }
+   *     };
+   * result:
+   *     x-goog-request-params:
+   *     table_name=projects/proj_foo/instances/instance_bar/table/table_baz
+   * Sub-example 3b
+   * The field does not match the template.
+   * annotation:
+   *     option (google.api.routing) = {
+   *       // Take the `table_name`, if it's well-formed (with region-based
+   *       // syntax).
+   *       routing_parameters {
+   *         field: "table_name"
+   *         path_template: "{table_name=regions/*/zones/*/**}"
+   *       }
+   *     };
+   * result:
+   *     <no routing header will be sent>
+   * Sub-example 3c
+   * Multiple alternative conflictingly named path templates are
+   * specified. The one that matches is used to construct the header.
+   * annotation:
+   *     option (google.api.routing) = {
+   *       // Take the `table_name`, if it's well-formed, whether
+   *       // using the region- or projects-based syntax.
+   *       routing_parameters {
+   *         field: "table_name"
+   *         path_template: "{table_name=regions/*/zones/*/**}"
+   *       }
+   *       routing_parameters {
+   *         field: "table_name"
+   *         path_template: "{table_name=projects/*/instances/*/**}"
+   *       }
+   *     };
+   * result:
+   *     x-goog-request-params:
+   *     table_name=projects/proj_foo/instances/instance_bar/table/table_baz
+   * Example 4
+   * Extracting a single routing header key-value pair by matching a
+   * template syntax on (a part of) a single request field.
+   * annotation:
+   *     option (google.api.routing) = {
+   *       // Take just the project id from the `table_name` field.
+   *       routing_parameters {
+   *         field: "table_name"
+   *         path_template: "{routing_id=projects/*}/**"
+   *       }
+   *     };
+   * result:
+   *     x-goog-request-params: routing_id=projects/proj_foo
+   * Example 5
+   * Extracting a single routing header key-value pair by matching
+   * several conflictingly named path templates on (parts of) a single request
+   * field. The last template to match "wins" the conflict.
+   * annotation:
+   *     option (google.api.routing) = {
+   *       // If the `table_name` does not have instances information,
+   *       // take just the project id for routing.
+   *       // Otherwise take project + instance.
+   *       routing_parameters {
+   *         field: "table_name"
+   *         path_template: "{routing_id=projects/*}/**"
+   *       }
+   *       routing_parameters {
+   *         field: "table_name"
+   *         path_template: "{routing_id=projects/*/instances/*}/**"
+   *       }
+   *     };
+   * result:
+   *     x-goog-request-params:
+   *     routing_id=projects/proj_foo/instances/instance_bar
+   * Example 6
+   * Extracting multiple routing header key-value pairs by matching
+   * several non-conflicting path templates on (parts of) a single request field.
+   * Sub-example 6a
+   * Make the templates strict, so that if the `table_name` does not
+   * have an instance information, nothing is sent.
+   * annotation:
+   *     option (google.api.routing) = {
+   *       // The routing code needs two keys instead of one composite
+   *       // but works only for the tables with the "project-instance" name
+   *       // syntax.
+   *       routing_parameters {
+   *         field: "table_name"
+   *         path_template: "{project_id=projects/*}/instances/*/**"
+   *       }
+   *       routing_parameters {
+   *         field: "table_name"
+   *         path_template: "projects/*/{instance_id=instances/*}/**"
+   *       }
+   *     };
+   * result:
+   *     x-goog-request-params:
+   *     project_id=projects/proj_foo&instance_id=instances/instance_bar
+   * Sub-example 6b
+   * Make the templates loose, so that if the `table_name` does not
+   * have an instance information, just the project id part is sent.
+   * annotation:
+   *     option (google.api.routing) = {
+   *       // The routing code wants two keys instead of one composite
+   *       // but will work with just the `project_id` for tables without
+   *       // an instance in the `table_name`.
+   *       routing_parameters {
+   *         field: "table_name"
+   *         path_template: "{project_id=projects/*}/**"
+   *       }
+   *       routing_parameters {
+   *         field: "table_name"
+   *         path_template: "projects/*/{instance_id=instances/*}/**"
+   *       }
+   *     };
+   * result (is the same as 6a for our example message because it has the instance
+   * information):
+   *     x-goog-request-params:
+   *     project_id=projects/proj_foo&instance_id=instances/instance_bar
+   * Example 7
+   * Extracting multiple routing header key-value pairs by matching
+   * several path templates on multiple request fields.
+   * NB: note that here there is no way to specify sending nothing if one of the
+   * fields does not match its template. E.g. if the `table_name` is in the wrong
+   * format, the `project_id` will not be sent, but the `routing_id` will be.
+   * The backend routing code has to be aware of that and be prepared to not
+   * receive a full complement of keys if it expects multiple.
+   * annotation:
+   *     option (google.api.routing) = {
+   *       // The routing needs both `project_id` and `routing_id`
+   *       // (from the `app_profile_id` field) for routing.
+   *       routing_parameters {
+   *         field: "table_name"
+   *         path_template: "{project_id=projects/*}/**"
+   *       }
+   *       routing_parameters {
+   *         field: "app_profile_id"
+   *         path_template: "{routing_id=**}"
+   *       }
+   *     };
+   * result:
+   *     x-goog-request-params:
+   *     project_id=projects/proj_foo&routing_id=profiles/prof_qux
+   * Example 8
+   * Extracting a single routing header key-value pair by matching
+   * several conflictingly named path templates on several request fields. The
+   * last template to match "wins" the conflict.
+   * annotation:
+   *     option (google.api.routing) = {
+   *       // The `routing_id` can be a project id or a region id depending on
+   *       // the table name format, but only if the `app_profile_id` is not set.
+   *       // If `app_profile_id` is set it should be used instead.
+   *       routing_parameters {
+   *         field: "table_name"
+   *         path_template: "{routing_id=projects/*}/**"
+   *       }
+   *       routing_parameters {
+   *          field: "table_name"
+   *          path_template: "{routing_id=regions/*}/**"
+   *       }
+   *       routing_parameters {
+   *         field: "app_profile_id"
+   *         path_template: "{routing_id=**}"
+   *       }
+   *     };
+   * result:
+   *     x-goog-request-params: routing_id=profiles/prof_qux
+   * Example 9
+   * Bringing it all together.
+   * annotation:
+   *     option (google.api.routing) = {
+   *       // For routing both `table_location` and a `routing_id` are needed.
+   *       //
+   *       // table_location can be either an instance id or a region+zone id.
+   *       //
+   *       // For `routing_id`, take the value of `app_profile_id`
+   *       // - If it's in the format `profiles/<profile_id>`, send
+   *       // just the `<profile_id>` part.
+   *       // - If it's any other literal, send it as is.
+   *       // If the `app_profile_id` is empty, and the `table_name` starts with
+   *       // the project_id, send that instead.
+   *       routing_parameters {
+   *         field: "table_name"
+   *         path_template: "projects/*/{table_location=instances/*}/tables/*"
+   *       }
+   *       routing_parameters {
+   *         field: "table_name"
+   *         path_template: "{table_location=regions/*/zones/*}/tables/*"
+   *       }
+   *       routing_parameters {
+   *         field: "table_name"
+   *         path_template: "{routing_id=projects/*}/**"
+   *       }
+   *       routing_parameters {
+   *         field: "app_profile_id"
+   *         path_template: "{routing_id=**}"
+   *       }
+   *       routing_parameters {
+   *         field: "app_profile_id"
+   *         path_template: "profiles/{routing_id=*}"
+   *       }
+   *     };
+   * result:
+   *     x-goog-request-params:
+   *     table_location=instances/instance_bar&routing_id=prof_qux
+   * 
+ * + * Protobuf type {@code google.api.RoutingRule} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.RoutingRule) + com.google.api.RoutingRuleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.RoutingProto.internal_static_google_api_RoutingRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.RoutingProto.internal_static_google_api_RoutingRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.RoutingRule.class, com.google.api.RoutingRule.Builder.class); + } + + // Construct using com.google.api.RoutingRule.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRoutingParametersFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (routingParametersBuilder_ == null) { + routingParameters_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + routingParametersBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.RoutingProto.internal_static_google_api_RoutingRule_descriptor; + } + + @java.lang.Override + public com.google.api.RoutingRule getDefaultInstanceForType() { + return com.google.api.RoutingRule.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.RoutingRule build() { + com.google.api.RoutingRule result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.RoutingRule buildPartial() { + com.google.api.RoutingRule result = new com.google.api.RoutingRule(this); + int from_bitField0_ = bitField0_; + if (routingParametersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + routingParameters_ = java.util.Collections.unmodifiableList(routingParameters_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.routingParameters_ = routingParameters_; + } else { + result.routingParameters_ = routingParametersBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.api.RoutingRule) { + return mergeFrom((com.google.api.RoutingRule) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.RoutingRule other) { + if (other == com.google.api.RoutingRule.getDefaultInstance()) return this; + if (routingParametersBuilder_ == null) { + if (!other.routingParameters_.isEmpty()) { + if (routingParameters_.isEmpty()) { + routingParameters_ = other.routingParameters_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRoutingParametersIsMutable(); + routingParameters_.addAll(other.routingParameters_); + } + onChanged(); + } + } else { + if (!other.routingParameters_.isEmpty()) { + if (routingParametersBuilder_.isEmpty()) { + routingParametersBuilder_.dispose(); + routingParametersBuilder_ = null; + routingParameters_ = other.routingParameters_; + bitField0_ = (bitField0_ & ~0x00000001); + routingParametersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRoutingParametersFieldBuilder() + : null; + } else { + routingParametersBuilder_.addAllMessages(other.routingParameters_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.api.RoutingRule parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.api.RoutingRule) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List routingParameters_ = + java.util.Collections.emptyList(); + + private void ensureRoutingParametersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + routingParameters_ = + new java.util.ArrayList(routingParameters_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.RoutingParameter, + com.google.api.RoutingParameter.Builder, + com.google.api.RoutingParameterOrBuilder> + routingParametersBuilder_; + + /** + * + * + *
+     * A collection of Routing Parameter specifications.
+     * **NOTE:** If multiple Routing Parameters describe the same key
+     * (via the `path_template` field or via the `field` field when
+     * `path_template` is not provided), "last one wins" rule
+     * determines which Parameter gets used.
+     * See the examples for more details.
+     * 
+ * + * repeated .google.api.RoutingParameter routing_parameters = 2; + */ + public java.util.List getRoutingParametersList() { + if (routingParametersBuilder_ == null) { + return java.util.Collections.unmodifiableList(routingParameters_); + } else { + return routingParametersBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A collection of Routing Parameter specifications.
+     * **NOTE:** If multiple Routing Parameters describe the same key
+     * (via the `path_template` field or via the `field` field when
+     * `path_template` is not provided), "last one wins" rule
+     * determines which Parameter gets used.
+     * See the examples for more details.
+     * 
+ * + * repeated .google.api.RoutingParameter routing_parameters = 2; + */ + public int getRoutingParametersCount() { + if (routingParametersBuilder_ == null) { + return routingParameters_.size(); + } else { + return routingParametersBuilder_.getCount(); + } + } + /** + * + * + *
+     * A collection of Routing Parameter specifications.
+     * **NOTE:** If multiple Routing Parameters describe the same key
+     * (via the `path_template` field or via the `field` field when
+     * `path_template` is not provided), "last one wins" rule
+     * determines which Parameter gets used.
+     * See the examples for more details.
+     * 
+ * + * repeated .google.api.RoutingParameter routing_parameters = 2; + */ + public com.google.api.RoutingParameter getRoutingParameters(int index) { + if (routingParametersBuilder_ == null) { + return routingParameters_.get(index); + } else { + return routingParametersBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A collection of Routing Parameter specifications.
+     * **NOTE:** If multiple Routing Parameters describe the same key
+     * (via the `path_template` field or via the `field` field when
+     * `path_template` is not provided), "last one wins" rule
+     * determines which Parameter gets used.
+     * See the examples for more details.
+     * 
+ * + * repeated .google.api.RoutingParameter routing_parameters = 2; + */ + public Builder setRoutingParameters(int index, com.google.api.RoutingParameter value) { + if (routingParametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRoutingParametersIsMutable(); + routingParameters_.set(index, value); + onChanged(); + } else { + routingParametersBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A collection of Routing Parameter specifications.
+     * **NOTE:** If multiple Routing Parameters describe the same key
+     * (via the `path_template` field or via the `field` field when
+     * `path_template` is not provided), "last one wins" rule
+     * determines which Parameter gets used.
+     * See the examples for more details.
+     * 
+ * + * repeated .google.api.RoutingParameter routing_parameters = 2; + */ + public Builder setRoutingParameters( + int index, com.google.api.RoutingParameter.Builder builderForValue) { + if (routingParametersBuilder_ == null) { + ensureRoutingParametersIsMutable(); + routingParameters_.set(index, builderForValue.build()); + onChanged(); + } else { + routingParametersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A collection of Routing Parameter specifications.
+     * **NOTE:** If multiple Routing Parameters describe the same key
+     * (via the `path_template` field or via the `field` field when
+     * `path_template` is not provided), "last one wins" rule
+     * determines which Parameter gets used.
+     * See the examples for more details.
+     * 
+ * + * repeated .google.api.RoutingParameter routing_parameters = 2; + */ + public Builder addRoutingParameters(com.google.api.RoutingParameter value) { + if (routingParametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRoutingParametersIsMutable(); + routingParameters_.add(value); + onChanged(); + } else { + routingParametersBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A collection of Routing Parameter specifications.
+     * **NOTE:** If multiple Routing Parameters describe the same key
+     * (via the `path_template` field or via the `field` field when
+     * `path_template` is not provided), "last one wins" rule
+     * determines which Parameter gets used.
+     * See the examples for more details.
+     * 
+ * + * repeated .google.api.RoutingParameter routing_parameters = 2; + */ + public Builder addRoutingParameters(int index, com.google.api.RoutingParameter value) { + if (routingParametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRoutingParametersIsMutable(); + routingParameters_.add(index, value); + onChanged(); + } else { + routingParametersBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A collection of Routing Parameter specifications.
+     * **NOTE:** If multiple Routing Parameters describe the same key
+     * (via the `path_template` field or via the `field` field when
+     * `path_template` is not provided), "last one wins" rule
+     * determines which Parameter gets used.
+     * See the examples for more details.
+     * 
+ * + * repeated .google.api.RoutingParameter routing_parameters = 2; + */ + public Builder addRoutingParameters(com.google.api.RoutingParameter.Builder builderForValue) { + if (routingParametersBuilder_ == null) { + ensureRoutingParametersIsMutable(); + routingParameters_.add(builderForValue.build()); + onChanged(); + } else { + routingParametersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A collection of Routing Parameter specifications.
+     * **NOTE:** If multiple Routing Parameters describe the same key
+     * (via the `path_template` field or via the `field` field when
+     * `path_template` is not provided), "last one wins" rule
+     * determines which Parameter gets used.
+     * See the examples for more details.
+     * 
+ * + * repeated .google.api.RoutingParameter routing_parameters = 2; + */ + public Builder addRoutingParameters( + int index, com.google.api.RoutingParameter.Builder builderForValue) { + if (routingParametersBuilder_ == null) { + ensureRoutingParametersIsMutable(); + routingParameters_.add(index, builderForValue.build()); + onChanged(); + } else { + routingParametersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A collection of Routing Parameter specifications.
+     * **NOTE:** If multiple Routing Parameters describe the same key
+     * (via the `path_template` field or via the `field` field when
+     * `path_template` is not provided), "last one wins" rule
+     * determines which Parameter gets used.
+     * See the examples for more details.
+     * 
+ * + * repeated .google.api.RoutingParameter routing_parameters = 2; + */ + public Builder addAllRoutingParameters( + java.lang.Iterable values) { + if (routingParametersBuilder_ == null) { + ensureRoutingParametersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, routingParameters_); + onChanged(); + } else { + routingParametersBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A collection of Routing Parameter specifications.
+     * **NOTE:** If multiple Routing Parameters describe the same key
+     * (via the `path_template` field or via the `field` field when
+     * `path_template` is not provided), "last one wins" rule
+     * determines which Parameter gets used.
+     * See the examples for more details.
+     * 
+ * + * repeated .google.api.RoutingParameter routing_parameters = 2; + */ + public Builder clearRoutingParameters() { + if (routingParametersBuilder_ == null) { + routingParameters_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + routingParametersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A collection of Routing Parameter specifications.
+     * **NOTE:** If multiple Routing Parameters describe the same key
+     * (via the `path_template` field or via the `field` field when
+     * `path_template` is not provided), "last one wins" rule
+     * determines which Parameter gets used.
+     * See the examples for more details.
+     * 
+ * + * repeated .google.api.RoutingParameter routing_parameters = 2; + */ + public Builder removeRoutingParameters(int index) { + if (routingParametersBuilder_ == null) { + ensureRoutingParametersIsMutable(); + routingParameters_.remove(index); + onChanged(); + } else { + routingParametersBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A collection of Routing Parameter specifications.
+     * **NOTE:** If multiple Routing Parameters describe the same key
+     * (via the `path_template` field or via the `field` field when
+     * `path_template` is not provided), "last one wins" rule
+     * determines which Parameter gets used.
+     * See the examples for more details.
+     * 
+ * + * repeated .google.api.RoutingParameter routing_parameters = 2; + */ + public com.google.api.RoutingParameter.Builder getRoutingParametersBuilder(int index) { + return getRoutingParametersFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A collection of Routing Parameter specifications.
+     * **NOTE:** If multiple Routing Parameters describe the same key
+     * (via the `path_template` field or via the `field` field when
+     * `path_template` is not provided), "last one wins" rule
+     * determines which Parameter gets used.
+     * See the examples for more details.
+     * 
+ * + * repeated .google.api.RoutingParameter routing_parameters = 2; + */ + public com.google.api.RoutingParameterOrBuilder getRoutingParametersOrBuilder(int index) { + if (routingParametersBuilder_ == null) { + return routingParameters_.get(index); + } else { + return routingParametersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A collection of Routing Parameter specifications.
+     * **NOTE:** If multiple Routing Parameters describe the same key
+     * (via the `path_template` field or via the `field` field when
+     * `path_template` is not provided), "last one wins" rule
+     * determines which Parameter gets used.
+     * See the examples for more details.
+     * 
+ * + * repeated .google.api.RoutingParameter routing_parameters = 2; + */ + public java.util.List + getRoutingParametersOrBuilderList() { + if (routingParametersBuilder_ != null) { + return routingParametersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(routingParameters_); + } + } + /** + * + * + *
+     * A collection of Routing Parameter specifications.
+     * **NOTE:** If multiple Routing Parameters describe the same key
+     * (via the `path_template` field or via the `field` field when
+     * `path_template` is not provided), "last one wins" rule
+     * determines which Parameter gets used.
+     * See the examples for more details.
+     * 
+ * + * repeated .google.api.RoutingParameter routing_parameters = 2; + */ + public com.google.api.RoutingParameter.Builder addRoutingParametersBuilder() { + return getRoutingParametersFieldBuilder() + .addBuilder(com.google.api.RoutingParameter.getDefaultInstance()); + } + /** + * + * + *
+     * A collection of Routing Parameter specifications.
+     * **NOTE:** If multiple Routing Parameters describe the same key
+     * (via the `path_template` field or via the `field` field when
+     * `path_template` is not provided), "last one wins" rule
+     * determines which Parameter gets used.
+     * See the examples for more details.
+     * 
+ * + * repeated .google.api.RoutingParameter routing_parameters = 2; + */ + public com.google.api.RoutingParameter.Builder addRoutingParametersBuilder(int index) { + return getRoutingParametersFieldBuilder() + .addBuilder(index, com.google.api.RoutingParameter.getDefaultInstance()); + } + /** + * + * + *
+     * A collection of Routing Parameter specifications.
+     * **NOTE:** If multiple Routing Parameters describe the same key
+     * (via the `path_template` field or via the `field` field when
+     * `path_template` is not provided), "last one wins" rule
+     * determines which Parameter gets used.
+     * See the examples for more details.
+     * 
+ * + * repeated .google.api.RoutingParameter routing_parameters = 2; + */ + public java.util.List + getRoutingParametersBuilderList() { + return getRoutingParametersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.RoutingParameter, + com.google.api.RoutingParameter.Builder, + com.google.api.RoutingParameterOrBuilder> + getRoutingParametersFieldBuilder() { + if (routingParametersBuilder_ == null) { + routingParametersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.RoutingParameter, + com.google.api.RoutingParameter.Builder, + com.google.api.RoutingParameterOrBuilder>( + routingParameters_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + routingParameters_ = null; + } + return routingParametersBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.api.RoutingRule) + } + + // @@protoc_insertion_point(class_scope:google.api.RoutingRule) + private static final com.google.api.RoutingRule DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.RoutingRule(); + } + + public static com.google.api.RoutingRule getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RoutingRule parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RoutingRule(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.api.RoutingRule getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-common-protos/src/main/java/com/google/api/RoutingRuleOrBuilder.java b/proto-google-common-protos/src/main/java/com/google/api/RoutingRuleOrBuilder.java new file mode 100644 index 00000000..76b09e5e --- /dev/null +++ b/proto-google-common-protos/src/main/java/com/google/api/RoutingRuleOrBuilder.java @@ -0,0 +1,102 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/routing.proto + +package com.google.api; + +public interface RoutingRuleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.RoutingRule) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A collection of Routing Parameter specifications.
+   * **NOTE:** If multiple Routing Parameters describe the same key
+   * (via the `path_template` field or via the `field` field when
+   * `path_template` is not provided), "last one wins" rule
+   * determines which Parameter gets used.
+   * See the examples for more details.
+   * 
+ * + * repeated .google.api.RoutingParameter routing_parameters = 2; + */ + java.util.List getRoutingParametersList(); + /** + * + * + *
+   * A collection of Routing Parameter specifications.
+   * **NOTE:** If multiple Routing Parameters describe the same key
+   * (via the `path_template` field or via the `field` field when
+   * `path_template` is not provided), "last one wins" rule
+   * determines which Parameter gets used.
+   * See the examples for more details.
+   * 
+ * + * repeated .google.api.RoutingParameter routing_parameters = 2; + */ + com.google.api.RoutingParameter getRoutingParameters(int index); + /** + * + * + *
+   * A collection of Routing Parameter specifications.
+   * **NOTE:** If multiple Routing Parameters describe the same key
+   * (via the `path_template` field or via the `field` field when
+   * `path_template` is not provided), "last one wins" rule
+   * determines which Parameter gets used.
+   * See the examples for more details.
+   * 
+ * + * repeated .google.api.RoutingParameter routing_parameters = 2; + */ + int getRoutingParametersCount(); + /** + * + * + *
+   * A collection of Routing Parameter specifications.
+   * **NOTE:** If multiple Routing Parameters describe the same key
+   * (via the `path_template` field or via the `field` field when
+   * `path_template` is not provided), "last one wins" rule
+   * determines which Parameter gets used.
+   * See the examples for more details.
+   * 
+ * + * repeated .google.api.RoutingParameter routing_parameters = 2; + */ + java.util.List + getRoutingParametersOrBuilderList(); + /** + * + * + *
+   * A collection of Routing Parameter specifications.
+   * **NOTE:** If multiple Routing Parameters describe the same key
+   * (via the `path_template` field or via the `field` field when
+   * `path_template` is not provided), "last one wins" rule
+   * determines which Parameter gets used.
+   * See the examples for more details.
+   * 
+ * + * repeated .google.api.RoutingParameter routing_parameters = 2; + */ + com.google.api.RoutingParameterOrBuilder getRoutingParametersOrBuilder(int index); +} diff --git a/synth.metadata b/synth.metadata index ebe587ff..22e23d7f 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-common-protos.git", - "sha": "c408f1d14f95f15fe741ff584554fce431146c00" + "sha": "08b5c8545ed6f29a11ae4d3f061df47f40234bd1" } }, { @@ -200,6 +200,11 @@ "proto-google-common-protos/src/main/java/com/google/api/ResourceProto.java", "proto-google-common-protos/src/main/java/com/google/api/ResourceReference.java", "proto-google-common-protos/src/main/java/com/google/api/ResourceReferenceOrBuilder.java", + "proto-google-common-protos/src/main/java/com/google/api/RoutingParameter.java", + "proto-google-common-protos/src/main/java/com/google/api/RoutingParameterOrBuilder.java", + "proto-google-common-protos/src/main/java/com/google/api/RoutingProto.java", + "proto-google-common-protos/src/main/java/com/google/api/RoutingRule.java", + "proto-google-common-protos/src/main/java/com/google/api/RoutingRuleOrBuilder.java", "proto-google-common-protos/src/main/java/com/google/api/Service.java", "proto-google-common-protos/src/main/java/com/google/api/ServiceOrBuilder.java", "proto-google-common-protos/src/main/java/com/google/api/ServiceProto.java",