Class: Google::Apis::MerchantapiProductsV1beta::ProductInput

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ ProductInput

Returns a new instance of ProductInput.



1609
1610
1611
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1609

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#attributesGoogle::Apis::MerchantapiProductsV1beta::Attributes

Attributes. Corresponds to the JSON property attributes



1492
1493
1494
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1492

def attributes
  @attributes
end

#base64_encoded_nameString

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`

Returns:

  • (String)


1506
1507
1508
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1506

def base64_encoded_name
  @base64_encoded_name
end

#base64_encoded_productString

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`

Returns:

  • (String)


1519
1520
1521
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1519

def base64_encoded_product
  @base64_encoded_product
end

#channelString

Immutable. The channel of the product. Corresponds to the JSON property channel

Returns:

  • (String)


1525
1526
1527
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1525

def channel
  @channel
end

#content_languageString

Required. Immutable. The two-letter ISO 639-1 language code for the product. Corresponds to the JSON property contentLanguage

Returns:

  • (String)


1531
1532
1533
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1531

def content_language
  @content_language
end

#custom_attributesArray<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



1543
1544
1545
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1543

def custom_attributes
  @custom_attributes
end

#feed_labelString

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

Returns:

  • (String)


1552
1553
1554
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1552

def feed_label
  @feed_label
end

#nameString

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`

Returns:

  • (String)


1579
1580
1581
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1579

def name
  @name
end

#offer_idString

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

Returns:

  • (String)


1588
1589
1590
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1588

def offer_id
  @offer_id
end

#productString

Output only. The name of the processed product. Format: accounts/account/ products/product` Corresponds to the JSON propertyproduct`

Returns:

  • (String)


1594
1595
1596
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1594

def product
  @product
end

#version_numberFixnum

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

Returns:

  • (Fixnum)


1607
1608
1609
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1607

def version_number
  @version_number
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1614

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