Class Product (0.5.0)

public final class Product extends GeneratedMessageV3 implements ProductOrBuilder

The processed product, built from multiple product inputs after applying rules and supplemental data sources. This processed product matches what is shown in your Merchant Center account and in Shopping ads and other surfaces across Google. Each product is built from exactly one primary data source product input, and multiple supplemental data source inputs. After inserting, updating, or deleting a product input, it may take several minutes before the updated processed product can be retrieved.

All fields in the processed product and its sub-messages match the name of their corresponding attribute in the Product data specification with some exceptions.

Protobuf type google.shopping.merchant.products.v1beta.Product

Implements

ProductOrBuilder

Static Fields

ATTRIBUTES_FIELD_NUMBER

public static final int ATTRIBUTES_FIELD_NUMBER
Field Value
Type Description
int

CHANNEL_FIELD_NUMBER

public static final int CHANNEL_FIELD_NUMBER
Field Value
Type Description
int

CONTENT_LANGUAGE_FIELD_NUMBER

public static final int CONTENT_LANGUAGE_FIELD_NUMBER
Field Value
Type Description
int

CUSTOM_ATTRIBUTES_FIELD_NUMBER

public static final int CUSTOM_ATTRIBUTES_FIELD_NUMBER
Field Value
Type Description
int

DATA_SOURCE_FIELD_NUMBER

public static final int DATA_SOURCE_FIELD_NUMBER
Field Value
Type Description
int

FEED_LABEL_FIELD_NUMBER

public static final int FEED_LABEL_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
Type Description
int

OFFER_ID_FIELD_NUMBER

public static final int OFFER_ID_FIELD_NUMBER
Field Value
Type Description
int

PRODUCT_STATUS_FIELD_NUMBER

public static final int PRODUCT_STATUS_FIELD_NUMBER
Field Value
Type Description
int

VERSION_NUMBER_FIELD_NUMBER

public static final int VERSION_NUMBER_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Product getDefaultInstance()
Returns
Type Description
Product

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static Product.Builder newBuilder()
Returns
Type Description
Product.Builder

newBuilder(Product prototype)

public static Product.Builder newBuilder(Product prototype)
Parameter
Name Description
prototype Product
Returns
Type Description
Product.Builder

parseDelimitedFrom(InputStream input)

public static Product parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Product
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Product parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Product
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static Product parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
Product
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Product parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Product
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Product parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
Product
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Product parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Product
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Product parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Product
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Product parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Product
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static Product parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Product
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Product parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Product
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static Product parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Product
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Product parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Product
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<Product> parser()
Returns
Type Description
Parser<Product>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getAttributes()

public Attributes getAttributes()

Output only. A list of product attributes.

.google.shopping.merchant.products.v1beta.Attributes attributes = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Attributes

The attributes.

getAttributesOrBuilder()

public AttributesOrBuilder getAttributesOrBuilder()

Output only. A list of product attributes.

.google.shopping.merchant.products.v1beta.Attributes attributes = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
AttributesOrBuilder

getChannel()

public Channel.ChannelEnum getChannel()

Output only. The channel of the product.

.google.shopping.type.Channel.ChannelEnum channel = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
com.google.shopping.type.Channel.ChannelEnum

The channel.

getChannelValue()

public int getChannelValue()

Output only. The channel of the product.

.google.shopping.type.Channel.ChannelEnum channel = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

The enum numeric value on the wire for channel.

getContentLanguage()

public String getContentLanguage()

Output only. The two-letter ISO 639-1 language code for the product.

string content_language = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The contentLanguage.

getContentLanguageBytes()

public ByteString getContentLanguageBytes()

Output only. The two-letter ISO 639-1 language code for the product.

string content_language = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for contentLanguage.

getCustomAttributes(int index)

public CustomAttribute getCustomAttributes(int index)

Output only. A list of custom (merchant-provided) attributes. It can also be used to submit any attribute of the data specification in its generic form (for example, { "name": "size type", "value": "regular" }). This is useful for submitting attributes not explicitly exposed by the API, such as additional attributes used for Buy on Google.

repeated .google.shopping.type.CustomAttribute custom_attributes = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
com.google.shopping.type.CustomAttribute

getCustomAttributesCount()

public int getCustomAttributesCount()

Output only. A list of custom (merchant-provided) attributes. It can also be used to submit any attribute of the data specification in its generic form (for example, { "name": "size type", "value": "regular" }). This is useful for submitting attributes not explicitly exposed by the API, such as additional attributes used for Buy on Google.

repeated .google.shopping.type.CustomAttribute custom_attributes = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

getCustomAttributesList()

public List<CustomAttribute> getCustomAttributesList()

Output only. A list of custom (merchant-provided) attributes. It can also be used to submit any attribute of the data specification in its generic form (for example, { "name": "size type", "value": "regular" }). This is useful for submitting attributes not explicitly exposed by the API, such as additional attributes used for Buy on Google.

