class YNAB::PayeeLocationsApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/ynab/api/payee_locations_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

get_payee_location_by_id(budget_id, payee_location_id, opts = {}) click to toggle source

Single payee location Returns a single payee location @param budget_id The id of the budget. "last-used" can be used to specify the last used budget and "default" can be used if default budget selection is enabled (see: api.youneedabudget.com/#oauth-default-budget). @param payee_location_id id of payee location @param [Hash] opts the optional parameters @return [PayeeLocationResponse]

# File lib/ynab/api/payee_locations_api.rb, line 28
def get_payee_location_by_id(budget_id, payee_location_id, opts = {})
  data, _status_code, _headers = get_payee_location_by_id_with_http_info(budget_id, payee_location_id, opts)
  data
end
get_payee_location_by_id_with_http_info(budget_id, payee_location_id, opts = {}) click to toggle source

Single payee location Returns a single payee location @param budget_id The id of the budget. "last-used&quot; can be used to specify the last used budget and "default&quot; can be used if default budget selection is enabled (see: api.youneedabudget.com/#oauth-default-budget). @param payee_location_id id of payee location @param [Hash] opts the optional parameters @return [Array<(PayeeLocationResponse, Fixnum, Hash)>] PayeeLocationResponse data, response status code and response headers

# File lib/ynab/api/payee_locations_api.rb, line 39
def get_payee_location_by_id_with_http_info(budget_id, payee_location_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PayeeLocationsApi.get_payee_location_by_id ...'
  end
  # verify the required parameter 'budget_id' is set
  if @api_client.config.client_side_validation && budget_id.nil?
    fail ArgumentError, "Missing the required parameter 'budget_id' when calling PayeeLocationsApi.get_payee_location_by_id"
  end
  # verify the required parameter 'payee_location_id' is set
  if @api_client.config.client_side_validation && payee_location_id.nil?
    fail ArgumentError, "Missing the required parameter 'payee_location_id' when calling PayeeLocationsApi.get_payee_location_by_id"
  end
  # resource path
  local_var_path = '/budgets/{budget_id}/payee_locations/{payee_location_id}'.sub('{' + 'budget_id' + '}', budget_id.to_s).sub('{' + 'payee_location_id' + '}', payee_location_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['bearer']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'PayeeLocationResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PayeeLocationsApi#get_payee_location_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_payee_locations(budget_id, opts = {}) click to toggle source

List payee locations Returns all payee locations @param budget_id The id of the budget. "last-used&quot; can be used to specify the last used budget and "default&quot; can be used if default budget selection is enabled (see: api.youneedabudget.com/#oauth-default-budget). @param [Hash] opts the optional parameters @return [PayeeLocationsResponse]

# File lib/ynab/api/payee_locations_api.rb, line 85
def get_payee_locations(budget_id, opts = {})
  data, _status_code, _headers = get_payee_locations_with_http_info(budget_id, opts)
  data
end
get_payee_locations_by_payee(budget_id, payee_id, opts = {}) click to toggle source

List locations for a payee Returns all payee locations for a specified payee @param budget_id The id of the budget. "last-used&quot; can be used to specify the last used budget and "default&quot; can be used if default budget selection is enabled (see: api.youneedabudget.com/#oauth-default-budget). @param payee_id id of payee @param [Hash] opts the optional parameters @return [PayeeLocationsResponse]

# File lib/ynab/api/payee_locations_api.rb, line 138
def get_payee_locations_by_payee(budget_id, payee_id, opts = {})
  data, _status_code, _headers = get_payee_locations_by_payee_with_http_info(budget_id, payee_id, opts)
  data
end
get_payee_locations_by_payee_with_http_info(budget_id, payee_id, opts = {}) click to toggle source

List locations for a payee Returns all payee locations for a specified payee @param budget_id The id of the budget. "last-used&quot; can be used to specify the last used budget and "default&quot; can be used if default budget selection is enabled (see: api.youneedabudget.com/#oauth-default-budget). @param payee_id id of payee @param [Hash] opts the optional parameters @return [Array<(PayeeLocationsResponse, Fixnum, Hash)>] PayeeLocationsResponse data, response status code and response headers

# File lib/ynab/api/payee_locations_api.rb, line 149
def get_payee_locations_by_payee_with_http_info(budget_id, payee_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PayeeLocationsApi.get_payee_locations_by_payee ...'
  end
  # verify the required parameter 'budget_id' is set
  if @api_client.config.client_side_validation && budget_id.nil?
    fail ArgumentError, "Missing the required parameter 'budget_id' when calling PayeeLocationsApi.get_payee_locations_by_payee"
  end
  # verify the required parameter 'payee_id' is set
  if @api_client.config.client_side_validation && payee_id.nil?
    fail ArgumentError, "Missing the required parameter 'payee_id' when calling PayeeLocationsApi.get_payee_locations_by_payee"
  end
  # resource path
  local_var_path = '/budgets/{budget_id}/payees/{payee_id}/payee_locations'.sub('{' + 'budget_id' + '}', budget_id.to_s).sub('{' + 'payee_id' + '}', payee_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['bearer']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'PayeeLocationsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PayeeLocationsApi#get_payee_locations_by_payee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_payee_locations_with_http_info(budget_id, opts = {}) click to toggle source

List payee locations Returns all payee locations @param budget_id The id of the budget. "last-used&quot; can be used to specify the last used budget and "default&quot; can be used if default budget selection is enabled (see: api.youneedabudget.com/#oauth-default-budget). @param [Hash] opts the optional parameters @return [Array<(PayeeLocationsResponse, Fixnum, Hash)>] PayeeLocationsResponse data, response status code and response headers

# File lib/ynab/api/payee_locations_api.rb, line 95
def get_payee_locations_with_http_info(budget_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PayeeLocationsApi.get_payee_locations ...'
  end
  # verify the required parameter 'budget_id' is set
  if @api_client.config.client_side_validation && budget_id.nil?
    fail ArgumentError, "Missing the required parameter 'budget_id' when calling PayeeLocationsApi.get_payee_locations"
  end
  # resource path
  local_var_path = '/budgets/{budget_id}/payee_locations'.sub('{' + 'budget_id' + '}', budget_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['bearer']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'PayeeLocationsResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PayeeLocationsApi#get_payee_locations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end