Class: Io::Flow::V0::Models::ShopifyMerchantApplicationForm

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

Instance Attribute Summary collapse

Attributes inherited from MerchantApplicationForm

#discriminator

Instance Method Summary collapse

Methods inherited from MerchantApplicationForm

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ ShopifyMerchantApplicationForm

Returns a new instance of ShopifyMerchantApplicationForm.



67993
67994
67995
67996
67997
67998
67999
68000
68001
68002
68003
68004
68005
68006
68007
68008
68009
68010
68011
68012
68013
68014
68015
68016
68017
68018
68019
68020
68021
68022
68023
68024
68025
68026
# 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

Instance Attribute Details

#aba_routing_transit_numberObject (readonly)

Returns the value of attribute aba_routing_transit_number.



67991
67992
67993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67991

def aba_routing_transit_number
  @aba_routing_transit_number
end

#average_order_valueObject (readonly)

Returns the value of attribute average_order_value.



67991
67992
67993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67991

def average_order_value
  @average_order_value
end

#average_order_weightObject (readonly)

Returns the value of attribute average_order_weight.



67991
67992
67993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67991

def average_order_weight
  @average_order_weight
end

#bank_account_numberObject (readonly)

Returns the value of attribute bank_account_number.



67991
67992
67993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67991

def 
  @bank_account_number
end

#beneficiaryObject (readonly)

Returns the value of attribute beneficiary.



67991
67992
67993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67991

def beneficiary
  @beneficiary
end

#business_addressObject (readonly)

Returns the value of attribute business_address.



67991
67992
67993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67991

def business_address
  @business_address
end

#business_descriptionObject (readonly)

Returns the value of attribute business_description.



67991
67992
67993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67991

def business_description
  @business_description
end

#business_urlObject (readonly)

Returns the value of attribute business_url.



67991
67992
67993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67991

def business_url
  @business_url
end

#chargeback_percentageObject (readonly)

Returns the value of attribute chargeback_percentage.



67991
67992
67993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67991

def chargeback_percentage
  @chargeback_percentage
end

#companyObject (readonly)

Returns the value of attribute company.



67991
67992
67993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67991

def company
  @company
end

#dangerous_goodsObject (readonly)

Returns the value of attribute dangerous_goods.



67991
67992
67993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67991

def dangerous_goods
  @dangerous_goods
end

#default_country_of_originObject (readonly)

Returns the value of attribute default_country_of_origin.



67991
67992
67993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67991

def default_country_of_origin
  @default_country_of_origin
end

#indirect_taxObject (readonly)

Returns the value of attribute indirect_tax.



67991
67992
67993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67991

def indirect_tax
  @indirect_tax
end

#last_month_xborder_gmvObject (readonly)

Returns the value of attribute last_month_xborder_gmv.



67991
67992
67993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67991

def last_month_xborder_gmv
  @last_month_xborder_gmv
end

#last_year_xborder_gmvObject (readonly)

Returns the value of attribute last_year_xborder_gmv.



67991
67992
67993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67991

def last_year_xborder_gmv
  @last_year_xborder_gmv
end

#logistics_formatObject (readonly)

Returns the value of attribute logistics_format.



67991
67992
67993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67991

def logistics_format
  @logistics_format
end

#monthly_average_number_transactionsObject (readonly)

Returns the value of attribute monthly_average_number_transactions.



67991
67992
67993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67991

def monthly_average_number_transactions
  @monthly_average_number_transactions
end

#monthly_average_volume_amountObject (readonly)

Returns the value of attribute monthly_average_volume_amount.



67991
67992
67993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67991

def monthly_average_volume_amount
  @monthly_average_volume_amount
end

#monthly_average_volume_currencyObject (readonly)

Returns the value of attribute monthly_average_volume_currency.



67991
67992
67993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67991

def monthly_average_volume_currency
  @monthly_average_volume_currency
end

#other_trade_sectorObject (readonly)

Returns the value of attribute other_trade_sector.



67991
67992
67993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67991

def other_trade_sector
  @other_trade_sector
end

#package_dimensionsObject (readonly)

Returns the value of attribute package_dimensions.



67991
67992
67993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67991

def package_dimensions
  @package_dimensions
end

#parent_companyObject (readonly)

Returns the value of attribute parent_company.



67991
67992
67993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67991

def parent_company
  @parent_company
end

#rate_cardObject (readonly)

Returns the value of attribute rate_card.



67991
67992
67993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67991

def rate_card
  @rate_card
end

#ratecard_idObject (readonly)

Returns the value of attribute ratecard_id.



67991
67992
67993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67991

def ratecard_id
  @ratecard_id
end

#refund_percentageObject (readonly)

Returns the value of attribute refund_percentage.



67991
67992
67993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67991

def refund_percentage
  @refund_percentage
end

#shopObject (readonly)

Returns the value of attribute shop.



67991
67992
67993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67991

def shop
  @shop
end

#third_party_logistics_partnersObject (readonly)

Returns the value of attribute third_party_logistics_partners.



67991
67992
67993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67991

def third_party_logistics_partners
  @third_party_logistics_partners
end

#trade_sectorsObject (readonly)

Returns the value of attribute trade_sectors.



67991
67992
67993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67991

def trade_sectors
  @trade_sectors
end

#ultimate_beneficiary_ownerObject (readonly)

Returns the value of attribute ultimate_beneficiary_owner.



67991
67992
67993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67991

def ultimate_beneficiary_owner
  @ultimate_beneficiary_owner
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



68032
68033
68034
# 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_hashObject



68036
68037
68038
68039
68040
68041
68042
68043
68044
68045
68046
68047
68048
68049
68050
68051
68052
68053
68054
68055
68056
68057
68058
68059
68060
68061
68062
68063
68064
68065
68066
68067
68068
# 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 => ,
    :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_jsonObject



68028
68029
68030
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 68028

def to_json
  JSON.dump(to_hash)
end