Class: FattureInCloud_Ruby_Sdk::CashbookApi

Inherits:
Object
  • Object
show all
Defined in:
lib/fattureincloud_ruby_sdk/api/cashbook_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ CashbookApi

Returns a new instance of CashbookApi.



19
20
21
# File 'lib/fattureincloud_ruby_sdk/api/cashbook_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/fattureincloud_ruby_sdk/api/cashbook_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_cashbook_entry(company_id, opts = {}) ⇒ CreateCashbookEntryResponse

Create Cashbook Entry Creates a new cashbook entry.

Parameters:

  • company_id (Integer)

    The ID of the company.

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

    the optional parameters

Options Hash (opts):

Returns:



28
29
30
31
# File 'lib/fattureincloud_ruby_sdk/api/cashbook_api.rb', line 28

def create_cashbook_entry(company_id, opts = {})
  data, _status_code, _headers = create_cashbook_entry_with_http_info(company_id, opts)
  data
end

#create_cashbook_entry_with_http_info(company_id, opts = {}) ⇒ Array<(CreateCashbookEntryResponse, Integer, Hash)>

Create Cashbook Entry Creates a new cashbook entry.

Parameters:

  • company_id (Integer)

    The ID of the company.

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

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(CreateCashbookEntryResponse, Integer, Hash)>)

    CreateCashbookEntryResponse data, response status code and response headers



39
40
41
42
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
88
89
90
# File 'lib/fattureincloud_ruby_sdk/api/cashbook_api.rb', line 39

