Class: Google::Apis::RecommendationengineV1beta1::GoogleCloudRecommendationengineV1beta1PurchaseTransaction
- Inherits:
-
Object
- Object
- Google::Apis::RecommendationengineV1beta1::GoogleCloudRecommendationengineV1beta1PurchaseTransaction
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/recommendationengine_v1beta1/classes.rb,
lib/google/apis/recommendationengine_v1beta1/representations.rb,
lib/google/apis/recommendationengine_v1beta1/representations.rb
Overview
A transaction represents the entire purchase transaction.
Instance Attribute Summary collapse
-
#costs ⇒ Hash<String,Float>
Optional.
-
#currency_code ⇒ String
Required.
-
#id ⇒ String
Optional.
-
#revenue ⇒ Float
Required.
-
#taxes ⇒ Hash<String,Float>
Optional.
Instance Method Summary collapse
-
#initialize(**args) ⇒ GoogleCloudRecommendationengineV1beta1PurchaseTransaction
constructor
A new instance of GoogleCloudRecommendationengineV1beta1PurchaseTransaction.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ GoogleCloudRecommendationengineV1beta1PurchaseTransaction
Returns a new instance of GoogleCloudRecommendationengineV1beta1PurchaseTransaction.
1469 1470 1471 |
# File 'lib/google/apis/recommendationengine_v1beta1/classes.rb', line 1469 def initialize(**args) update!(**args) end |
Instance Attribute Details
#costs ⇒ Hash<String,Float>
Optional. All the costs associated with the product. These can be
manufacturing costs, shipping expenses not borne by the end user, or any other
costs. Total product cost such that profit = revenue - (sum(taxes) + sum(costs)
) If product_cost is not set, then profit = revenue - tax - shipping - sum(
CatalogItem.costs). If CatalogItem.cost is not specified for one of the items,
CatalogItem.cost based profit cannot be calculated for this Transaction.
Corresponds to the JSON property costs
1443 1444 1445 |
# File 'lib/google/apis/recommendationengine_v1beta1/classes.rb', line 1443 def costs @costs end |
#currency_code ⇒ String
Required. Currency code. Use three-character ISO-4217 code. This field is not
required if the event type is refund
.
Corresponds to the JSON property currencyCode
1449 1450 1451 |
# File 'lib/google/apis/recommendationengine_v1beta1/classes.rb', line 1449 def currency_code @currency_code end |
#id ⇒ String
Optional. The transaction ID with a length limit of 128 bytes.
Corresponds to the JSON property id
1454 1455 1456 |
# File 'lib/google/apis/recommendationengine_v1beta1/classes.rb', line 1454 def id @id end |
#revenue ⇒ Float
Required. Total 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. This field is not
required if the event type is refund
.
Corresponds to the JSON property revenue
1462 1463 1464 |
# File 'lib/google/apis/recommendationengine_v1beta1/classes.rb', line 1462 def revenue @revenue end |
#taxes ⇒ Hash<String,Float>
Optional. All the taxes associated with the transaction.
Corresponds to the JSON property taxes
1467 1468 1469 |
# File 'lib/google/apis/recommendationengine_v1beta1/classes.rb', line 1467 def taxes @taxes end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
1474 1475 1476 1477 1478 1479 1480 |
# File 'lib/google/apis/recommendationengine_v1beta1/classes.rb', line 1474 def update!(**args) @costs = args[:costs] if args.key?(:costs) @currency_code = args[:currency_code] if args.key?(:currency_code) @id = args[:id] if args.key?(:id) @revenue = args[:revenue] if args.key?(:revenue) @taxes = args[:taxes] if args.key?(:taxes) end |