Class: Moov::Client

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/moov/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client: nil, retry_config: nil, timeout_ms: nil, security: nil, security_source: nil, x_moov_version: nil, server_idx: nil, server_url: nil, url_params: nil) ⇒ Client

Returns a new instance of Client.



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/moov/client.rb', line 34

def initialize(client: nil, retry_config: nil, timeout_ms: nil, security: nil, security_source: nil, x_moov_version: nil, server_idx: nil, server_url: nil, url_params: nil)
  ## Instantiates the SDK configuring it with the provided parameters.
  # @param [T.nilable(Faraday::Connection)] client The faraday HTTP client to use for all operations
  # @param [T.nilable(::Moov::Utils::RetryConfig)] retry_config The retry configuration to use for all operations
  # @param [T.nilable(Integer)] timeout_ms Request timeout in milliseconds for all operations
  # @param [T.nilable(Models::Components::Security)] security: The security details required for authentication
  # @param [T.proc.returns(T.nilable(Models::Components::Security))] security_source: A function that returns security details required for authentication
  # @param [T.nilable(::String)] x_moov_version: Configures the x_moov_version parameter for all supported operations
  # @param [T.nilable(::Integer)] server_idx The index of the server to use for all operations
  # @param [T.nilable(::String)] server_url The server URL to use for all operations
  # @param [T.nilable(::Hash<::Symbol, ::String>)] url_params Parameters to optionally template the server URL with

  connection_options = {
    request: {
      params_encoder: Faraday::FlatParamsEncoder
    }
  }
  connection_options[:request][:timeout] = (timeout_ms.to_f / 1000) unless timeout_ms.nil?

  client ||= Faraday.new(**connection_options) do |f|
    f.request :multipart, {}
    # f.response :logger, nil, { headers: true, bodies: true, errors: true }
  end
  
  if !server_url.nil?
    if !url_params.nil?
      server_url = Utils.template_url(server_url, url_params)
    end
  end

  server_idx = 0 if server_idx.nil?

  globals = {
    'parameters': {
      'queryParam': {
      },
      'pathParam': {
      },
      'header': {
        'x_moov_version': x_moov_version,
      }
    }
  }
  hooks = SDKHooks::Hooks.new
  @sdk_configuration = SDKConfiguration.new(
    client,
    hooks,
    retry_config,
    timeout_ms,
    security,
    security_source,
    server_url,
    server_idx,
    globals
  )
  @sdk_configuration = hooks.sdk_init(config: @sdk_configuration)
  init_sdks
end

Instance Attribute Details

#account_terminal_applicationsObject

Returns the value of attribute account_terminal_applications.



19
20
21
# File 'lib/moov/client.rb', line 19

def 
  @account_terminal_applications
end

#accountsObject

Returns the value of attribute accounts.



19
20
21
# File 'lib/moov/client.rb', line 19

def accounts
  @accounts
end

#adjustmentsObject

Returns the value of attribute adjustments.



19
20
21
# File 'lib/moov/client.rb', line 19

def adjustments
  @adjustments
end

#apple_payObject

Returns the value of attribute apple_pay.



19
20
21
# File 'lib/moov/client.rb', line 19

def apple_pay
  @apple_pay
end

#authenticationObject

Returns the value of attribute authentication.



19
20
21
# File 'lib/moov/client.rb', line 19

def authentication
  @authentication
end

#avatarsObject

Returns the value of attribute avatars.



19
20
21
# File 'lib/moov/client.rb', line 19

def avatars
  @avatars
end

#bank_accountsObject

Returns the value of attribute bank_accounts.



19
20
21
# File 'lib/moov/client.rb', line 19

def bank_accounts
  @bank_accounts
end

#brandingObject

Returns the value of attribute branding.



19
20
21
# File 'lib/moov/client.rb', line 19

def branding
  @branding
end

#capabilitiesObject

Returns the value of attribute capabilities.



19
20
21
# File 'lib/moov/client.rb', line 19

def capabilities
  @capabilities
end

#card_issuingObject

Returns the value of attribute card_issuing.



19
20
21
# File 'lib/moov/client.rb', line 19

def card_issuing
  @card_issuing
end

#cardsObject

Returns the value of attribute cards.



19
20
21
# File 'lib/moov/client.rb', line 19

def cards
  @cards
end

#disputesObject

Returns the value of attribute disputes.



19
20
21
# File 'lib/moov/client.rb', line 19

def disputes
  @disputes
end

#end_to_end_encryptionObject

Returns the value of attribute end_to_end_encryption.



19
20
21
# File 'lib/moov/client.rb', line 19

def end_to_end_encryption
  @end_to_end_encryption
end

#enriched_addressObject

Returns the value of attribute enriched_address.



19
20
21
# File 'lib/moov/client.rb', line 19

def enriched_address
  @enriched_address
end

#enriched_profileObject

Returns the value of attribute enriched_profile.



19
20
21
# File 'lib/moov/client.rb', line 19

def enriched_profile
  @enriched_profile
end

#fee_plansObject

Returns the value of attribute fee_plans.



19
20
21
# File 'lib/moov/client.rb', line 19

def fee_plans
  @fee_plans
end

#filesObject

Returns the value of attribute files.



19
20
21
# File 'lib/moov/client.rb', line 19

def files
  @files
end

#industriesObject

Returns the value of attribute industries.



