class Io::Flow::V0::Models::ShopifyMerchantApplicationForm

Attributes

aba_routing_transit_number[R]
average_order_value[R]
average_order_weight[R]
bank_account_number[R]
beneficiary[R]
business_address[R]
business_description[R]
business_url[R]
chargeback_percentage[R]
company[R]
dangerous_goods[R]
default_country_of_origin[R]
indirect_tax[R]
last_month_xborder_gmv[R]
last_year_xborder_gmv[R]
logistics_format[R]
monthly_average_number_transactions[R]
monthly_average_volume_amount[R]
monthly_average_volume_currency[R]
other_trade_sector[R]
package_dimensions[R]
parent_company[R]
rate_card[R]
ratecard_id[R]
refund_percentage[R]
shop[R]
third_party_logistics_partners[R]
trade_sectors[R]
ultimate_beneficiary_owner[R]

Public Class Methods

new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 67993
def initialize(incoming={})
  super(:discriminator => MerchantApplicationForm::Types::SHOPIFY_MERCHANT_APPLICATION_FORM)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:rate_card], 'ShopifyMerchantApplicationForm')
  @company = (x = opts.delete(:company); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::MerchantInfo) ? x : ::Io::Flow::V0::Models::MerchantInfo.new(x)))
  @indirect_tax = (x = opts.delete(:indirect_tax); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::IndirectTax) ? x : ::Io::Flow::V0::Models::IndirectTax.new(x)))
  @parent_company = (x = opts.delete(:parent_company); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::MerchantInfo) ? x : ::Io::Flow::V0::Models::MerchantInfo.new(x)))
  @beneficiary = (x = opts.delete(:beneficiary); x.nil? ? nil : HttpClient::Preconditions.assert_class('beneficiary', x, String))
  @ultimate_beneficiary_owner = (x = opts.delete(:ultimate_beneficiary_owner); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::UltimateBeneficiaryOwner) ? x : ::Io::Flow::V0::Models::UltimateBeneficiaryOwner.new(x)))
  @business_url = (x = opts.delete(:business_url); x.nil? ? nil : HttpClient::Preconditions.assert_class('business_url', x, String))
  @business_description = (x = opts.delete(:business_description); x.nil? ? nil : HttpClient::Preconditions.assert_class('business_description', x, String))
  @business_address = (x = opts.delete(:business_address); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Address) ? x : ::Io::Flow::V0::Models::Address.new(x)))
  @refund_percentage = (x = opts.delete(:refund_percentage); x.nil? ? nil : HttpClient::Preconditions.assert_class('refund_percentage', HttpClient::Helper.to_big_decimal(x), BigDecimal))
  @chargeback_percentage = (x = opts.delete(:chargeback_percentage); x.nil? ? nil : HttpClient::Preconditions.assert_class('chargeback_percentage', HttpClient::Helper.to_big_decimal(x), BigDecimal))
  @bank_account_number = (x = opts.delete(:bank_account_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('bank_account_number', x, String))
  @aba_routing_transit_number = (x = opts.delete(:aba_routing_transit_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('aba_routing_transit_number', x, String))
  @trade_sectors = (x = opts.delete(:trade_sectors); x.nil? ? nil : HttpClient::Preconditions.assert_class('trade_sectors', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::OnboardingTradeSector) ? x : ::Io::Flow::V0::Models::OnboardingTradeSector.apply(x)) })
  @other_trade_sector = (x = opts.delete(:other_trade_sector); x.nil? ? nil : HttpClient::Preconditions.assert_class('other_trade_sector', x, String))
  @third_party_logistics_partners = (x = opts.delete(:third_party_logistics_partners); x.nil? ? nil : HttpClient::Preconditions.assert_class('third_party_logistics_partners', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ThirdPartyLogisticsPartner) ? x : ::Io::Flow::V0::Models::ThirdPartyLogisticsPartner.new(x)) })
  @average_order_weight = (x = opts.delete(:average_order_weight); x.nil? ? nil : HttpClient::Preconditions.assert_class('average_order_weight', HttpClient::Helper.to_big_decimal(x), BigDecimal))
  @package_dimensions = (x = opts.delete(:package_dimensions); x.nil? ? nil : HttpClient::Preconditions.assert_class('package_dimensions', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::Dimension) ? x : ::Io::Flow::V0::Models::Dimension.new(x)) })
  @monthly_average_volume_amount = (x = opts.delete(:monthly_average_volume_amount); x.nil? ? nil : HttpClient::Preconditions.assert_class('monthly_average_volume_amount', HttpClient::Helper.to_big_decimal(x), BigDecimal))
  @monthly_average_volume_currency = (x = opts.delete(:monthly_average_volume_currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('monthly_average_volume_currency', x, String))
  @monthly_average_number_transactions = (x = opts.delete(:monthly_average_number_transactions); x.nil? ? nil : HttpClient::Preconditions.assert_class('monthly_average_number_transactions', x, Integer))
  @dangerous_goods = (x = opts.delete(:dangerous_goods); x.nil? ? nil : HttpClient::Preconditions.assert_boolean('dangerous_goods', x))
  @default_country_of_origin = (x = opts.delete(:default_country_of_origin); x.nil? ? nil : HttpClient::Preconditions.assert_class('default_country_of_origin', x, String))
  @ratecard_id = (x = opts.delete(:ratecard_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('ratecard_id', x, String))
  @rate_card = HttpClient::Preconditions.assert_class('rate_card', opts.delete(:rate_card), String)
  @logistics_format = (x = opts.delete(:logistics_format); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::LogisticsFormat) ? x : ::Io::Flow::V0::Models::LogisticsFormat.new(x)))
  @shop = (x = opts.delete(:shop); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Shop) ? x : ::Io::Flow::V0::Models::Shop.new(x)))
  @last_year_xborder_gmv = (x = opts.delete(:last_year_xborder_gmv); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Money) ? x : ::Io::Flow::V0::Models::Money.new(x)))
  @last_month_xborder_gmv = (x = opts.delete(:last_month_xborder_gmv); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Money) ? x : ::Io::Flow::V0::Models::Money.new(x)))
  @average_order_value = (x = opts.delete(:average_order_value); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Money) ? x : ::Io::Flow::V0::Models::Money.new(x)))