def create_cashbook_entry_with_http_info(company_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CashbookApi.create_cashbook_entry ...'
  end
  # verify the required parameter 'company_id' is set
  if @api_client.config.client_side_validation && company_id.nil?
    fail ArgumentError, "Missing the required parameter 'company_id' when calling CashbookApi.create_cashbook_entry"
  end
  # resource path
  local_var_path = '/c/{company_id}/cashbook'.sub('{' + 'company_id' + '}', CGI.escape(company_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'])
  # 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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_cashbook_entry_request'])

  # return_type
  return_type = opts[:debug_return_type] || 'CreateCashbookEntryResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2AuthenticationCodeFlow']

  new_options = opts.merge(
    :operation => :"CashbookApi.create_cashbook_entry",
    :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: CashbookApi#create_cashbook_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_cashbook_entry(company_id, document_id, opts = {}) ⇒ nil

Delete Cashbook Entry Deletes the specified cashbook entry.

Parameters:

  • company_id (Integer)

    The ID of the company.

  • document_id (String)

    The ID of the document.

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

    the optional parameters

Returns:

  • (nil)


98
99
100
101
# File 'lib/fattureincloud_ruby_sdk/api/cashbook_api.rb', line 98

def delete_cashbook_entry(company_id, document_id, opts = {})
  delete_cashbook_entry_with_http_info(company_id, document_id, opts)
  nil
end

#delete_cashbook_entry_with_http_info(company_id, document_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete Cashbook Entry Deletes the specified cashbook entry.

Parameters:

  • company_id (Integer)

    The ID of the company.

  • document_id (String)

    The ID of the document.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/fattureincloud_ruby_sdk/api/cashbook_api.rb', line 109

def delete_cashbook_entry_with_http_info(company_id, document_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CashbookApi.delete_cashbook_entry ...'
  end
  # verify the required parameter 'company_id' is set
  if @api_client.config.client_side_validation && company_id.nil?
    fail ArgumentError, "Missing the required parameter 'company_id' when calling CashbookApi.delete_cashbook_entry"
  end
  # verify the required parameter 'document_id' is set
  if @api_client.config.client_side_validation && document_id.nil?
    fail ArgumentError, "Missing the required parameter 'document_id' when calling CashbookApi.delete_cashbook_entry"
  end
  # resource path
  local_var_path = '/c/{company_id}/cashbook/{document_id}'.sub('{' + 'company_id' + '}', CGI.escape(company_id.to_s)).sub('{' + 'document_id' + '}', CGI.escape(document_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2AuthenticationCodeFlow']

  new_options = opts.merge(
    :operation => :"CashbookApi.delete_cashbook_entry",
    :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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CashbookApi#delete_cashbook_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_cashbook_entry(company_id, document_id, opts = {}) ⇒ GetCashbookEntryResponse

Get Cashbook Entry Gets the specified cashbook entry.

Parameters:

  • company_id (Integer)

    The ID of the company.

  • document_id (String)

    The ID of the document.

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

    the optional parameters

Options Hash (opts):

  • :fields (String)

    List of comma-separated fields.

  • :fieldset (String)

    Name of the fieldset.

Returns:



167
168
169
170
# File 'lib/fattureincloud_ruby_sdk/api/cashbook_api.rb', line 167

def get_cashbook_entry(company_id, document_id, opts = {})
  data, _status_code, _headers = get_cashbook_entry_with_http_info(company_id, document_id, opts)
  data
end

#get_cashbook_entry_with_http_info(company_id, document_id, opts = {}) ⇒ Array<(GetCashbookEntryResponse, Integer, Hash)>

Get Cashbook Entry Gets the specified cashbook entry.

Parameters:

  • company_id (Integer)

    The ID of the company.

  • document_id (String)

    The ID of the document.

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

    the optional parameters

Options Hash (opts):

  • :fields (String)

    List of comma-separated fields.

  • :fieldset (String)

    Name of the fieldset.

Returns:

  • (Array<(GetCashbookEntryResponse, Integer, Hash)>)

    GetCashbookEntryResponse data, response status code and response headers



180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# File 'lib/fattureincloud_ruby_sdk/api/cashbook_api.rb', line 180

def get_cashbook_entry_with_http_info(company_id, document_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CashbookApi.get_cashbook_entry ...'
  end
  # verify the required parameter 'company_id' is set
  if @api_client.config.client_side_validation && company_id.nil?
    fail ArgumentError, "Missing the required parameter 'company_id' when calling CashbookApi.get_cashbook_entry"
  end
  # verify the required parameter 'document_id' is set
  if @api_client.config.client_side_validation && document_id.nil?
    fail ArgumentError, "Missing the required parameter 'document_id' when calling CashbookApi.get_cashbook_entry"
  end
  allowable_values = ["basic", "detailed"]
  if @api_client.config.client_side_validation && opts[:'fieldset'] && !allowable_values.include?(opts[:'fieldset'])
    fail ArgumentError, "invalid value for \"fieldset\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/c/{company_id}/cashbook/{document_id}'.sub('{' + 'company_id' + '}', CGI.escape(company_id.to_s)).sub('{' + 'document_id' + '}', CGI.escape(document_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
  query_params[:'fieldset'] = opts[:'fieldset'] if !opts[:'fieldset'].nil?

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetCashbookEntryResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2AuthenticationCodeFlow']

  new_options = opts.merge(
    :operation => :"CashbookApi.get_cashbook_entry",
    :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: CashbookApi#get_cashbook_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_cashbook_entries(company_id, date_from, date_to, opts = {}) ⇒ ListCashbookEntriesResponse

List Cashbook Entries Lists the cashbook entries.

Parameters:

  • company_id (Integer)

    The ID of the company.

  • date_from (String)

    Start date.

  • date_to (String)

    End date.

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

    the optional parameters

Options Hash (opts):

  • :year (Integer)

    Filter cashbook by year.

  • :type (String)

    Filter cashbook by type.

  • :payment_account_id (Integer)

    Filter by payment account.

Returns:



248
249
250
251
# File 'lib/fattureincloud_ruby_sdk/api/cashbook_api.rb', line 248

def list_cashbook_entries(company_id, date_from, date_to, opts = {})
  data, _status_code, _headers = list_cashbook_entries_with_http_info(company_id, date_from, date_to, opts)
  data
end

#list_cashbook_entries_with_http_info(company_id, date_from, date_to, opts = {}) ⇒ Array<(ListCashbookEntriesResponse, Integer, Hash)>

List Cashbook Entries Lists the cashbook entries.

Parameters:

  • company_id (Integer)

    The ID of the company.

  • date_from (String)

    Start date.

  • date_to (String)

    End date.

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

    the optional parameters

Options Hash (opts):

  • :year (Integer)

    Filter cashbook by year.

  • :type (String)

    Filter cashbook by type.

  • :payment_account_id (Integer)

    Filter by payment account.

Returns:

  • (Array<(ListCashbookEntriesResponse, Integer, Hash)>)

    ListCashbookEntriesResponse data, response status code and response headers



263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# File 'lib/fattureincloud_ruby_sdk/api/cashbook_api.rb', line 263

def list_cashbook_entries_with_http_info(company_id, date_from, date_to, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CashbookApi.list_cashbook_entries ...'
  end
  # verify the required parameter 'company_id' is set
  if @api_client.config.client_side_validation && company_id.nil?
    fail ArgumentError, "Missing the required parameter 'company_id' when calling CashbookApi.list_cashbook_entries"
  end
  # verify the required parameter 'date_from' is set
  if @api_client.config.client_side_validation && date_from.nil?
    fail ArgumentError, "Missing the required parameter 'date_from' when calling CashbookApi.list_cashbook_entries"
  end
  # verify the required parameter 'date_to' is set
  if @api_client.config.client_side_validation && date_to.nil?
    fail ArgumentError, "Missing the required parameter 'date_to' when calling CashbookApi.list_cashbook_entries"
  end
  allowable_values = ["all", "in", "out"]
  if @api_client.config.client_side_validation && opts[:'type'] && !allowable_values.include?(opts[:'type'])
    fail ArgumentError, "invalid value for \"type\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/c/{company_id}/cashbook'.sub('{' + 'company_id' + '}', CGI.escape(company_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'date_from'] = date_from
  query_params[:'date_to'] = date_to
  query_params[:'year'] = opts[:'year'] if !opts[:'year'].nil?
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
  query_params[:'payment_account_id'] = opts[:'payment_account_id'] if !opts[:'payment_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'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListCashbookEntriesResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2AuthenticationCodeFlow']

  new_options = opts.merge(
    :operation => :"CashbookApi.list_cashbook_entries",
    :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: CashbookApi#list_cashbook_entries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#modify_cashbook_entry(company_id, document_id, opts = {}) ⇒ ModifyCashbookEntryResponse

Modify Cashbook Entry Modifies the specified cashbook entry.

Parameters:

  • company_id (Integer)

    The ID of the company.

  • document_id (String)

    The ID of the document.

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

    the optional parameters

Options Hash (opts):

Returns:



335
336
337
338
# File 'lib/fattureincloud_ruby_sdk/api/cashbook_api.rb', line 335

def modify_cashbook_entry(company_id, document_id, opts = {})
  data, _status_code, _headers = modify_cashbook_entry_with_http_info(company_id, document_id, opts)
  data
end

#modify_cashbook_entry_with_http_info(company_id, document_id, opts = {}) ⇒ Array<(ModifyCashbookEntryResponse, Integer, Hash)>

Modify Cashbook Entry Modifies the specified cashbook entry.

Parameters:

  • company_id (Integer)

    The ID of the company.

  • document_id (String)

    The ID of the document.

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

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(ModifyCashbookEntryResponse, Integer, Hash)>)

    ModifyCashbookEntryResponse data, response status code and response headers



347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
# File 'lib/fattureincloud_ruby_sdk/api/cashbook_api.rb', line 347

def modify_cashbook_entry_with_http_info(company_id, document_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CashbookApi.modify_cashbook_entry ...'
  end
  # verify the required parameter 'company_id' is set
  if @api_client.config.client_side_validation && company_id.nil?
    fail ArgumentError, "Missing the required parameter 'company_id' when calling CashbookApi.modify_cashbook_entry"
  end
  # verify the required parameter 'document_id' is set
  if @api_client.config.client_side_validation && document_id.nil?
    fail ArgumentError, "Missing the required parameter 'document_id' when calling CashbookApi.modify_cashbook_entry"
  end
  # resource path
  local_var_path = '/c/{company_id}/cashbook/{document_id}'.sub('{' + 'company_id' + '}', CGI.escape(company_id.to_s)).sub('{' + 'document_id' + '}', CGI.escape(document_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'])
  # 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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'modify_cashbook_entry_request'])

  # return_type
  return_type = opts[:debug_return_type] || 'ModifyCashbookEntryResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['OAuth2AuthenticationCodeFlow']

  new_options = opts.merge(
    :operation => :"CashbookApi.modify_cashbook_entry",
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CashbookApi#modify_cashbook_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end