Class: Google::Apis::RecommendationengineV1beta1::GoogleCloudRecommendationengineV1beta1PurchaseTransaction

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

Overview

A transaction represents the entire purchase transaction.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudRecommendationengineV1beta1PurchaseTransaction

Returns a new instance of GoogleCloudRecommendationengineV1beta1PurchaseTransaction.



1459
1460
1461
# File 'generated/google/apis/recommendationengine_v1beta1/classes.rb', line 1459

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

Instance Attribute Details

#costsHash<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

Returns:

  • (Hash<String,Float>)


1433
1434
1435
# File 'generated/google/apis/recommendationengine_v1beta1/classes.rb', line 1433

def costs
  @costs
end

#currency_codeString

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

Returns:

  • (String)


1439
1440
1441
# File 'generated/google/apis/recommendationengine_v1beta1/classes.rb', line 1439

def currency_code
  @currency_code
end

#idString

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

Returns:

  • (String)


1444
1445
1446
# File 'generated/google/apis/recommendationengine_v1beta1/classes.rb', line 1444

def id
  @id
end

#revenueFloat

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

Returns:

  • (Float)


1452
1453
1454
# File 'generated/google/apis/recommendationengine_v1beta1/classes.rb', line 1452

def revenue
  @revenue
end

#taxesHash<String,Float>

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

Returns:

  • (Hash<String,Float>)


1457
1458
1459
# File 'generated/google/apis/recommendationengine_v1beta1/classes.rb', line 1457

def taxes
  @taxes
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1464
1465
1466
1467
1468
1469
1470
# File 'generated/google/apis/recommendationengine_v1beta1/classes.rb', line 1464

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