=begin #Treezor #Treezor API. more info [here](https://www.treezor.com). OpenAPI spec version: 0.1.1 Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.1 =end require 'uri' module TreezorClient class BankaccountApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # deactivate a bank account # Change bank account's status to CANCELED. If a payout is being validated on this bank account, it can not be canceled. # @param id Bank Accounts internal id. # @param [Hash] opts the optional parameters # @return [InlineResponse2001] def delete_bankaccount(id, opts = {}) data, _status_code, _headers = delete_bankaccount_with_http_info(id, opts) data end # deactivate a bank account # Change bank account's status to CANCELED. If a payout is being validated on this bank account, it can not be canceled. # @param id Bank Accounts internal id. # @param [Hash] opts the optional parameters # @return [Array<(InlineResponse2001, Fixnum, Hash)>] InlineResponse2001 data, response status code and response headers def delete_bankaccount_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BankaccountApi.delete_bankaccount ...' 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 BankaccountApi.delete_bankaccount" end # resource path local_var_path = '/bankaccounts/{id}'.sub('{' + 'id' + '}', 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']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'InlineResponse2001') if @api_client.config.debugging @api_client.config.logger.debug "API called: BankaccountApi#delete_bankaccount\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # get a bank account # Get a bank account from the system. # @param id Bank Accounts internal id. # @param [Hash] opts the optional parameters # @return [InlineResponse2001] def get_bankaccount(id, opts = {}) data, _status_code, _headers = get_bankaccount_with_http_info(id, opts) data end # get a bank account # Get a bank account from the system. # @param id Bank Accounts internal id. # @param [Hash] opts the optional parameters # @return [Array<(InlineResponse2001, Fixnum, Hash)>] InlineResponse2001 data, response status code and response headers def get_bankaccount_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BankaccountApi.get_bankaccount ...' 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 BankaccountApi.get_bankaccount" end # resource path local_var_path = '/bankaccounts/{id}'.sub('{' + 'id' + '}', 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']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_key'] 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 => 'InlineResponse2001') if @api_client.config.debugging @api_client.config.logger.debug "API called: BankaccountApi#get_bankaccount\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # search bank accounts # Get bank accounts that match search criteria. # @param [Hash] opts the optional parameters # @option opts [String] :access_signature Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](https://agent.treezor.com/security-authentication). # @option opts [String] :access_tag Access tag is used for idem potency query. More info [here](https://agent.treezor.com/basics). # @option opts [Integer] :access_user_id Access user's id is used for user's action restriction. More info [here](https://agent.treezor.com/basics). # @option opts [String] :access_user_ip Access user's ip is used for user's action restriction. More info [here](https://agent.treezor.com/basics). # @option opts [Integer] :bankaccount_id bank account id. # @option opts [String] :bankaccount_status bank account status. Possible values: * CANCELED * PENDING * VALIDATED # @option opts [Integer] :user_id Bank account owner user's id # @option opts [String] :bankaccount_iban Bank account IBAN # @option opts [Integer] :page_number Pagination page number. More info [here](https://agent.treezor.com/lists). # @option opts [Integer] :page_count The number of items per page. More info [here](https://agent.treezor.com/lists). # @option opts [String] :sort_by The transaction element you want to sort the list with. Default value : _createdDate_. More info [here](https://agent.treezor.com/lists). # @option opts [String] :sort_order The order you want to sort the list. * **DESC** for a descending sort * **ASC** for a ascending sort. Default value : DESC. More info [here](https://agent.treezor.com/lists). # @option opts [DateTime] :created_date_from The creation date from which you want to filter the request result. Format YYYY-MM-DD HH:MM:SS. More info [here](https://agent.treezor.com/lists) # @option opts [DateTime] :created_date_to The creation date up to which you want to filter the request result. Format YYYY-MM-DD HH:MM:SS. More info [here](https://agent.treezor.com/lists) # @option opts [DateTime] :updated_date_from The modification date from which you want to filter the request result. Format YYYY-MM-DD HH:MM:SS. More info [here](https://agent.treezor.com/lists) # @option opts [DateTime] :updated_date_to The modification date up to which you want to filter the request result. Format YYYY-MM-DD HH:MM:SS. More info [here](https://agent.treezor.com/lists) # @return [InlineResponse2001] def get_bankaccounts(opts = {}) data, _status_code, _headers = get_bankaccounts_with_http_info(opts) data end # search bank accounts # Get bank accounts that match search criteria. # @param [Hash] opts the optional parameters # @option opts [String] :access_signature Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](https://agent.treezor.com/security-authentication). # @option opts [String] :access_tag Access tag is used for idem potency query. More info [here](https://agent.treezor.com/basics). # @option opts [Integer] :access_user_id Access user's id is used for user's action restriction. More info [here](https://agent.treezor.com/basics). # @option opts [String] :access_user_ip Access user's ip is used for user's action restriction. More info [here](https://agent.treezor.com/basics). # @option opts [Integer] :bankaccount_id bank account id. # @option opts [String] :bankaccount_status bank account status. Possible values: * CANCELED * PENDING * VALIDATED # @option opts [Integer] :user_id Bank account owner user's id # @option opts [String] :bankaccount_iban Bank account IBAN # @option opts [Integer] :page_number Pagination page number. More info [here](https://agent.treezor.com/lists). # @option opts [Integer] :page_count The number of items per page. More info [here](https://agent.treezor.com/lists). # @option opts [String] :sort_by The transaction element you want to sort the list with. Default value : _createdDate_. More info [here](https://agent.treezor.com/lists). # @option opts [String] :sort_order The order you want to sort the list. * **DESC** for a descending sort * **ASC** for a ascending sort. Default value : DESC. More info [here](https://agent.treezor.com/lists). # @option opts [DateTime] :created_date_from The creation date from which you want to filter the request result. Format YYYY-MM-DD HH:MM:SS. More info [here](https://agent.treezor.com/lists) # @option opts [DateTime] :created_date_to The creation date up to which you want to filter the request result. Format YYYY-MM-DD HH:MM:SS. More info [here](https://agent.treezor.com/lists) # @option opts [DateTime] :updated_date_from The modification date from which you want to filter the request result. Format YYYY-MM-DD HH:MM:SS. More info [here](https://agent.treezor.com/lists) # @option opts [DateTime] :updated_date_to The modification date up to which you want to filter the request result. Format YYYY-MM-DD HH:MM:SS. More info [here](https://agent.treezor.com/lists) # @return [Array<(InlineResponse2001, Fixnum, Hash)>] InlineResponse2001 data, response status code and response headers def get_bankaccounts_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BankaccountApi.get_bankaccounts ...' end # resource path local_var_path = '/bankaccounts' # query parameters query_params = {} query_params[:'accessSignature'] = opts[:'access_signature'] if !opts[:'access_signature'].nil? query_params[:'accessTag'] = opts[:'access_tag'] if !opts[:'access_tag'].nil? query_params[:'accessUserId'] = opts[:'access_user_id'] if !opts[:'access_user_id'].nil? query_params[:'accessUserIp'] = opts[:'access_user_ip'] if !opts[:'access_user_ip'].nil? query_params[:'bankaccountId'] = opts[:'bankaccount_id'] if !opts[:'bankaccount_id'].nil? query_params[:'bankaccountStatus'] = opts[:'bankaccount_status'] if !opts[:'bankaccount_status'].nil? query_params[:'userId'] = opts[:'user_id'] if !opts[:'user_id'].nil? query_params[:'bankaccountIBAN'] = opts[:'bankaccount_iban'] if !opts[:'bankaccount_iban'].nil? query_params[:'pageNumber'] = opts[:'page_number'] if !opts[:'page_number'].nil? query_params[:'pageCount'] = opts[:'page_count'] if !opts[:'page_count'].nil? query_params[:'sortBy'] = opts[:'sort_by'] if !opts[:'sort_by'].nil? query_params[:'sortOrder'] = opts[:'sort_order'] if !opts[:'sort_order'].nil? query_params[:'createdDateFrom'] = opts[:'created_date_from'] if !opts[:'created_date_from'].nil? query_params[:'createdDateTo'] = opts[:'created_date_to'] if !opts[:'created_date_to'].nil? query_params[:'updatedDateFrom'] = opts[:'updated_date_from'] if !opts[:'updated_date_from'].nil? query_params[:'updatedDateTo'] = opts[:'updated_date_to'] if !opts[:'updated_date_to'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_key'] 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 => 'InlineResponse2001') if @api_client.config.debugging @api_client.config.logger.debug "API called: BankaccountApi#get_bankaccounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # create a bank account # Create a new benefeciary bank account in the system. # @param user_id Owner user's id. # @param bankaccount_owner_name Bank account owner's name. # @param bankaccount_owner_address Bank account owner's address. # @param bankaccount_iban Beneficiary bank account's IBAN. # @param bankaccount_bic Beneficiary bank account's BIC (or SWIFT). # @param bankaccount_type Beneficiary bank account's type. # @param [Hash] opts the optional parameters # @option opts [String] :access_signature Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](https://agent.treezor.com/security-authentication). # @option opts [String] :access_tag Access tag is used for idem potency query. More info [here](https://agent.treezor.com/basics). # @option opts [Integer] :access_user_id Access user's id is used for user's action restriction. More info [here](https://agent.treezor.com/basics). # @option opts [String] :access_user_ip Access user's ip is used for user's action restriction. More info [here](https://agent.treezor.com/basics). # @option opts [String] :bankaccount_tag Custom data. # @option opts [String] :name Bank account's name. # @return [InlineResponse2001] def post_bankaccount(user_id, bankaccount_owner_name, bankaccount_owner_address, bankaccount_iban, bankaccount_bic, bankaccount_type, opts = {}) data, _status_code, _headers = post_bankaccount_with_http_info(user_id, bankaccount_owner_name, bankaccount_owner_address, bankaccount_iban, bankaccount_bic, bankaccount_type, opts) data end # create a bank account # Create a new benefeciary bank account in the system. # @param user_id Owner user's id. # @param bankaccount_owner_name Bank account owner's name. # @param bankaccount_owner_address Bank account owner's address. # @param bankaccount_iban Beneficiary bank account's IBAN. # @param bankaccount_bic Beneficiary bank account's BIC (or SWIFT). # @param bankaccount_type Beneficiary bank account's type. # @param [Hash] opts the optional parameters # @option opts [String] :access_signature Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](https://agent.treezor.com/security-authentication). # @option opts [String] :access_tag Access tag is used for idem potency query. More info [here](https://agent.treezor.com/basics). # @option opts [Integer] :access_user_id Access user's id is used for user's action restriction. More info [here](https://agent.treezor.com/basics). # @option opts [String] :access_user_ip Access user's ip is used for user's action restriction. More info [here](https://agent.treezor.com/basics). # @option opts [String] :bankaccount_tag Custom data. # @option opts [String] :name Bank account's name. # @return [Array<(InlineResponse2001, Fixnum, Hash)>] InlineResponse2001 data, response status code and response headers def post_bankaccount_with_http_info(user_id, bankaccount_owner_name, bankaccount_owner_address, bankaccount_iban, bankaccount_bic, bankaccount_type, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: BankaccountApi.post_bankaccount ...' end # verify the required parameter 'user_id' is set if @api_client.config.client_side_validation && user_id.nil? fail ArgumentError, "Missing the required parameter 'user_id' when calling BankaccountApi.post_bankaccount" end # verify the required parameter 'bankaccount_owner_name' is set if @api_client.config.client_side_validation && bankaccount_owner_name.nil? fail ArgumentError, "Missing the required parameter 'bankaccount_owner_name' when calling BankaccountApi.post_bankaccount" end # verify the required parameter 'bankaccount_owner_address' is set if @api_client.config.client_side_validation && bankaccount_owner_address.nil? fail ArgumentError, "Missing the required parameter 'bankaccount_owner_address' when calling BankaccountApi.post_bankaccount" end # verify the required parameter 'bankaccount_iban' is set if @api_client.config.client_side_validation && bankaccount_iban.nil? fail ArgumentError, "Missing the required parameter 'bankaccount_iban' when calling BankaccountApi.post_bankaccount" end # verify the required parameter 'bankaccount_bic' is set if @api_client.config.client_side_validation && bankaccount_bic.nil? fail ArgumentError, "Missing the required parameter 'bankaccount_bic' when calling BankaccountApi.post_bankaccount" end # verify the required parameter 'bankaccount_type' is set if @api_client.config.client_side_validation && bankaccount_type.nil? fail ArgumentError, "Missing the required parameter 'bankaccount_type' when calling BankaccountApi.post_bankaccount" end # verify enum value if @api_client.config.client_side_validation && !['sct', 'sdd_core', 'sdd_b2b'].include?(bankaccount_type) fail ArgumentError, "invalid value for 'bankaccount_type', must be one of sct, sdd_core, sdd_b2b" end # resource path local_var_path = '/bankaccounts' # query parameters query_params = {} query_params[:'userId'] = user_id query_params[:'bankaccountOwnerName'] = bankaccount_owner_name query_params[:'bankaccountOwnerAddress'] = bankaccount_owner_address query_params[:'bankaccountIBAN'] = bankaccount_iban query_params[:'bankaccountBIC'] = bankaccount_bic query_params[:'bankaccountType'] = bankaccount_type query_params[:'accessSignature'] = opts[:'access_signature'] if !opts[:'access_signature'].nil? query_params[:'accessTag'] = opts[:'access_tag'] if !opts[:'access_tag'].nil? query_params[:'accessUserId'] = opts[:'access_user_id'] if !opts[:'access_user_id'].nil? query_params[:'accessUserIp'] = opts[:'access_user_ip'] if !opts[:'access_user_ip'].nil? query_params[:'bankaccountTag'] = opts[:'bankaccount_tag'] if !opts[:'bankaccount_tag'].nil? query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'InlineResponse2001') if @api_client.config.debugging @api_client.config.logger.debug "API called: BankaccountApi#post_bankaccount\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end