=begin #Synctera API #
Welcome to the official reference documentation for Synctera APIs. Our APIs are the best way to automate your company's banking needs and are designed to be easy to understand and implement.
We're continuously growing this library and what you see here is just the start, but if you need something specific or have a question, contact us.
The version of the OpenAPI document: 0.60.0 Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.5.0 =end require 'cgi' module SyncteraRubySdk class WiresApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Cancel an outgoing wire # Cancel an outgoing tranfer # @param wire_id [String] The unique identifier of a wire transfer. # @param update_transfer [UpdateTransfer] wire to update # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key An idempotency key is an arbitrary unique value generated by client to detect subsequent retries of the same request. It is recommended that a UUID or a similar random identifier be used as an idempotency key. A different key must be used for each request, unless it is a retry. # @return [Wire] def cancel_wire(wire_id, update_transfer, opts = {}) data, _status_code, _headers = cancel_wire_with_http_info(wire_id, update_transfer, opts) data end # Cancel an outgoing wire # Cancel an outgoing tranfer # @param wire_id [String] The unique identifier of a wire transfer. # @param update_transfer [UpdateTransfer] wire to update # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key An idempotency key is an arbitrary unique value generated by client to detect subsequent retries of the same request. It is recommended that a UUID or a similar random identifier be used as an idempotency key. A different key must be used for each request, unless it is a retry. # @return [Array<(Wire, Integer, Hash)>] Wire data, response status code and response headers def cancel_wire_with_http_info(wire_id, update_transfer, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: WiresApi.cancel_wire ...' end # verify the required parameter 'wire_id' is set if @api_client.config.client_side_validation && wire_id.nil? fail ArgumentError, "Missing the required parameter 'wire_id' when calling WiresApi.cancel_wire" end # verify the required parameter 'update_transfer' is set if @api_client.config.client_side_validation && update_transfer.nil? fail ArgumentError, "Missing the required parameter 'update_transfer' when calling WiresApi.cancel_wire" end # resource path local_var_path = '/wires/{wire_id}'.sub('{' + 'wire_id' + '}', CGI.escape(wire_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', 'application/problem+json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(update_transfer) # return_type return_type = opts[:debug_return_type] || 'Wire' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] new_options = opts.merge( :operation => :"WiresApi.cancel_wire", :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(:PATCH, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: WiresApi#cancel_wire\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Send a wire # Create an outgoing wire transfer # @param wire_request [WireRequest] Wire transfer request # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key An idempotency key is an arbitrary unique value generated by client to detect subsequent retries of the same request. It is recommended that a UUID or a similar random identifier be used as an idempotency key. A different key must be used for each request, unless it is a retry. # @return [Wire] def create_wire(wire_request, opts = {}) data, _status_code, _headers = create_wire_with_http_info(wire_request, opts) data end # Send a wire # Create an outgoing wire transfer # @param wire_request [WireRequest] Wire transfer request # @param [Hash] opts the optional parameters # @option opts [String] :idempotency_key An idempotency key is an arbitrary unique value generated by client to detect subsequent retries of the same request. It is recommended that a UUID or a similar random identifier be used as an idempotency key. A different key must be used for each request, unless it is a retry. # @return [Array<(Wire, Integer, Hash)>] Wire data, response status code and response headers def create_wire_with_http_info(wire_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: WiresApi.create_wire ...' end # verify the required parameter 'wire_request' is set if @api_client.config.client_side_validation && wire_request.nil? fail ArgumentError, "Missing the required parameter 'wire_request' when calling WiresApi.create_wire" end # resource path local_var_path = '/wires' # 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', 'application/problem+json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(wire_request) # return_type return_type = opts[:debug_return_type] || 'Wire' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] new_options = opts.merge( :operation => :"WiresApi.create_wire", :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(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: WiresApi#create_wire\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a wire by id # Get a wire by id # @param wire_id [String] The unique identifier of a wire transfer. # @param [Hash] opts the optional parameters # @return [Wire] def get_wire(wire_id, opts = {}) data, _status_code, _headers = get_wire_with_http_info(wire_id, opts) data end # Get a wire by id # Get a wire by id # @param wire_id [String] The unique identifier of a wire transfer. # @param [Hash] opts the optional parameters # @return [Array<(Wire, Integer, Hash)>] Wire data, response status code and response headers def get_wire_with_http_info(wire_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: WiresApi.get_wire ...' end # verify the required parameter 'wire_id' is set if @api_client.config.client_side_validation && wire_id.nil? fail ArgumentError, "Missing the required parameter 'wire_id' when calling WiresApi.get_wire" end # resource path local_var_path = '/wires/{wire_id}'.sub('{' + 'wire_id' + '}', CGI.escape(wire_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', 'application/problem+json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Wire' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] new_options = opts.merge( :operation => :"WiresApi.get_wire", :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: WiresApi#get_wire\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List wires # Get paginated list of wires # @param [Hash] opts the optional parameters # @option opts [Integer] :limit (default to 100) # @option opts [String] :page_token # @option opts [String] :status # @option opts [String] :customer_id The unique identifier of a customer. # @option opts [String] :originating_account_id The unique identifier of the originating account. # @option opts [String] :receiving_account_id The unique identifier of the receiving account. # @return [WireList] def list_wires(opts = {}) data, _status_code, _headers = list_wires_with_http_info(opts) data end # List wires # Get paginated list of wires # @param [Hash] opts the optional parameters # @option opts [Integer] :limit (default to 100) # @option opts [String] :page_token # @option opts [String] :status # @option opts [String] :customer_id The unique identifier of a customer. # @option opts [String] :originating_account_id The unique identifier of the originating account. # @option opts [String] :receiving_account_id The unique identifier of the receiving account. # @return [Array<(WireList, Integer, Hash)>] WireList data, response status code and response headers def list_wires_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: WiresApi.list_wires ...' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling WiresApi.list_wires, must be greater than or equal to 1.' end allowable_values = ["READY", "BLOCKED", "POSTED"] if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status']) fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}" end # resource path local_var_path = '/wires' # query parameters query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'page_token'] = opts[:'page_token'] if !opts[:'page_token'].nil? query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil? query_params[:'customer_id'] = opts[:'customer_id'] if !opts[:'customer_id'].nil? query_params[:'originating_account_id'] = opts[:'originating_account_id'] if !opts[:'originating_account_id'].nil? query_params[:'receiving_account_id'] = opts[:'receiving_account_id'] if !opts[:'receiving_account_id'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'WireList' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] new_options = opts.merge( :operation => :"WiresApi.list_wires", :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: WiresApi#list_wires\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end