19
20
21
# File 'lib/moov/client.rb', line 19

def industries
  @industries
end

#institutionsObject

Returns the value of attribute institutions.



19
20
21
# File 'lib/moov/client.rb', line 19

def institutions
  @institutions
end

#issuing_transactionsObject

Returns the value of attribute issuing_transactions.



19
20
21
# File 'lib/moov/client.rb', line 19

def issuing_transactions
  @issuing_transactions
end

#onboardingObject

Returns the value of attribute onboarding.



19
20
21
# File 'lib/moov/client.rb', line 19

def onboarding
  @onboarding
end

Returns the value of attribute payment_links.



19
20
21
# File 'lib/moov/client.rb', line 19

def payment_links
  @payment_links
end

#payment_methodsObject

Returns the value of attribute payment_methods.



19
20
21
# File 'lib/moov/client.rb', line 19

def payment_methods
  @payment_methods
end

#pingObject

Returns the value of attribute ping.



19
20
21
# File 'lib/moov/client.rb', line 19

def ping
  @ping
end

#receiptsObject

Returns the value of attribute receipts.



19
20
21
# File 'lib/moov/client.rb', line 19

def receipts
  @receipts
end

#representativesObject

Returns the value of attribute representatives.



19
20
21
# File 'lib/moov/client.rb', line 19

def representatives
  @representatives
end

#schedulingObject

Returns the value of attribute scheduling.



19
20
21
# File 'lib/moov/client.rb', line 19

def scheduling
  @scheduling
end

#supportObject

Returns the value of attribute support.



19
20
21
# File 'lib/moov/client.rb', line 19

def support
  @support
end

#sweepsObject

Returns the value of attribute sweeps.



19
20
21
# File 'lib/moov/client.rb', line 19

def sweeps
  @sweeps
end

#terminal_applicationsObject

Returns the value of attribute terminal_applications.



19
20
21
# File 'lib/moov/client.rb', line 19

def terminal_applications
  @terminal_applications
end

#transfersObject

Returns the value of attribute transfers.



19
20
21
# File 'lib/moov/client.rb', line 19

def transfers
  @transfers
end

#underwritingObject

Returns the value of attribute underwriting.



19
20
21
# File 'lib/moov/client.rb', line 19

def underwriting
  @underwriting
end

#wallet_transactionsObject

Returns the value of attribute wallet_transactions.



19
20
21
# File 'lib/moov/client.rb', line 19

def wallet_transactions
  @wallet_transactions
end

#walletsObject

Returns the value of attribute wallets.



19
20
21
# File 'lib/moov/client.rb', line 19

def wallets
  @wallets
end

Instance Method Details

#get_url(base_url:, url_variables: nil) ⇒ Object



132
133
134
135
136
137
138
139
140
141
142
143
144
# File 'lib/moov/client.rb', line 132

def get_url(base_url:, url_variables: nil)
  sd_base_url, sd_options = @sdk_configuration.get_server_details

  if base_url.nil?
    base_url = sd_base_url
  end

  if url_variables.nil?
    url_variables = sd_options
  end

  return Utils.template_url base_url, url_variables
end

#init_sdksObject



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/moov/client.rb', line 94

def init_sdks
  @accounts = Accounts.new(@sdk_configuration)
  @adjustments = Adjustments.new(@sdk_configuration)
  @apple_pay = ApplePay.new(@sdk_configuration)
  @bank_accounts = BankAccounts.new(@sdk_configuration)
  @branding = Branding.new(@sdk_configuration)
  @capabilities = Capabilities.new(@sdk_configuration)
  @cards = Cards.new(@sdk_configuration)
  @disputes = Disputes.new(@sdk_configuration)
  @fee_plans = FeePlans.new(@sdk_configuration)
  @files = Files.new(@sdk_configuration)
  @payment_links = PaymentLinks.new(@sdk_configuration)
  @payment_methods = PaymentMethods.new(@sdk_configuration)
  @representatives = Representatives.new(@sdk_configuration)
  @scheduling = Scheduling.new(@sdk_configuration)
  @sweeps = Sweeps.new(@sdk_configuration)
  @account_terminal_applications = AccountTerminalApplications.new(@sdk_configuration)
  @support = Support.new(@sdk_configuration)
  @transfers = Transfers.new(@sdk_configuration)
  @underwriting = Underwriting.new(@sdk_configuration)
  @wallets = Wallets.new(@sdk_configuration)
  @wallet_transactions = WalletTransactions.new(@sdk_configuration)
  @avatars = Avatars.new(@sdk_configuration)
  @end_to_end_encryption = EndToEndEncryption.new(@sdk_configuration)
  @enriched_address = EnrichedAddress.new(@sdk_configuration)
  @enriched_profile = EnrichedProfile.new(@sdk_configuration)
  @industries = Industries.new(@sdk_configuration)
  @institutions = Institutions.new(@sdk_configuration)
  @issuing_transactions = IssuingTransactions.new(@sdk_configuration)
  @card_issuing = CardIssuing.new(@sdk_configuration)
  @authentication = Authentication.new(@sdk_configuration)
  @onboarding = Onboarding.new(@sdk_configuration)
  @ping = Ping.new(@sdk_configuration)
  @receipts = Receipts.new(@sdk_configuration)
  @terminal_applications = TerminalApplications.new(@sdk_configuration)
end