end

Public Instance Methods

copy(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 68032
def copy(incoming={})
  ShopifyMerchantApplicationForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end
subtype_to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 68036
def subtype_to_hash
  {
    :company => company.nil? ? nil : company.to_hash,
    :indirect_tax => indirect_tax.nil? ? nil : indirect_tax.to_hash,
    :parent_company => parent_company.nil? ? nil : parent_company.to_hash,
    :beneficiary => beneficiary,
    :ultimate_beneficiary_owner => ultimate_beneficiary_owner.nil? ? nil : ultimate_beneficiary_owner.to_hash,
    :business_url => business_url,
    :business_description => business_description,
    :business_address => business_address.nil? ? nil : business_address.to_hash,
    :refund_percentage => refund_percentage.to_f.to_s,
    :chargeback_percentage => chargeback_percentage.to_f.to_s,
    :bank_account_number => bank_account_number,
    :aba_routing_transit_number => aba_routing_transit_number,
    :trade_sectors => trade_sectors.nil? ? nil : trade_sectors.map { |o| o.value },
    :other_trade_sector => other_trade_sector,
    :third_party_logistics_partners => third_party_logistics_partners.nil? ? nil : third_party_logistics_partners.map { |o| o.to_hash },
    :average_order_weight => average_order_weight.to_f.to_s,
    :package_dimensions => package_dimensions.nil? ? nil : package_dimensions.map { |o| o.to_hash },
    :monthly_average_volume_amount => monthly_average_volume_amount.to_f.to_s,
    :monthly_average_volume_currency => monthly_average_volume_currency,
    :monthly_average_number_transactions => monthly_average_number_transactions,
    :dangerous_goods => dangerous_goods,
    :default_country_of_origin => default_country_of_origin,
    :ratecard_id => ratecard_id,
    :rate_card => rate_card,
    :logistics_format => logistics_format.nil? ? nil : logistics_format.to_hash,
    :shop => shop.nil? ? nil : shop.to_hash,
    :last_year_xborder_gmv => last_year_xborder_gmv.nil? ? nil : last_year_xborder_gmv.to_hash,
    :last_month_xborder_gmv => last_month_xborder_gmv.nil? ? nil : last_month_xborder_gmv.to_hash,
    :average_order_value => average_order_value.nil? ? nil : average_order_value.to_hash
  }
end
to_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 68028
def to_json
  JSON.dump(to_hash)
end