Class: SubskribeSandboxClient::AccountingApi

Inherits:
Object
  • Object
show all
Defined in:
lib/subskribe_sandbox/api/accounting_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AccountingApi

Returns a new instance of AccountingApi.



19
20
21
# File 'lib/subskribe_sandbox/api/accounting_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/subskribe_sandbox/api/accounting_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_accounting_events(from, to, opts = {}) ⇒ AccountingEventPaginatedResponse

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.

Parameters:

  • from

    start date in seconds since Epoch(GMT)

  • to

    end date in seconds since Epoch(GMT)

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    number of items per page

  • :page_token (String)

    pass this to subsequent calls

Returns:



30
31
32
33
# File 'lib/subskribe_sandbox/api/accounting_api.rb', line 30

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_with_http_info(from, to, opts = {}) ⇒ Array<(AccountingEventPaginatedResponse, Fixnum, Hash)>

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.

Parameters:

  • from

    start date in seconds since Epoch(GMT)

  • to

    end date in seconds since Epoch(GMT)

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    number of items per page

  • :page_token (String)

    pass this to subsequent calls

Returns:



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/subskribe_sandbox/api/accounting_api.rb', line 43

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

#get_journal_entries(accounting_period_id, opts = {}) ⇒ nil

Return Journal Entries for period Returns all Journal Entries for the specified accounting period as text/csv

Parameters:

  • accounting_period_id

    Id of the period

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

    the optional parameters

Returns:

  • (nil)


93
94
95
96
# File 'lib/subskribe_sandbox/api/accounting_api.rb', line 93

def get_journal_entries(accounting_period_id, opts = {})
  get_journal_entries_with_http_info(accounting_period_id, opts)
  nil
end

#get_journal_entries_with_http_info(accounting_period_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Return Journal Entries for period Returns all Journal Entries for the specified accounting period as text/csv

Parameters:

  • accounting_period_id

    Id of the period

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

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/subskribe_sandbox/api/accounting_api.rb', line 103

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_current_accounting_period(opts = {}) ⇒ AccountingPeriod

Specify the current accounting period Specify the start date of and open an accounting period, making it current

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :start_date (Integer)

    Start date of new period in seconds since Epoch (GMT)

Returns:



147
148
149
150
# File 'lib/subskribe_sandbox/api/accounting_api.rb', line 147

def specify_current_accounting_period(opts = {})
  data, _status_code, _headers = specify_current_accounting_period_with_http_info(opts)
  data
end

#specify_current_accounting_period_with_http_info(opts = {}) ⇒ Array<(AccountingPeriod, Fixnum, Hash)>

Specify the current accounting period Specify the start date of and open an accounting period, making it current

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :start_date (Integer)

    Start date of new period in seconds since Epoch (GMT)

Returns:

  • (Array<(AccountingPeriod, Fixnum, Hash)>)

    AccountingPeriod data, response status code and response headers



157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/subskribe_sandbox/api/accounting_api.rb', line 157

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