Class: Io::Flow::V0::Models::PriceDetailComponentKey

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ PriceDetailComponentKey

Returns a new instance of PriceDetailComponentKey.



12071
12072
12073
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12071

def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



12069
12070
12071
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12069

def value
  @value
end

Class Method Details

.apply(value) ⇒ Object

Returns the instance of PriceDetailComponentKey for this value, creating a new instance for an unknown value



12076
12077
12078
12079
12080
12081
12082
12083
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12076

def PriceDetailComponentKey.apply(value)
  if value.instance_of?(PriceDetailComponentKey)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || PriceDetailComponentKey.new(value))
  end
end

.base_priceObject

The base price of the item.



12096
12097
12098
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12096

def PriceDetailComponentKey.base_price
  @@_base_price ||= PriceDetailComponentKey.new('base_price')
end

.currency_marginObject

The amount added to the post-discount item price due to FX markup, as configured in the organization’s currency settings.



12107
12108
12109
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12107

def PriceDetailComponentKey.currency_margin
  @@_currency_margin ||= PriceDetailComponentKey.new('currency_margin')
end

.discountObject

A discount applied to the base price of the item.



12101
12102
12103
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12101

def PriceDetailComponentKey.discount
  @@_discount ||= PriceDetailComponentKey.new('discount')
end

.duties_added_marginObject

The duty owed on the sum of the currency margin, percent item margin, and fixed item margin.



12130
12131
12132
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12130

def PriceDetailComponentKey.duties_added_margin
  @@_duties_added_margin ||= PriceDetailComponentKey.new('duties_added_margin')
end

.duties_deminimisObject

An adjustment made if the item does not meet the duty de minimis rule.



12140
12141
12142
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12140

def PriceDetailComponentKey.duties_deminimis
  @@_duties_deminimis ||= PriceDetailComponentKey.new('duties_deminimis')
end

.duties_item_priceObject

The duty owed on the post-discount base item price.



12124
12125
12126
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12124

def PriceDetailComponentKey.duties_item_price
  @@_duties_item_price ||= PriceDetailComponentKey.new('duties_item_price')
end

.duties_roundingObject

The duty owed on any rounding applied to the total item price.



12135
12136
12137
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12135

def PriceDetailComponentKey.duties_rounding
  @@_duties_rounding ||= PriceDetailComponentKey.new('duties_rounding')
end

.duty_percent_sales_marginObject

An adjustment made to duty owed as a result of a percent sales margin.



12208
12209
12210
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12208

def PriceDetailComponentKey.duty_percent_sales_margin
  @@_duty_percent_sales_margin ||= PriceDetailComponentKey.new('duty_percent_sales_margin')
end

.fixed_item_marginObject

The amount added to the post-discount item price from a fixed item margin. Negative amounts represent discounts.



12119
12120
12121
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12119

def PriceDetailComponentKey.fixed_item_margin
  @@_fixed_item_margin ||= PriceDetailComponentKey.new('fixed_item_margin')
end

.from_string(value) ⇒ Object

Returns the instance of PriceDetailComponentKey for this value, or nil if not found



12086
12087
12088
12089
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12086

def PriceDetailComponentKey.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  PriceDetailComponentKey.ALL.find { |v| v.value == value }
end

.item_price_percent_sales_marginObject

An adjustment made to the item price as a result of a percent sales margin.



12182
12183
12184
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12182

def PriceDetailComponentKey.item_price_percent_sales_margin
  @@_item_price_percent_sales_margin ||= PriceDetailComponentKey.new('item_price_percent_sales_margin')
end

.margins_percent_sales_marginObject

An adjustment made to the item margins as a result of a percent sales margin.



12187
12188
12189
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12187

def PriceDetailComponentKey.margins_percent_sales_margin
  @@_margins_percent_sales_margin ||= PriceDetailComponentKey.new('margins_percent_sales_margin')
end

.percent_item_marginObject

The amount added to the post-discount item price from a percent item margin. Negative amounts represent discounts.



12113
12114
12115
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12113

def PriceDetailComponentKey.percent_item_margin
  @@_percent_item_margin ||= PriceDetailComponentKey.new('percent_item_margin')
end

.rounding_percent_sales_marginObject

An adjustment made to rounding as a result of a percent sales margin.



12192
12193
12194
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12192

def PriceDetailComponentKey.rounding_percent_sales_margin
  @@_rounding_percent_sales_margin ||= PriceDetailComponentKey.new('rounding_percent_sales_margin')
end

.vat_added_marginObject

The VAT owed on the sum of the currency margin, percent item margin, and fixed item margin.



12151
12152
12153
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12151

def PriceDetailComponentKey.vat_added_margin
  @@_vat_added_margin ||= PriceDetailComponentKey.new('vat_added_margin')
end

.vat_deminimisObject

An adjustment made if the item does not meet the VAT de minimis rule.



12177
12178
12179
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12177

def PriceDetailComponentKey.vat_deminimis
  @@_vat_deminimis ||= PriceDetailComponentKey.new('vat_deminimis')
end

.vat_duties_added_marginObject

The VAT owed on the duty owed on the sum of the currency margin, percent item margin, and fixed item margin.



12167
12168
12169
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12167

def PriceDetailComponentKey.vat_duties_added_margin
  @@_vat_duties_added_margin ||= PriceDetailComponentKey.new('vat_duties_added_margin')
end

.vat_duties_item_priceObject

The VAT owed on the duty owed on the post-discount base item price.



12161
12162
12163
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12161

def PriceDetailComponentKey.vat_duties_item_price
  @@_vat_duties_item_price ||= PriceDetailComponentKey.new('vat_duties_item_price')
end

.vat_duties_roundingObject

The VAT owed on the duty owed on any rounding applied to the total item price.



12172
12173
12174
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12172

def PriceDetailComponentKey.vat_duties_rounding
  @@_vat_duties_rounding ||= PriceDetailComponentKey.new('vat_duties_rounding')
end

.vat_duty_percent_sales_marginObject

An adjustment made to VAT on duties (e.g. VAT on duties on item price) owed as a result of a percent sales margin.



12203
12204
12205
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12203

def PriceDetailComponentKey.vat_duty_percent_sales_margin
  @@_vat_duty_percent_sales_margin ||= PriceDetailComponentKey.new('vat_duty_percent_sales_margin')
end

.vat_item_priceObject

The VAT owed on the post-discount base item price.



12145
12146
12147
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12145

def PriceDetailComponentKey.vat_item_price
  @@_vat_item_price ||= PriceDetailComponentKey.new('vat_item_price')
end

.vat_percent_sales_marginObject

An adjustment made to VAT owed as a result of a percent sales margin.



12197
12198
12199
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12197

def PriceDetailComponentKey.vat_percent_sales_margin
  @@_vat_percent_sales_margin ||= PriceDetailComponentKey.new('vat_percent_sales_margin')
end

.vat_roundingObject

The VAT owed on any rounding applied to the total item price.



12156
12157
12158
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12156

def PriceDetailComponentKey.vat_rounding
  @@_vat_rounding ||= PriceDetailComponentKey.new('vat_rounding')
end

Instance Method Details

#to_hashObject



12212
12213
12214
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12212

def to_hash
  value
end