diff --git a/java-common-protos/README.md b/java-common-protos/README.md index a062c7dc57..e9d4a96727 100644 --- a/java-common-protos/README.md +++ b/java-common-protos/README.md @@ -19,20 +19,20 @@ If you are using Maven, add this to your pom.xml file: com.google.api.grpc proto-google-common-protos - 2.37.1 + 2.38.0 ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.api.grpc:proto-google-common-protos:2.37.1' +implementation 'com.google.api.grpc:proto-google-common-protos:2.38.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.api.grpc" % "proto-google-common-protos" % "2.37.1" +libraryDependencies += "com.google.api.grpc" % "proto-google-common-protos" % "2.38.0" ``` ## Authentication diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/Price.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/Price.java index 0e32d2884b..54a67678ff 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/Price.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/Price.java @@ -72,8 +72,6 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * The price represented as a number in micros (1 million micros is an * equivalent to one's currency standard unit, for example, 1 USD = 1000000 * micros). - * This field can also be set as infinity by setting to -1. - * This field only support -1 and positive value. * * * optional int64 amount_micros = 1; @@ -91,8 +89,6 @@ public boolean hasAmountMicros() { * The price represented as a number in micros (1 million micros is an * equivalent to one's currency standard unit, for example, 1 USD = 1000000 * micros). - * This field can also be set as infinity by setting to -1. - * This field only support -1 and positive value. * * * optional int64 amount_micros = 1; @@ -554,8 +550,6 @@ public Builder mergeFrom( * The price represented as a number in micros (1 million micros is an * equivalent to one's currency standard unit, for example, 1 USD = 1000000 * micros). - * This field can also be set as infinity by setting to -1. - * This field only support -1 and positive value. * * * optional int64 amount_micros = 1; @@ -573,8 +567,6 @@ public boolean hasAmountMicros() { * The price represented as a number in micros (1 million micros is an * equivalent to one's currency standard unit, for example, 1 USD = 1000000 * micros). - * This field can also be set as infinity by setting to -1. - * This field only support -1 and positive value. * * * optional int64 amount_micros = 1; @@ -592,8 +584,6 @@ public long getAmountMicros() { * The price represented as a number in micros (1 million micros is an * equivalent to one's currency standard unit, for example, 1 USD = 1000000 * micros). - * This field can also be set as infinity by setting to -1. - * This field only support -1 and positive value. * * * optional int64 amount_micros = 1; @@ -615,8 +605,6 @@ public Builder setAmountMicros(long value) { * The price represented as a number in micros (1 million micros is an * equivalent to one's currency standard unit, for example, 1 USD = 1000000 * micros). - * This field can also be set as infinity by setting to -1. - * This field only support -1 and positive value. * * * optional int64 amount_micros = 1; diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/PriceOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/PriceOrBuilder.java index 738b7268d0..bee4a652c5 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/PriceOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/PriceOrBuilder.java @@ -31,8 +31,6 @@ public interface PriceOrBuilder * The price represented as a number in micros (1 million micros is an * equivalent to one's currency standard unit, for example, 1 USD = 1000000 * micros). - * This field can also be set as infinity by setting to -1. - * This field only support -1 and positive value. * * * optional int64 amount_micros = 1; @@ -47,8 +45,6 @@ public interface PriceOrBuilder * The price represented as a number in micros (1 million micros is an * equivalent to one's currency standard unit, for example, 1 USD = 1000000 * micros). - * This field can also be set as infinity by setting to -1. - * This field only support -1 and positive value. * * * optional int64 amount_micros = 1; diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/TypesProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/TypesProto.java index 9ae914ad08..79c44df517 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/TypesProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/TypesProto.java @@ -28,6 +28,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_shopping_type_Weight_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_shopping_type_Weight_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_shopping_type_Price_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -58,39 +62,52 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { "\n google/shopping/type/types.proto\022\024goog" - + "le.shopping.type\"c\n\005Price\022\032\n\ramount_micr" - + "os\030\001 \001(\003H\000\210\001\001\022\032\n\rcurrency_code\030\002 \001(\tH\001\210\001" - + "\001B\020\n\016_amount_microsB\020\n\016_currency_code\"\210\001" - + "\n\017CustomAttribute\022\021\n\004name\030\001 \001(\tH\000\210\001\001\022\022\n\005" - + "value\030\002 \001(\tH\001\210\001\001\022;\n\014group_values\030\003 \003(\0132%" - + ".google.shopping.type.CustomAttributeB\007\n" - + "\005_nameB\010\n\006_value\"\301\001\n\013Destination\"\261\001\n\017Des" - + "tinationEnum\022 \n\034DESTINATION_ENUM_UNSPECI" - + "FIED\020\000\022\020\n\014SHOPPING_ADS\020\001\022\017\n\013DISPLAY_ADS\020" - + "\002\022\027\n\023LOCAL_INVENTORY_ADS\020\003\022\021\n\rFREE_LISTI" - + "NGS\020\004\022\027\n\023FREE_LOCAL_LISTINGS\020\005\022\024\n\020YOUTUB" - + "E_SHOPPING\020\006\"\226\003\n\020ReportingContext\"\201\003\n\024Re" - + "portingContextEnum\022&\n\"REPORTING_CONTEXT_" - + "ENUM_UNSPECIFIED\020\000\022\020\n\014SHOPPING_ADS\020\001\022\025\n\r" - + "DISCOVERY_ADS\020\002\032\002\010\001\022\022\n\016DEMAND_GEN_ADS\020\r\022" - + "#\n\037DEMAND_GEN_ADS_DISCOVER_SURFACE\020\016\022\r\n\t" - + "VIDEO_ADS\020\003\022\017\n\013DISPLAY_ADS\020\004\022\027\n\023LOCAL_IN" - + "VENTORY_ADS\020\005\022\031\n\025VEHICLE_INVENTORY_ADS\020\006" - + "\022\021\n\rFREE_LISTINGS\020\007\022\027\n\023FREE_LOCAL_LISTIN" - + "GS\020\010\022\037\n\033FREE_LOCAL_VEHICLE_LISTINGS\020\t\022\024\n" - + "\020YOUTUBE_SHOPPING\020\n\022\020\n\014CLOUD_RETAIL\020\013\022\026\n" - + "\022LOCAL_CLOUD_RETAIL\020\014\"M\n\007Channel\"B\n\013Chan" - + "nelEnum\022\034\n\030CHANNEL_ENUM_UNSPECIFIED\020\000\022\n\n" - + "\006ONLINE\020\001\022\t\n\005LOCAL\020\002Bp\n\030com.google.shopp" - + "ing.typeB\nTypesProtoP\001Z/cloud.google.com" - + "/go/shopping/type/typepb;typepb\252\002\024Google" - + ".Shopping.Typeb\006proto3" + + "le.shopping.type\"\261\001\n\006Weight\022\032\n\ramount_mi" + + "cros\030\001 \001(\003H\000\210\001\001\0225\n\004unit\030\002 \001(\0162\'.google.s" + + "hopping.type.Weight.WeightUnit\"B\n\nWeight" + + "Unit\022\033\n\027WEIGHT_UNIT_UNSPECIFIED\020\000\022\t\n\005POU" + + "ND\020\001\022\014\n\010KILOGRAM\020\002B\020\n\016_amount_micros\"c\n\005" + + "Price\022\032\n\ramount_micros\030\001 \001(\003H\000\210\001\001\022\032\n\rcur" + + "rency_code\030\002 \001(\tH\001\210\001\001B\020\n\016_amount_microsB" + + "\020\n\016_currency_code\"\210\001\n\017CustomAttribute\022\021\n" + + "\004name\030\001 \001(\tH\000\210\001\001\022\022\n\005value\030\002 \001(\tH\001\210\001\001\022;\n\014" + + "group_values\030\003 \003(\0132%.google.shopping.typ" + + "e.CustomAttributeB\007\n\005_nameB\010\n\006_value\"\301\001\n" + + "\013Destination\"\261\001\n\017DestinationEnum\022 \n\034DEST" + + "INATION_ENUM_UNSPECIFIED\020\000\022\020\n\014SHOPPING_A" + + "DS\020\001\022\017\n\013DISPLAY_ADS\020\002\022\027\n\023LOCAL_INVENTORY" + + "_ADS\020\003\022\021\n\rFREE_LISTINGS\020\004\022\027\n\023FREE_LOCAL_" + + "LISTINGS\020\005\022\024\n\020YOUTUBE_SHOPPING\020\006\"\226\003\n\020Rep" + + "ortingContext\"\201\003\n\024ReportingContextEnum\022&" + + "\n\"REPORTING_CONTEXT_ENUM_UNSPECIFIED\020\000\022\020" + + "\n\014SHOPPING_ADS\020\001\022\025\n\rDISCOVERY_ADS\020\002\032\002\010\001\022" + + "\022\n\016DEMAND_GEN_ADS\020\r\022#\n\037DEMAND_GEN_ADS_DI" + + "SCOVER_SURFACE\020\016\022\r\n\tVIDEO_ADS\020\003\022\017\n\013DISPL" + + "AY_ADS\020\004\022\027\n\023LOCAL_INVENTORY_ADS\020\005\022\031\n\025VEH" + + "ICLE_INVENTORY_ADS\020\006\022\021\n\rFREE_LISTINGS\020\007\022" + + "\027\n\023FREE_LOCAL_LISTINGS\020\010\022\037\n\033FREE_LOCAL_V" + + "EHICLE_LISTINGS\020\t\022\024\n\020YOUTUBE_SHOPPING\020\n\022" + + "\020\n\014CLOUD_RETAIL\020\013\022\026\n\022LOCAL_CLOUD_RETAIL\020" + + "\014\"M\n\007Channel\"B\n\013ChannelEnum\022\034\n\030CHANNEL_E" + + "NUM_UNSPECIFIED\020\000\022\n\n\006ONLINE\020\001\022\t\n\005LOCAL\020\002" + + "Bp\n\030com.google.shopping.typeB\nTypesProto" + + "P\001Z/cloud.google.com/go/shopping/type/ty" + + "pepb;typepb\252\002\024Google.Shopping.Typeb\006prot" + + "o3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); - internal_static_google_shopping_type_Price_descriptor = + internal_static_google_shopping_type_Weight_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_shopping_type_Weight_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_shopping_type_Weight_descriptor, + new java.lang.String[] { + "AmountMicros", "Unit", + }); + internal_static_google_shopping_type_Price_descriptor = + getDescriptor().getMessageTypes().get(1); internal_static_google_shopping_type_Price_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_shopping_type_Price_descriptor, @@ -98,7 +115,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "AmountMicros", "CurrencyCode", }); internal_static_google_shopping_type_CustomAttribute_descriptor = - getDescriptor().getMessageTypes().get(1); + getDescriptor().getMessageTypes().get(2); internal_static_google_shopping_type_CustomAttribute_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_shopping_type_CustomAttribute_descriptor, @@ -106,18 +123,18 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", "Value", "GroupValues", }); internal_static_google_shopping_type_Destination_descriptor = - getDescriptor().getMessageTypes().get(2); + getDescriptor().getMessageTypes().get(3); internal_static_google_shopping_type_Destination_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_shopping_type_Destination_descriptor, new java.lang.String[] {}); internal_static_google_shopping_type_ReportingContext_descriptor = - getDescriptor().getMessageTypes().get(3); + getDescriptor().getMessageTypes().get(4); internal_static_google_shopping_type_ReportingContext_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_shopping_type_ReportingContext_descriptor, new java.lang.String[] {}); internal_static_google_shopping_type_Channel_descriptor = - getDescriptor().getMessageTypes().get(4); + getDescriptor().getMessageTypes().get(5); internal_static_google_shopping_type_Channel_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_shopping_type_Channel_descriptor, new java.lang.String[] {}); diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/Weight.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/Weight.java new file mode 100644 index 0000000000..f66f829d57 --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/Weight.java @@ -0,0 +1,905 @@ +/* + * 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/shopping/type/types.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.type; + +/** + * + * + *
+ * The weight represented as the value in string and the unit.
+ * 
+ * + * Protobuf type {@code google.shopping.type.Weight} + */ +public final class Weight extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.shopping.type.Weight) + WeightOrBuilder { + private static final long serialVersionUID = 0L; + // Use Weight.newBuilder() to construct. + private Weight(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Weight() { + unit_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Weight(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Weight_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Weight_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.type.Weight.class, com.google.shopping.type.Weight.Builder.class); + } + + /** + * + * + *
+   * The weight unit.
+   * 
+ * + * Protobuf enum {@code google.shopping.type.Weight.WeightUnit} + */ + public enum WeightUnit implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * unit unspecified
+     * 
+ * + * WEIGHT_UNIT_UNSPECIFIED = 0; + */ + WEIGHT_UNIT_UNSPECIFIED(0), + /** + * + * + *
+     * lb unit.
+     * 
+ * + * POUND = 1; + */ + POUND(1), + /** + * + * + *
+     * kg unit.
+     * 
+ * + * KILOGRAM = 2; + */ + KILOGRAM(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * unit unspecified
+     * 
+ * + * WEIGHT_UNIT_UNSPECIFIED = 0; + */ + public static final int WEIGHT_UNIT_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * lb unit.
+     * 
+ * + * POUND = 1; + */ + public static final int POUND_VALUE = 1; + /** + * + * + *
+     * kg unit.
+     * 
+ * + * KILOGRAM = 2; + */ + public static final int KILOGRAM_VALUE = 2; + + 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 WeightUnit 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 WeightUnit forNumber(int value) { + switch (value) { + case 0: + return WEIGHT_UNIT_UNSPECIFIED; + case 1: + return POUND; + case 2: + return KILOGRAM; + 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 WeightUnit findValueByNumber(int number) { + return WeightUnit.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.shopping.type.Weight.getDescriptor().getEnumTypes().get(0); + } + + private static final WeightUnit[] VALUES = values(); + + public static WeightUnit 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 WeightUnit(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.shopping.type.Weight.WeightUnit) + } + + private int bitField0_; + public static final int AMOUNT_MICROS_FIELD_NUMBER = 1; + private long amountMicros_ = 0L; + /** + * + * + *
+   * Required. The weight represented as a number in micros (1 million micros is
+   * an equivalent to one's currency standard unit, for example, 1 kg = 1000000
+   * micros).
+   * This field can also be set as infinity by setting to -1.
+   * This field only support -1 and positive value.
+   * 
+ * + * optional int64 amount_micros = 1; + * + * @return Whether the amountMicros field is set. + */ + @java.lang.Override + public boolean hasAmountMicros() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The weight represented as a number in micros (1 million micros is
+   * an equivalent to one's currency standard unit, for example, 1 kg = 1000000
+   * micros).
+   * This field can also be set as infinity by setting to -1.
+   * This field only support -1 and positive value.
+   * 
+ * + * optional int64 amount_micros = 1; + * + * @return The amountMicros. + */ + @java.lang.Override + public long getAmountMicros() { + return amountMicros_; + } + + public static final int UNIT_FIELD_NUMBER = 2; + private int unit_ = 0; + /** + * + * + *
+   * Required. The weight unit.
+   * Acceptable values are: kg and lb
+   * 
+ * + * .google.shopping.type.Weight.WeightUnit unit = 2; + * + * @return The enum numeric value on the wire for unit. + */ + @java.lang.Override + public int getUnitValue() { + return unit_; + } + /** + * + * + *
+   * Required. The weight unit.
+   * Acceptable values are: kg and lb
+   * 
+ * + * .google.shopping.type.Weight.WeightUnit unit = 2; + * + * @return The unit. + */ + @java.lang.Override + public com.google.shopping.type.Weight.WeightUnit getUnit() { + com.google.shopping.type.Weight.WeightUnit result = + com.google.shopping.type.Weight.WeightUnit.forNumber(unit_); + return result == null ? com.google.shopping.type.Weight.WeightUnit.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 (((bitField0_ & 0x00000001) != 0)) { + output.writeInt64(1, amountMicros_); + } + if (unit_ != com.google.shopping.type.Weight.WeightUnit.WEIGHT_UNIT_UNSPECIFIED.getNumber()) { + output.writeEnum(2, unit_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, amountMicros_); + } + if (unit_ != com.google.shopping.type.Weight.WeightUnit.WEIGHT_UNIT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, unit_); + } + 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.shopping.type.Weight)) { + return super.equals(obj); + } + com.google.shopping.type.Weight other = (com.google.shopping.type.Weight) obj; + + if (hasAmountMicros() != other.hasAmountMicros()) return false; + if (hasAmountMicros()) { + if (getAmountMicros() != other.getAmountMicros()) return false; + } + if (unit_ != other.unit_) 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(); + if (hasAmountMicros()) { + hash = (37 * hash) + AMOUNT_MICROS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getAmountMicros()); + } + hash = (37 * hash) + UNIT_FIELD_NUMBER; + hash = (53 * hash) + unit_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.shopping.type.Weight parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.Weight parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.type.Weight parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.Weight 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.shopping.type.Weight parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.shopping.type.Weight parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.shopping.type.Weight parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.type.Weight 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.shopping.type.Weight parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.shopping.type.Weight 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.shopping.type.Weight parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.shopping.type.Weight 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.shopping.type.Weight 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; + } + /** + * + * + *
+   * The weight represented as the value in string and the unit.
+   * 
+ * + * Protobuf type {@code google.shopping.type.Weight} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.shopping.type.Weight) + com.google.shopping.type.WeightOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Weight_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Weight_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.shopping.type.Weight.class, com.google.shopping.type.Weight.Builder.class); + } + + // Construct using com.google.shopping.type.Weight.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + amountMicros_ = 0L; + unit_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.shopping.type.TypesProto + .internal_static_google_shopping_type_Weight_descriptor; + } + + @java.lang.Override + public com.google.shopping.type.Weight getDefaultInstanceForType() { + return com.google.shopping.type.Weight.getDefaultInstance(); + } + + @java.lang.Override + public com.google.shopping.type.Weight build() { + com.google.shopping.type.Weight result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.shopping.type.Weight buildPartial() { + com.google.shopping.type.Weight result = new com.google.shopping.type.Weight(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.shopping.type.Weight result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.amountMicros_ = amountMicros_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.unit_ = unit_; + } + result.bitField0_ |= to_bitField0_; + } + + @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.shopping.type.Weight) { + return mergeFrom((com.google.shopping.type.Weight) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.shopping.type.Weight other) { + if (other == com.google.shopping.type.Weight.getDefaultInstance()) return this; + if (other.hasAmountMicros()) { + setAmountMicros(other.getAmountMicros()); + } + if (other.unit_ != 0) { + setUnitValue(other.getUnitValue()); + } + 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: + { + amountMicros_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + unit_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + 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 long amountMicros_; + /** + * + * + *
+     * Required. The weight represented as a number in micros (1 million micros is
+     * an equivalent to one's currency standard unit, for example, 1 kg = 1000000
+     * micros).
+     * This field can also be set as infinity by setting to -1.
+     * This field only support -1 and positive value.
+     * 
+ * + * optional int64 amount_micros = 1; + * + * @return Whether the amountMicros field is set. + */ + @java.lang.Override + public boolean hasAmountMicros() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. The weight represented as a number in micros (1 million micros is
+     * an equivalent to one's currency standard unit, for example, 1 kg = 1000000
+     * micros).
+     * This field can also be set as infinity by setting to -1.
+     * This field only support -1 and positive value.
+     * 
+ * + * optional int64 amount_micros = 1; + * + * @return The amountMicros. + */ + @java.lang.Override + public long getAmountMicros() { + return amountMicros_; + } + /** + * + * + *
+     * Required. The weight represented as a number in micros (1 million micros is
+     * an equivalent to one's currency standard unit, for example, 1 kg = 1000000
+     * micros).
+     * This field can also be set as infinity by setting to -1.
+     * This field only support -1 and positive value.
+     * 
+ * + * optional int64 amount_micros = 1; + * + * @param value The amountMicros to set. + * @return This builder for chaining. + */ + public Builder setAmountMicros(long value) { + + amountMicros_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The weight represented as a number in micros (1 million micros is
+     * an equivalent to one's currency standard unit, for example, 1 kg = 1000000
+     * micros).
+     * This field can also be set as infinity by setting to -1.
+     * This field only support -1 and positive value.
+     * 
+ * + * optional int64 amount_micros = 1; + * + * @return This builder for chaining. + */ + public Builder clearAmountMicros() { + bitField0_ = (bitField0_ & ~0x00000001); + amountMicros_ = 0L; + onChanged(); + return this; + } + + private int unit_ = 0; + /** + * + * + *
+     * Required. The weight unit.
+     * Acceptable values are: kg and lb
+     * 
+ * + * .google.shopping.type.Weight.WeightUnit unit = 2; + * + * @return The enum numeric value on the wire for unit. + */ + @java.lang.Override + public int getUnitValue() { + return unit_; + } + /** + * + * + *
+     * Required. The weight unit.
+     * Acceptable values are: kg and lb
+     * 
+ * + * .google.shopping.type.Weight.WeightUnit unit = 2; + * + * @param value The enum numeric value on the wire for unit to set. + * @return This builder for chaining. + */ + public Builder setUnitValue(int value) { + unit_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The weight unit.
+     * Acceptable values are: kg and lb
+     * 
+ * + * .google.shopping.type.Weight.WeightUnit unit = 2; + * + * @return The unit. + */ + @java.lang.Override + public com.google.shopping.type.Weight.WeightUnit getUnit() { + com.google.shopping.type.Weight.WeightUnit result = + com.google.shopping.type.Weight.WeightUnit.forNumber(unit_); + return result == null ? com.google.shopping.type.Weight.WeightUnit.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Required. The weight unit.
+     * Acceptable values are: kg and lb
+     * 
+ * + * .google.shopping.type.Weight.WeightUnit unit = 2; + * + * @param value The unit to set. + * @return This builder for chaining. + */ + public Builder setUnit(com.google.shopping.type.Weight.WeightUnit value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + unit_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The weight unit.
+     * Acceptable values are: kg and lb
+     * 
+ * + * .google.shopping.type.Weight.WeightUnit unit = 2; + * + * @return This builder for chaining. + */ + public Builder clearUnit() { + bitField0_ = (bitField0_ & ~0x00000002); + unit_ = 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.shopping.type.Weight) + } + + // @@protoc_insertion_point(class_scope:google.shopping.type.Weight) + private static final com.google.shopping.type.Weight DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.shopping.type.Weight(); + } + + public static com.google.shopping.type.Weight getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Weight 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.shopping.type.Weight getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/WeightOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/WeightOrBuilder.java new file mode 100644 index 0000000000..2e52f5a014 --- /dev/null +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/shopping/type/WeightOrBuilder.java @@ -0,0 +1,86 @@ +/* + * 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/shopping/type/types.proto + +// Protobuf Java Version: 3.25.3 +package com.google.shopping.type; + +public interface WeightOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.shopping.type.Weight) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The weight represented as a number in micros (1 million micros is
+   * an equivalent to one's currency standard unit, for example, 1 kg = 1000000
+   * micros).
+   * This field can also be set as infinity by setting to -1.
+   * This field only support -1 and positive value.
+   * 
+ * + * optional int64 amount_micros = 1; + * + * @return Whether the amountMicros field is set. + */ + boolean hasAmountMicros(); + /** + * + * + *
+   * Required. The weight represented as a number in micros (1 million micros is
+   * an equivalent to one's currency standard unit, for example, 1 kg = 1000000
+   * micros).
+   * This field can also be set as infinity by setting to -1.
+   * This field only support -1 and positive value.
+   * 
+ * + * optional int64 amount_micros = 1; + * + * @return The amountMicros. + */ + long getAmountMicros(); + + /** + * + * + *
+   * Required. The weight unit.
+   * Acceptable values are: kg and lb
+   * 
+ * + * .google.shopping.type.Weight.WeightUnit unit = 2; + * + * @return The enum numeric value on the wire for unit. + */ + int getUnitValue(); + /** + * + * + *
+   * Required. The weight unit.
+   * Acceptable values are: kg and lb
+   * 
+ * + * .google.shopping.type.Weight.WeightUnit unit = 2; + * + * @return The unit. + */ + com.google.shopping.type.Weight.WeightUnit getUnit(); +} diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/shopping/type/types.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/shopping/type/types.proto index c23bf52d62..f5c218694f 100644 --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/shopping/type/types.proto +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/shopping/type/types.proto @@ -22,13 +22,37 @@ option java_multiple_files = true; option java_outer_classname = "TypesProto"; option java_package = "com.google.shopping.type"; +// The weight represented as the value in string and the unit. +message Weight { + // The weight unit. + enum WeightUnit { + // unit unspecified + WEIGHT_UNIT_UNSPECIFIED = 0; + + // lb unit. + POUND = 1; + + // kg unit. + KILOGRAM = 2; + } + + // Required. The weight represented as a number in micros (1 million micros is + // an equivalent to one's currency standard unit, for example, 1 kg = 1000000 + // micros). + // This field can also be set as infinity by setting to -1. + // This field only support -1 and positive value. + optional int64 amount_micros = 1; + + // Required. The weight unit. + // Acceptable values are: kg and lb + WeightUnit unit = 2; +} + // The price represented as a number and currency. message Price { // The price represented as a number in micros (1 million micros is an // equivalent to one's currency standard unit, for example, 1 USD = 1000000 // micros). - // This field can also be set as infinity by setting to -1. - // This field only support -1 and positive value. optional int64 amount_micros = 1; // The currency of the price using three-letter acronyms according to [ISO