Class: Google::Apis::MerchantapiProductsV1beta::Product

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

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. 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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Product

Returns a new instance of Product.



1345
1346
1347
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1345

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

Instance Attribute Details

#attributesGoogle::Apis::MerchantapiProductsV1beta::Attributes

Attributes. Corresponds to the JSON property attributes



1254
1255
1256
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1254

def attributes
  @attributes
end

#automated_discountsGoogle::Apis::MerchantapiProductsV1beta::AutomatedDiscounts

Information regarding Automated Discounts. Corresponds to the JSON property automatedDiscounts



1259
1260
1261
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1259

def automated_discounts
  @automated_discounts
end

#base64_encoded_nameString

Output only. The unpadded base64url encoded name of the product. Format: accounts/account/products/product`where the last sectionproductis the unpadded base64url encoding of thecontent_language~feed_label~offer_idname. Example:accounts/123/products/ZW5-VVN-c2t1LzEyMwfor 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 propertybase64EncodedName`

Returns:

  • (String)


1271
1272
1273
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1271

def base64_encoded_name
  @base64_encoded_name
end

#channelString

Output only. The channel of the product. Corresponds to the JSON property channel

Returns:

  • (String)


1277
1278
1279
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1277

def channel
  @channel
end

#content_languageString

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

Returns:

  • (String)


1283
1284
1285
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1283

def content_language
  @content_language
end

#custom_attributesArray<Google::Apis::MerchantapiProductsV1beta::CustomAttribute>

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. Corresponds to the JSON property customAttributes



1292
1293
1294
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1292

def custom_attributes
  @custom_attributes
end

#data_sourceString

Output only. The primary data source of the product. Corresponds to the JSON property dataSource

Returns:

  • (String)


1297
1298
1299
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1297

def data_source
  @data_source
end

#feed_labelString

Output only. The feed label lets you categorize and identify your products. The maximum allowed characters is 20 and the supported characters areA-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)


1306
1307
1308
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1306

def feed_label
  @feed_label
end

#nameString

The name of the product. Format: accounts/account/products/product`where the last sectionproductconsists of:content_language~feed_label~offer_id example for product name isaccounts/123/products/en~US~sku123. A legacy local product name would beaccounts/123/products/local~en~US~sku123. Note: For calls to the v1beta version, theproductsection consists of:channel~ content_language~feed_label~offer_id, for example:accounts/123/products/ online~en~US~sku123. Corresponds to the JSON propertyname`

Returns:

  • (String)


1317
1318
1319
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1317

def name
  @name
end

#offer_idString

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. Corresponds to the JSON property offerId

Returns:

  • (String)


1326
1327
1328
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1326

def offer_id
  @offer_id
end

#product_statusGoogle::Apis::MerchantapiProductsV1beta::ProductStatus

The status of a product, data validation issues, that is, information about a product computed asynchronously. Corresponds to the JSON property productStatus



1332
1333
1334
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1332

def product_status
  @product_status
end

#version_numberFixnum

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. Corresponds to the JSON property versionNumber

Returns:

  • (Fixnum)


1343
1344
1345
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1343

def version_number
  @version_number
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
# File 'lib/google/apis/merchantapi_products_v1beta/classes.rb', line 1350

def update!(**args)
  @attributes = args[:attributes] if args.key?(:attributes)
  @automated_discounts = args[:automated_discounts] if args.key?(:automated_discounts)
  @base64_encoded_name = args[:base64_encoded_name] if args.key?(:base64_encoded_name)
  @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)
  @data_source = args[:data_source] if args.key?(:data_source)
  @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_status = args[:product_status] if args.key?(:product_status)
  @version_number = args[:version_number] if args.key?(:version_number)
end