=begin #Subskribe API #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 1.0.0 Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.41 =end require 'uri' module SubskribeDevClient class AccountingApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Get accounting events for the specified dates # Returns all accounting related events between the from and to dates. Since there can be a large number of these, the results are paginated. To retrieve subsequent pages of events, pass in the pageToken returned from the prior call. # @param from start date in seconds since Epoch(GMT) # @param to end date in seconds since Epoch(GMT) # @param [Hash] opts the optional parameters # @option opts [Integer] :limit number of items per page # @option opts [String] :page_token pass this to subsequent calls # @return [AccountingEventPaginatedResponse] def get_accounting_events(from, to, opts = {}) data, _status_code, _headers = get_accounting_events_with_http_info(from, to, opts) data end # Get accounting events for the specified dates # Returns all accounting related events between the from and to dates. Since there can be a large number of these, the results are paginated. To retrieve subsequent pages of events, pass in the pageToken returned from the prior call. # @param from start date in seconds since Epoch(GMT) # @param to end date in seconds since Epoch(GMT) # @param [Hash] opts the optional parameters # @option opts [Integer] :limit number of items per page # @option opts [String] :page_token pass this to subsequent calls # @return [Array<(AccountingEventPaginatedResponse, Fixnum, Hash)>] AccountingEventPaginatedResponse data, response status code and response headers def get_accounting_events_with_http_info(from, to, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountingApi.get_accounting_events ...' end # verify the required parameter 'from' is set if @api_client.config.client_side_validation && from.nil? fail ArgumentError, "Missing the required parameter 'from' when calling AccountingApi.get_accounting_events" end # verify the required parameter 'to' is set if @api_client.config.client_side_validation && to.nil? fail ArgumentError, "Missing the required parameter 'to' when calling AccountingApi.get_accounting_events" end # resource path local_var_path = '/accounting/journalEntry/events' # query parameters query_params = {} query_params[:'from'] = from query_params[:'to'] = to query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'pageToken'] = opts[:'page_token'] if !opts[:'page_token'].nil? # 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 = ['ApiKeyAuth'] 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 => 'AccountingEventPaginatedResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_accounting_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Return Journal Entries for period # Returns all Journal Entries for the specified accounting period as text/csv # @param accounting_period_id Id of the period # @param [Hash] opts the optional parameters # @return [nil] def get_journal_entries(accounting_period_id, opts = {}) get_journal_entries_with_http_info(accounting_period_id, opts) nil end # Return Journal Entries for period # Returns all Journal Entries for the specified accounting period as text/csv # @param accounting_period_id Id of the period # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def get_journal_entries_with_http_info(accounting_period_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountingApi.get_journal_entries ...' end # verify the required parameter 'accounting_period_id' is set if @api_client.config.client_side_validation && accounting_period_id.nil? fail ArgumentError, "Missing the required parameter 'accounting_period_id' when calling AccountingApi.get_journal_entries" end # resource path local_var_path = '/accounting/journalEntry' # query parameters query_params = {} query_params[:'accountingPeriodId'] = accounting_period_id # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream', '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 = ['ApiKeyAuth'] 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) if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#get_journal_entries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Specify the current accounting period # Specify the start date of and open an accounting period, making it current # @param [Hash] opts the optional parameters # @option opts [Integer] :start_date Start date of new period in seconds since Epoch (GMT) # @return [AccountingPeriod] def specify_current_accounting_period(opts = {}) data, _status_code, _headers = specify_current_accounting_period_with_http_info(opts) data end # Specify the current accounting period # Specify the start date of and open an accounting period, making it current # @param [Hash] opts the optional parameters # @option opts [Integer] :start_date Start date of new period in seconds since Epoch (GMT) # @return [Array<(AccountingPeriod, Fixnum, Hash)>] AccountingPeriod data, response status code and response headers def specify_current_accounting_period_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountingApi.specify_current_accounting_period ...' end # resource path local_var_path = '/accountingPeriods' # 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 = @api_client.object_to_http_body(opts[:'start_date']) auth_names = ['ApiKeyAuth'] 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 => 'AccountingPeriod') if @api_client.config.debugging @api_client.config.logger.debug "API called: AccountingApi#specify_current_accounting_period\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end