Class: Google::Apis::CloudchannelV1::GoogleCloudChannelV1DiscountComponent
- Inherits:
-
Object
- Object
- Google::Apis::CloudchannelV1::GoogleCloudChannelV1DiscountComponent
- Includes:
- Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
- Defined in:
- lib/google/apis/cloudchannel_v1/classes.rb,
lib/google/apis/cloudchannel_v1/representations.rb,
lib/google/apis/cloudchannel_v1/representations.rb
Overview
Represents a single component of the total discount applicable on a Price.
Instance Attribute Summary collapse
-
#discount_absolute ⇒ Google::Apis::CloudchannelV1::GoogleTypeMoney
Represents an amount of money with its currency type.
-
#discount_percentage ⇒ Float
Discount percentage, represented as decimal.
-
#discount_type ⇒ String
Type of the discount.
Instance Method Summary collapse
-
#initialize(**args) ⇒ GoogleCloudChannelV1DiscountComponent
constructor
A new instance of GoogleCloudChannelV1DiscountComponent.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ GoogleCloudChannelV1DiscountComponent
Returns a new instance of GoogleCloudChannelV1DiscountComponent.
1142 1143 1144 |
# File 'lib/google/apis/cloudchannel_v1/classes.rb', line 1142 def initialize(**args) update!(**args) end |
Instance Attribute Details
#discount_absolute ⇒ Google::Apis::CloudchannelV1::GoogleTypeMoney
Represents an amount of money with its currency type.
Corresponds to the JSON property discountAbsolute
1129 1130 1131 |
# File 'lib/google/apis/cloudchannel_v1/classes.rb', line 1129 def discount_absolute @discount_absolute end |
#discount_percentage ⇒ Float
Discount percentage, represented as decimal. For example, a 20% discount will
be represented as 0.2.
Corresponds to the JSON property discountPercentage
1135 1136 1137 |
# File 'lib/google/apis/cloudchannel_v1/classes.rb', line 1135 def discount_percentage @discount_percentage end |
#discount_type ⇒ String
Type of the discount.
Corresponds to the JSON property discountType
1140 1141 1142 |
# File 'lib/google/apis/cloudchannel_v1/classes.rb', line 1140 def discount_type @discount_type end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
1147 1148 1149 1150 1151 |
# File 'lib/google/apis/cloudchannel_v1/classes.rb', line 1147 def update!(**args) @discount_absolute = args[:discount_absolute] if args.key?(:discount_absolute) @discount_percentage = args[:discount_percentage] if args.key?(:discount_percentage) @discount_type = args[:discount_type] if args.key?(:discount_type) end |