From f2b828005e6b21a2af0e646bb8cc6d0f8c39d4e4 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 6 Oct 2023 10:01:10 -0400 Subject: [PATCH] feat: [common-protos] public google.api.FieldInfo type and extension (#2037) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): Update gapic-generator-java to 2.26.0 PiperOrigin-RevId: 567624307 Source-Link: https://github.com/googleapis/googleapis/commit/2ecf4defdf5b4564491e7eee9a4b436b58b29e35 Source-Link: https://github.com/googleapis/googleapis-gen/commit/a5cfbd9a05b3a134e92886114db776fb33cec9f2 Copy-Tag: eyJwIjoiamF2YS1jb21tb24tcHJvdG9zLy5Pd2xCb3QueWFtbCIsImgiOiJhNWNmYmQ5YTA1YjNhMTM0ZTkyODg2MTE0ZGI3NzZmYjMzY2VjOWYyIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore(deps): Update gapic-generator-java to 2.26.0 PiperOrigin-RevId: 567624307 Source-Link: https://github.com/googleapis/googleapis/commit/2ecf4defdf5b4564491e7eee9a4b436b58b29e35 Source-Link: https://github.com/googleapis/googleapis-gen/commit/a5cfbd9a05b3a134e92886114db776fb33cec9f2 Copy-Tag: eyJwIjoiamF2YS1jb21tb24tcHJvdG9zLy5Pd2xCb3QueWFtbCIsImgiOiJhNWNmYmQ5YTA1YjNhMTM0ZTkyODg2MTE0ZGI3NzZmYjMzY2VjOWYyIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: refactor BUILD PiperOrigin-RevId: 570077450 Source-Link: https://github.com/googleapis/googleapis/commit/615270f06972970e9d750b820d20abe187940e7b Source-Link: https://github.com/googleapis/googleapis-gen/commit/2ab4e3b5366de5ead65a0969ce8db21d09101b78 Copy-Tag: eyJwIjoiamF2YS1jb21tb24tcHJvdG9zLy5Pd2xCb3QueWFtbCIsImgiOiIyYWI0ZTNiNTM2NmRlNWVhZDY1YTA5NjljZThkYjIxZDA5MTAxYjc4In0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: refactor BUILD PiperOrigin-RevId: 570077450 Source-Link: https://github.com/googleapis/googleapis/commit/615270f06972970e9d750b820d20abe187940e7b Source-Link: https://github.com/googleapis/googleapis-gen/commit/2ab4e3b5366de5ead65a0969ce8db21d09101b78 Copy-Tag: eyJwIjoiamF2YS1jb21tb24tcHJvdG9zLy5Pd2xCb3QueWFtbCIsImgiOiIyYWI0ZTNiNTM2NmRlNWVhZDY1YTA5NjljZThkYjIxZDA5MTAxYjc4In0= * feat: public google.api.FieldInfo type and extension PiperOrigin-RevId: 570083911 Source-Link: https://github.com/googleapis/googleapis/commit/2ca95f64cd5c6d8e4087cc769f0d4d3f470110c0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/c30822cae9be09ac7f854d6f65ab1d8cdb05e7d9 Copy-Tag: eyJwIjoiamF2YS1jb21tb24tcHJvdG9zLy5Pd2xCb3QueWFtbCIsImgiOiJjMzA4MjJjYWU5YmUwOWFjN2Y4NTRkNmY2NWFiMWQ4Y2RiMDVlN2Q5In0= * feat: public google.api.FieldInfo type and extension PiperOrigin-RevId: 570083911 Source-Link: https://github.com/googleapis/googleapis/commit/2ca95f64cd5c6d8e4087cc769f0d4d3f470110c0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/c30822cae9be09ac7f854d6f65ab1d8cdb05e7d9 Copy-Tag: eyJwIjoiamF2YS1jb21tb24tcHJvdG9zLy5Pd2xCb3QueWFtbCIsImgiOiJjMzA4MjJjYWU5YmUwOWFjN2Y4NTRkNmY2NWFiMWQ4Y2RiMDVlN2Q5In0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- .../google/cloud/location/LocationsGrpc.java | 6 +- .../google/longrunning/OperationsGrpc.java | 6 +- .../main/java/com/google/api/FieldInfo.java | 819 ++++++++++++++++++ .../com/google/api/FieldInfoOrBuilder.java | 54 ++ .../java/com/google/api/FieldInfoProto.java | 100 +++ .../main/proto/google/api/field_info.proto | 79 ++ .../google/cloud/location/locations.proto | 108 +++ 7 files changed, 1166 insertions(+), 6 deletions(-) create mode 100644 java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldInfo.java create mode 100644 java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldInfoOrBuilder.java create mode 100644 java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldInfoProto.java create mode 100644 java-common-protos/proto-google-common-protos/src/main/proto/google/api/field_info.proto create mode 100644 java-common-protos/proto-google-common-protos/src/main/proto/google/cloud/location/locations.proto diff --git a/java-common-protos/grpc-google-common-protos/src/main/java/com/google/cloud/location/LocationsGrpc.java b/java-common-protos/grpc-google-common-protos/src/main/java/com/google/cloud/location/LocationsGrpc.java index fe6b6d8ee4..8cc3bac92e 100644 --- a/java-common-protos/grpc-google-common-protos/src/main/java/com/google/cloud/location/LocationsGrpc.java +++ b/java-common-protos/grpc-google-common-protos/src/main/java/com/google/cloud/location/LocationsGrpc.java @@ -34,7 +34,7 @@ public final class LocationsGrpc { private LocationsGrpc() {} - public static final String SERVICE_NAME = "google.cloud.location.Locations"; + public static final java.lang.String SERVICE_NAME = "google.cloud.location.Locations"; // Static method descriptors that strictly reflect the proto. private static volatile io.grpc.MethodDescriptor< @@ -458,9 +458,9 @@ private static final class LocationsFileDescriptorSupplier private static final class LocationsMethodDescriptorSupplier extends LocationsBaseDescriptorSupplier implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; + private final java.lang.String methodName; - LocationsMethodDescriptorSupplier(String methodName) { + LocationsMethodDescriptorSupplier(java.lang.String methodName) { this.methodName = methodName; } diff --git a/java-common-protos/grpc-google-common-protos/src/main/java/com/google/longrunning/OperationsGrpc.java b/java-common-protos/grpc-google-common-protos/src/main/java/com/google/longrunning/OperationsGrpc.java index f90982b30f..6e81480663 100644 --- a/java-common-protos/grpc-google-common-protos/src/main/java/com/google/longrunning/OperationsGrpc.java +++ b/java-common-protos/grpc-google-common-protos/src/main/java/com/google/longrunning/OperationsGrpc.java @@ -39,7 +39,7 @@ public final class OperationsGrpc { private OperationsGrpc() {} - public static final String SERVICE_NAME = "google.longrunning.Operations"; + public static final java.lang.String SERVICE_NAME = "google.longrunning.Operations"; // Static method descriptors that strictly reflect the proto. private static volatile io.grpc.MethodDescriptor< @@ -935,9 +935,9 @@ private static final class OperationsFileDescriptorSupplier private static final class OperationsMethodDescriptorSupplier extends OperationsBaseDescriptorSupplier implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; + private final java.lang.String methodName; - OperationsMethodDescriptorSupplier(String methodName) { + OperationsMethodDescriptorSupplier(java.lang.String methodName) { this.methodName = methodName; } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldInfo.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldInfo.java new file mode 100644 index 0000000000..e2ccfd2008 --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldInfo.java @@ -0,0 +1,819 @@ +/* + * 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/field_info.proto + +package com.google.api; + +/** + * + * + *
+ * Rich semantic information of an API field beyond basic typing.
+ * 
+ * + * Protobuf type {@code google.api.FieldInfo} + */ +public final class FieldInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.api.FieldInfo) + FieldInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use FieldInfo.newBuilder() to construct. + private FieldInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FieldInfo() { + format_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FieldInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.FieldInfoProto.internal_static_google_api_FieldInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.FieldInfoProto.internal_static_google_api_FieldInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.FieldInfo.class, com.google.api.FieldInfo.Builder.class); + } + + /** + * + * + *
+   * The standard format of a field value. The supported formats are all backed
+   * by either an RFC defined by the IETF or a Google-defined AIP.
+   * 
+ * + * Protobuf enum {@code google.api.FieldInfo.Format} + */ + public enum Format implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default, unspecified value.
+     * 
+ * + * FORMAT_UNSPECIFIED = 0; + */ + FORMAT_UNSPECIFIED(0), + /** + * + * + *
+     * Universally Unique Identifier, version 4, value as defined by
+     * https://datatracker.ietf.org/doc/html/rfc4122. The value may be
+     * normalized to entirely lowercase letters. For example, the value
+     * `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to
+     * `f47ac10b-58cc-0372-8567-0e02b2c3d479`.
+     * 
+ * + * UUID4 = 1; + */ + UUID4(1), + /** + * + * + *
+     * Internet Protocol v4 value as defined by [RFC
+     * 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be
+     * condensed, with leading zeros in each octet stripped. For example,
+     * `001.022.233.040` would be condensed to `1.22.233.40`.
+     * 
+ * + * IPV4 = 2; + */ + IPV4(2), + /** + * + * + *
+     * Internet Protocol v6 value as defined by [RFC
+     * 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be
+     * normalized to entirely lowercase letters, and zero-padded partial and
+     * empty octets. For example, the value `2001:DB8::` would be normalized to
+     * `2001:0db8:0:0`.
+     * 
+ * + * IPV6 = 3; + */ + IPV6(3), + /** + * + * + *
+     * An IP address in either v4 or v6 format as described by the individual
+     * values defined herein. See the comments on the IPV4 and IPV6 types for
+     * allowed normalizations of each.
+     * 
+ * + * IPV4_OR_IPV6 = 4; + */ + IPV4_OR_IPV6(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default, unspecified value.
+     * 
+ * + * FORMAT_UNSPECIFIED = 0; + */ + public static final int FORMAT_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Universally Unique Identifier, version 4, value as defined by
+     * https://datatracker.ietf.org/doc/html/rfc4122. The value may be
+     * normalized to entirely lowercase letters. For example, the value
+     * `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to
+     * `f47ac10b-58cc-0372-8567-0e02b2c3d479`.
+     * 
+ * + * UUID4 = 1; + */ + public static final int UUID4_VALUE = 1; + /** + * + * + *
+     * Internet Protocol v4 value as defined by [RFC
+     * 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be
+     * condensed, with leading zeros in each octet stripped. For example,
+     * `001.022.233.040` would be condensed to `1.22.233.40`.
+     * 
+ * + * IPV4 = 2; + */ + public static final int IPV4_VALUE = 2; + /** + * + * + *
+     * Internet Protocol v6 value as defined by [RFC
+     * 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be
+     * normalized to entirely lowercase letters, and zero-padded partial and
+     * empty octets. For example, the value `2001:DB8::` would be normalized to
+     * `2001:0db8:0:0`.
+     * 
+ * + * IPV6 = 3; + */ + public static final int IPV6_VALUE = 3; + /** + * + * + *
+     * An IP address in either v4 or v6 format as described by the individual
+     * values defined herein. See the comments on the IPV4 and IPV6 types for
+     * allowed normalizations of each.
+     * 
+ * + * IPV4_OR_IPV6 = 4; + */ + public static final int IPV4_OR_IPV6_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Format valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Format forNumber(int value) { + switch (value) { + case 0: + return FORMAT_UNSPECIFIED; + case 1: + return UUID4; + case 2: + return IPV4; + case 3: + return IPV6; + case 4: + return IPV4_OR_IPV6; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Format findValueByNumber(int number) { + return Format.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.api.FieldInfo.getDescriptor().getEnumTypes().get(0); + } + + private static final Format[] VALUES = values(); + + public static Format valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Format(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.api.FieldInfo.Format) + } + + public static final int FORMAT_FIELD_NUMBER = 1; + private int format_ = 0; + /** + * + * + *
+   * The standard format of a field value. This does not explicitly configure
+   * any API consumer, just documents the API's format for the field it is
+   * applied to.
+   * 
+ * + * .google.api.FieldInfo.Format format = 1; + * + * @return The enum numeric value on the wire for format. + */ + @java.lang.Override + public int getFormatValue() { + return format_; + } + /** + * + * + *
+   * The standard format of a field value. This does not explicitly configure
+   * any API consumer, just documents the API's format for the field it is
+   * applied to.
+   * 
+ * + * .google.api.FieldInfo.Format format = 1; + * + * @return The format. + */ + @java.lang.Override + public com.google.api.FieldInfo.Format getFormat() { + com.google.api.FieldInfo.Format result = com.google.api.FieldInfo.Format.forNumber(format_); + return result == null ? com.google.api.FieldInfo.Format.UNRECOGNIZED : result; + } + + 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 (format_ != com.google.api.FieldInfo.Format.FORMAT_UNSPECIFIED.getNumber()) { + output.writeEnum(1, format_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (format_ != com.google.api.FieldInfo.Format.FORMAT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, format_); + } + size += getUnknownFields().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.FieldInfo)) { + return super.equals(obj); + } + com.google.api.FieldInfo other = (com.google.api.FieldInfo) obj; + + if (format_ != other.format_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + FORMAT_FIELD_NUMBER; + hash = (53 * hash) + format_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.FieldInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.FieldInfo 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.FieldInfo parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.FieldInfo 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.FieldInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.api.FieldInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.api.FieldInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.FieldInfo 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.FieldInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.api.FieldInfo 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.FieldInfo parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.api.FieldInfo 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.FieldInfo 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; + } + /** + * + * + *
+   * Rich semantic information of an API field beyond basic typing.
+   * 
+ * + * Protobuf type {@code google.api.FieldInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.api.FieldInfo) + com.google.api.FieldInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.api.FieldInfoProto.internal_static_google_api_FieldInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.FieldInfoProto.internal_static_google_api_FieldInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.FieldInfo.class, com.google.api.FieldInfo.Builder.class); + } + + // Construct using com.google.api.FieldInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + format_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.api.FieldInfoProto.internal_static_google_api_FieldInfo_descriptor; + } + + @java.lang.Override + public com.google.api.FieldInfo getDefaultInstanceForType() { + return com.google.api.FieldInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.FieldInfo build() { + com.google.api.FieldInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.FieldInfo buildPartial() { + com.google.api.FieldInfo result = new com.google.api.FieldInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.api.FieldInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.format_ = format_; + } + } + + @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.FieldInfo) { + return mergeFrom((com.google.api.FieldInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.FieldInfo other) { + if (other == com.google.api.FieldInfo.getDefaultInstance()) return this; + if (other.format_ != 0) { + setFormatValue(other.getFormatValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + format_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int format_ = 0; + /** + * + * + *
+     * The standard format of a field value. This does not explicitly configure
+     * any API consumer, just documents the API's format for the field it is
+     * applied to.
+     * 
+ * + * .google.api.FieldInfo.Format format = 1; + * + * @return The enum numeric value on the wire for format. + */ + @java.lang.Override + public int getFormatValue() { + return format_; + } + /** + * + * + *
+     * The standard format of a field value. This does not explicitly configure
+     * any API consumer, just documents the API's format for the field it is
+     * applied to.
+     * 
+ * + * .google.api.FieldInfo.Format format = 1; + * + * @param value The enum numeric value on the wire for format to set. + * @return This builder for chaining. + */ + public Builder setFormatValue(int value) { + format_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * The standard format of a field value. This does not explicitly configure
+     * any API consumer, just documents the API's format for the field it is
+     * applied to.
+     * 
+ * + * .google.api.FieldInfo.Format format = 1; + * + * @return The format. + */ + @java.lang.Override + public com.google.api.FieldInfo.Format getFormat() { + com.google.api.FieldInfo.Format result = com.google.api.FieldInfo.Format.forNumber(format_); + return result == null ? com.google.api.FieldInfo.Format.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The standard format of a field value. This does not explicitly configure
+     * any API consumer, just documents the API's format for the field it is
+     * applied to.
+     * 
+ * + * .google.api.FieldInfo.Format format = 1; + * + * @param value The format to set. + * @return This builder for chaining. + */ + public Builder setFormat(com.google.api.FieldInfo.Format value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + format_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The standard format of a field value. This does not explicitly configure
+     * any API consumer, just documents the API's format for the field it is
+     * applied to.
+     * 
+ * + * .google.api.FieldInfo.Format format = 1; + * + * @return This builder for chaining. + */ + public Builder clearFormat() { + bitField0_ = (bitField0_ & ~0x00000001); + format_ = 0; + 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.FieldInfo) + } + + // @@protoc_insertion_point(class_scope:google.api.FieldInfo) + private static final com.google.api.FieldInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.api.FieldInfo(); + } + + public static com.google.api.FieldInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FieldInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.FieldInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldInfoOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldInfoOrBuilder.java new file mode 100644 index 0000000000..f736d260b0 --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldInfoOrBuilder.java @@ -0,0 +1,54 @@ +/* + * 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/field_info.proto + +package com.google.api; + +public interface FieldInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.api.FieldInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The standard format of a field value. This does not explicitly configure
+   * any API consumer, just documents the API's format for the field it is
+   * applied to.
+   * 
+ * + * .google.api.FieldInfo.Format format = 1; + * + * @return The enum numeric value on the wire for format. + */ + int getFormatValue(); + /** + * + * + *
+   * The standard format of a field value. This does not explicitly configure
+   * any API consumer, just documents the API's format for the field it is
+   * applied to.
+   * 
+ * + * .google.api.FieldInfo.Format format = 1; + * + * @return The format. + */ + com.google.api.FieldInfo.Format getFormat(); +} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldInfoProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldInfoProto.java new file mode 100644 index 0000000000..08f6abd13b --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/api/FieldInfoProto.java @@ -0,0 +1,100 @@ +/* + * 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/field_info.proto + +package com.google.api; + +public final class FieldInfoProto { + private FieldInfoProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { + registry.add(com.google.api.FieldInfoProto.fieldInfo); + } + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static final int FIELD_INFO_FIELD_NUMBER = 291403980; + /** + * + * + *
+   * Rich semantic descriptor of an API field beyond the basic typing.
+   *
+   * Examples:
+   *
+   *   string request_id = 1 [(google.api.field_info).format = UUID4];
+   *   string old_ip_address = 2 [(google.api.field_info).format = IPV4];
+   *   string new_ip_address = 3 [(google.api.field_info).format = IPV6];
+   *   string actual_ip_address = 4 [
+   *     (google.api.field_info).format = IPV4_OR_IPV6
+   *   ];
+   * 
+ * + * extend .google.protobuf.FieldOptions { ... } + */ + public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, com.google.api.FieldInfo> + fieldInfo = + com.google.protobuf.GeneratedMessage.newFileScopedGeneratedExtension( + com.google.api.FieldInfo.class, com.google.api.FieldInfo.getDefaultInstance()); + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_FieldInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_FieldInfo_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\033google/api/field_info.proto\022\ngoogle.ap" + + "i\032 google/protobuf/descriptor.proto\"\214\001\n\t" + + "FieldInfo\022,\n\006format\030\001 \001(\0162\034.google.api.F" + + "ieldInfo.Format\"Q\n\006Format\022\026\n\022FORMAT_UNSP" + + "ECIFIED\020\000\022\t\n\005UUID4\020\001\022\010\n\004IPV4\020\002\022\010\n\004IPV6\020\003" + + "\022\020\n\014IPV4_OR_IPV6\020\004:L\n\nfield_info\022\035.googl" + + "e.protobuf.FieldOptions\030\314\361\371\212\001 \001(\0132\025.goog" + + "le.api.FieldInfoBl\n\016com.google.apiB\016Fiel" + + "dInfoProtoP\001ZAgoogle.golang.org/genproto" + + "/googleapis/api/annotations;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_FieldInfo_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_api_FieldInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_FieldInfo_descriptor, + new java.lang.String[] { + "Format", + }); + fieldInfo.internalInit(descriptor.getExtensions().get(0)); + com.google.protobuf.DescriptorProtos.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/api/field_info.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/field_info.proto new file mode 100644 index 0000000000..dd66340a02 --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/api/field_info.proto @@ -0,0 +1,79 @@ +// Copyright 2023 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 +// +// http://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. + +syntax = "proto3"; + +package google.api; + +import "google/protobuf/descriptor.proto"; + +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "FieldInfoProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +extend google.protobuf.FieldOptions { + // Rich semantic descriptor of an API field beyond the basic typing. + // + // Examples: + // + // string request_id = 1 [(google.api.field_info).format = UUID4]; + // string old_ip_address = 2 [(google.api.field_info).format = IPV4]; + // string new_ip_address = 3 [(google.api.field_info).format = IPV6]; + // string actual_ip_address = 4 [ + // (google.api.field_info).format = IPV4_OR_IPV6 + // ]; + google.api.FieldInfo field_info = 291403980; +} + +// Rich semantic information of an API field beyond basic typing. +message FieldInfo { + // The standard format of a field value. The supported formats are all backed + // by either an RFC defined by the IETF or a Google-defined AIP. + enum Format { + // Default, unspecified value. + FORMAT_UNSPECIFIED = 0; + + // Universally Unique Identifier, version 4, value as defined by + // https://datatracker.ietf.org/doc/html/rfc4122. The value may be + // normalized to entirely lowercase letters. For example, the value + // `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to + // `f47ac10b-58cc-0372-8567-0e02b2c3d479`. + UUID4 = 1; + + // Internet Protocol v4 value as defined by [RFC + // 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be + // condensed, with leading zeros in each octet stripped. For example, + // `001.022.233.040` would be condensed to `1.22.233.40`. + IPV4 = 2; + + // Internet Protocol v6 value as defined by [RFC + // 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be + // normalized to entirely lowercase letters, and zero-padded partial and + // empty octets. For example, the value `2001:DB8::` would be normalized to + // `2001:0db8:0:0`. + IPV6 = 3; + + // An IP address in either v4 or v6 format as described by the individual + // values defined herein. See the comments on the IPV4 and IPV6 types for + // allowed normalizations of each. + IPV4_OR_IPV6 = 4; + } + + // The standard format of a field value. This does not explicitly configure + // any API consumer, just documents the API's format for the field it is + // applied to. + Format format = 1; +} diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/cloud/location/locations.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/cloud/location/locations.proto new file mode 100644 index 0000000000..a91766c9d4 --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/cloud/location/locations.proto @@ -0,0 +1,108 @@ +// 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.location; + +import "google/api/annotations.proto"; +import "google/protobuf/any.proto"; +import "google/api/client.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/cloud/location;location"; +option java_multiple_files = true; +option java_outer_classname = "LocationsProto"; +option java_package = "com.google.cloud.location"; + +// An abstract interface that provides location-related information for +// a service. Service-specific metadata is provided through the +// [Location.metadata][google.cloud.location.Location.metadata] field. +service Locations { + option (google.api.default_host) = "cloud.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists information about the supported locations for this service. + rpc ListLocations(ListLocationsRequest) returns (ListLocationsResponse) { + option (google.api.http) = { + get: "/v1/{name=locations}" + additional_bindings { + get: "/v1/{name=projects/*}/locations" + } + }; + } + + // Gets information about a location. + rpc GetLocation(GetLocationRequest) returns (Location) { + option (google.api.http) = { + get: "/v1/{name=locations/*}" + additional_bindings { + get: "/v1/{name=projects/*/locations/*}" + } + }; + } +} + +// The request message for [Locations.ListLocations][google.cloud.location.Locations.ListLocations]. +message ListLocationsRequest { + // The resource that owns the locations collection, if applicable. + string name = 1; + + // The standard list filter. + string filter = 2; + + // The standard list page size. + int32 page_size = 3; + + // The standard list page token. + string page_token = 4; +} + +// The response message for [Locations.ListLocations][google.cloud.location.Locations.ListLocations]. +message ListLocationsResponse { + // A list of locations that matches the specified filter in the request. + repeated Location locations = 1; + + // The standard List next-page token. + string next_page_token = 2; +} + +// The request message for [Locations.GetLocation][google.cloud.location.Locations.GetLocation]. +message GetLocationRequest { + // Resource name for the location. + string name = 1; +} + +// A resource that represents Google Cloud Platform location. +message Location { + // Resource name for the location, which may vary between implementations. + // For example: `"projects/example-project/locations/us-east1"` + string name = 1; + + // The canonical id for this location. For example: `"us-east1"`. + string location_id = 4; + + // The friendly name for this location, typically a nearby city name. + // For example, "Tokyo". + string display_name = 5; + + // Cross-service attributes for the location. For example + // + // {"cloud.googleapis.com/region": "us-east1"} + map labels = 2; + + // Service-specific metadata. For example the available capacity at the given + // location. + google.protobuf.Any metadata = 3; +}