repeated .google.shopping.type.CustomAttribute custom_attributes = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<com.google.shopping.type.CustomAttribute>

getCustomAttributesOrBuilder(int index)

public CustomAttributeOrBuilder getCustomAttributesOrBuilder(int index)

Output only. A list of custom (merchant-provided) attributes. It can also be used to submit any attribute of the data specification in its generic form (for example, { "name": "size type", "value": "regular" }). This is useful for submitting attributes not explicitly exposed by the API, such as additional attributes used for Buy on Google.

repeated .google.shopping.type.CustomAttribute custom_attributes = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int
Returns
Type Description
com.google.shopping.type.CustomAttributeOrBuilder

getCustomAttributesOrBuilderList()

public List<? extends CustomAttributeOrBuilder> getCustomAttributesOrBuilderList()

Output only. A list of custom (merchant-provided) attributes. It can also be used to submit any attribute of the data specification in its generic form (for example, { "name": "size type", "value": "regular" }). This is useful for submitting attributes not explicitly exposed by the API, such as additional attributes used for Buy on Google.

repeated .google.shopping.type.CustomAttribute custom_attributes = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<? extends com.google.shopping.type.CustomAttributeOrBuilder>

getDataSource()

public String getDataSource()

Output only. The primary data source of the product.

string data_source = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The dataSource.

getDataSourceBytes()

public ByteString getDataSourceBytes()

Output only. The primary data source of the product.

string data_source = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for dataSource.

getDefaultInstanceForType()

public Product getDefaultInstanceForType()
Returns
Type Description
Product

getFeedLabel()

public String getFeedLabel()

Output only. The feed label for the product.

string feed_label = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The feedLabel.

getFeedLabelBytes()

public ByteString getFeedLabelBytes()

Output only. The feed label for the product.

string feed_label = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for feedLabel.

getName()

public String getName()

The name of the product. Format: "{product.name=accounts/{account}/products/{product}}"

string name = 1;

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

The name of the product. Format: "{product.name=accounts/{account}/products/{product}}"

string name = 1;

Returns
Type Description
ByteString

The bytes for name.

getOfferId()

public String getOfferId()

Output only. Your unique identifier for the product. This is the same for the product input and processed product. Leading and trailing whitespaces are stripped and multiple whitespaces are replaced by a single whitespace upon submission. See the product data specification for details.

string offer_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The offerId.

getOfferIdBytes()

public ByteString getOfferIdBytes()

Output only. Your unique identifier for the product. This is the same for the product input and processed product. Leading and trailing whitespaces are stripped and multiple whitespaces are replaced by a single whitespace upon submission. See the product data specification for details.

string offer_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for offerId.

getParserForType()

public Parser<Product> getParserForType()
Returns
Type Description
Parser<Product>
Overrides

getProductStatus()

public ProductStatus getProductStatus()

Output only. The status of a product, data validation issues, that is, information about a product computed asynchronously.

.google.shopping.merchant.products.v1beta.ProductStatus product_status = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ProductStatus

The productStatus.

getProductStatusOrBuilder()

public ProductStatusOrBuilder getProductStatusOrBuilder()

Output only. The status of a product, data validation issues, that is, information about a product computed asynchronously.

.google.shopping.merchant.products.v1beta.ProductStatus product_status = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ProductStatusOrBuilder

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getVersionNumber()

public long getVersionNumber()

Output only. Represents the existing version (freshness) of the product, which can be used to preserve the right order when multiple updates are done at the same time.

If set, the insertion is prevented when version number is lower than the current version number of the existing product. Re-insertion (for example, product refresh after 30 days) can be performed with the current version_number.

Only supported for insertions into primary data sources.

If the operation is prevented, the aborted exception will be thrown.

optional int64 version_number = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
long

The versionNumber.

hasAttributes()

public boolean hasAttributes()

Output only. A list of product attributes.

.google.shopping.merchant.products.v1beta.Attributes attributes = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the attributes field is set.

hasProductStatus()

public boolean hasProductStatus()

Output only. The status of a product, data validation issues, that is, information about a product computed asynchronously.

.google.shopping.merchant.products.v1beta.ProductStatus product_status = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the productStatus field is set.

hasVersionNumber()

public boolean hasVersionNumber()

Output only. Represents the existing version (freshness) of the product, which can be used to preserve the right order when multiple updates are done at the same time.

If set, the insertion is prevented when version number is lower than the current version number of the existing product. Re-insertion (for example, product refresh after 30 days) can be performed with the current version_number.

Only supported for insertions into primary data sources.

If the operation is prevented, the aborted exception will be thrown.

optional int64 version_number = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the versionNumber field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public Product.Builder newBuilderForType()
Returns
Type Description
Product.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Product.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Product.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public Product.Builder toBuilder()
Returns
Type Description
Product.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException