Class: Google::Apis::RetailV2::GoogleCloudRetailV2PurchaseTransaction

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

A transaction represents the entire purchase transaction.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudRetailV2PurchaseTransaction

Returns a new instance of GoogleCloudRetailV2PurchaseTransaction.



2049
2050
2051
# File 'lib/google/apis/retail_v2/classes.rb', line 2049

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

Instance Attribute Details

#costFloat

All the costs associated with the products. These can be manufacturing costs, shipping expenses not borne by the end user, or any other costs, such that: * Profit = revenue - tax - cost Corresponds to the JSON property cost

Returns:

  • (Float)


2025
2026
2027
# File 'lib/google/apis/retail_v2/classes.rb', line 2025

def cost
  @cost
end

#currency_codeString

Required. Currency code. Use three-character ISO-4217 code. Corresponds to the JSON property currencyCode

Returns:

  • (String)


2030
2031
2032
# File 'lib/google/apis/retail_v2/classes.rb', line 2030

def currency_code
  @currency_code
end

#idString

The transaction ID with a length limit of 128 characters. Corresponds to the JSON property id

Returns:

  • (String)


2035
2036
2037
# File 'lib/google/apis/retail_v2/classes.rb', line 2035

def id
  @id
end

#revenueFloat

Required. Total non-zero revenue or grand total associated with the transaction. This value include shipping, tax, or other adjustments to total revenue that you want to include as part of your revenue calculations. Corresponds to the JSON property revenue

Returns:

  • (Float)


2042
2043
2044
# File 'lib/google/apis/retail_v2/classes.rb', line 2042

def revenue
  @revenue
end

#taxFloat

All the taxes associated with the transaction. Corresponds to the JSON property tax

Returns:

  • (Float)


2047
2048
2049
# File 'lib/google/apis/retail_v2/classes.rb', line 2047

def tax
  @tax
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2054
2055
2056
2057
2058
2059
2060
# File 'lib/google/apis/retail_v2/classes.rb', line 2054

def update!(**args)
  @cost = args[:cost] if args.key?(:cost)
  @currency_code = args[:currency_code] if args.key?(:currency_code)
  @id = args[:id] if args.key?(:id)
  @revenue = args[:revenue] if args.key?(:revenue)
  @tax = args[:tax] if args.key?(:tax)
end