Class: Google::Apis::CloudchannelV1::GoogleCloudChannelV1DiscountComponent

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudChannelV1DiscountComponent

Returns a new instance of GoogleCloudChannelV1DiscountComponent.



1139
1140
1141
# File 'lib/google/apis/cloudchannel_v1/classes.rb', line 1139

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

Instance Attribute Details

#discount_absoluteGoogle::Apis::CloudchannelV1::GoogleTypeMoney

Represents an amount of money with its currency type. Corresponds to the JSON property discountAbsolute



1126
1127
1128
# File 'lib/google/apis/cloudchannel_v1/classes.rb', line 1126

def discount_absolute
  @discount_absolute
end

#discount_percentageFloat

Discount percentage, represented as decimal. For example, a 20% discount will be represented as 0.2. Corresponds to the JSON property discountPercentage

Returns:

  • (Float)


1132
1133
1134
# File 'lib/google/apis/cloudchannel_v1/classes.rb', line 1132

def discount_percentage
  @discount_percentage
end

#discount_typeString

Type of the discount. Corresponds to the JSON property discountType

Returns:

  • (String)


1137
1138
1139
# File 'lib/google/apis/cloudchannel_v1/classes.rb', line 1137

def discount_type
  @discount_type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1144
1145
1146
1147
1148
# File 'lib/google/apis/cloudchannel_v1/classes.rb', line 1144

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