Method: MoneyKit::LinksApi#get_user_links_with_http_info

Defined in:
lib/moneykit/api/links_api.rb

/users/id/links Fetches all links belonging to a <a href=#operation/get_user_accounts>user</a>.

Parameters:

  • id (String)

    The unique ID for this user. This is the same ID provided in the call to <a href=#operation/create_link_session>/link-session</a> to create any link for this user.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :moneykit_version (String) — default: default to '2023-02-18'

Returns:

  • (Array<(GetUserLinksResponse, Integer, Hash)>)

    GetUserLinksResponse data, response status code and response headers



171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# File 'lib/moneykit/api/links_api.rb', line 171

def get_user_links_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LinksApi.get_user_links ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling LinksApi.get_user_links"
  end
  # resource path
  local_var_path = '/users/{id}/links'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'moneykit-version'] = opts[:'moneykit_version'] if !opts[:'moneykit_version'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetUserLinksResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2ClientCredentials']

  new_options = opts.merge(
    :operation => :"LinksApi.get_user_links",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LinksApi#get_user_links\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end