# Interface ProductInputOrBuilder (1.21.0)

1.21.0 (latest) 1.19.0 1.16.0 1.15.0 1.13.0 1.11.0 1.10.0 1.8.0 1.6.0 1.4.0 1.3.0 1.2.0 1.1.0 1.0.0 0.26.0 0.24.0 0.23.0 0.20.0 0.19.0 0.18.0 0.16.0 0.15.0 0.14.0 0.13.0 0.12.0 0.11.0 0.10.0 0.9.0 0.8.0 0.7.0 0.5.0 0.4.0 0.3.0 0.2.0 0.1.0

    public interface ProductInputOrBuilder extends MessageOrBuilder

## Implements

[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)

## Methods

### getBase64EncodedName()

    public abstract String getBase64EncodedName()

Output only. The **unpadded base64url encoded name** of the product input.
Format:
`accounts/{account}/productInputs/{productinput}` where the last
section `productinput` is the unpadded base64url encoding of the
`content_language~feed_label~offer_id` name.
Example: `accounts/123/productInputs/ZW5-VVN-c2t1LzEyMw` for the decoded
product input name `accounts/123/productInputs/en~US~sku/123`. This field
can be used directly as input to the API methods that require the product
input name to be encoded if it contains special characters, for example
[`GetProductInput`](https://developers.google.com/merchant/api/reference/rest/products_v1/accounts.productInputs/get).

`string base64_encoded_name = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The base64EncodedName. |

### getBase64EncodedNameBytes()

    public abstract ByteString getBase64EncodedNameBytes()

Output only. The **unpadded base64url encoded name** of the product input.
Format:
`accounts/{account}/productInputs/{productinput}` where the last
section `productinput` is the unpadded base64url encoding of the
`content_language~feed_label~offer_id` name.
Example: `accounts/123/productInputs/ZW5-VVN-c2t1LzEyMw` for the decoded
product input name `accounts/123/productInputs/en~US~sku/123`. This field
can be used directly as input to the API methods that require the product
input name to be encoded if it contains special characters, for example
[`GetProductInput`](https://developers.google.com/merchant/api/reference/rest/products_v1/accounts.productInputs/get).

`string base64_encoded_name = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for base64EncodedName. |

### getBase64EncodedProduct()

    public abstract String getBase64EncodedProduct()

Output only. The **unpadded base64url encoded name** of the processed
product. Format: `accounts/{account}/products/{product}` where the last
section `product` is the unpadded base64url encoding of the
`content_language~feed_label~offer_id` name.
Example: `accounts/123/products/ZW5-VVN-c2t1LzEyMw` for the decoded
product name `accounts/123/products/en~US~sku/123`. This field can be used
directly as input to the API methods that require the product name to be
encoded if it contains special characters, for example
[`GetProduct`](https://developers.google.com/merchant/api/reference/rest/products_v1/accounts.products/get).

`string base64_encoded_product = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The base64EncodedProduct. |

### getBase64EncodedProductBytes()

    public abstract ByteString getBase64EncodedProductBytes()

Output only. The **unpadded base64url encoded name** of the processed
product. Format: `accounts/{account}/products/{product}` where the last
section `product` is the unpadded base64url encoding of the
`content_language~feed_label~offer_id` name.
Example: `accounts/123/products/ZW5-VVN-c2t1LzEyMw` for the decoded
product name `accounts/123/products/en~US~sku/123`. This field can be used
directly as input to the API methods that require the product name to be
encoded if it contains special characters, for example
[`GetProduct`](https://developers.google.com/merchant/api/reference/rest/products_v1/accounts.products/get).

`string base64_encoded_product = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for base64EncodedProduct. |

### getContentLanguage()

    public abstract String getContentLanguage()

Required. Immutable. The two-letter [ISO
639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the
product.

`
string content_language = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The contentLanguage. |

### getContentLanguageBytes()

    public abstract ByteString getContentLanguageBytes()

Required. Immutable. The two-letter [ISO
639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the
product.

`
string content_language = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for contentLanguage. |

### getCustomAttributes(int index)

    public abstract CustomAttribute getCustomAttributes(int index)

Optional. A list of custom (merchant-provided) attributes. It can also be
used for submitting 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.
Maximum allowed number of characters for each
custom attribute is 10240 (represents sum of characters for name and
value). Maximum 2500 custom attributes can be set per product, with total
size of 102.4kB. Underscores in custom attribute names are replaced by
spaces upon insertion.

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.shopping.type.CustomAttribute` |   |

### getCustomAttributesCount()

    public abstract int getCustomAttributesCount()

Optional. A list of custom (merchant-provided) attributes. It can also be
used for submitting 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.
Maximum allowed number of characters for each
custom attribute is 10240 (represents sum of characters for name and
value). Maximum 2500 custom attributes can be set per product, with total
size of 102.4kB. Underscores in custom attribute names are replaced by
spaces upon insertion.

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getCustomAttributesList()

    public abstract List<CustomAttribute> getCustomAttributesList()

Optional. A list of custom (merchant-provided) attributes. It can also be
used for submitting 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.
Maximum allowed number of characters for each
custom attribute is 10240 (represents sum of characters for name and
value). Maximum 2500 custom attributes can be set per product, with total
size of 102.4kB. Underscores in custom attribute names are replaced by
spaces upon insertion.

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<com.google.shopping.type.CustomAttribute>` |   |

### getCustomAttributesOrBuilder(int index)

    public abstract CustomAttributeOrBuilder getCustomAttributesOrBuilder(int index)

Optional. A list of custom (merchant-provided) attributes. It can also be
used for submitting 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.
Maximum allowed number of characters for each
custom attribute is 10240 (represents sum of characters for name and
value). Maximum 2500 custom attributes can be set per product, with total
size of 102.4kB. Underscores in custom attribute names are replaced by
spaces upon insertion.

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.shopping.type.CustomAttributeOrBuilder` |   |

### getCustomAttributesOrBuilderList()

    public abstract List<? extends CustomAttributeOrBuilder> getCustomAttributesOrBuilderList()

Optional. A list of custom (merchant-provided) attributes. It can also be
used for submitting 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.
Maximum allowed number of characters for each
custom attribute is 10240 (represents sum of characters for name and
value). Maximum 2500 custom attributes can be set per product, with total
size of 102.4kB. Underscores in custom attribute names are replaced by
spaces upon insertion.

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<? extends com.google.shopping.type.CustomAttributeOrBuilder>` |   |

### getFeedLabel()

    public abstract String getFeedLabel()

Required. Immutable. The feed label that lets you categorize and identify
your products. The maximum allowed characters are 20, and the supported
characters are `A-Z`, `0-9`, hyphen, and underscore. The feed label must
not include any spaces. For more information, see [Using feed
labels](https://support.google.com/merchants/answer/14994087).

`
string feed_label = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The feedLabel. |

### getFeedLabelBytes()

    public abstract ByteString getFeedLabelBytes()

Required. Immutable. The feed label that lets you categorize and identify
your products. The maximum allowed characters are 20, and the supported
characters are `A-Z`, `0-9`, hyphen, and underscore. The feed label must
not include any spaces. For more information, see [Using feed
labels](https://support.google.com/merchants/answer/14994087).

`
string feed_label = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for feedLabel. |

### getLegacyLocal()

    public abstract boolean getLegacyLocal()

Immutable. Determines whether the product is **only** targeting
local destinations and whether the product name should be distinguished
with a `local~` prefix. For example,
`accounts/123/productInputs/local~en~US~sku123`. If a product that is not
`legacy_local` is already targeting local destinations,
creating a `legacy_local` product with an otherwise matching name will
fail.

`bool legacy_local = 10 [(.google.api.field_behavior) = IMMUTABLE];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The legacyLocal. |

### getName()

    public abstract String getName()

Identifier. The name of the product.
Format: `accounts/{account}/productInputs/{productinput}`

The {productinput} segment is a unique identifier for the product.
This identifier must be unique within a merchant account and generally
follows the structure: `content_language~feed_label~offer_id`. Example:
`en~US~sku123` For legacy local products, the structure is:
`local~content_language~feed_label~offer_id`. Example: `local~en~US~sku123`

The format of the {productinput} segment in the URL is automatically
detected by the server, supporting two options:

1. **Encoded Format** : The `{productinput}` segment is an unpadded base64url encoded string (RFC 4648 Section 5). The decoded string must result in the `content_language~feed_label~offer_id` structure. This encoding MUST be used if any part of the product identifier (like `offer_id`) contains characters such as `/`, `%`, or `~`.
2. Example: To represent the product ID `en~US~sku/123`, the
   `{productinput}` segment must be the unpadded base64url encoding of
   this string, which is `ZW5-VVN-c2t1LzEyMw`. The full resource name
   for the product would be
   `accounts/123/productInputs/ZW5-VVN-c2t1LzEyMw`.

3. **Plain Format** : The `{productinput}` segment is the tilde-separated
   string
   `content_language~feed_label~offer_id`. This format is suitable only
   when `content_language`, `feed_label`, and `offer_id` do not contain
   URL-problematic characters like `/`, `%`, or `~`.

   We recommend using the **Encoded Format** for all product IDs to ensure
   correct parsing, especially those containing special characters. The
   presence of tilde (`~`) characters in the `{productinput}` segment is used
   to differentiate between the two formats.

`string name = 1 [(.google.api.field_behavior) = IDENTIFIER];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The name. |

### getNameBytes()

    public abstract ByteString getNameBytes()

Identifier. The name of the product.
Format: `accounts/{account}/productInputs/{productinput}`

The {productinput} segment is a unique identifier for the product.
This identifier must be unique within a merchant account and generally
follows the structure: `content_language~feed_label~offer_id`. Example:
`en~US~sku123` For legacy local products, the structure is:
`local~content_language~feed_label~offer_id`. Example: `local~en~US~sku123`

The format of the {productinput} segment in the URL is automatically
detected by the server, supporting two options:

1. **Encoded Format** : The `{productinput}` segment is an unpadded base64url encoded string (RFC 4648 Section 5). The decoded string must result in the `content_language~feed_label~offer_id` structure. This encoding MUST be used if any part of the product identifier (like `offer_id`) contains characters such as `/`, `%`, or `~`.
2. Example: To represent the product ID `en~US~sku/123`, the
   `{productinput}` segment must be the unpadded base64url encoding of
   this string, which is `ZW5-VVN-c2t1LzEyMw`. The full resource name
   for the product would be
   `accounts/123/productInputs/ZW5-VVN-c2t1LzEyMw`.

3. **Plain Format** : The `{productinput}` segment is the tilde-separated
   string
   `content_language~feed_label~offer_id`. This format is suitable only
   when `content_language`, `feed_label`, and `offer_id` do not contain
   URL-problematic characters like `/`, `%`, or `~`.

   We recommend using the **Encoded Format** for all product IDs to ensure
   correct parsing, especially those containing special characters. The
   presence of tilde (`~`) characters in the `{productinput}` segment is used
   to differentiate between the two formats.

`string name = 1 [(.google.api.field_behavior) = IDENTIFIER];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for name. |

### getOfferId()

    public abstract String getOfferId()

Required. Immutable. 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 [products data
specification](https://support.google.com/merchants/answer/188494#id) for
details.

`
string offer_id = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The offerId. |

### getOfferIdBytes()

    public abstract ByteString getOfferIdBytes()

Required. Immutable. 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 [products data
specification](https://support.google.com/merchants/answer/188494#id) for
details.

`
string offer_id = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for offerId. |

### getProduct()

    public abstract String getProduct()

Output only. The name of the processed product.
Format: `accounts/{account}/products/{product}`

`string product = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The product. |

### getProductAttributes()

    public abstract ProductAttributes getProductAttributes()

Optional. A list of strongly-typed product attributes.

`
.google.shopping.merchant.products.v1.ProductAttributes product_attributes = 11 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-products/latest/com.google.shopping.merchant.products.v1.ProductAttributes` | The productAttributes. |

### getProductAttributesOrBuilder()

    public abstract ProductAttributesOrBuilder getProductAttributesOrBuilder()

Optional. A list of strongly-typed product attributes.

`
.google.shopping.merchant.products.v1.ProductAttributes product_attributes = 11 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-products/latest/com.google.shopping.merchant.products.v1.ProductAttributesOrBuilder` |   |

### getProductBytes()

    public abstract ByteString getProductBytes()

Output only. The name of the processed product.
Format: `accounts/{account}/products/{product}`

`string product = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for product. |

### getVersionNumber()

    public abstract long getVersionNumber()

Optional. Immutable. 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.
Do not set this field for updates.
Do not set this field for insertions into supplemental data sources.

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

`
optional int64 version_number = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The versionNumber. |

### hasProductAttributes()

    public abstract boolean hasProductAttributes()

Optional. A list of strongly-typed product attributes.

`
.google.shopping.merchant.products.v1.ProductAttributes product_attributes = 11 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the productAttributes field is set. |

### hasVersionNumber()

    public abstract boolean hasVersionNumber()

Optional. Immutable. 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.
Do not set this field for updates.
Do not set this field for insertions into supplemental data sources.

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

`
optional int64 version_number = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the versionNumber field is set. |