Class: Io::Flow::V0::Models::OrderPriceDetailKey

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) ⇒ OrderPriceDetailKey

Returns a new instance of OrderPriceDetailKey.



9365
9366
9367
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9365

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



9363
9364
9365
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9363

def value
  @value
end

Class Method Details

.adjustmentObject

The details of any adjustments made to the order.



9390
9391
9392
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9390

def OrderPriceDetailKey.adjustment
  @@_adjustment ||= OrderPriceDetailKey.new('adjustment')
end

.ALLObject



9385
9386
9387
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9385

def OrderPriceDetailKey.ALL
  @@all ||= [OrderPriceDetailKey.adjustment, OrderPriceDetailKey.subtotal, OrderPriceDetailKey.vat, OrderPriceDetailKey.duty, OrderPriceDetailKey.shipping, OrderPriceDetailKey.insurance, OrderPriceDetailKey.discount]
end

.apply(value) ⇒ Object

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



9370
9371
9372
9373
9374
9375
9376
9377
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9370

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

.discountObject

The details of any discount applied to the order.



9421
9422
9423
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9421

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

.dutyObject

The details of any duties owed on the order.



9406
9407
9408
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9406

def OrderPriceDetailKey.duty
  @@_duty ||= OrderPriceDetailKey.new('duty')
end

.from_string(value) ⇒ Object

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



9380
9381
9382
9383
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9380

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

.insuranceObject

The details of insurance costs for the order.



9416
9417
9418
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9416

def OrderPriceDetailKey.insurance
  @@_insurance ||= OrderPriceDetailKey.new('insurance')
end

.shippingObject

The details of shipping costs for the order.



9411
9412
9413
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9411

def OrderPriceDetailKey.shipping
  @@_shipping ||= OrderPriceDetailKey.new('shipping')
end

.subtotalObject

The details of the subtotal for the order, including item prices, margins, and rounding.



9396
9397
9398
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9396

def OrderPriceDetailKey.subtotal
  @@_subtotal ||= OrderPriceDetailKey.new('subtotal')
end

.vatObject

The details of any VAT owed on the order.



9401
9402
9403
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9401

def OrderPriceDetailKey.vat
  @@_vat ||= OrderPriceDetailKey.new('vat')
end

Instance Method Details

#to_hashObject



9425
9426
9427
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9425

def to_hash
  value
end