Class: Google::Apis::MerchantapiProductsV1beta::ProductInput
- Inherits:
-
Object
- Object
- Google::Apis::MerchantapiProductsV1beta::ProductInput
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/merchantapi_products_v1beta/classes.rb,
lib/google/apis/merchantapi_products_v1beta/representations.rb,
lib/google/apis/merchantapi_products_v1beta/representations.rb
Overview
This resource represents input data you submit for a product, not the processed product that you see in Merchant Center, in Shopping ads, or across Google surfaces. Product inputs, rules and supplemental data source data are combined to create the processed Product. For more information, see Manage products. Required product input attributes to pass data validation checks are primarily defined in the Products Data Specification. The following attributes are required: feedLabel, contentLanguage and offerId. After inserting, updating, or deleting a product input, it may take several minutes before the processed product can be retrieved. All fields in the product input and its sub-messages match the English name of their corresponding attribute in the Products Data Specification with some exceptions. The following reference documentation lists the field names in the camelCase casing style while the Products Data Specification lists the names in the snake_case casing style.
Instance Attribute Summary collapse
-
#attributes ⇒ Google::Apis::MerchantapiProductsV1beta::Attributes
Attributes.
-
#base64_encoded_name ⇒ String
Output only.
-
#base64_encoded_product ⇒ String
Output only.
-
#channel ⇒ String
Immutable.
-
#content_language ⇒ String
Required.
-
#custom_attributes ⇒ Array<Google::Apis::MerchantapiProductsV1beta::CustomAttribute>
Optional.
-
#feed_label ⇒ String
Required.
-
#name ⇒ String
Identifier.
-
#offer_id ⇒ String
Required.
-
#product ⇒ String
Output only.
-
#version_number ⇒ Fixnum
Optional.
Instance Method Summary collapse
-
#initialize(**args) ⇒ ProductInput
constructor
A new instance of ProductInput.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ ProductInput
Returns a new instance of ProductInput.
1619 1620 1621 |
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1619 def initialize(**args) update!(**args) end |
Instance Attribute Details
#attributes ⇒ Google::Apis::MerchantapiProductsV1beta::Attributes
Attributes.
Corresponds to the JSON property attributes
1502 1503 1504 |
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1502 def attributes @attributes end |
#base64_encoded_name ⇒ String
Output only. The unpadded base64url encoded name of the product input.
Format: accounts/account/productInputs/productinput`where the last
sectionproductinputis the unpadded base64url encoding of the
content_language~feed_label~offer_idname. Example:accounts/123/
productInputs/ZW5-VVN-c2t1LzEyMwfor the decoded product input nameaccounts/
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_v1beta/accounts.
productInputs/get).
Corresponds to the JSON propertybase64EncodedName`
1516 1517 1518 |
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1516 def base64_encoded_name @base64_encoded_name end |
#base64_encoded_product ⇒ String
Output only. The unpadded base64url encoded name of the processed product.
Format: accounts/account/products/product`where the last section
productis the unpadded base64url encoding of thecontent_language~
feed_label~offer_idname. Example:accounts/123/products/ZW5-VVN-c2t1LzEyMw
for the decoded product nameaccounts/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_v1beta/
accounts.products/get).
Corresponds to the JSON propertybase64EncodedProduct`
1529 1530 1531 |
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1529 def base64_encoded_product @base64_encoded_product end |
#channel ⇒ String
Immutable. The channel
of the product.
Corresponds to the JSON property channel
1535 1536 1537 |
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1535 def channel @channel end |
#content_language ⇒ String
Required. Immutable. The two-letter ISO 639-1 language code for the product.
Corresponds to the JSON property contentLanguage
1541 1542 1543 |
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1541 def content_language @content_language end |
#custom_attributes ⇒ Array<Google::Apis::MerchantapiProductsV1beta::CustomAttribute>
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.
Corresponds to the JSON property customAttributes
1553 1554 1555 |
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1553 def custom_attributes @custom_attributes end |
#feed_label ⇒ String
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.
Corresponds to the JSON property feedLabel
1562 1563 1564 |
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1562 def feed_label @feed_label end |
#name ⇒ String
Identifier. The name of the product. Format: accounts/account/productInputs/
productinputThe `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**: Theproductinput
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 `~`. * Example: To
represent the product ID `en~US~sku/123`, theproductinputsegment 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`. 2. **Plain Format**: Theproductinputsegment 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 theproductinput`segment is used to differentiate between
the two formats.
Corresponds to the JSON propertyname`
1589 1590 1591 |
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1589 def name @name end |
#offer_id ⇒ String
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 for details.
Corresponds to the JSON property offerId
1598 1599 1600 |
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1598 def offer_id @offer_id end |
#product ⇒ String
Output only. The name of the processed product. Format: accounts/account/
products/product`
Corresponds to the JSON propertyproduct`
1604 1605 1606 |
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1604 def product @product end |
#version_number ⇒ Fixnum
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.
Corresponds to the JSON property versionNumber
1617 1618 1619 |
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1617 def version_number @version_number end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 |
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1624 def update!(**args) @attributes = args[:attributes] if args.key?(:attributes) @base64_encoded_name = args[:base64_encoded_name] if args.key?(:base64_encoded_name) @base64_encoded_product = args[:base64_encoded_product] if args.key?(:base64_encoded_product) @channel = args[:channel] if args.key?(:channel) @content_language = args[:content_language] if args.key?(:content_language) @custom_attributes = args[:custom_attributes] if args.key?(:custom_attributes) @feed_label = args[:feed_label] if args.key?(:feed_label) @name = args[:name] if args.key?(:name) @offer_id = args[:offer_id] if args.key?(:offer_id) @product = args[:product] if args.key?(:product) @version_number = args[:version_number] if args.key?(:version_number) end |