Class: Io::Flow::V0::Models::DutiesTaxesPaidSurchargeRatecardFee

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

Instance Attribute Summary collapse

Attributes inherited from RatecardFee

#discriminator

Instance Method Summary collapse

Methods inherited from RatecardFee

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ DutiesTaxesPaidSurchargeRatecardFee

Returns a new instance of DutiesTaxesPaidSurchargeRatecardFee.



37105
37106
37107
37108
37109
37110
37111
37112
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37105

def initialize(incoming={})
  super(:discriminator => RatecardFee::Types::DUTIES_TAXES_PAID_SURCHARGE_RATECARD_FEE)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:amount], 'DutiesTaxesPaidSurchargeRatecardFee')
  @amount = (x = opts.delete(:amount); x.is_a?(::Io::Flow::V0::Models::Money) ? x : ::Io::Flow::V0::Models::Money.new(x))
  @starts_at = (x = opts.delete(:starts_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('starts_at', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
  @ends_at = (x = opts.delete(:ends_at); x.nil? ? nil : HttpClient::Preconditions.assert_class('ends_at', HttpClient::Helper.to_date_time_iso8601(x), DateTime))
end

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount.



37103
37104
37105
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37103

def amount
  @amount
end

#ends_atObject (readonly)

Returns the value of attribute ends_at.



37103
37104
37105
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37103

def ends_at
  @ends_at
end

#starts_atObject (readonly)

Returns the value of attribute starts_at.



37103
37104
37105
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37103

def starts_at
  @starts_at
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



37118
37119
37120
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37118

def copy(incoming={})
  DutiesTaxesPaidSurchargeRatecardFee.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#subtype_to_hashObject



37122
37123
37124
37125
37126
37127
37128
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37122

def subtype_to_hash
  {
    :amount => amount.to_hash,
    :starts_at => starts_at,
    :ends_at => ends_at
  }
end

#to_jsonObject



37114
37115
37116
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37114

def to_json
  JSON.dump(to_hash)
end