Class: Google::Apis::MerchantapiInventoriesV1beta::LocalInventory

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/merchantapi_inventories_v1beta/classes.rb,
lib/google/apis/merchantapi_inventories_v1beta/representations.rb,
lib/google/apis/merchantapi_inventories_v1beta/representations.rb

Overview

Local inventory information for the product. Represents in-store information for a specific product at the store specified by storeCode. For a list of all accepted attribute values, see the local product inventory data specification.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ LocalInventory

Returns a new instance of LocalInventory.



282
283
284
# File 'lib/google/apis/merchantapi_inventories_v1beta/classes.rb', line 282

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

Instance Attribute Details

#accountFixnum

Output only. The account that owns the product. This field will be ignored if set by the client. Corresponds to the JSON property account

Returns:

  • (Fixnum)


170
171
172
# File 'lib/google/apis/merchantapi_inventories_v1beta/classes.rb', line 170

def 
  @account
end

#availabilityString

Availability of the product at this store. For accepted attribute values, see the local product inventory data specification Corresponds to the JSON property availability

Returns:

  • (String)


177
178
179
# File 'lib/google/apis/merchantapi_inventories_v1beta/classes.rb', line 177

def availability
  @availability
end

#base64_encoded_nameString

Output only. The unpadded base64url encoded name of the LocalInventory resource. Format: accounts/account/products/product/localInventories/ store_codewhere theproduct`segment is the unpadded base64url encoded value of the identifier of the formcontent_language~feed_label~offer_id. Example:accounts/123/products/ZW5-VVN-c2t1LzEyMw/localInventories/store123 for the decoded product IDen~US~sku/123andstore_code"store123". Can be used directly as input to the API methods that require the local product identifier within the local inventory name to be encoded if it contains special characters, for example [GetLocalInventory](https://developers. google.com/merchant/api/reference/rest/inventories_v1beta/accounts.products. localInventories/get). Corresponds to the JSON propertybase64EncodedName`

Returns:

  • (String)


192
193
194
# File 'lib/google/apis/merchantapi_inventories_v1beta/classes.rb', line 192

def base64_encoded_name
  @base64_encoded_name
end

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

A list of custom (merchant-provided) attributes. You can also use CustomAttribute to submit any attribute of the data specification in its generic form. Corresponds to the JSON property customAttributes



199
200
201
# File 'lib/google/apis/merchantapi_inventories_v1beta/classes.rb', line 199

def custom_attributes
  @custom_attributes
end

#instore_product_locationString

Location of the product inside the store. Maximum length is 20 bytes. Corresponds to the JSON property instoreProductLocation

Returns:

  • (String)


204
205
206
# File 'lib/google/apis/merchantapi_inventories_v1beta/classes.rb', line 204

def instore_product_location
  @instore_product_location
end

#nameString

Output only. The name of the LocalInventory resource. Format: accounts/ account/products/product/localInventories/store_codeTheproduct 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 theproductsegment in the URL is automatically detected by the server, supporting two options: 1. ** Encoded Format**: Theproductsegment 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` for `store_code` "store123", theproductsegment must be the base64url encoding of this string, which is `ZW5-VVN-c2t1LzEyMw`. The full resource name for the local inventory would be `accounts/123/products/ZW5-VVN-c2t1LzEyMw/ localInventories/store123`. 2. **Plain Format**: Theproductsegment 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 theproduct`segment is used to differentiate between the two formats. Corresponds to the JSON propertyname`

Returns:

  • (String)


232
233
234
# File 'lib/google/apis/merchantapi_inventories_v1beta/classes.rb', line 232

def name
  @name
end

#pickup_methodString

Supported pickup method for this product. Unless the value is "not supported" , this field must be submitted together with pickupSla. For accepted attribute values, see the local product inventory data specification Corresponds to the JSON property pickupMethod

Returns:

  • (String)


240
241
242
# File 'lib/google/apis/merchantapi_inventories_v1beta/classes.rb', line 240

def pickup_method
  @pickup_method
end

#pickup_slaString

Relative time period from the order date for an order for this product, from this store, to be ready for pickup. Must be submitted with pickupMethod. For accepted attribute values, see the local product inventory data specification Corresponds to the JSON property pickupSla

Returns:

  • (String)


248
249
250
# File 'lib/google/apis/merchantapi_inventories_v1beta/classes.rb', line 248

def pickup_sla
  @pickup_sla
end

#priceGoogle::Apis::MerchantapiInventoriesV1beta::Price

The price represented as a number and currency. Corresponds to the JSON property price



253
254
255
# File 'lib/google/apis/merchantapi_inventories_v1beta/classes.rb', line 253

def price
  @price
end

#quantityFixnum

Quantity of the product available at this store. Must be greater than or equal to zero. Corresponds to the JSON property quantity

Returns:

  • (Fixnum)


259
260
261
# File 'lib/google/apis/merchantapi_inventories_v1beta/classes.rb', line 259

def quantity
  @quantity
end

#sale_priceGoogle::Apis::MerchantapiInventoriesV1beta::Price

The price represented as a number and currency. Corresponds to the JSON property salePrice



264
265
266
# File 'lib/google/apis/merchantapi_inventories_v1beta/classes.rb', line 264

def sale_price
  @sale_price
end

#sale_price_effective_dateGoogle::Apis::MerchantapiInventoriesV1beta::Interval

Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive). The start must be less than or equal to the end. When the start equals the end, the interval is empty (matches no time). When both start and end are unspecified, the interval matches any time. Corresponds to the JSON property salePriceEffectiveDate



272
273
274
# File 'lib/google/apis/merchantapi_inventories_v1beta/classes.rb', line 272

def sale_price_effective_date
  @sale_price_effective_date
end

#store_codeString

Required. Immutable. Store code (the store ID from your Business Profile) of the physical store the product is sold in. See the Local product inventory data specification for more information. Corresponds to the JSON property storeCode

Returns:

  • (String)


280
281
282
# File 'lib/google/apis/merchantapi_inventories_v1beta/classes.rb', line 280

def store_code
  @store_code
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# File 'lib/google/apis/merchantapi_inventories_v1beta/classes.rb', line 287

def update!(**args)
  @account = args[:account] if args.key?(:account)
  @availability = args[:availability] if args.key?(:availability)
  @base64_encoded_name = args[:base64_encoded_name] if args.key?(:base64_encoded_name)
  @custom_attributes = args[:custom_attributes] if args.key?(:custom_attributes)
  @instore_product_location = args[:instore_product_location] if args.key?(:instore_product_location)
  @name = args[:name] if args.key?(:name)
  @pickup_method = args[:pickup_method] if args.key?(:pickup_method)
  @pickup_sla = args[:pickup_sla] if args.key?(:pickup_sla)
  @price = args[:price] if args.key?(:price)
  @quantity = args[:quantity] if args.key?(:quantity)
  @sale_price = args[:sale_price] if args.key?(:sale_price)
  @sale_price_effective_date = args[:sale_price_effective_date] if args.key?(:sale_price_effective_date)
  @store_code = args[:store_code] if args.key?(:store_code)
end