Class: Google::Apis::RetailV2::GoogleCloudRetailV2PriceInfo

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

Overview

The price information of a Product.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudRetailV2PriceInfo

Returns a new instance of GoogleCloudRetailV2PriceInfo.



2553
2554
2555
# File 'lib/google/apis/retail_v2/classes.rb', line 2553

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

Instance Attribute Details

#costFloat

The costs associated with the sale of a particular product. Used for gross profit reporting. * Profit = price - cost Google Merchant Center property cost_of_goods_sold. Corresponds to the JSON property cost

Returns:

  • (Float)


2505
2506
2507
# File 'lib/google/apis/retail_v2/classes.rb', line 2505

def cost
  @cost
end

#currency_codeString

The 3-letter currency code defined in ISO 4217. If this field is an unrecognizable currency code, an INVALID_ARGUMENT error is returned. The Product.Type.VARIANT Products with the same Product.primary_product_id must share the same currency_code. Otherwise, a FAILED_PRECONDITION error is returned. Corresponds to the JSON property currencyCode

Returns:

  • (String)


2514
2515
2516
# File 'lib/google/apis/retail_v2/classes.rb', line 2514

def currency_code
  @currency_code
end

#original_priceFloat

Price of the product without any discount. If zero, by default set to be the price. If set, original_price should be greater than or equal to price, otherwise an INVALID_ARGUMENT error is thrown. Corresponds to the JSON property originalPrice

Returns:

  • (Float)


2521
2522
2523
# File 'lib/google/apis/retail_v2/classes.rb', line 2521

def original_price
  @original_price
end

#priceFloat

Price of the product. Google Merchant Center property price. Schema.org property Offer.price. Corresponds to the JSON property price

Returns:

  • (Float)


2528
2529
2530
# File 'lib/google/apis/retail_v2/classes.rb', line 2528

def price
  @price
end

#price_effective_timeString

The timestamp when the price starts to be effective. This can be set as a future timestamp, and the price is only used for search after price_effective_time. If so, the original_price must be set and original_price is used before price_effective_time. Do not set if price is always effective because it will cause additional latency during search. Corresponds to the JSON property priceEffectiveTime

Returns:

  • (String)


2537
2538
2539
# File 'lib/google/apis/retail_v2/classes.rb', line 2537

def price_effective_time
  @price_effective_time
end

#price_expire_timeString

The timestamp when the price stops to be effective. The price is used for search before price_expire_time. If this field is set, the original_price must be set and original_price is used after price_expire_time. Do not set if price is always effective because it will cause additional latency during search. Corresponds to the JSON property priceExpireTime

Returns:

  • (String)


2545
2546
2547
# File 'lib/google/apis/retail_v2/classes.rb', line 2545

def price_expire_time
  @price_expire_time
end

#price_rangeGoogle::Apis::RetailV2::GoogleCloudRetailV2PriceInfoPriceRange

The price range of all variant Product having the same Product. primary_product_id. Corresponds to the JSON property priceRange



2551
2552
2553
# File 'lib/google/apis/retail_v2/classes.rb', line 2551

def price_range
  @price_range
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2558
2559
2560
2561
2562
2563
2564
2565
2566
# File 'lib/google/apis/retail_v2/classes.rb', line 2558

def update!(**args)
  @cost = args[:cost] if args.key?(:cost)
  @currency_code = args[:currency_code] if args.key?(:currency_code)
  @original_price = args[:original_price] if args.key?(:original_price)
  @price = args[:price] if args.key?(:price)
  @price_effective_time = args[:price_effective_time] if args.key?(:price_effective_time)
  @price_expire_time = args[:price_expire_time] if args.key?(:price_expire_time)
  @price_range = args[:price_range] if args.key?(:price_range)
end