class Dhl::Bcs::V2::ExportDocPosition

Constants

PROPERTIES

Public Class Methods

new(**attributes) click to toggle source
# File lib/dhl/bcs/v2/export_document.rb, line 60
def initialize(**attributes)
  attributes.each do |property, value|
    send("#{property}=", value) if PROPERTIES.include?(property)
  end
end

Public Instance Methods

to_soap_hash() click to toggle source
# File lib/dhl/bcs/v2/export_document.rb, line 66
def to_soap_hash
  raise Dhl::Bcs::Error, 'export doc position description must be set' unless description
  raise Dhl::Bcs::Error, 'export doc position country_code_origin must be set'  unless country_code_origin
  raise Dhl::Bcs::Error, 'export doc position customs_tariff_number must be set' unless customs_tariff_number
  raise Dhl::Bcs::Error, 'export doc position amount must be set' unless amount
  raise Dhl::Bcs::Error, 'export doc position net_weight_in_kg must be set' unless net_weight_in_kg
  raise Dhl::Bcs::Error, 'export doc position customs_value must be set' unless customs_value
  {
    'description' => description,
    'countryCodeOrigin' => country_code_origin,
    'customsTariffNumber' => customs_tariff_number,
    'amount' => amount,
    'netWeightInKG' => net_weight_in_kg,
    'customsValue' => customs_value
  }
end